:root {
  --bg: #07080a;
  --bg2: #0d0f12;
  --ink: #f3f5ec;
  --muted: rgba(243, 245, 236, .64);
  --faint: rgba(243, 245, 236, .1);
  --lime: #dcfe25;
  --lime-ink: #111404;
  --gold: #f4c14f;
  --glass: rgba(18, 21, 24, .62);
  --line: rgba(220, 254, 37, .28);
  --display: "Chakra Petch", "IBM Plex Sans Thai", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "Chakra Petch", system-ui, sans-serif;
  --r: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--body); overflow-x: hidden;
}
img { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.kicker { margin: 0; font: 600 13px/1.2 var(--display); letter-spacing: .28em; color: var(--lime); text-transform: uppercase; }
.hint { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- ฉากหลัง ---------- */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #161b0d 0%, var(--bg) 62%); }
.scene.has-plate { background-size: cover; background-position: center; }
.scene-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; }
.scene.has-video .scene-video { opacity: 1; }
.scene.has-plate .scene-glow, .scene.has-plate .scene-floor, .scene.has-plate .lights { display: none; }
.scene.has-video .scene-glow, .scene.has-video .scene-floor, .scene.has-video .lights, .scene.has-video .bokeh { display: none; }
.scene-glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 30% at 20% 30%, rgba(220, 254, 37, .12), transparent 70%),
    radial-gradient(35% 28% at 85% 20%, rgba(140, 90, 255, .16), transparent 70%),
    radial-gradient(50% 30% at 60% 85%, rgba(244, 193, 79, .08), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.05); } }
.scene-floor {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%;
  background-image:
    linear-gradient(rgba(220, 254, 37, .2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 254, 37, .2) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(62deg); transform-origin: 50% 0;
  mask-image: linear-gradient(transparent, #000 30%, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 60%, transparent);
  animation: floor 6s linear infinite; opacity: .5;
}
@keyframes floor { to { background-position: 0 64px, 0 0; } }
.lights { position: absolute; top: 0; left: 0; width: 100%; height: 110px; }
.lights path { stroke: rgba(243, 245, 236, .25); stroke-width: 1.5; }
.lights circle { stroke: none; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .35; } }
.bokeh span {
  position: absolute; border-radius: 50%; filter: blur(1px);
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%);
  animation: rise linear infinite;
}
@keyframes rise { from { transform: translateY(10vh); opacity: 0; } 15% { opacity: .8; } 85% { opacity: .6; } to { transform: translateY(-110vh); opacity: 0; } }
.scene-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 8, 10, .1), rgba(7, 8, 10, .55) 70%, var(--bg)); }

/* ---------- แถบบน ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px; gap: 12px;
  background: linear-gradient(rgba(7, 8, 10, .92), rgba(7, 8, 10, .55)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand img { height: 26px; width: auto; }
.nav-cta {
  font: 700 14px/1 var(--display); padding: 11px 18px; border-radius: 999px; text-decoration: none;
  background: var(--lime); color: var(--lime-ink);
}

/* นาฬิกานับถอยหลัง */
.count { margin: 22px auto 0; width: 100%; max-width: 560px; }
.count-label { margin: 0 0 10px; font: 600 12px/1.3 var(--display); letter-spacing: .2em; color: var(--muted); }
.count-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cbox {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid var(--faint); overflow: hidden;
}
.cbox::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .35); }
.cbox b { font: 700 clamp(34px, 11vw, 64px)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--ink); }
.cbox.sec b { color: var(--lime); }
.cbox span { font-size: 12px; color: var(--muted); }
.cbox b.tick { animation: tickin .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tickin { from { transform: translateY(-30%); opacity: .2; } }
.count-done { margin: 0; padding: 18px; border-radius: 16px; background: var(--lime); color: var(--lime-ink); font: 700 24px/1.2 var(--display); text-align: center; }

/* ---------- ฮีโร่ ---------- */
.hero { position: relative; display: grid; gap: 4px; padding: 6px 16px 0; max-width: 1180px; margin: 0 auto; text-align: center; }
.hero-miar { --mh: min(66vw, 340px); position: relative; height: var(--mh); display: flex; align-items: flex-end; justify-content: center; }
.fireworks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.halo {
  position: absolute; bottom: 4%; width: min(78vw, 360px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 254, 37, .28), rgba(244, 193, 79, .1) 45%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.06); opacity: .75; } }
