@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --night: #0f1a2b;
  --night-2: #16253b;
  --night-3: #1f3350;
  --ink: #fff4dc;
  --ink-soft: #c9bfa8;
  --ink-mute: #8d8a80;
  --gold: #f2b632;
  --gold-deep: #c98a12;
  --red: #b3262e;
  --red-deep: #7e1720;
  --green: #1f5e3b;
  --green-deep: #133d26;
  --cream: #efe3c8;
  --kraft: #8a5a32;
  --radius: 14px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, #2a4470 0%, transparent 60%),
    radial-gradient(900px 500px at 0% 110%, #1b3a2b 0%, transparent 60%),
    var(--night);
  background-attachment: fixed;
  line-height: 1.5;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
header, main, footer, .countdown { position: relative; z-index: 1; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 8px 20px 48px; outline: none; }

a { color: var(--gold); }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
[hidden] { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  max-width: 1100px; width: 100%; margin: 0 auto; padding: 18px 20px 10px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand b { display: block; font-family: var(--display); font-weight: 900; font-size: 1.45rem; line-height: 1; }
.brand small { display: block; color: var(--ink-soft); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.nav a.active { color: var(--night); background: var(--gold); }
.who { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--night-3); font-weight: 600; font-size: .9rem; }
a.chip { color: var(--ink); text-decoration: none; }
a.chip:hover { background: #2a4468; }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--gold)); }
.c0 { --c: #f2b632; } .c1 { --c: #ef6b5b; } .c2 { --c: #6cc48c; }
button.link { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
button.link:hover { color: var(--ink); }

.countdown {
  width: fit-content; margin: 4px auto 18px; padding: 6px 16px; border-radius: 999px;
  background: rgba(15,26,43,.7); border: 1px solid rgba(242,182,50,.35); color: var(--ink-soft); font-size: .95rem;
}
.countdown b { color: var(--gold); font-variant-numeric: tabular-nums; font-family: var(--display); font-weight: 600; letter-spacing: .03em; }

.foot { text-align: center; color: var(--ink-mute); font-size: .85rem; padding: 24px; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 1rem var(--body); color: var(--night); background: var(--gold);
  box-shadow: 0 3px 0 var(--gold-deep); transition: transform .08s, box-shadow .08s, filter .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px rgba(255,244,220,.25); }
.btn.ghost:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 7px 14px; font-size: .9rem; }

label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-soft); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(255,244,220,.15);
  background: rgba(0,0,0,.25); color: var(--ink); font: inherit;
}
input:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible, .door:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

.card {
  background: linear-gradient(180deg, rgba(31,51,80,.85), rgba(22,37,59,.92));
  border: 1px solid rgba(255,244,220,.08); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
}

/* ---------- Calendar ---------- */
.hero { text-align: center; margin: 4px 0 22px; }
.hero p { margin: 0; color: var(--ink-soft); }

.board {
  --gap: 12px;
  position: relative;
  container-type: inline-size;
  padding: 18px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #9b6a3d, var(--kraft) 55%, #6e4524);
  box-shadow: inset 0 0 0 6px rgba(0,0,0,.15), inset 0 0 40px rgba(0,0,0,.35), 0 20px 60px rgba(0,0,0,.45);
}
.grid {
  display: grid;
  --cols: 6;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
  grid-auto-flow: dense;
  gap: var(--gap);
}
.door.wide { grid-column: span 2; }
.door.big { grid-column: span 2; grid-row: span 2; }

.door {
  position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 10px; perspective: 900px; font: inherit; color: inherit; min-height: 0;
}
.door-inside {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #3a2412, #1b0f06);
  box-shadow: inset 0 4px 14px rgba(0,0,0,.8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 8px;
}
.door-inside img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.door-inside .label {
  position: relative; z-index: 1; font-family: var(--display); font-weight: 600; font-size: .85rem; line-height: 1.15;
  background: rgba(15,26,43,.82); padding: 4px 8px; border-radius: 8px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.door-inside .score {
  position: absolute; z-index: 1; right: 6px; top: 6px; min-width: 34px; padding: 2px 7px; border-radius: 999px;
  background: var(--gold); color: var(--night); font: 900 .9rem var(--display);
}
.door-inside .empty-bottle { width: 34%; max-width: 44px; opacity: .8; }

.leaf {
  position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.3,1.4,.5,1);
}
.leaf > div { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf .front {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--fg);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12), inset 0 -6px 0 rgba(0,0,0,.18), 0 3px 8px rgba(0,0,0,.35);
}
.leaf .front::after {
  content: ""; position: absolute; right: 9%; top: 50%; width: 7px; height: 7px; margin-top: -3px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 1px 0 rgba(0,0,0,.4);
}
.leaf .back {
  transform: rotateY(180deg);
  background: repeating-linear-gradient(0deg, #c9a46d 0 3px, #bf9960 3px 6px);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.1);
}
.num { font-family: var(--display); font-weight: 900; font-size: clamp(1.6rem, 4.4vw, 2.8rem); line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.big .num { font-size: clamp(3rem, 9vw, 5.6rem); }

.door-inside .score.pending { background: rgba(15,26,43,.85); color: var(--ink-soft); font-size: .8rem; }

/* Door paint jobs */
.v0 .front { --bg: radial-gradient(circle at 30% 25%, #c93a41, var(--red) 60%, var(--red-deep)); --fg: var(--ink); }
.v1 .front { --bg: repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 8px, transparent 8px 16px), linear-gradient(160deg, #2a7a4e, var(--green) 60%, var(--green-deep)); --fg: var(--ink); }
.v2 .front { --bg: radial-gradient(rgba(179,38,46,.14) 2px, transparent 2.5px) 0 0 / 14px 14px, linear-gradient(160deg, #fbf3e0, var(--cream)); --fg: var(--red); }
.v3 .front { --bg: linear-gradient(160deg, #2b4a78, #1c3257 60%, #132541); --fg: var(--gold); }
.big .front { --bg: radial-gradient(circle at 50% 35%, #ffd26a, var(--gold) 45%, var(--gold-deep)); --fg: var(--red-deep); }

.door { z-index: 1; }
.door.open { z-index: 0; }
.door.open .leaf { transform: rotateY(-108deg); }
.door.open:hover .leaf { transform: rotateY(-100deg); }
.door.locked .front { filter: saturate(.75) brightness(.92); }
.door.locked:hover .leaf { transform: rotateY(-4deg); }
.door:not(.open):not(.locked):hover .leaf { transform: rotateY(-14deg); }
.door.shake { animation: shake .45s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-1deg); } 40% { transform: translateX(6px) rotate(1deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.door.today { z-index: 2; }
.door.today.open { z-index: 0; }
.door.today:not(.open) .front { animation: glow 2.2s ease-in-out infinite; }
.door.today:not(.open) .leaf { animation: wiggle 5s ease-in-out infinite; }
@keyframes glow { 0%,100% { box-shadow: inset 0 0 0 2px rgba(255,255,255,.12), 0 0 0 3px var(--gold), 0 0 18px 4px rgba(242,182,50,.55); } 50% { box-shadow: inset 0 0 0 2px rgba(255,255,255,.12), 0 0 0 3px var(--gold), 0 0 34px 10px rgba(242,182,50,.85); } }
@keyframes wiggle { 0%, 84%, 100% { transform: rotateY(0); } 88% { transform: rotateY(-16deg); } 92% { transform: rotateY(-4deg); } 95% { transform: rotateY(-11deg); } }
.tag {
  position: absolute; z-index: 3; left: 50%; top: -11px; transform: translateX(-50%);
  background: var(--red); color: var(--ink); font: 800 .7rem var(--body); letter-spacing: .12em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.4);
  pointer-events: none;
}

/* Bubbles when a door opens */
.bubble {
  position: fixed; z-index: 50; width: var(--s); height: var(--s); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(255,244,220,.35) 45%, rgba(242,182,50,.2));
  border: 1px solid rgba(255,255,255,.6);
  animation: rise var(--d) cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes rise { 0% { transform: translate(0,0) scale(.3); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } }

/* ---------- Login ---------- */
.login { max-width: 460px; margin: 10px auto; text-align: center; }
.faces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.face {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; cursor: pointer;
  border-radius: var(--radius); border: 2px solid transparent; background: rgba(0,0,0,.2); color: var(--ink); font: 600 1rem var(--body);
}
.face .avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font: 900 1.5rem var(--display); color: var(--night); background: var(--c); }
.face[aria-pressed=true] { border-color: var(--gold); background: rgba(242,182,50,.1); }
.pin { display: flex; gap: 10px; justify-content: center; }
.pin input { width: 180px; text-align: center; font-size: 1.6rem; letter-spacing: .5em; }
.error { color: #ff9b8f; min-height: 1.5em; margin: 8px 0 0; }

/* ---------- Account ---------- */
.account { max-width: 460px; margin: 0 auto; }
.account .field { margin-bottom: 14px; }
.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; max-width: 760px; margin: 0 auto 18px; padding: 12px 18px; border-radius: 12px; background: rgba(242,182,50,.12); border: 1px solid rgba(242,182,50,.4); }

/* ---------- Top 3 lists ---------- */
.toplists { margin: 34px 0 30px; }
.toplists > h2, .toplists > p { text-align: center; }
.toplists > p { margin: 0 0 18px; }
.top-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.top-card { padding: 18px; }
.top-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.top-card header h3 { margin: 0; font-size: 1.35rem; font-weight: 900; }
.top-card .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 900 1.1rem var(--display); color: var(--night); background: var(--c); }
.top-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.top-row { display: grid; grid-template-columns: 28px 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.18); }
.top-row.empty { grid-template-columns: 28px 1fr; min-height: 62px; opacity: .6; }
.top-row .thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--night-3); display: grid; place-items: center; overflow: hidden; }
.top-row .thumb svg { width: 18px; }
.top-name { min-width: 0; }
.top-name b, .top-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-name small { color: var(--ink-mute); font-size: .8rem; }
.top-score { font: 900 1.4rem var(--display); color: var(--gold); }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 900 .9rem var(--display); color: var(--night); }
.medal.m0 { background: linear-gradient(145deg, #ffe08f, var(--gold-deep)); }
.medal.m1 { background: linear-gradient(145deg, #f1f3f7, #a9b0bc); }
.medal.m2 { background: linear-gradient(145deg, #f0b98a, #a8622d); }
.login h2 { margin-top: 0; }
@media (max-width: 860px) { .top-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } }

/* ---------- Day page ---------- */
.daynav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.daynav a { text-decoration: none; font-weight: 600; }
.daynav .off { visibility: hidden; }
.dayhead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.dayhead .eyebrow { color: var(--gold); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.day-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 22px; align-items: start; }
.stack { display: grid; gap: 22px; }

.beer-photo {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; margin: -22px -22px 18px;
  background: radial-gradient(circle at 50% 40%, #2a3e5e, #121e30);
  display: grid; place-items: center;
}
.beer-photo img { width: 100%; height: 100%; object-fit: cover; }
.beer-photo .placeholder { text-align: center; color: var(--ink-soft); padding: 20px; }
.beer-photo .placeholder svg { width: 64px; opacity: .55; display: block; margin: 0 auto 10px; }
.photo-btn { position: absolute; right: 12px; bottom: 12px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.beer-name { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; padding: 0; list-style: none; }
.facts li { padding: 4px 12px; border-radius: 999px; background: rgba(255,244,220,.08); font-size: .9rem; }
.note { font-style: italic; color: var(--ink-soft); margin: 0 0 10px; }
.opened-by { color: var(--ink-mute); font-size: .85rem; margin: 10px 0 0; }

.avg-badge {
  float: right; width: 92px; height: 92px; margin: -6px -6px 8px 12px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; color: var(--night);
  background: radial-gradient(circle at 35% 30%, #ffe08f, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 0 0 5px rgba(242,182,50,.2), 0 8px 18px rgba(0,0,0,.35);
}
.avg-badge b { display: block; font: 900 2rem/1 var(--display); }
.avg-badge small { display: block; font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* Rating widget */
.rater { display: grid; grid-template-columns: 110px 1fr; gap: 20px; align-items: center; }
.glass { width: 110px; height: auto; display: block; }
.glass .beer { transition: y .25s ease, height .25s ease; }
.glass .foam { transition: transform .25s ease; }
.score-big { font: 900 3.4rem/1 var(--display); color: var(--gold); }
.score-word { font-family: var(--display); font-weight: 600; font-size: 1.2rem; min-height: 1.5em; }
input[type=range] { width: 100%; accent-color: var(--gold); height: 28px; margin: 6px 0; }
.ticks { display: flex; justify-content: space-between; color: var(--ink-mute); font-size: .75rem; margin-top: -4px; }
.again { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.rater + label { margin-top: 18px; }
.toggle {
  padding: 7px 14px; border-radius: 999px; border: 2px solid rgba(255,244,220,.2); background: none; color: var(--ink-soft);
  font: 600 .9rem var(--body); cursor: pointer;
}
.toggle[aria-pressed=true] { border-color: var(--gold); color: var(--night); background: var(--gold); }

.judges { display: grid; gap: 12px; }
.judge { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.18); }
.judge .who-name { font-weight: 700; }
.judge .judge-score { font: 900 1.8rem/1 var(--display); color: var(--gold); }
.judge .comment { grid-column: 1 / -1; margin: 4px 0 0; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.judge.hidden-score .judge-score { filter: blur(7px); user-select: none; }
.judge.pending { opacity: .55; }
.judge.reveal .judge-score { animation: flip-in .7s cubic-bezier(.3,1.6,.5,1) backwards; animation-delay: var(--delay); display: inline-block; }
.judge.reveal .comment { animation: fade-in .5s backwards; animation-delay: calc(var(--delay) + .3s); }
.avg-badge.reveal { animation: pop-in .8s cubic-bezier(.3,1.7,.5,1) backwards; animation-delay: 1.7s; }
@keyframes flip-in { from { transform: rotateX(90deg) scale(.4); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(0) rotate(-30deg); opacity: 0; } }
.badge-again { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(108,196,140,.18); color: #9fe0b5; }
.badge-again.no { background: rgba(239,107,91,.15); color: #ffb1a6; }

.locked-page { text-align: center; padding: 40px 20px; }
.locked-page .num { font-size: 6rem; color: var(--gold); }

/* Evening photo gallery */
.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 6px; }
.moment { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--night-3); }
.moment a { display: block; height: 100%; }
.moment img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.moment:hover img { transform: scale(1.04); }
.moment .by { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); font-size: .75rem; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moment .del { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(15,26,43,.8); color: var(--ink); font-size: 1rem; line-height: 1; }
.moment-add { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 2px dashed rgba(255,244,220,.25); background: none; color: var(--ink-soft); cursor: pointer; font: 600 .9rem var(--body); padding: 10px; text-align: center; }
.moment-add:hover { border-color: var(--gold); color: var(--gold); }
.moment-add b { display: block; font-size: 2rem; line-height: 1; font-family: var(--display); }

/* ---------- Leaderboard ---------- */
.table-wrap { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; }
.rank th { text-align: left; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); padding: 8px 10px; border-bottom: 1px solid rgba(255,244,220,.1); }
.rank td { padding: 10px; border-bottom: 1px solid rgba(255,244,220,.06); vertical-align: middle; }
.rank tr { cursor: pointer; }
.rank tbody tr:hover td { background: rgba(255,244,220,.04); }
.rank .pos { font: 900 1.3rem var(--display); color: var(--ink-mute); width: 2.5em; }
.rank .p1 .pos { color: var(--gold); } .rank .p2 .pos { color: #d7dbe3; } .rank .p3 .pos { color: #d08b54; }
.rank .thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--night-3); display: block; }
.rank .name { font-weight: 700; }
.rank .sub { color: var(--ink-mute); font-size: .85rem; }
.rank .s { font-variant-numeric: tabular-nums; text-align: center; }
.rank .avg { font: 900 1.25rem var(--display); color: var(--gold); text-align: right; }
.rank th.s, .rank th.avg { text-align: center; }
.rank th.avg { text-align: right; }
.missing { margin-top: 18px; color: var(--ink-soft); }
.missing a { margin-right: 6px; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-tile { padding: 18px; }
.stat-tile .label { color: var(--ink-mute); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.stat-tile .value { font: 900 2.2rem/1.1 var(--display); color: var(--gold); margin: 4px 0; }
.stat-tile .detail { color: var(--ink-soft); font-size: .9rem; }
.title-badge { display: inline-block; margin: 8px 6px 0 0; padding: 3px 10px; border-radius: 999px; background: rgba(242,182,50,.14); color: var(--gold); font-size: .8rem; font-weight: 700; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 50px; gap: 12px; align-items: center; font-size: .95rem; }
.bar-row .track { height: 12px; border-radius: 999px; background: rgba(255,244,220,.08); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; background: var(--gold); width: 0; transition: width .6s ease; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,244,220,.06); }
.duel:last-child { border-bottom: 0; }
.duel .scores { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); }
.toast {
  padding: 12px 18px; border-radius: 12px; background: var(--cream); color: var(--night); font-weight: 600; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toast-in .25s ease-out;
}
.toast.gold { background: var(--gold); }
.toast.bad { background: #ffb1a6; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .day-layout, .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  main { padding: 4px 12px 40px; }
  .top { gap: 10px; padding: 14px 12px 6px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: center; }
  .who { margin-left: auto; }
  .board { padding: 10px; --gap: 8px; border-radius: 16px; }
  .grid { --cols: 3; }
  .door.wide { grid-column: span 1; }
  .num { font-size: 2rem; }
  .big .num { font-size: 4.2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .rater { grid-template-columns: 80px 1fr; gap: 14px; }
  .glass { width: 80px; }
  .bar-row { grid-template-columns: 110px 1fr 44px; }
  .rank .sub, .rank .hide-sm { display: none; }
  .avg-badge { width: 76px; height: 76px; }
  .avg-badge b { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
