:root {
  --night: #0f1f1a;
  --pine: #1c3a2e;
  --pine-2: #24493a;
  --ember: #f7b955;
  --gold: #d9a441;
  --cranberry: #b3262e;
  --cranberry-dark: #8c1c23;
  --cream: #f8f1e4;
  --paper: #fbf6ec;
  --ink: #2a1f1a;
  --muted: #6b5d52;
  --snow: #f3f6f8;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 10, 5, .18);
  --display: "Fraunces", Georgia, serif;
  --body: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(15, 31, 26, .72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--cream);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav a { text-decoration: none; }
.nav__brand { font-family: var(--display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.nav__links { display: flex; gap: 4px; align-items: center; font-weight: 700; font-size: .92rem; }
.nav__links a { padding: 8px 10px; border-radius: 99px; }
.nav__links a:hover { background: rgba(255,255,255,.08); }
.nav__cta { background: var(--cranberry); }
.nav__links a.nav__cta:hover { background: var(--cranberry-dark); }
@media (max-width: 420px) {
  .nav__brand span { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 1.05rem var(--body);
  padding: 15px 26px; border-radius: 99px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--gold { background: var(--ember); color: var(--ink); box-shadow: 0 6px 0 #b9832e, 0 12px 30px rgba(247,185,85,.35); }
.btn--gold:hover { transform: translateY(-2px); }
.btn--red { background: var(--cranberry); color: #fff; box-shadow: 0 6px 0 var(--cranberry-dark); }
.btn--red:hover { transform: translateY(-2px); }
.btn--red:disabled { opacity: .6; cursor: default; transform: none; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--cream); border: 2px solid rgba(255,255,255,.3); }

.eyebrow {
  font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem;
  color: var(--ember); margin-bottom: .8em;
}
.eyebrow--dark { color: var(--cranberry); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  text-align: center; color: var(--cream);
  padding: 96px 16px 0;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(247,185,85,.18), transparent 60%),
    linear-gradient(180deg, #08130f 0%, #10261f 45%, #1d3d33 100%);
  overflow: hidden;
}
.hero__sky { position: absolute; inset: 0; pointer-events: none; }
.hero__sky::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 6%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 95% 44%, #fff 50%, transparent 51%);
  opacity: .7; animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: .35; } }
.moon {
  position: absolute; top: 90px; right: 9%; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe8, #f1e3b5 70%);
  box-shadow: 0 0 60px 12px rgba(255, 240, 200, .18);
}
@media (max-width: 600px) { .moon { top: 72px; right: 18px; width: 38px; height: 38px; } }
.hero__copy { position: relative; z-index: 2; max-width: 680px; }
.hero h1 {
  font-size: clamp(2.6rem, 11vw, 5.4rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .25em;
  text-shadow: 0 4px 30px rgba(0,0,0,.4);
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--ember); font-size: .62em; display: inline-block; margin-top: .1em; }
.hero__dates { font-weight: 700; opacity: .9; margin-bottom: 1.4em; }

.countdown { display: flex; justify-content: center; gap: 10px; margin-bottom: .5em; }
.countdown div {
  min-width: 66px; padding: 10px 6px 8px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
}
.countdown b { display: block; font: 800 1.8rem/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.countdown__label { font-size: .9rem; opacity: .75; margin-bottom: 1.6em; }

.hero__house { position: relative; z-index: 1; width: calc(100% + 32px); margin-inline: -16px; height: clamp(220px, 38vw, 360px); margin-top: auto; display: block; }
.hero__house .windows rect { fill: #ffcf73; filter: drop-shadow(0 0 6px rgba(255, 190, 90, .9)); animation: flicker 4s infinite; }
.hero__house .windows rect:nth-child(3n) { animation-delay: -1.3s; }
.hero__house .windows rect:nth-child(4n) { animation-delay: -2.1s; fill: #ffb956; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .88; } 50% { opacity: .97; } 70% { opacity: .9; } }
.hero__house .smoke { animation: smoke 5s ease-in-out infinite; transform-origin: bottom; }
@keyframes smoke { 50% { transform: translateY(-6px) scaleX(1.2); opacity: .15; } }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(64px, 10vw, 110px) 0; }
.section--paper {
  background: var(--paper);
  background-image: radial-gradient(rgba(120, 80, 40, .05) 1px, transparent 1px);
  background-size: 18px 18px;
}
.section--paper + .section--paper { border-top: 1px dashed rgba(42,31,26,.12); }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fact { padding: 16px 14px; }
  .fact b { font-size: 1.02rem; }
  .fact p { font-size: .86rem; }
}
.fact {
  background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  border: 1px solid rgba(42,31,26,.06);
}
.fact__icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.fact b { font-family: var(--display); font-size: 1.2rem; display: block; margin-bottom: 4px; }
.fact p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---------- drawing room ---------- */
.section--drawing {
  color: var(--cream);
  background:
    radial-gradient(ellipse at 70% 90%, rgba(247, 140, 50, .28), transparent 55%),
    repeating-linear-gradient(90deg, #3b1d1b 0 46px, #351a18 46px 92px);
}
.drawing { display: grid; gap: 40px; align-items: center; }
@media (min-width: 860px) { .drawing { grid-template-columns: 1fr 1.05fr; } }
.drawing__copy p { opacity: .9; }
.whisper { font-family: var(--display); font-style: italic; color: var(--ember); font-size: 1.1rem; }

.fireplace { position: relative; display: flex; flex-direction: column; align-items: center; }
.portrait {
  position: relative; z-index: 2; padding: 16px; border: 0; cursor: pointer;
  width: min(260px, 64vw);
  background: linear-gradient(135deg, #f3d488, #b5832f 30%, #f0cd7c 52%, #8f6420 80%, #d8ae58);
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(80,50,10,.5), inset 0 0 0 10px rgba(255,240,190,.25), 0 18px 40px rgba(0,0,0,.55);
  transition: transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.portrait img { border-radius: 2px; box-shadow: inset 0 0 20px rgba(0,0,0,.6); filter: saturate(.95) contrast(1.02); }
.portrait.is-knocked { animation: knock .25s ease; }
@keyframes knock { 30% { transform: rotate(-2deg) translateY(1px); } 70% { transform: rotate(1.5deg); } }
.portrait__knock {
  position: absolute; top: 8px; right: -6px; font: 800 .9rem var(--display); color: var(--ember);
  opacity: 0; pointer-events: none;
}
.portrait__knock.show { animation: knockText .8s ease forwards; }
@keyframes knockText { 0% { opacity: 1; transform: translate(0, 0) rotate(8deg); } 100% { opacity: 0; transform: translate(14px, -26px) rotate(14deg); } }
.portrait.is-unlocked { box-shadow: inset 0 0 0 3px rgba(80,50,10,.5), 0 0 0 4px var(--ember), 0 0 60px 10px rgba(247,185,85,.5); }

.mantel {
  position: relative; z-index: 1; width: min(440px, 92vw); height: 34px; margin-top: 26px;
  background: linear-gradient(#efe4d2, #d6c6ae); border-radius: 4px;
  box-shadow: 0 8px 18px rgba(0,0,0,.4);
}
.garland {
  position: absolute; left: -8px; right: -8px; top: -12px; height: 26px;
  background: radial-gradient(circle at 50% 50%, #2f6b3f 55%, transparent 56%) 0 0/22px 22px repeat-x;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.4));
}
.garland i {
  position: absolute; top: 8px; width: 10px; height: 10px; border-radius: 50%;
  background: #ffd36e; box-shadow: 0 0 10px 3px rgba(255, 200, 90, .8);
  animation: bulb 1.6s infinite alternate;
}
.garland i:nth-child(1) { left: 6%; } .garland i:nth-child(2) { left: 20%; background: #ff6b6b; box-shadow: 0 0 10px 3px rgba(255,90,90,.7); animation-delay: .4s; }
.garland i:nth-child(3) { left: 34%; } .garland i:nth-child(4) { left: 50%; background: #7fd1ff; box-shadow: 0 0 10px 3px rgba(120,200,255,.7); animation-delay: .8s; }
.garland i:nth-child(5) { left: 64%; } .garland i:nth-child(6) { left: 78%; background: #ff6b6b; box-shadow: 0 0 10px 3px rgba(255,90,90,.7); animation-delay: .2s; }
.garland i:nth-child(7) { left: 92%; animation-delay: 1s; }
@keyframes bulb { to { opacity: .45; } }
.stockings { position: absolute; top: 26px; left: 0; right: 0; display: flex; justify-content: space-around; font-size: 2rem; }
.stockings span { transform: rotate(8deg); display: inline-block; }
.stockings span:nth-child(2) { transform: rotate(-6deg); }

.hearth {
  position: relative; width: min(380px, 80vw); height: 170px;
  background: linear-gradient(#5a4d45, #3f342e);
  border: 14px solid #d9cbb5; border-bottom: 0; border-radius: 6px 6px 0 0;
  display: flex; justify-content: center; align-items: flex-end; overflow: hidden;
}
.hearth::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, #160c08 30%, #241712 70%); }
.fire { position: relative; width: 120px; height: 110px; margin-bottom: 14px; }
.fire i {
  position: absolute; bottom: 0; left: 50%; width: 60px; height: 90px; margin-left: -30px;
  border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 80%, #fff3b0, #ffb347 40%, #ff6a1f 70%, transparent 72%);
  filter: blur(1px); mix-blend-mode: screen;
  animation: flame 1.2s ease-in-out infinite alternate; transform-origin: 50% 100%;
}
.fire i:nth-child(2) { left: 30%; height: 70px; animation-delay: -.4s; animation-duration: .9s; }
.fire i:nth-child(3) { left: 70%; height: 76px; animation-delay: -.7s; animation-duration: 1.1s; }
.fire i:nth-child(4) { height: 50px; width: 40px; margin-left: -20px; background: radial-gradient(ellipse at 50% 80%, #fff, #ffe08a 50%, transparent 70%); animation-duration: .7s; }
@keyframes flame { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.92, 1.08) skewX(3deg); } 100% { transform: scale(1.05, .94) skewX(-3deg); } }
.logs { position: absolute; bottom: 6px; width: 150px; height: 22px; }
.logs::before, .logs::after {
  content: ""; position: absolute; bottom: 0; width: 110px; height: 18px; border-radius: 10px;
  background: linear-gradient(#6b4226, #3d2414);
}
.logs::before { left: 0; transform: rotate(8deg); } .logs::after { right: 0; transform: rotate(-8deg); }
.fireplace::after {
  content: ""; width: min(440px, 92vw); height: 16px; background: #cdbda5; border-radius: 3px;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}

/* ---------- rules ---------- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 28px; }
.rule {
  position: relative; padding: 30px 24px 24px; border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow); overflow: hidden; border-top: 8px solid var(--cranberry);
}
.rule--2 { border-top-color: #2f6b3f; }
.rule--3 { border-top-color: var(--gold); }
.rule__num {
  position: absolute; right: 14px; top: -6px; font: 800 6rem/1 var(--display); color: rgba(42,31,26,.06);
}
.rule__icon { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.rule h3 { font-size: 1.5rem; font-weight: 800; }
.rule p { color: var(--muted); margin: 0; }
.rule a { color: var(--cranberry); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- game ---------- */
.section--tartan {
  color: var(--cream);
  background-color: #6b1219;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(16,40,30,.55) 34px 58px, transparent 58px 70px, rgba(255,215,120,.18) 70px 72px, transparent 72px 104px),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(16,40,30,.55) 34px 58px, transparent 58px 70px, rgba(255,215,120,.18) 70px 72px, transparent 72px 104px);
}
.section--tartan::before { content: ""; position: absolute; inset: 0; background: rgba(40, 8, 12, .55); }
.section--tartan > .wrap { position: relative; }

.game-layout { display: grid; gap: 40px; align-items: start; margin-top: 24px; }
@media (min-width: 860px) { .game-layout { grid-template-columns: 1.4fr 1fr; } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  backdrop-filter: blur(4px);
}
.steps__icon { font-size: 1.7rem; line-height: 1; flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(0,0,0,.25); border-radius: 12px; }
.steps b { font-family: var(--display); font-size: 1.15rem; display: block; margin-bottom: 2px; }
.steps p { margin: 0; opacity: .85; font-size: .96rem; }
.steps strong { color: var(--ember); }

.steal-card { perspective: 1000px; width: min(260px, 70vw); margin-inline: auto; cursor: pointer; outline: none; }
.steal-card__inner {
  position: relative; aspect-ratio: 5 / 7; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,1.4,.5,1);
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob { 50% { translate: 0 -8px; rotate: 2deg; } }
.steal-card.is-flipped .steal-card__inner { transform: rotateY(180deg); }
.steal-card__face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.steal-card__front {
  background: linear-gradient(160deg, #fff8e6, #f4e2b8); color: var(--cranberry);
  border: 8px solid #fff; outline: 2px solid var(--gold); outline-offset: -16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.steal-card__title { font: 800 2.8rem/1 var(--display); letter-spacing: .08em; }
.steal-card__art { font-size: 5rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); animation: wiggle 2.5s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
.steal-card__sub { font-weight: 800; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .7; }
.steal-card__corner { position: absolute; top: 18px; left: 22px; font-size: 1.3rem; }
.steal-card__corner--b { top: auto; left: auto; bottom: 18px; right: 22px; transform: rotate(180deg); }
.steal-card__back {
  transform: rotateY(180deg); background: #1c3a2e; border: 8px solid #fff; overflow: hidden;
  display: grid; place-items: center; text-align: center;
}
.steal-card__back-pattern {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(217,164,65,.25) 0 2px, transparent 2px 14px), repeating-linear-gradient(-45deg, rgba(217,164,65,.25) 0 2px, transparent 2px 14px);
}
.steal-card__back-text { position: relative; font: 800 1.6rem/1.05 var(--display); color: var(--ember); background: #1c3a2e; padding: 14px 18px; border-radius: 12px; border: 2px solid var(--gold); }
.steal-card__hint { text-align: center; font-size: .8rem; opacity: .7; margin-top: 14px; }

.bonus {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 36px; padding: 18px 20px;
  border-radius: 16px; background: rgba(247,185,85,.14); border: 1px dashed rgba(247,185,85,.6);
}
.bonus__icon { font-size: 1.6rem; }
.bonus p { margin: 0; }
.bonus em { color: var(--ember); font-style: normal; font-weight: 800; }

/* ---------- signup ---------- */
.signup { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .signup { grid-template-columns: 1fr 1fr; grid-template-areas: "intro form" "list form"; align-items: start; }
  .signup__intro { grid-area: intro; } .form { grid-area: form; } .guestlist { grid-area: list; }
}
.progress { height: 14px; background: #eadfcc; border-radius: 99px; overflow: hidden; margin-top: 18px; }
.progress__bar {
  height: 100%; width: 0; border-radius: inherit; transition: width .8s cubic-bezier(.3,1.3,.5,1);
  background: repeating-linear-gradient(-45deg, var(--cranberry) 0 10px, #fff 10px 20px);
  background-size: 28px 28px; animation: candy 1s linear infinite;
}
@keyframes candy { to { background-position: 28px 0; } }
.progress__label { font-weight: 800; font-size: .9rem; color: var(--muted); margin-top: 8px; }

.form { background: #fff; border-radius: 22px; padding: 24px; box-shadow: var(--shadow); border: 1px solid rgba(42,31,26,.06); }
.field { display: block; margin-bottom: 20px; }
.field span, .emoji-picker legend { display: block; font-weight: 800; margin-bottom: 8px; }
.field input {
  width: 100%; font: 600 1.1rem var(--body); padding: 14px 16px; border-radius: 14px;
  border: 2px solid #e6dccb; background: var(--paper); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--cranberry); box-shadow: 0 0 0 4px rgba(179,38,46,.12); }
.emoji-picker { border: 0; padding: 0; margin: 0 0 22px; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emoji-grid button {
  font-size: 1.7rem; aspect-ratio: 1; border-radius: 14px; border: 2px solid #eee3d2; background: var(--paper);
  cursor: pointer; transition: transform .12s, border-color .12s, background .12s; -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center; padding: 0;
}
.emoji-grid button:hover { transform: scale(1.08); }
.emoji-grid button[aria-pressed="true"] { border-color: var(--cranberry); background: #fde8e6; transform: scale(1.08); box-shadow: 0 4px 10px rgba(179,38,46,.2); }
.emoji-grid button:disabled { opacity: .25; cursor: not-allowed; transform: none; }
.form__msg { min-height: 1.4em; margin: 12px 0 0; font-weight: 700; text-align: center; }
.form__msg.is-error { color: var(--cranberry); }
.form__msg.is-ok { color: #2f6b3f; }

.guestlist h3 { margin-bottom: 12px; }
.guests { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.guests li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff;
  box-shadow: 0 4px 12px rgba(42,31,26,.08); font-weight: 700; font-size: .95rem; min-width: 0;
  animation: pop .4s cubic-bezier(.3,1.6,.5,1) both;
}
.guests li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guests li.is-me { outline: 2px solid var(--cranberry); }
.guests .guest__emoji { font-size: 1.5rem; flex: none; }
.guests li.empty { background: transparent; box-shadow: none; border: 2px dashed #e0d4c0; color: #b5a796; justify-content: center; font-weight: 600; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- footer ---------- */
.footer { text-align: center; color: var(--cream); padding: 40px 16px calc(40px + env(safe-area-inset-bottom)); background: var(--night); }
.footer p { margin: 0 0 6px; }
.footer__small { font-size: .85rem; opacity: .6; }

/* ---------- game modal ---------- */
.game-modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(5, 12, 9, .82); backdrop-filter: blur(6px); padding: 12px;
}
.game-modal[hidden] { display: none; }
.game-modal__panel {
  position: relative; width: min(520px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--pine); color: var(--cream); border-radius: 24px; padding: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); border: 2px solid rgba(247,185,85,.35);
  animation: pop .45s cubic-bezier(.3,1.4,.5,1);
}
.game-modal__close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.1); color: var(--cream); font-size: 1.1rem; cursor: pointer;
}
.game-modal__head { padding-right: 44px; }
.game-modal__head h2 { font-size: 1.6rem; margin-bottom: .2em; color: var(--ember); }
.game-modal__head p { font-size: .9rem; opacity: .85; margin-bottom: 12px; }
.game-stage { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4; width: min(100%, calc(62svh * .75)); margin-inline: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.game-stage canvas { width: 100%; height: 100%; display: block; }
.game-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; font: 800 1.1rem var(--body); text-shadow: 0 2px 6px rgba(0,0,0,.6); pointer-events: none; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 20, 15, .72); text-align: center; padding: 20px; }
.game-overlay[hidden] { display: none; }
.game-overlay h3 { font-size: 1.8rem; color: var(--ember); }
.game-overlay p { opacity: .9; }
.game-overlay .big { font: 800 3.4rem/1 var(--display); color: #fff; margin: 6px 0 12px; }
.game-overlay .btn { margin-top: 6px; }
.game-overlay input {
  font: 600 1rem var(--body); padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08); color: #fff; width: 100%; margin-bottom: 10px;
}
.leaderboard { margin-top: 16px; }
.leaderboard h3 { font-size: 1.1rem; }
.leaderboard h3 small { font-family: var(--body); font-weight: 600; font-size: .75rem; opacity: .7; display: block; margin-top: 2px; }
.leaderboard ol { padding: 0; margin: 0; list-style: none; counter-reset: lb; }
.leaderboard li {
  counter-increment: lb; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-weight: 700;
}
.leaderboard li:nth-child(odd) { background: rgba(255,255,255,.05); }
.leaderboard li::before { content: counter(lb); width: 22px; text-align: center; opacity: .6; font-size: .85rem; }
.leaderboard li:first-child { background: rgba(247,185,85,.18); color: var(--ember); }
.leaderboard li:first-child::before { content: "👑"; opacity: 1; }
.leaderboard li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.leaderboard .lb-empty { opacity: .6; font-weight: 600; }
.leaderboard li.lb-empty::before { content: none; }
.leaderboard li.lb-empty { background: rgba(255,255,255,.05); color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