.miar-wrap { position: relative; height: var(--mh); width: calc(var(--mh) * 915 / 1496); flex: none; animation: bob 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
.miar-ny { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .55)); }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1.2deg); } }
/* ประกายไฟปลายไม้ (ภาพต้นฉบับหายตอนลบพื้นหลัง เลยทำใหม่ด้วยโค้ด) */
.sparkler { position: absolute; left: 13%; top: 11.5%; width: 0; height: 0; }
.sparkler::before {
  content: ""; position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 22%, #ffe9a6 38%, rgba(244, 193, 79, 0) 70%);
  animation: flick .18s steps(2) infinite alternate;
}
@keyframes flick { to { transform: scale(1.25); opacity: .85; } }
.sparkler i {
  position: absolute; left: 0; top: 0; width: 2px; height: 26px; margin-left: -1px; border-radius: 2px; transform-origin: 50% 0;
  background: linear-gradient(#fff6cf, rgba(244, 193, 79, 0));
  animation: spark .7s linear infinite;
}
.sparkler i:nth-child(1) { --a: 0deg; } .sparkler i:nth-child(2) { --a: 45deg; animation-delay: -.1s; }
.sparkler i:nth-child(3) { --a: 90deg; animation-delay: -.3s; } .sparkler i:nth-child(4) { --a: 135deg; animation-delay: -.5s; }
.sparkler i:nth-child(5) { --a: 180deg; animation-delay: -.2s; } .sparkler i:nth-child(6) { --a: 225deg; animation-delay: -.6s; }
.sparkler i:nth-child(7) { --a: 270deg; animation-delay: -.4s; } .sparkler i:nth-child(8) { --a: 315deg; animation-delay: -.15s; }
@keyframes spark { from { transform: rotate(var(--a)) scaleY(.2); opacity: 1; } to { transform: rotate(calc(var(--a) + 20deg)) scaleY(1.2) translateY(6px); opacity: 0; } }
.bubble {
  position: absolute; right: 4%; top: 8%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--ink); color: #111;
  font: 600 13px/1.3 var(--body); white-space: nowrap; box-shadow: var(--shadow);
  animation: pop .5s 1.1s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes pop { from { transform: scale(0); opacity: 0; } }

.title { margin: 6px 0 0; font-family: var(--display); font-weight: 700; line-height: .86; letter-spacing: -.01em; }
.title .t1 { display: inline-flex; align-items: flex-start; }
.title .t1 b { font-size: clamp(96px, 30vw, 220px); color: var(--lime); }
.title .t1 i { font-style: normal; font-size: clamp(36px, 11vw, 80px); margin: .3em 0 0 .06em; -webkit-text-stroke: 2px var(--ink); color: transparent; }
.title .t2 { display: block; font-size: clamp(38px, 11.2vw, 88px); margin-top: 4px; }
.ny { margin: 12px 0 0; font: 700 clamp(15px, 4.4vw, 20px)/1 var(--display); letter-spacing: .18em; color: var(--gold); }
.ny b { display: inline-block; padding: 4px 10px; margin-left: 6px; border-radius: 6px; background: var(--gold); color: #1d1404; letter-spacing: .08em; }
.sub { margin: 14px 0 0; font-size: clamp(16px, 4.4vw, 20px); font-weight: 600; color: var(--muted); }

/* บัตรเชิญ: วัน · เวลา · สถานที่ */
.ticket {
  --notch: 12px;
  position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 22px auto 0; width: 100%; max-width: 560px; text-align: left;
  border-radius: 20px; background: linear-gradient(135deg, rgba(220, 254, 37, .1), rgba(18, 21, 24, .86) 40%); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tk { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; text-decoration: none; min-width: 0; }
.tk small { font: 600 11px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.tk b { font: 700 34px/1.05 var(--display); }
.tk span { font-size: 14px; color: var(--muted); }
.tk-date b { color: var(--lime); font-size: 40px; }
.tk-time { border-left: 1.5px dashed rgba(243, 245, 236, .18); }
.tk-place { grid-column: 1 / -1; border-top: 1.5px dashed rgba(243, 245, 236, .18); position: relative; }
.tk-place b { font-size: 24px; }
.tk-place u { color: var(--lime); text-underline-offset: 3px; }
.tk-place::before, .tk-place::after {
  content: ""; position: absolute; top: calc(var(--notch) * -1); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--bg);
}
.tk-place::before { left: calc(var(--notch) * -1 - 1px); }
.tk-place::after { right: calc(var(--notch) * -1 - 1px); }
.tk-place:hover u { color: var(--ink); }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin: 16px auto 0; width: 100%; max-width: 560px;
  min-height: 58px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); text-decoration: none;
  font: 700 18px/1 var(--display); box-shadow: var(--shadow); transition: transform .2s;
}
.cta svg { width: 20px; height: 20px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.cta:hover { transform: translateY(-2px); }

/* ---------- รูปรวม ---------- */
.crowd { position: relative; margin: 56px auto 0; max-width: 1280px; padding: 0 12px; }
.crowd-head { text-align: center; margin-bottom: 18px; }
.crowd-head h2 { margin: 8px 0 0; font: 700 clamp(22px, 6vw, 36px)/1.2 var(--display); }
.crowd-head h2 b { color: var(--lime); }
.crowd-stage { position: relative; }
.crowd-stage::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 0; bottom: 0; z-index: -1;
  background: radial-gradient(60% 70% at 50% 40%, rgba(244, 193, 79, .12), transparent 70%);
}
.crow { display: flex; justify-content: center; gap: 4px; }
.crow + .crow { margin-top: 2px; }
.fig {
  position: relative; width: var(--fig); flex: none; margin: 0; padding: calc(var(--fig) * .16) 0 0; border: 0; background: none; cursor: pointer;
}
.fig img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 0; transition: filter .2s; }
.fig::after {
  content: attr(data-name); position: absolute; left: 50%; bottom: 8%; transform: translate(-50%, 4px); opacity: 0; transition: .2s; z-index: 3;
  max-width: 120%; overflow: hidden; text-overflow: ellipsis;
  padding: 4px 9px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font: 700 12px/1.2 var(--display); white-space: nowrap; pointer-events: none;
}
.fig:hover img, .fig:focus-visible img { filter: brightness(1.12) drop-shadow(0 0 1px var(--lime)); }
.fig:hover::after, .fig:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
/* โยกขึ้นลงนิดเดียว ไม่ขยับข้าง ไม่หมุน (ไม่ให้ไปทับใคร) */
@keyframes bob2 { 50% { transform: translateY(-1.5%); } }
.crowd-banner {
  position: relative; z-index: 40; margin: calc(var(--fig, 60px) * -0.18) -12px 0; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--lime); color: var(--lime-ink); font: 700 clamp(12px, 3.4vw, 22px)/1 var(--display); letter-spacing: .08em;
  clip-path: polygon(0 18%, 100% 0, 100% 82%, 0 100%);
}
.crowd-banner b { font-size: 1.15em; }
.crowd-banner span { opacity: .7; }

