/* De svære julegåder — velvet, candlelight, gold leaf and bad decisions. */

:root {
  --bg0: #0c0306;
  --bg1: #2a0710;
  --bg2: #4a0b19;
  --ink: #f8ead8;
  --ink-dim: #c9a99a;
  --gold: #e8c26e;
  --gold-hi: #fff1c1;
  --gold-lo: #9c7428;
  --red: #d7263d;
  --rose: #ff5c8a;
  --green: #1f6f4a;
  --panel: rgba(28, 6, 12, .72);
  --line: rgba(232, 194, 110, .28);
  --wrap-a: #7a0f22;
  --wrap-b: #5a0a19;
  --wrap-c: #a3162f;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
  --display: "Playfair Display", "Didot", Georgia, serif;
  --hand: "Mountains of Christmas", "Playfair Display", cursive;
  --body: Inter, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}


* { box-sizing: border-box; }
html { background: var(--bg0); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.55 var(--body);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--bg2), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, color-mix(in oklab, var(--bg2) 70%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 80%, color-mix(in oklab, var(--bg1) 90%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: background .8s ease;
}
/* Velvet grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .13;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
a { color: var(--gold); }
code { font: .9em ui-monospace, "SF Mono", Menlo, monospace; color: var(--gold-hi); background: rgba(232,194,110,.08); padding: .05em .35em; border-radius: 4px; }

/* ------------------------------------------------------------ atmosphere */

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

.glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.glow::before, .glow::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(60px);
  animation: flicker 3.2s infinite alternate ease-in-out;
}
.glow::before { width: 46vmax; height: 46vmax; left: -14vmax; bottom: -18vmax; background: radial-gradient(circle, rgba(255,160,60,.30), transparent 65%); }
.glow::after { width: 38vmax; height: 38vmax; right: -12vmax; top: 10vh; background: radial-gradient(circle, rgba(255,70,110,.20), transparent 65%); animation-delay: -1.6s; animation-duration: 4.1s; }
@keyframes flicker {
  0% { opacity: .75; transform: scale(1) translate(0,0); }
  30% { opacity: 1; }
  55% { opacity: .82; transform: scale(1.04) translate(6px,-4px); }
  80% { opacity: .96; }
  100% { opacity: .7; transform: scale(.98) translate(-4px,3px); }
}

