/* ============================================================
   style.css — satu stylesheet untuk semua halaman.
   Bahasa desain: biru santai, gaya "stiker" (garis tebal, bayangan keras),
   bukan kaca/gradient. Warna diambil dari avatar Nara.
   ============================================================ */

:root {
  --bg: #d8e3f0;
  --paper: #f7faff;
  --ink: #1c2742;
  --blue: #5f7fd1;
  --blue-soft: #a9bde6;
  --bear: #8b5a3c;
  --live: #e5484d;
  --line: 2.5px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --font: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  min-height: 100svh;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(28, 39, 66, .09) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.4;
}

/* ---------- badge OFFLINE / LIVE ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .8rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 999px;
  font-size: .8rem;
  letter-spacing: .08em;
}
.badge i {
  width: .6rem; height: .6rem;
  border-radius: 50%;
  background: #8a93a8;
}
.is-open .badge { background: var(--live); color: #fff; }
.is-open .badge i { background: #fff; animation: pulse 1.2s ease-in-out infinite; }

/* ---------- halaman countdown ---------- */
.wait {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(1.25rem, 5vw, 4rem);
  max-width: 1150px;
  margin: 0 auto;
}

.wait__text h1 {
  margin: 1.1rem 0 .5rem;
  font-size: clamp(2.1rem, 5.6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.sub { margin: 0 0 1.8rem; font-size: clamp(1rem, 2vw, 1.2rem); max-width: 34ch; }

.clock { display: flex; flex-wrap: wrap; gap: clamp(.6rem, 1.6vw, 1rem); }
.tile {
  min-width: clamp(4.2rem, 11vw, 6.6rem);
  padding: .7rem .6rem .5rem;
  text-align: center;
  background: var(--paper);
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.tile:nth-child(odd)  { transform: rotate(-1.4deg); }
.tile:nth-child(even) { transform: rotate(1deg); }
.tile span {
  display: block;
  font-size: clamp(2.2rem, 6.2vw, 4.2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tile small { display: block; margin-top: .35rem; font-size: .75rem; color: var(--blue); }

.open {
  display: inline-block;
  margin-top: 1.8rem;
  padding: .8rem 1.8rem;
  background: var(--blue);
  color: #fff;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 1.15rem;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.open:hover  { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.open:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--ink); }

.hint { margin: 1.4rem 0 0; font-size: .85rem; color: #55627f; }
.sound { margin: .6rem 0 0; padding: 0; background: none; border: 0; font: inherit; font-size: .85rem; color: #3f5fb8; text-decoration: underline; cursor: pointer; }
.sound[hidden] { display: none; }

/* stiker avatar */
.sticker {
  margin: 0;
  justify-self: center;
  width: clamp(220px, 34vw, 380px);
  padding: 10px 10px 0;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(3deg);
  animation: bob 4s ease-in-out infinite;
}
.sticker img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
}
.sticker figcaption { padding: .55rem 0 .7rem; text-align: center; font-size: .95rem; color: var(--bear); }

@keyframes bob {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50%      { transform: rotate(2deg) translateY(-8px); }
}
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- HP ---------- */
@media (max-width: 760px) {
  .wait { grid-template-columns: 1fr; align-content: center; }
  .sticker { order: -1; width: min(58vw, 240px); }
}

@media (prefers-reduced-motion: reduce) {
  .sticker, .is-open .badge i { animation: none; }
}


/* ============================================================
   halaman stream (LIVE Studio)
   ============================================================ */
.badge--live { background: var(--live); color: #fff; }
.badge--live i { background: #fff; animation: pulse 1.2s ease-in-out infinite; }

.studio {
  height: 100svh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "bar bar" "stage side";
  gap: 14px;
}
.studio__bar { grid-area: bar; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.studio__logo { font-size: 1.15rem; }
.studio__scene { margin-right: auto; font-size: .85rem; color: #55627f; }
.studio__time { font-size: .85rem; font-variant-numeric: tabular-nums; }

/* panggung */
.stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  min-height: 0;
  background-color: #eef3fb;
  background-image: radial-gradient(rgba(28, 39, 66, .08) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stage__count {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  padding: .3rem .8rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 999px;
  font-size: .85rem;
}

.cam {
  position: absolute; left: 18px; bottom: 16px; z-index: 2;
  width: clamp(92px, 13vw, 150px);
  margin: 0;
  padding: 6px 6px 0;
  background: var(--paper);
  border: var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  rotate: -3deg;
}
.cam img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.cam figcaption { padding: .3rem 0 .4rem; text-align: center; font-size: .75rem; color: var(--bear); }


/* confetti latar */
.dust { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.dust i {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  background: var(--c); border: 2px solid var(--ink); border-radius: var(--r);
  opacity: .5; rotate: var(--rot);
  animation: drift var(--t) ease-in-out infinite alternate;
  animation-delay: var(--dl);
}
@keyframes drift { to { translate: var(--dx) var(--dy); rotate: calc(var(--rot) + 180deg); } }

/* area balon */
.field { position: absolute; inset: 7% 5% 22% 5%; }

.overlay {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center;
  padding: 1rem;
  background: rgba(216, 227, 240, .88);
}
.stage__card {
  max-width: 380px;
  padding: 1.6rem 1.8rem;
  text-align: center;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  rotate: -1.2deg;
}
.stage__card h2 { margin: 0 0 .4rem; font-size: 1.7rem; line-height: 1.1; }
.stage__card p { margin: 0; }
.stage__card .open { margin-top: 1.2rem; }

/* item: balon / kotak / bintang */
.item {
  --s: clamp(64px, 8vw, 96px);
  position: absolute;
  translate: -50% -50%;
  width: var(--s);
  height: calc(var(--s) * 1.3);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: itemIn .5s cubic-bezier(.3, 1.6, .5, 1) backwards;
  animation-delay: var(--in, 0s);
  transition: transform .15s;
}
.item:hover, .item:focus-visible { transform: scale(1.1) rotate(-4deg); }
.item:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; border-radius: 12px; }

.bob {
  display: block; position: relative; width: 100%; height: 100%;
  animation: float var(--d, 3.4s) ease-in-out infinite;
  animation-delay: var(--dl, 0s);
}
.shape {
  position: absolute; left: 0; right: 0; top: 0; height: 78%;
  background: var(--c);
  border: var(--line);
  box-shadow: 3px 3px 0 var(--ink);
}
.balloon .shape { border-radius: 50% 50% 46% 46%; }
.balloon .shape::before {
  content: ""; position: absolute; left: 18%; top: 14%;
  width: 20%; height: 26%; border-radius: 50%;
  background: rgba(255, 255, 255, .55); rotate: 20deg;
}
.balloon .bob::after {
  content: ""; position: absolute; left: 50%; top: 78%;
  width: 2.5px; height: 22%; background: var(--ink); translate: -50% 0;
}
.gift .shape {
  top: 14%; height: 58%; border-radius: 10px;
  background:
    linear-gradient(90deg, transparent 41%, rgba(255, 255, 255, .92) 41% 59%, transparent 59%),
    linear-gradient(0deg, transparent 41%, rgba(255, 255, 255, .92) 41% 59%, transparent 59%),
    var(--c);
}
.star .bob { filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)) drop-shadow(3px 3px 0 var(--ink)); }
.star .shape {
  border: 0; box-shadow: none; height: 86%;
  clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 98%, 50% 76%, 20% 98%, 30% 60%, 0 38%, 38% 36%);
}

.item.pop { animation: pop .3s ease-out forwards; pointer-events: none; }
.spark {
  position: absolute; z-index: 3; width: 9px; height: 9px;
  background: var(--c); border: 2px solid var(--ink);
  translate: -50% -50%; pointer-events: none;
  animation: spark .55s ease-out forwards;
}

@keyframes float  { 50% { translate: 0 -10px; } }
@keyframes itemIn { from { transform: scale(0) rotate(-20deg); } }
@keyframes pop    { to { transform: scale(1.5); opacity: 0; } }
@keyframes spark  { to { transform: translate(var(--dx), var(--dy)) rotate(180deg) scale(.2); opacity: 0; } }

/* panel samping */
.side { grid-area: side; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; min-height: 0; }
.panel {
  display: flex; flex-direction: column; min-height: 0;
  padding: .8rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 .6rem; font-size: .95rem; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.stats div { padding: .45rem .6rem; background: #eaf0f9; border-radius: 10px; }
.stats small { display: block; font-size: .7rem; color: #55627f; }
.stats b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.chat ul {
  flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none;
  overflow-y: auto; display: flex; flex-direction: column; gap: .4rem;
}
.chat li { font-size: .9rem; overflow-wrap: anywhere; }
.chat li b { color: var(--c, var(--blue)); }
.chat li.is-gift {
  padding: .35rem .55rem;
  background: var(--blue-soft);
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.chat li.is-sys { font-size: .8rem; color: #55627f; }
.chat { position: relative; }
.chat__form { display: flex; gap: .5rem; margin-top: .6rem; }
.chat__form input {
  flex: 1; min-width: 0; padding: .55rem .7rem;
  font: inherit; font-size: .85rem; color: var(--ink);
  background: #eaf0f9; border: var(--line); border-radius: 10px;
}
.chat__form input:focus { outline: 3px solid var(--blue-soft); }
.chat__send {
  padding: 0 .9rem; font: inherit; font-size: .85rem; color: #fff;
  background: var(--blue); border: var(--line); border-radius: 10px; cursor: pointer;
}
.chat__send:active { transform: translateY(2px); }
.chat__new {
  position: absolute; left: 50%; bottom: 4.2rem; translate: -50% 0;
  padding: .3rem .85rem; font: inherit; font-size: .8rem; color: #fff;
  background: var(--ink); border: 0; border-radius: 999px; cursor: pointer;
}
.chat li.is-me { padding-left: .5rem; border-left: 3px solid var(--blue); }

/* surat */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 1rem; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(28, 39, 66, .5); }
.letter {
  position: relative;
  width: min(560px, 100%);
  max-height: 86svh;
  overflow-y: auto;
  padding: 1.4rem 1.6rem 1.6rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  animation: itemIn .35s cubic-bezier(.3, 1.4, .5, 1) backwards;
}
.letter__tag { margin: 0; font-size: .8rem; color: var(--bear); }
.letter h2 { margin: .1rem 0 .9rem; font-size: 1.5rem; line-height: 1.1; }
.letter__body p { margin: 0 0 .9rem; font-size: 1.05rem; line-height: 1.6; }
.letter .open { margin-top: .4rem; }

/* HP / layar sempit: tumpuk vertikal */
@media (max-width: 900px) {
  .studio {
    height: auto; min-height: 100svh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas: "bar" "stage" "side";
  }
  .stage { min-height: 62svh; }
  .side { grid-template-rows: auto 46svh; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats b { font-size: 1.05rem; }
  .stats small { font-size: .62rem; }
  .cam { left: 10px; bottom: 10px; }
  .item { --s: clamp(56px, 15vw, 80px); }
}

@media (prefers-reduced-motion: reduce) {
  .bob, .badge--live i, .letter, .dust i { animation: none; }
}


/* ============================================================
   halaman galeri
   ============================================================ */
.gallery { max-width: 1100px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 3rem); }
.gallery__head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; }
.gallery__head p { margin: .4rem 0 0; color: #55627f; }

.photos {
  list-style: none; margin: 0; padding: 1.8rem 0 2.2rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.8rem 1.4rem;
}
.photo {
  display: block; width: 100%; padding: 8px 8px 0;
  font: inherit; color: inherit; text-align: left;
  background: var(--paper);
  border: var(--line); border-radius: 14px; box-shadow: var(--shadow);
  rotate: var(--rt); cursor: pointer;
  transition: rotate .2s, translate .2s, box-shadow .2s;
}
.photo:hover, .photo:focus-visible { rotate: 0deg; translate: 0 -4px; box-shadow: 8px 8px 0 var(--ink); }
.photos li { position: relative; perspective: 800px; }
.photos li.is-movable { translate: var(--dx, 0px) var(--dy, 0px); }
.photos li.is-movable .photo { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.photo { transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: rotate .2s, translate .2s, box-shadow .2s, transform .12s ease-out; }
.photo.is-drag { cursor: grabbing; rotate: 0deg; translate: 0 -6px; transform: scale(1.05); box-shadow: 14px 14px 0 var(--ink); transition: box-shadow .15s; }
.photo .frame img { -webkit-user-drag: none; user-drag: none; }
@media (prefers-reduced-motion: reduce) { .photo { transform: none; } }
.photo:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.photo .frame {
  position: relative; display: block; aspect-ratio: 4 / 5;
  background: #eaf0f9; border-radius: 8px; overflow: hidden;
}
.photo .frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo.is-broken .frame img { visibility: hidden; }
.photo.is-broken .frame::after {
  content: "foto belum ada"; position: absolute; inset: 0;
  display: grid; place-items: center; font-size: .85rem; color: #55627f;
}
.photo .cap { display: block; padding: .5rem 0 .6rem; font-size: .85rem; color: var(--bear); }

/* penampil foto */
.viewer img {
  display: block; width: 100%; max-height: 62svh; object-fit: contain;
  background: #eaf0f9; border-radius: 10px;
}
.viewer__cap { margin: .7rem 0 0; color: var(--bear); text-align: center; }
.viewer__nav { display: flex; gap: .6rem; justify-content: space-between; margin-top: .9rem; }
.viewer__nav .open { margin: 0; padding: .5rem 1.1rem; font-size: 1rem; }

/* ============================================================
   halaman penutup
   ============================================================ */
.page-ending .dust { position: fixed; }
.ending {
  position: relative; z-index: 1; min-height: 100svh;
  display: grid; place-content: center; justify-items: center; gap: 1.4rem;
  padding: 2rem; text-align: center;
}
.sticker--sm { width: clamp(150px, 22vw, 210px); }
.ending__text { max-width: 36ch; font-size: clamp(1.15rem, 2.8vw, 1.6rem); line-height: 1.5; }
.ending__text p { margin: 0 0 .9rem; }
.ending__text .lead { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; margin-bottom: 1.2rem; }
.ending .w { opacity: 0; transition: opacity .35s; }
.ending .w.on { opacity: 1; }
.ending .open { margin-top: .4rem; }
.ending .hint { margin: 0; }

@media (max-width: 480px) {
  .photos { grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem; }
}


/* ============================================================
   perbaikan: sentuh, gerbang, tombol lewati
   ============================================================ */
/* halaman terkunci disembunyikan sampai lolos pemeriksaan waktu (tanpa kedip) */
body[data-gate]:not(.gate-ok) { visibility: hidden; }

/* item game: ketuk tidak ditunda & tidak ada kilatan sentuh */
.item { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* geser kiri/kanan di foto tidak menggulung halaman */
.viewer img { touch-action: pan-y; }

.skip {
  padding: .3rem .95rem; font: inherit; font-size: .85rem; color: #55627f;
  background: var(--paper); border: var(--line); border-radius: 999px; cursor: pointer;
}
.skip:hover { color: var(--ink); }

/* ============================================================
   halaman credit roll & after-credit
   ============================================================ */
.credits-wrap {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: clamp(2rem, 5vw, 4rem) 1.25rem 5rem;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.credits-box {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--paper);
  border: var(--line);
  border-radius: 20px;
  box-shadow: 8px 8px 0 var(--ink);
  margin-bottom: 2rem;
}

.credits-title {
  margin: 1.2rem 0 .4rem;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}

.credits-sub {
  margin: 0 0 1.8rem;
  color: #55627f;
  font-size: clamp(.95rem, 2vw, 1.15rem);
}

.credits-list {
  display: flex; flex-direction: column; gap: 1.4rem;
  margin: 1.8rem 0;
  padding: 1.5rem 0;
  border-top: 2px dashed rgba(28, 39, 66, .2);
  border-bottom: 2px dashed rgba(28, 39, 66, .2);
}

.credit-item {
  display: flex; flex-direction: column; gap: .25rem;
}

.credit-role {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--bear);
}

.credit-name {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--ink);
}

.credits-note {
  margin: 1.5rem 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--blue);
}

.credits-video-wrap {
  margin: 1.5rem 0 0.5rem;
  width: 100%;
}

.credits-video {
  width: 100%;
  max-height: 340px;
  background: #000;
  border: var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  display: block;
}

.credits-video-cap {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--sub);
  font-style: italic;
}

/* Kotak After-Credit */
.after-credit {
  width: 100%;
  max-width: 580px;
  padding: 1.8rem 1.6rem;
  background: #fff;
  border: var(--line);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--live);
  text-align: center;
  margin: 1.5rem 0 2rem;
  animation: itemIn .5s cubic-bezier(.3, 1.5, .5, 1) backwards;
}

.after-credit__tag {
  display: inline-block;
  padding: .2rem .75rem;
  background: #ffe3e3;
  color: var(--live);
  border: 2px solid var(--live);
  border-radius: 999px;
  font-size: .75rem;
  letter-spacing: .08em;
  font-weight: bold;
}

.after-credit h2 {
  margin: .6rem 0 .4rem;
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
}

.after-credit p {
  margin: 0 0 1.2rem;
  color: #55627f;
  font-size: .95rem;
}

.ac-btn {
  background: var(--live) !important;
  margin-top: 0 !important;
}
.ac-btn:hover {
  box-shadow: 3px 3px 0 var(--ink) !important;
}

.credits-actions {
  position: sticky; bottom: 1.2rem; z-index: 5;
}

.credits-skip {
  padding: .5rem 1.3rem;
  font: inherit; font-size: .9rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.credits-skip:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ============================================================
   halaman surat pribadi (after-credit)
   ============================================================ */
.page-letter .dust { position: fixed; }
.letter-wrap {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1.2rem;
}

.letter-paper {
  position: relative;
  width: min(680px, 100%);
  padding: clamp(1.8rem, 5vw, 3rem);
  background: var(--paper);
  border: var(--line);
  border-radius: 20px;
  box-shadow: 10px 10px 0 var(--ink);
  animation: itemIn .45s cubic-bezier(.3, 1.4, .5, 1) backwards;
}

.letter-paper__head {
  border-bottom: 2px solid rgba(28, 39, 66, .12);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
}

.letter-paper__head h1 {
  margin: .8rem 0 .3rem;
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  line-height: 1.15;
}

.letter-paper__sub {
  margin: 0;
  color: #55627f;
  font-size: .95rem;
}

.letter-paper__body {
  font-size: clamp(1.02rem, 2.2vw, 1.15rem);
  line-height: 1.7;
}

.letter-paper__body p {
  margin: 0 0 1.2rem;
}

.letter-paper__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed rgba(28, 39, 66, .15);
}

.sticker--mini {
  margin: 0;
  width: 104px;
  padding: 5px 5px 0;
  background: var(--paper);
  border: var(--line);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-3deg);
}
.sticker--mini img {
  display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border-radius: 8px;
}
.sticker--mini figcaption {
  padding: .3rem 0; text-align: center; font-size: .75rem; color: var(--bear); font-weight: bold;
}



/* ---------- transisi glitch (penutup -> surat) ---------- */
.glitch {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: .6rem;
  background: #05070f; color: #dfe8ff; text-align: center;
  animation: glitch-in .5s steps(6) both;
}
.glitch::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(95,127,209,.12) 0 2px, transparent 2px 4px);
  animation: scan 6s linear infinite;
}
.glitch b {
  position: relative; font-size: clamp(1.6rem, 6vw, 3.4rem); letter-spacing: .08em;
  text-shadow: 3px 0 #5f7fd1, -3px 0 #a9bde6;
  animation: jitter .35s steps(2) infinite;
}
.glitch span { position: relative; font-size: 1rem; color: #a9bde6; min-height: 1.4em; }
.glitch.is-back b { animation: none; text-shadow: none; }
.glitch.is-back { animation: glitch-out .5s ease-out .1s both; }
body.is-glitching > main { animation: jitter .12s steps(2) 4; filter: contrast(1.4) saturate(1.5); }
@keyframes glitch-in { 0% { opacity: 0; transform: translateX(-8px); } 30% { opacity: 1; transform: translateX(6px); } 60% { opacity: .4; } 100% { opacity: 1; transform: none; } }
@keyframes glitch-out { to { opacity: .0; } }
@keyframes jitter { 0% { transform: translate(0,0); } 50% { transform: translate(-3px, 2px); } 100% { transform: translate(3px,-2px); } }
@keyframes scan { to { background-position: 0 100vh; } }
@media (prefers-reduced-motion: reduce) {
  .glitch, .glitch::before, .glitch b, body.is-glitching > main { animation: none; }
}


/* ---------- tombol musik ---------- */
.mute {
  position: fixed; right: 14px; bottom: 14px; z-index: 60;
  padding: .35rem .8rem; font: inherit; font-size: .8rem; color: var(--ink);
  background: var(--paper); border: var(--line); border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.mute:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.mute:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 480px) { .mute { right: 10px; bottom: 10px; } }


/* ---------- foto di dalam surat teman ---------- */
.letter__photo {
  margin: 0 auto 1.1rem; width: min(260px, 80%);
  padding: 8px 8px 0; background: #fff; border: var(--line); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink); rotate: -2deg;
}
.letter__photo img { display: block; width: 100%; max-height: 300px; object-fit: cover; background: #e7ecf8; }
.letter__photo figcaption { padding: .4rem 0 .5rem; font-size: .8rem; text-align: center; color: var(--bear); }


/* seret & lempar item (mouse) */
@media (pointer: fine) { .item { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; } }
.item.is-drag { cursor: grabbing; z-index: 3; transform: scale(1.12); }


/* ---------- halaman titip pesan ---------- */
.titip { display: grid; gap: 1.1rem; margin-top: 1.2rem; }
.titip__field { display: grid; gap: .35rem; font-weight: 600; }
.titip__field input, .titip__field textarea {
  width: 100%; padding: .7rem .9rem; font: inherit; font-weight: 400; color: var(--ink);
  background: #fff; border: var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
}
.titip__field textarea { resize: vertical; min-height: 9rem; line-height: 1.6; }
.titip__field input:focus-visible, .titip__field textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.titip__count { justify-self: end; font-weight: 400; color: #55627f; }
.titip__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.titip .open { justify-self: start; }
.titip .open:disabled { opacity: .6; cursor: default; }
.titip__note { margin: 0; min-height: 1.4em; font-size: .9rem; color: var(--bear); }
.titip__done { margin-top: 1.2rem; text-align: center; }
.titip__done h2 { margin: 0 0 .4rem; font-size: 1.7rem; }
.titip__done p { margin: 0; }


/* ---------- notifikasi pencapaian ---------- */
.toast {
  position: fixed; top: 16px; left: 50%; z-index: 120; translate: -50% 0;
  display: grid; gap: 1px; min-width: 240px; max-width: 90vw; padding: .7rem 1.1rem;
  background: var(--paper); color: var(--ink); border: var(--line); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink); animation: toast-in .35s ease-out both;
}
.toast small { font-size: .72rem; color: #55627f; }
.toast b { font-size: 1.05rem; }
.toast span { font-size: .85rem; }
.toast.is-out { animation: toast-out .45s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-14px); } }

/* ---------- hujan hati (easter egg) + avatar berputar ---------- */
.rain { position: fixed; top: -40px; z-index: 110; color: #e86a8d; pointer-events: none; animation: rain-fall linear forwards; }
@keyframes rain-fall { to { transform: translateY(110vh) rotate(40deg); opacity: .6; } }
.sticker.spin { animation: sticker-spin .9s ease-in-out; }
@keyframes sticker-spin { from { transform: rotate(3deg) rotateY(0); } to { transform: rotate(3deg) rotateY(720deg); } }

/* ---------- super chat ---------- */
.chat li.is-super, #chat li.is-super { display: block; margin: .35rem 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--sc, #3f5fb8); color: #fff; }
#chat li.is-super div { display: flex; justify-content: space-between; gap: .6rem; padding: .35rem .6rem; background: rgba(0,0,0,.14); font-size: .85rem; }
#chat li.is-super b { color: #fff; }
#chat li.is-super p { margin: 0; padding: .4rem .6rem .5rem; font-size: .85rem; line-height: 1.4; }
#chat li.is-super.sc1 { --sc: #3f5fb8; }
#chat li.is-super.sc2 { --sc: #1f8f7a; }
#chat li.is-super.sc3 { --sc: #b08a00; }
#chat li.is-super.sc4 { --sc: #c4661f; }
#chat li.is-super.sc5 { --sc: #b3364f; }

/* ---------- chat ruang tunggu (countdown) ---------- */
.waitchat { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .25rem; font-size: .85rem; color: #55627f; min-height: 4.2em; }
.waitchat[hidden] { display: none; }
.waitchat li { animation: toast-in .3s ease-out both; }
.waitchat b { margin-right: .3rem; }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-out, .waitchat li, .sticker.spin, .rain { animation: none; } }


/* ---------- kuis ---------- */
.quiz { max-width: 720px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 3rem); }
.quiz__head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; }
.quiz__head p { margin: .4rem 0 1.4rem; color: #55627f; }
.quiz__card { padding: clamp(1.1rem, 3vw, 1.8rem); background: var(--paper); border: var(--line); border-radius: 20px; box-shadow: 8px 8px 0 var(--ink); }
.quiz__meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; color: #55627f; }
.quiz__card h2 { margin: .6rem 0 1.1rem; font-size: clamp(1.25rem, 3.4vw, 1.7rem); line-height: 1.3; }
.quiz__opts { display: grid; gap: .6rem; }
.quiz__opt { padding: .75rem 1rem; font: inherit; text-align: left; color: var(--ink); background: #fff; border: var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.quiz__opt:hover:not(:disabled), .quiz__opt:focus-visible { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); outline: 3px solid var(--blue); outline-offset: 2px; }
.quiz__opt:disabled { cursor: default; opacity: .75; }
.quiz__opt.is-right { background: #d9f2e4; opacity: 1; }
.quiz__opt.is-wrong { background: #f8dce2; opacity: 1; }
.quiz__fb { min-height: 1.5em; margin: 1rem 0 .6rem; font-weight: 600; }
.quiz__fb.is-right { color: #1f7a56; }
.quiz__fb.is-wrong { color: #b3364f; }
.quiz__result { text-align: center; }
.quiz__score { font-size: 1.4rem; font-weight: 700; margin: .2rem 0 .6rem; }

/* ---------- tiup lilin ---------- */
.candle-page { max-width: 560px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 3rem); text-align: center; }
.candle-page h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.1; }
.candle-page > p { margin: .4rem 0 1rem; color: #55627f; }
.cake { width: min(100%, 420px); height: auto; overflow: visible; }
.candle { cursor: pointer; outline: none; }
.candle:focus-visible rect { stroke: var(--blue); stroke-width: 5; }
.candle .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .5s ease-in-out infinite alternate; }
.candle .smoke { opacity: 0; stroke-dasharray: 60; stroke-dashoffset: 60; }
.candle.out .flame { display: none; }
.candle.out .smoke { animation: smoke 1.6s ease-out forwards; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.88, 1.1) rotate(3deg); } }
@keyframes smoke { 0% { opacity: .9; stroke-dashoffset: 60; } 100% { opacity: 0; stroke-dashoffset: 0; transform: translateY(-14px); } }
.candle-page__ctl { margin-top: .8rem; }
.candle-page__ctl .open:disabled { opacity: .6; cursor: default; }
.candle-page__done { margin-top: .8rem; }
.candle-page__done h2 { margin: 0 0 .3rem; font-size: 1.8rem; }
@media (prefers-reduced-motion: reduce) { .candle .flame, .candle.out .smoke { animation: none; } }
.letter-paper__foot { flex-wrap: wrap; gap: .8rem; }