/* ---------- หาชื่อ ---------- */
.find { max-width: 1180px; margin: 0 auto; padding: 56px 16px 24px; scroll-margin-top: 60px; }
.find-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.find h2 { margin: 0; font: 700 clamp(28px, 8vw, 44px)/1.1 var(--display); }
.progress { margin: 0; color: var(--muted); font-size: 14px; }
.progress b { color: var(--lime); }
.search {
  position: sticky; top: 58px; z-index: 15; display: flex; align-items: center; gap: 10px; margin: 16px 0 18px; padding: 0 16px;
  min-height: 54px; border-radius: 16px; background: rgba(18, 21, 24, .9); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.search svg { width: 20px; height: 20px; color: var(--lime); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 500 17px/1 var(--body); }
.search input::placeholder { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; cursor: pointer; text-align: left;
  border-radius: 16px; border: 1px solid var(--faint); background: linear-gradient(180deg, rgba(220, 254, 37, .08), rgba(18, 21, 24, .85) 60%);
  transition: transform .2s, border-color .2s;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 0; transition: transform .3s; }
.card span { padding: 8px 10px 10px; font: 600 13px/1.25 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:hover { transform: translateY(-4px); border-color: var(--line); }
.card:hover img { transform: scale(1.05); }
.card.answered::after {
  content: "ตอบแล้ว"; position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
  background: var(--lime); color: var(--lime-ink); font: 700 11px/1.3 var(--display);
}
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---------- ปีที่แล้ว ---------- */
.memory { max-width: 980px; margin: 0 auto; padding: 40px 16px 30px; text-align: center; }
.polaroid { margin: 18px auto 0; padding: 10px 10px 0; background: #f4f2ea; border-radius: 6px; transform: rotate(-1.6deg); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); max-width: 820px; }
.polaroid img { border-radius: 3px; width: 100%; }
.polaroid figcaption { color: #222; padding: 12px 6px 16px; font: 600 15px/1.3 var(--display); }
.foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px 16px max(30px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- หน้าของแต่ละคน ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 6, .74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  position: relative; max-height: 94vh; overflow: auto; overscroll-behavior: contain;
  border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  background: radial-gradient(120% 60% at 50% 0%, #1b210f 0%, var(--bg2) 55%);
  animation: up .45s cubic-bezier(.2, .9, .2, 1) both; padding-bottom: env(safe-area-inset-bottom);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--faint); background: var(--glass); cursor: pointer; }
.close svg { width: 20px; height: 20px; }
.p-visual { position: relative; height: 42vh; min-height: 260px; display: grid; place-items: end center; overflow: hidden; }
.p-ring { position: absolute; width: 74vw; max-width: 380px; aspect-ratio: 1; bottom: -14%; border-radius: 50%; background: radial-gradient(circle, rgba(220, 254, 37, .38), rgba(220, 254, 37, 0) 68%); animation: pulse 3s ease-in-out infinite; }
.p-img { position: relative; height: 100%; width: auto; max-width: 92%; object-fit: contain; object-position: 50% 0; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .6)); animation: in .6s .1s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes in { from { transform: translateY(30px) scale(.92); opacity: 0; } }
.p-visual::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(transparent, var(--bg2)); }
.p-body { position: relative; padding: 0 18px 26px; margin-top: -18px; }
.p-name { margin: 6px 0 0; font: 700 clamp(30px, 9vw, 48px)/1.05 var(--display); word-break: break-word; }
.p-nick { margin: 2px 0 0; color: var(--muted); }
.p-nick:empty { display: none; }
.miar-say { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.miar-say img { width: 64px; height: 64px; object-fit: contain; flex: none; animation: boing .6s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes boing { from { transform: scale(.3) rotate(-12deg); } }
.miar-say p { margin: 0; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--ink); color: #111; font-weight: 600; font-size: 15px; line-height: 1.4; }
.p-form fieldset { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.p-form legend { font: 700 17px/1.3 var(--display); margin-bottom: 10px; padding: 0; }
.opts { display: grid; gap: 10px; }
.opt, .pill { position: relative; display: block; cursor: pointer; }
.opt input, .pill input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--r); border: 1.5px solid var(--faint);
  background: rgba(255, 255, 255, .03); transition: .2s;
}
.opt b { font: 700 20px/1.2 var(--display); }
.opt small { color: var(--muted); font-size: 13px; }
.opt.yes input:checked + span { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); box-shadow: var(--shadow); }
.opt.yes input:checked + span small { color: rgba(17, 20, 4, .7); }
.opt.no input:checked + span { border-color: var(--ink); background: rgba(243, 245, 236, .1); }
.opt input:focus-visible + span, .pill input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.plus { grid-template-columns: 1fr 1fr; animation: up .35s both; }
.pill span { display: grid; place-items: center; min-height: 50px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--faint); font-weight: 600; transition: .2s; text-align: center; }
.pill input:checked + span { border-color: var(--lime); color: var(--lime); background: rgba(220, 254, 37, .08); }
.submit {
  width: 100%; min-height: 58px; margin-top: 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #0a0b0c; font: 700 18px/1 var(--display); transition: .2s;
}
.submit:disabled { opacity: .35; cursor: not-allowed; }
.submit:not(:disabled):hover { background: var(--lime); }
.err { min-height: 1.4em; margin: 10px 0 0; color: #ff8a7a; font-size: 14px; text-align: center; }
.done { position: relative; margin-top: 20px; padding: 20px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(220, 254, 37, .06); text-align: center; animation: up .4s both; }
.done-miar { width: 120px; height: auto; margin: -8px auto 6px; animation: boing .7s cubic-bezier(.2, 1.8, .4, 1) both; }
.done.no .done-miar { display: none; }
.done-title { margin: 0; font: 700 24px/1.2 var(--display); color: var(--lime); }
.done-sub { margin: 6px 0 0; color: var(--muted); }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.edit, .game { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--faint); background: var(--glass); cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; font-weight: 600; }
.game { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; width: 100%; height: 100%; }

/* ---------- เปิดตัว ---------- */
.reveal { animation: reveal .8s cubic-bezier(.2, .9, .2, 1) both; }
.hero-miar.reveal { animation-delay: .05s; } .kicker.reveal { animation-delay: .2s; } .t1.reveal { animation-delay: .3s; } .t2.reveal { animation-delay: .42s; }
.ny.reveal { animation-delay: .52s; } .sub.reveal { animation-delay: .6s; } .count.reveal { animation-delay: .66s; } .ticket.reveal { animation-delay: .74s; } .cta.reveal { animation-delay: .84s; }
@keyframes reveal { from { opacity: 0; transform: translateY(22px); filter: blur(10px); } }
.fig img {
  animation: figin .7s cubic-bezier(.2, 1.4, .4, 1) var(--ed, 0s) both,
             bob3 var(--d, 3s) ease-in-out var(--dl, 0s) infinite,
             wave 8s ease-in-out var(--wd, 2s) infinite;
}
/* ขยับอยู่ในช่องของตัวเองเท่านั้น (มีที่ว่างเหนือหัว 16%) → ไม่ทับคนแถวบน */
@keyframes bob3 { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3.5%; } }
@keyframes wave { 0%, 14%, 100% { transform: none; } 6% { transform: translateY(-8%); } 10% { transform: translateY(-1%); } }
@keyframes figin { from { transform: translateY(30%); opacity: 0; } }