.lights {
  position: absolute; top: -6px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  margin: 0; padding: 0 1vw; list-style: none;
  z-index: 40; pointer-events: none;
  height: 54px;
}
.lights::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30px;
  border-bottom: 2px solid #1b1b14;
  border-radius: 0 0 50% 50% / 0 0 30px 30px;
}
.lights li {
  position: relative; top: 22px;
  width: 11px; height: 20px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 6px 22px 4px var(--c);
  animation: twinkle 1.8s infinite ease-in-out;
  animation-delay: calc(var(--i) * -0.37s);
}
.lights li:nth-child(odd) { top: 27px; }
.lights li::before { content: ""; position: absolute; top: -5px; left: 2px; width: 7px; height: 6px; background: #2b2a22; border-radius: 2px; }
.lights li:nth-child(4n+1) { --c: #ff3b5c; --i: 1; }
.lights li:nth-child(4n+2) { --c: #ffd36e; --i: 3; }
.lights li:nth-child(4n+3) { --c: #ff7ab6; --i: 2; }
.lights li:nth-child(4n+4) { --c: #6effc4; --i: 5; }
@keyframes twinkle {
  0%, 100% { opacity: 1; filter: brightness(1.15); }
  50% { opacity: .35; box-shadow: 0 6px 6px 0 var(--c); filter: brightness(.6); }
}

/* --------------------------------------------------------------- header */

.top, .layout, .countdown, .foot { position: relative; z-index: 2; }
.top {
  max-width: 1240px; margin: 0 auto; padding: 72px 24px 8px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between;
}
.brand { text-decoration: none; display: grid; gap: 2px; }
.kicker { font: 600 11px/1 var(--body); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-dim); }
.logo {
  /* Room below the baseline: with the text clipped to its gold background,
     a tight line-height cut off the tail of the g. */
  font: 800 clamp(40px, 7vw, 84px)/1.12 var(--display);
  padding-bottom: .08em;
  letter-spacing: -.02em;
  background: linear-gradient(100deg, var(--gold-lo) 0%, var(--gold-hi) 18%, var(--gold) 32%, var(--gold-lo) 50%, var(--gold-hi) 68%, var(--gold) 85%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 9s linear infinite;
  filter: drop-shadow(0 4px 18px rgba(232, 194, 110, .25));
}
.logo em { font-style: italic; font-weight: 500; }
@keyframes foil { to { background-position: -220% 0; } }
.sub { font: italic 500 17px var(--display); color: var(--ink-dim); }

.top-side { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.me-card {
  display: grid; grid-template-columns: auto auto; gap: 0 14px; align-items: center;
  padding: 10px 16px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.me-name { font: 800 20px var(--display); color: var(--gold-hi); }
.me-score { display: flex; gap: 10px; font-weight: 600; }
.me-verdict { grid-column: 1 / -1; font-size: 12px; color: var(--ink-dim); letter-spacing: .06em; }
.me-card.uartig .me-verdict { color: var(--rose); }

/* The way in: it should be the first thing a new visitor's eye lands on. */
.join {
  display: grid; gap: 10px; padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(232,194,110,.14), rgba(28,6,12,.85) 55%);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(232,194,110,.08), 0 0 34px -6px rgba(232,194,110,.45), var(--shadow);
  backdrop-filter: blur(10px);
  animation: beckon-glow 3.2s ease-in-out infinite;
}
@keyframes beckon-glow {
  50% { box-shadow: 0 0 0 4px rgba(232,194,110,.14), 0 0 48px -2px rgba(232,194,110,.6), var(--shadow); }
}
.join label { font: italic 700 18px var(--display); color: var(--gold-hi); }
.join label::before { content: "🎅 "; font-style: normal; }
.join { grid-template-columns: minmax(0, 1fr); }
.join-row { display: flex; gap: 8px; min-width: 0; }
/* An input's built-in width (~20 characters) would push the row past the box. */
.join input { padding: 14px 14px; font-size: 16px; width: 0; min-width: 0; }
.join input:not(.pin) { flex: 1 1 auto; }
.join .pin { flex: 0 0 5.2em; text-align: center; letter-spacing: .3em; }
.join .join-btn { width: 100%; padding: 14px 16px; font-size: 16px; }
@media (max-width: 640px) {
  .top-side, .me, .join { width: 100%; }
}
.join-help { font-size: 11.5px; color: var(--ink-dim); max-width: 28em; }
.me-foot { grid-column: 1 / -1; font-size: 11px; color: var(--ink-dim); margin-top: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }

input {
  font: 500 15px var(--body); color: var(--ink);
  background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-width: 0; flex: 1;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,194,110,.18); }
button { font: 600 14px var(--body); cursor: pointer; }
.join button, .answer button, .big-btn {
  border: 0; border-radius: 10px; padding: 10px 16px;
  color: #2a0a00;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  box-shadow: 0 6px 20px -6px rgba(232,194,110,.6), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .15s, filter .15s;
}
.join button:hover, .answer button:hover, .big-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.big-btn { font-size: 17px; padding: 14px 26px; border-radius: 14px; }
.ghost-btn {
  border: 1px solid var(--gold); background: transparent; color: var(--gold-hi);
  border-radius: 14px; padding: 13px 22px; font-size: 15px;
}
.ghost-btn:hover { background: rgba(232,194,110,.1); }

.appbar {
  position: relative; z-index: 2;
  max-width: 1240px; margin: 6px auto 0; padding: 0 24px;
  font: 500 14px var(--body); color: var(--ink-dim);
}
.appbar b { color: var(--gold-hi); }
.appbar-on { color: var(--gold-hi); }
.appbar-btn {
  border: 1px solid var(--gold); background: rgba(232,194,110,.08); color: var(--gold-hi);
  border-radius: 999px; padding: 8px 16px; font: 600 14px var(--body);
}
.appbar-btn:hover { background: rgba(232,194,110,.16); }
.countdown {
  max-width: 1240px; margin: 4px auto 0; padding: 0 24px;
  font: italic 500 16px var(--display); color: var(--ink-dim);
}
.countdown b { font: 700 18px ui-monospace, "SF Mono", Menlo, monospace; color: var(--gold-hi); letter-spacing: .06em; }

/* --------------------------------------------------------------- layout */

.layout {
  max-width: 1240px; margin: 0 auto; padding: 20px 24px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px;
}
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.stage { display: grid; gap: 22px; align-content: start; }
.side { display: grid; gap: 22px; align-content: start; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel h2 { margin: 0 0 12px; font: 800 20px var(--display); color: var(--gold-hi); display: flex; align-items: baseline; gap: 10px; }
.panel h2 small { font: 500 12px var(--body); color: var(--ink-dim); }
.fine { font-size: 12.5px; color: var(--ink-dim); }

/* ------------------------------------------------------------- calendar */

.calendar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 118px;
  grid-auto-flow: dense;
  gap: 14px;
  perspective: 1400px;
}
@media (max-width: 720px) { .calendar { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 96px; gap: 10px; } }
@media (max-width: 440px) { .calendar { grid-template-columns: repeat(3, 1fr); } }

.door {
  position: relative; display: block; padding: 0; border: 0;
  border-radius: 14px; text-decoration: none; color: inherit;
  transform: rotate(calc(var(--tilt) * .25));
  transform-style: preserve-3d;
  background: #0a0204;
  box-shadow: inset 0 0 0 1px rgba(232,194,110,.25), inset 0 10px 30px rgba(0,0,0,.9);
}
.door.big { grid-column: span 2; grid-row: span 2; }

.door-inside {
  position: absolute; inset: 0; border-radius: 14px;
  display: grid; place-content: center; text-align: center; gap: 6px; padding: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(255,190,90,.35), transparent 65%), #120307;
}
.door-inside .icon { font-size: 40px; filter: drop-shadow(0 0 14px rgba(255,200,120,.6)); }
.door.big .door-inside .icon { font-size: 76px; }
.door-inside .t { font: italic 500 13px var(--display); color: var(--gold-hi); }

.door-face {
  position: absolute; inset: 0; border-radius: 14px;
  display: grid; place-items: center;
  transform-origin: left center;
  transition: transform .9s cubic-bezier(.2, .9, .25, 1.15), box-shadow .5s;
  backface-visibility: hidden;
  background:
    linear-gradient(90deg, transparent 46%, rgba(232,194,110,.85) 46%, var(--gold-hi) 50%, rgba(232,194,110,.85) 54%, transparent 54%),
    repeating-linear-gradient(45deg, var(--wrap-a) 0 14px, var(--wrap-b) 14px 28px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 -20px 30px rgba(0,0,0,.35), 0 10px 20px -10px rgba(0,0,0,.9);
}
.door:nth-child(3n) .door-face {
  background:
    linear-gradient(0deg, transparent 44%, rgba(232,194,110,.85) 44%, var(--gold-hi) 50%, rgba(232,194,110,.85) 56%, transparent 56%),
    radial-gradient(circle at 25% 25%, rgba(255,255,255,.12) 0 2px, transparent 3px) 0 0 / 18px 18px,
    var(--wrap-c);
}
.door:nth-child(3n+1) .door-face {
  background:
    linear-gradient(90deg, transparent 46%, rgba(232,194,110,.85) 46%, var(--gold-hi) 50%, rgba(232,194,110,.85) 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(232,194,110,.85) 46%, var(--gold-hi) 50%, rgba(232,194,110,.85) 54%, transparent 54%),
    repeating-linear-gradient(-45deg, #1a0408 0 10px, var(--wrap-b) 10px 20px);
}

.num {
  font: 800 34px/1 var(--display);
  color: var(--gold-hi);
  text-shadow: 0 2px 0 #4a2a00, 0 0 18px rgba(255,210,120,.55);
  background: rgba(10, 2, 4, .55);
  border: 1px solid rgba(232,194,110,.5);
  border-radius: 50%;
  width: 58px; height: 58px; display: grid; place-items: center;
}
.door.big .num { font-size: 58px; width: 104px; height: 104px; }

.door.open:hover .door-face, .door.open:focus-visible .door-face { transform: rotateY(-38deg); box-shadow: 20px 10px 30px -10px rgba(0,0,0,.9); }
.door.solved .door-face { transform: rotateY(-102deg); }
.door.solved:hover .door-face { transform: rotateY(-110deg); }
.door.solved .door-inside { box-shadow: inset 0 0 0 2px var(--gold); }

.seal, .new {
  position: absolute; right: 8px; bottom: 8px; font-size: 20px;
}
.new {
  font: 700 10px var(--body); letter-spacing: .16em; text-transform: uppercase;
  color: #2a0a00; background: var(--gold); padding: 4px 8px; border-radius: 999px;
}
.door.today { animation: today 2.4s infinite ease-in-out; }
@keyframes today {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold), 0 0 24px 2px rgba(232,194,110,.45); }
  50% { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 46px 8px rgba(255,92,138,.45); }
}

.door.locked { cursor: not-allowed; }
.door.locked .door-face { filter: saturate(.55) brightness(.62); }
.door.locked .lock { position: absolute; right: 8px; top: 8px; font-size: 14px; opacity: .8; }
.door.locked:hover .door-face { filter: saturate(.8) brightness(.8); }
.door.locked:active { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: rotate(calc(var(--tilt) * .25)) translateX(0); }
  20% { transform: translateX(-6px) rotate(-2deg); }
  40% { transform: translateX(6px) rotate(2deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ---------------------------------------------------------------- days */

.crumbs { display: flex; gap: 18px; flex-wrap: wrap; font: italic 500 15px var(--display); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.day-head { display: flex; gap: 20px; align-items: center; margin-bottom: 14px; }
.day-num {
  flex: none;
  font: 800 64px/1 var(--display); color: var(--gold-hi);
  width: 104px; height: 104px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--gold);
  background: radial-gradient(circle at 35% 30%, var(--wrap-c), var(--wrap-b));
  text-shadow: 0 3px 0 #4a2a00;
  box-shadow: 0 0 40px -4px rgba(232,194,110,.5);
}
.day-icon { font-size: 28px; }
.day-head h1 { margin: 2px 0; font: 800 clamp(26px, 4vw, 40px)/1.05 var(--display); }
.teaser { margin: 0; font: italic 500 17px var(--display); color: var(--ink-dim); }

.question { font: 500 21px/1.5 var(--display); margin: 18px 0; }
.answer { display: flex; gap: 10px; margin: 18px 0 10px; }
.answer input { font-size: 18px; padding: 14px 16px; }
.answer.fraction { align-items: center; }
.answer .frac {
  flex: 0 0 auto; width: 4.2em; text-align: center;
  font: 800 30px var(--display); color: var(--gold-hi); padding: 10px 6px;
}
.answer .slash { font: 500 54px/1 var(--display); color: var(--gold); transform: skewX(-12deg); margin: 0 -2px; }
.answer.fraction button { margin-left: 8px; }
.field { position: relative; flex: 1; display: flex; min-width: 0; }
.field input { width: 100%; }
.field .unit {
  /* Sits on the input's text line: an invisible copy of what was typed
     pushes the unit to just after the last digit. */
  position: absolute; left: 17px; right: 16px; top: 50%; transform: translateY(-50%);
  font: 500 18px var(--body); color: var(--gold-hi);
  white-space: pre; overflow: hidden;
  pointer-events: none;
}
.field .unit .ghost { color: transparent; }
.wrong { color: var(--rose); font-weight: 600; }
.tries { display: flex; align-items: center; gap: 7px; margin: 14px 0 0; font: 600 12px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.tries.center { justify-content: center; margin: 0 0 12px; }
.pip { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold-lo)); box-shadow: 0 0 10px rgba(232,194,110,.6); }
.pip.used { background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px var(--rose); }
.closed {
  margin-top: 18px; padding: 18px 20px 16px; border-radius: 16px;
  border: 1px dashed var(--rose); background: rgba(255,92,138,.06);
  font: 500 17px/1.5 var(--display);
}
.closed p { margin: 0; }
.door.failed .door-face { filter: grayscale(.6) brightness(.55); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 20px 0 12px; }
.choice {
  position: relative;
  padding: 18px 10px; border-radius: 14px;
  font: 800 26px var(--display); color: var(--gold-hi);
  background: radial-gradient(circle at 50% 0%, rgba(232,194,110,.18), transparent 70%), rgba(0,0,0,.4);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px -14px #000;
  transition: transform .15s, border-color .15s, box-shadow .2s;
}
.choice:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,194,110,.15), 0 14px 30px -12px #000; }
.choice.tried {
  cursor: not-allowed; color: var(--ink-dim); opacity: .55;
  text-decoration: line-through; text-decoration-color: var(--rose); text-decoration-thickness: 3px;
  transform: rotate(-1.5deg);
}
.choice.tried::after { content: "😈"; position: absolute; top: -8px; right: -6px; font-size: 18px; text-decoration: none; }
.hint { margin-top: 12px; color: var(--ink-dim); }
.hint summary { cursor: pointer; font: italic 500 15px var(--display); color: var(--gold); }
.need-name { font: italic 500 17px var(--display); color: var(--rose); }
.solvers { margin: 16px 0 0; font-size: 13px; color: var(--ink-dim); }

.reveal {
  position: relative; margin-top: 18px; padding: 18px 20px 16px;
  border-radius: 16px; border: 1px dashed var(--gold);
  background: linear-gradient(135deg, rgba(232,194,110,.10), rgba(255,92,138,.08));
  font: 500 17px/1.5 var(--display);
}
.reveal p { margin: 0; }
.stamp {
  display: inline-block; margin-bottom: 8px;
  font: 700 14px var(--hand); font-size: 22px; color: var(--rose);
  transform: rotate(-4deg);
}

/* --------------------------------------------------------------- monty */

.host { display: flex; gap: 16px; align-items: flex-start; margin: 10px 0 18px; }
.host-face { font-size: 46px; filter: drop-shadow(0 0 14px rgba(255,160,90,.5)); animation: bob 3s infinite ease-in-out; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-3deg); } }
.host-line {
  margin: 0; position: relative;
  padding: 14px 18px; border-radius: 4px 18px 18px 18px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line);
  font: 500 18px/1.5 var(--display);
}
.host-line em { color: var(--rose); }
.host-line strong { color: var(--gold-hi); }

.stage-doors {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 3vw, 30px);
  perspective: 1200px; margin: 10px auto 22px; max-width: 640px;
}
.mdoor {
  position: relative; aspect-ratio: 5 / 8;
  border-radius: 12px 12px 6px 6px;
  background: #090103;
  box-shadow: inset 0 0 0 3px #3b1d07, inset 0 18px 40px rgba(0,0,0,.95), 0 0 0 6px #2a1404, 0 0 0 7px var(--gold-lo), var(--shadow);
  transform-style: preserve-3d;
}
.mdoor .behind {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 50% 55%, rgba(255,200,110,.35), transparent 60%);
}
.prize { font-size: clamp(48px, 9vw, 92px); animation: pop .7s cubic-bezier(.2,1.6,.4,1) both; animation-delay: .45s; }
.cap { font: 700 15px var(--display); color: var(--gold-hi); }
@keyframes pop { from { transform: scale(0) rotate(-20deg); opacity: 0; } }

