/* "Những xấp giấy bị bỏ đi": pencil-sketch pile, desk and viewer */
.sg-locked, .sg-locked body { overflow: hidden; }

/* pile inside the timeline card */
.pile { margin-top: 22px; }
.pile__stack { position: relative; aspect-ratio: 4 / 3.3; margin: 6px 4px 0; }
.pile__sheet {
  position: absolute; inset: 6% 7%; padding: 0; border: 0; cursor: default;
  background: #fff; border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 18px -10px rgba(42,20,51,.55);
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  transition: transform .45s cubic-bezier(.16,1,.3,1), box-shadow .3s, opacity .3s;
}
.pile__sheet img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 3px; background: #fff; }
.pile__sheet.is-top { cursor: pointer; }
.pile__sheet.is-top::before {   /* a strip of tape on the top sheet */
  content: ""; position: absolute; top: -9px; left: 50%; width: 72px; height: 20px; z-index: 1;
  translate: -50% 0; rotate: -4deg; background: color-mix(in srgb, var(--c, #9bd13a) 75%, transparent);
  border-left: 2px dashed rgba(255,255,255,.6); border-right: 2px dashed rgba(255,255,255,.6);
}
.pile__sheet.is-top:hover { transform: translate(var(--x), calc(var(--y) - 6px)) rotate(calc(var(--r) * .4)) scale(1.02); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 22px 30px -14px rgba(42,20,51,.6); }
.pile__sheet.is-tossed {
  transform: translate(calc(var(--dir, 1) * 115%), -18%) rotate(calc(var(--dir, 1) * 28deg)) scale(.92);
  transition: transform .38s cubic-bezier(.5,0,.75,0), opacity .16s linear .22s; opacity: 0;
}
.pile__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pile__count { font-family: var(--hand, cursive); font-size: 1.05rem; margin-right: auto; }
.pile__count b { font-size: 1.35rem; }
.pile__btn {
  font: 600 var(--t-sm, .9rem)/1 var(--body, sans-serif); color: var(--ink, #2a1433); cursor: pointer;
  background: var(--paper, #fff); border: 2px solid var(--ink, #2a1433); border-radius: 999px; padding: 9px 14px;
  transition: transform .15s, box-shadow .15s;
}
.pile__btn:hover { transform: translate(-1px, -2px); box-shadow: 3px 4px 0 var(--ink, #2a1433); }
.pile__btn--fill { background: var(--c, #9bd13a); }
.pile__hint { margin: 10px 0 0; font-size: var(--t-xs, .8rem); opacity: .65; }

/* the desk overlay */
.sg-desk {
  position: fixed; inset: 0; z-index: 2000; overflow-y: auto; overscroll-behavior: contain;
  background:
    radial-gradient(circle at 15% 0%, rgba(155,209,58,.18), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(224,71,158,.18), transparent 45%),
    #24102c;
  color: #fbf4ff;
}
.sg-desk__inner { max-width: 1240px; margin: 0 auto; padding: clamp(56px, 8vh, 90px) clamp(16px, 4vw, 48px) 80px; }
.sg-desk__head { text-align: center; max-width: 640px; margin: 0 auto clamp(30px, 5vh, 56px); }
.sg-desk__kicker { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px; background: var(--lime, #9bd13a); color: var(--ink, #2a1433); font-weight: 600; font-size: var(--t-sm, .9rem); }
.sg-desk__head h2 { margin: 0; font-family: var(--display, sans-serif); font-size: var(--t-2xl, 3rem); font-stretch: 85%; line-height: 1; }
.sg-desk__lede { margin: 14px auto 0; font-family: var(--hand, cursive); font-size: 1.1rem; line-height: 1.6; opacity: .9; }
.sg-desk__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 42vw), 1fr)); gap: clamp(18px, 3vw, 38px) clamp(14px, 2.4vw, 30px); align-items: center; }
.sg-desk__sheet {
  position: relative; padding: 8px; border: 0; cursor: zoom-in; background: #fff; border-radius: 3px;
  transform: rotate(var(--r)); box-shadow: 0 16px 28px -14px rgba(0,0,0,.7);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.sg-desk__sheet::before {
  content: ""; position: absolute; top: -8px; left: 50%; width: 56px; height: 18px; translate: -50% 0; rotate: var(--tape);
  background: color-mix(in srgb, var(--c) 80%, transparent);
}
.sg-desk__sheet img { display: block; width: 100%; height: auto; }
.sg-desk__sheet:hover, .sg-desk__sheet:focus-visible { transform: rotate(0deg) scale(1.06); box-shadow: 0 26px 40px -16px rgba(0,0,0,.8); z-index: 1; }

/* single-sheet viewer */
.sg-view { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; background: rgba(20,8,26,.86); padding: 56px 16px 70px; touch-action: pan-y; }
.sg-view__paper { margin: 0; background: #fff; padding: clamp(8px, 1.2vw, 14px); border-radius: 4px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8); max-width: min(1100px, 100%); }
.sg-view__paper img { display: block; max-width: 100%; max-height: calc(100vh - 160px); width: auto; height: auto; }
.sg-view__count { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; margin: 0; color: #fff; font-family: var(--hand, cursive); font-size: 1.1rem; }
.sg-view__nav, .sg-close {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--ink, #2a1433);
  background: var(--paper, #fff); color: var(--ink, #2a1433); font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink, #2a1433); transition: transform .15s;
}
.sg-view__nav:hover, .sg-close:hover { transform: translate(-1px, -2px); }
.sg-view__nav--prev { left: clamp(10px, 3vw, 40px); top: 50%; translate: 0 -50%; }
.sg-view__nav--next { right: clamp(10px, 3vw, 40px); top: 50%; translate: 0 -50%; }
.sg-close { top: 16px; right: 16px; z-index: 2; }
.sg-desk .sg-close { position: fixed; }
@media (max-width: 640px) {
  .sg-view__nav { top: auto; bottom: 12px; translate: none; width: 44px; height: 44px; }
  .sg-view__paper img { max-height: calc(100vh - 170px); }
}
@media (prefers-reduced-motion: reduce) {
  .pile__sheet, .sg-desk__sheet { transition: none; }
}