/* ---------- จอใหญ่ ---------- */
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .ticket { grid-template-columns: .8fr .8fr 1.4fr; }
  .tk-place { grid-column: auto; border-top: 0; border-left: 1.5px dashed rgba(243, 245, 236, .18); }
  .tk-place::before, .tk-place::after { left: calc(var(--notch) * -1); right: auto; }
  .tk-place::before { top: calc(var(--notch) * -1 - 1px); } .tk-place::after { top: auto; bottom: calc(var(--notch) * -1 - 1px); }
  .search { top: 64px; }
}
@media (min-width: 960px) {
  .nav { padding: 18px 32px; }
  .brand img { height: 32px; }
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; padding: 10px 32px 0; text-align: left; max-width: 1280px; }
  .hero-copy { grid-column: 1; grid-row: 1; }
  .hero-miar { grid-column: 2; grid-row: 1; --mh: min(52vw, 760px); }
  .halo { width: min(40vw, 620px); }
  .count, .ticket, .cta { margin-left: 0; }
  .count-label { text-align: left; }
  .cbox b { font-size: clamp(48px, 5vw, 76px); }
  .cta { width: auto; padding: 0 36px; }
  .bubble { font-size: 15px; padding: 10px 16px; right: 0; top: 12%; }
  .sheet { align-items: center; justify-items: center; padding: 24px; }
  .sheet-card { display: grid; grid-template-columns: 1fr 1fr; width: min(980px, 100%); max-height: 90vh; border-radius: 28px; border-bottom: 1px solid var(--line); }
  .p-visual { height: auto; min-height: 560px; }
  .p-visual::after { display: none; }
  .p-body { margin: 0; padding: 48px 36px 36px 8px; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scene-video, .fireworks, .sparkler { display: none; }
}
/* ขอบล่างของรูปครึ่งตัวจางลง ไม่เห็นเป็นเส้นแถว */
.fig img { -webkit-mask-image: linear-gradient(#000 74%, transparent 99%); mask-image: linear-gradient(#000 74%, transparent 99%); }

/* หาชื่อ: ชื่อล้วน ไม่ซ้ำรูปกับรูปรวมด้านบน */
.grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--faint); background: rgba(18, 21, 24, .8); font: 600 15px/1.2 var(--display); transition: border-color .2s, background .2s;
}
.chip small { font: 500 12px/1 var(--body); color: var(--muted); }
.chip:hover { border-color: var(--lime); background: rgba(220, 254, 37, .08); }
.chip.answered { border-color: var(--line); }
.chip.answered::before { content: "✓"; color: var(--lime); font-weight: 700; }