.mdoor .leaf {
  position: absolute; inset: 0; border-radius: 12px 12px 6px 6px;
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.25, .9, .25, 1.1);
  backface-visibility: hidden;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35), transparent 12%, transparent 88%, rgba(0,0,0,.35)),
    linear-gradient(180deg, transparent 8%, rgba(0,0,0,.25) 8% 9%, transparent 9% 48%, rgba(0,0,0,.25) 48% 49%, transparent 49% 91%, rgba(0,0,0,.25) 91% 92%, transparent 92%),
    linear-gradient(180deg, #8d1328, #5c0918);
  box-shadow: inset 0 0 0 2px rgba(232,194,110,.4), inset 0 0 0 10px rgba(0,0,0,.18);
  display: grid; place-items: center;
}
.wreath { position: absolute; top: 12%; font-size: clamp(26px, 5vw, 46px); filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.mnum { font: 800 clamp(40px, 8vw, 80px)/1 var(--display); color: var(--gold-hi); text-shadow: 0 3px 0 #3d2000, 0 0 24px rgba(255,210,120,.5); }
.knob { position: absolute; right: 12%; top: 54%; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--gold-hi), var(--gold-lo)); box-shadow: 0 2px 4px rgba(0,0,0,.7); }

.mdoor.is-open .leaf { transform: rotateY(-108deg); }
.mdoor.is-live { cursor: pointer; }
.mdoor.is-live:hover .leaf { transform: rotateY(-14deg); }
.mdoor.is-live:hover { box-shadow: inset 0 0 0 3px #3b1d07, inset 0 18px 40px rgba(0,0,0,.95), 0 0 0 6px #2a1404, 0 0 0 7px var(--gold), 0 0 40px 4px rgba(232,194,110,.35); }
.mdoor.is-picked { box-shadow: inset 0 0 0 3px #3b1d07, inset 0 18px 40px rgba(0,0,0,.95), 0 0 0 6px #2a1404, 0 0 0 8px var(--rose), 0 0 50px 6px rgba(255,92,138,.45); }
.mdoor.is-final { outline: 3px solid var(--gold-hi); outline-offset: 10px; }
.mdoor .tag {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  font: 700 11px var(--body); letter-spacing: .14em; text-transform: uppercase;
  background: var(--rose); color: #fff; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.stage-pick .mdoor.is-live { animation: beckon 2.6s infinite ease-in-out; }
.stage-pick .mdoor.is-live:nth-child(2) { animation-delay: .3s; }
.stage-pick .mdoor.is-live:nth-child(3) { animation-delay: .6s; }
@keyframes beckon { 50% { transform: translateY(-5px); } }

.actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 6px 0 4px; }

.mstats table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.mstats th { text-align: left; font: 600 13px var(--body); color: var(--ink-dim); padding-right: 10px; }
.mstats thead th { font: 700 12px var(--body); letter-spacing: .14em; text-transform: uppercase; }
.mstats td { width: 42%; padding-right: 12px; }
.mstats td small { color: var(--ink-dim); font-size: 11px; }
.bar {
  position: relative; height: 26px; border-radius: 8px; overflow: hidden;
  background: rgba(0,0,0,.4); border: 1px solid var(--line);
}
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; transition: width 1.2s cubic-bezier(.2,.9,.2,1); }
.bar.stay i { background: linear-gradient(90deg, #6b1022, var(--red)); }
.bar.switch i { background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.bar span { position: relative; z-index: 1; font: 700 13px ui-monospace, Menlo, monospace; padding-left: 8px; line-height: 26px; text-shadow: 0 1px 2px #000; }
.bar::before, .bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 0; z-index: 2; }
.bar::before { left: 33.333%; border-left: 2px dashed rgba(255,255,255,.55); }
.bar::after { left: 66.667%; border-left: 2px solid var(--gold-hi); }
.sim { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------------------------------------------------------- side panels */

.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.board h3 { margin: 0 0 6px; font: 700 13px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.board ol { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.board li {
  counter-increment: r;
  display: flex; justify-content: space-between; gap: 6px;
  padding: 5px 0; border-bottom: 1px solid rgba(232,194,110,.1);
  font-size: 13.5px;
}
.board li span::before { content: counter(r) ". "; color: var(--ink-dim); }
.board li b { color: var(--gold-hi); }
.board li.me-row span { color: var(--rose); font-weight: 700; }
.board li.empty { color: var(--ink-dim); font-style: italic; border: 0; }
.board li.empty span::before, .board li.empty::before { content: none; }

.feed ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.feed li {
  font-size: 13.5px; padding: 8px 10px; border-radius: 10px;
  background: rgba(0,0,0,.25); border-left: 3px solid var(--line);
  animation: slidein .5s ease both;
}
.feed li.k-nice { border-left-color: var(--gold); }
.feed li.k-naughty { border-left-color: var(--rose); }
.feed li.k-join { border-left-color: #6effc4; }
.feed li.k-sim { border-left-color: #8aa4ff; }
.feed li.empty { font-style: italic; color: var(--ink-dim); }
.live { font: 700 11px var(--body); color: var(--rose); letter-spacing: .1em; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes slidein { from { opacity: 0; transform: translateX(-8px); } }

.foot { text-align: center; padding: 10px 24px 60px; color: var(--ink-dim); font-size: 12.5px; line-height: 1.9; }

/* ------------------------------------------------------- toasts and fx */

#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; gap: 10px; z-index: 100; width: min(92vw, 520px); }
.toast {
  padding: 14px 18px; border-radius: 14px;
  background: rgba(20, 4, 8, .94); border: 1px solid var(--gold);
  box-shadow: 0 20px 50px -10px #000, 0 0 30px -6px rgba(232,194,110,.5);
  font: 500 16px var(--display);
  animation: toastin .5s cubic-bezier(.2,1.4,.4,1) both;
}
.toast.naughty { border-color: var(--rose); box-shadow: 0 20px 50px -10px #000, 0 0 30px -6px rgba(255,92,138,.6); }
.toast.out { animation: toastout .4s ease forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px); } }

.burst { position: fixed; z-index: 90; pointer-events: none; font-size: 26px; will-change: transform, opacity; }
body.shake { animation: bodyshake .45s; }
@keyframes bodyshake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