/* ช่องค้นหาอยู่บนรูปรวม */
.finder { position: relative; z-index: 45; max-width: 640px; margin: 0 auto 18px; }
.finder .search { position: relative; top: auto; margin: 0; }
.finder .grid { justify-content: center; margin-top: 10px; }
.finder .empty { padding: 10px 0 0; margin: 0; }
.crowd-head h2 { font-size: clamp(28px, 8vw, 44px); }
.crowd-head .hint b { color: var(--lime); }
#crowd.searching .fig:not(.hit) { opacity: .18; filter: grayscale(1); }
#crowd .fig { transition: opacity .25s, filter .25s; }
#crowd.searching .fig.hit img { filter: drop-shadow(0 0 0 transparent) brightness(1.1); }
#crowd.searching .fig.hit::after { opacity: 1; transform: translate(-50%, 0); }
.fig.is-answered::before { content: "✓"; position: absolute; top: 4%; right: 8%; z-index: 4; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); font: 800 11px/1 var(--display); }

/* หลังรูปรวมเป็นพื้นทึบ ขอบจาง (พลุที่แตกใกล้ ๆ จะไม่โผล่ผ่านช่องว่างระหว่างคน) */
.crowd-stage { isolation: isolate; }
.crowd-stage::after {
  content: ""; position: absolute; inset: -24px -12px 0; z-index: -2; border-radius: 30px;
  background: radial-gradient(120% 100% at 50% 60%, var(--bg) 62%, rgba(7, 8, 10, 0) 100%);
}

/* แถบ "สวัสดี [ชื่อ]" */
.me { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 8px 8px 10px; border-radius: 16px; background: rgba(220, 254, 37, .08); border: 1px solid var(--line); text-align: left; }
.me img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; object-position: 50% 0; background: #15181b; flex: none; }
.me span { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-go { min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font: 700 14px/1 var(--display); cursor: pointer; flex: none; }
.me-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; flex: none; }

/* หน้าทดสอบ: แถบสีส้มชัด ๆ */
.testbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 64px 12px 16px;
  background: #ff8a1f; color: #1d0f00; font-size: 14px; line-height: 1.35;
}
.testbar b { font: 700 16px/1.2 var(--display); }
.testbar a { margin-left: auto; font-weight: 700; color: #1d0f00; }
.sheet.is-test .sheet-card { border-color: #ff8a1f; }
@media (min-width: 960px) { .testbar { grid-column: 1 / -1; } }

/* กล่องเกม */
.gamebox { margin: 16px 0 4px; padding: 16px; border-radius: var(--r); background: linear-gradient(135deg, rgba(220, 254, 37, .16), rgba(220, 254, 37, .04)); border: 1px solid var(--line); display: grid; gap: 10px; }
.gb-title { margin: 0; font: 700 17px/1.3 var(--display); color: var(--lime); }
.gb-btn { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 16px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); text-decoration: none; font: 700 17px/1.2 var(--display); text-align: center; }
.gb-guest { background: transparent; color: var(--ink); border: 1.5px solid var(--lime); font-size: 15px; }
.gb-note { margin: 0; font-size: 13px; color: #ffb066; }
.done-keep { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 14px; line-height: 1.5; }
