/* ==========================================================================
   LOCKED IN — style
   Art Deco vault at night. One system everywhere:
     · surfaces  = translucent ink panels with a double gold rule (.deco)
     · type      = Limelight (display, numerals) + Josefin Sans (UI, body)
     · numbering = brass plates (boxes, answers, steps, milestones)
     · icons     = one 24px line sprite, 1.8 stroke
   Gold / silver / bronze / ruby are reserved for scoring.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Finish: Midnight (default) */
  --ink-0: #050913;
  --ink-1: #0A1120;
  --ink-2: #0F182B;
  --ink-3: #152038;
  --ink-4: #1F2C49;
  --ink-0-rgb: 5, 9, 19;
  --ink-1-rgb: 10, 17, 32;
  --ink-2-rgb: 15, 24, 43;
  --ink-3-rgb: 21, 32, 56;
  --orn: #D9B25F;
  --orn-hi: #F5DDA0;
  --orn-lo: #94702E;
  --orn-rgb: 217, 178, 95;
  --metal: linear-gradient(180deg, #FCE8B2 0%, #E8C470 38%, #C8963F 74%, #A87A2E 100%);
  --metal-ink: #1E1405;

  --ivory: #EEE5D1;
  --ivory-2: #BDB5A3;
  --muted: #8F98AD;
  --dim: #5E6881;

  /* Reserved for scoring: the five kinds of loot */
  --t-diamond: #8FD8FF; --t-diamond-rgb: 143, 216, 255;
  --t-gold: #F2C14E; --t-gold-rgb: 242, 193, 78;
  --t-silver: #7CCB95; --t-silver-rgb: 124, 203, 149;   /* Stack of Hundreds */
  --t-key: #E39046; --t-key-rgb: 227, 144, 70;          /* Roll of Quarters */
  --t-cobweb: #6E7891; --t-cobweb-rgb: 110, 120, 145;
  --gold: var(--t-gold);
  --gold-rgb: var(--t-gold-rgb);
  --ruby: #E5484D;
  --ruby-rgb: 229, 72, 77;

  --rule: rgba(var(--orn-rgb), 0.42);
  --rule-soft: rgba(var(--orn-rgb), 0.17);
  --rule-faint: rgba(var(--orn-rgb), 0.08);
  --panel: rgba(var(--ink-2-rgb), 0.86);
  --panel-solid: var(--ink-2);

  /* Limelight's zero reads as "◐", so a one-glyph Abril Fatface subset supplies 0. */
  --display: "Abril Fatface", "Limelight", Georgia, serif;
  --ui: "Josefin Sans", "Futura", "Century Gothic", ui-sans-serif, system-ui, sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  --r: 6px;
  --r-sm: 4px;
  --box-h: clamp(46px, 5.9vh, 58px);
  --door: min(90vw, 46vh, 480px);
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- vault finishes (streak rewards) ----------------------------- */

/* Colours built from the palette are declared again on body, so whichever finish
   is on recolours every panel, rule and border. (A custom property resolves where
   it's declared: left only on :root they'd stay Midnight forever.) */
body {
  --rule: rgba(var(--orn-rgb), 0.42);
  --rule-soft: rgba(var(--orn-rgb), 0.17);
  --rule-faint: rgba(var(--orn-rgb), 0.08);
  --panel: rgba(var(--ink-2-rgb), 0.86);
  --panel-solid: var(--ink-2);
}

body[data-finish="emerald"] {
  --ink-0: #030E0B; --ink-1: #06171A; --ink-2: #0A211F; --ink-3: #0F2D29; --ink-4: #173F39;
  --ink-0-rgb: 3, 14, 11; --ink-1-rgb: 6, 23, 26; --ink-2-rgb: 10, 33, 31; --ink-3-rgb: 15, 45, 41;
}
body[data-finish="oxblood"] {
  --ink-0: #0E0406; --ink-1: #19090D; --ink-2: #220E13; --ink-3: #2D141B; --ink-4: #3F1D26;
  --ink-0-rgb: 14, 4, 6; --ink-1-rgb: 25, 9, 13; --ink-2-rgb: 34, 14, 19; --ink-3-rgb: 45, 20, 27;
  --orn: #E2A47A; --orn-hi: #F8D2B4; --orn-lo: #9A5C3B; --orn-rgb: 226, 164, 122;
  --metal: linear-gradient(180deg, #FFE0C8 0%, #EDB48C 38%, #C98257 74%, #A2613B 100%);
  --metal-ink: #2A1208;
}
body[data-finish="amethyst"] {
  --ink-0: #0B0614; --ink-1: #140A22; --ink-2: #1C0F30; --ink-3: #27163F; --ink-4: #3A2159;
  --ink-0-rgb: 11, 6, 20; --ink-1-rgb: 20, 10, 34; --ink-2-rgb: 28, 15, 48; --ink-3-rgb: 39, 22, 63;
  --orn: #E8B4A0; --orn-hi: #FFE0D4; --orn-lo: #9C6A5A; --orn-rgb: 232, 180, 160;
  --metal: linear-gradient(180deg, #FFE9DF 0%, #F0BFA8 40%, #CF8F7A 75%, #A86A58 100%);
  --metal-ink: #2A120C;
}
body[data-finish="gilded"] {
  --ink-0: #050403; --ink-1: #0C0A06; --ink-2: #14110A; --ink-3: #1C170D; --ink-4: #2C2414;
  --ink-0-rgb: 5, 4, 3; --ink-1-rgb: 12, 10, 6; --ink-2-rgb: 20, 17, 10; --ink-3-rgb: 28, 23, 13;
  --orn: #F0C24B; --orn-hi: #FFE7A0; --orn-lo: #A07A1E; --orn-rgb: 240, 194, 75;
  --metal: linear-gradient(180deg, #FFF2B8 0%, #F5CC55 38%, #D49C22 74%, #A87714 100%);
  --metal-ink: #241805;
}
body[data-finish="noir"] {
  --ink-0: #040404; --ink-1: #0A0A0B; --ink-2: #111113; --ink-3: #18181B; --ink-4: #26262A;
  --ink-0-rgb: 4, 4, 4; --ink-1-rgb: 10, 10, 11; --ink-2-rgb: 17, 17, 19; --ink-3-rgb: 24, 24, 27;
  --orn: #E6DCC6; --orn-hi: #FFF8EA; --orn-lo: #8F8778; --orn-rgb: 230, 220, 198;
  --metal: linear-gradient(180deg, #FFFFFF 0%, #EFE7D6 40%, #CFC4AE 75%, #ADA28C 100%);
  --metal-ink: #141210;
}

/* ---------- base -------------------------------------------------------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink-0); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink-1);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.4s;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--orn-hi); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ic { width: 20px; height: 20px; flex: none; display: block; }
.emo { font-family: var(--emoji); line-height: 1; font-style: normal; }
/* Drawn valuables sit where an emoji would, at the same size */
.emo .iart { display: block; width: 1em; height: 1em; overflow: visible; }
.ticon { display: inline-block; flex: none; width: 1.2em; height: 1.2em; vertical-align: -0.25em; }
.noscript { position: relative; z-index: 2; text-align: center; padding: 40px; }

.kicker {
  font-family: var(--ui); font-weight: 600; font-size: 10.5px; line-height: 1.3;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--orn);
}
.deco-title {
  margin: 4px 0 0; font-family: var(--display); font-weight: 400;
  font-size: 24px; line-height: 1.05; letter-spacing: 0.03em; color: var(--ivory);
}

/* ---------- the scene (background) -------------------------------------- */

.scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(130% 90% at 50% 0%, var(--ink-2) 0%, var(--ink-1) 42%, var(--ink-0) 100%);
}
.topbar, #app { position: relative; z-index: 1; }

/* Deco sunburst fanning down from the top edge */
.scene-sunburst {
  position: absolute; left: 50%; top: -100vmax; width: 200vmax; height: 200vmax; margin-left: -100vmax;
  background: repeating-conic-gradient(from 0deg, rgba(var(--orn-rgb), 0.06) 0deg 1.6deg, transparent 1.6deg 7.5deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.55) 22%, transparent 46%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.55) 22%, transparent 46%);
}

/* A wall of safe-deposit boxes, fading out toward the centre
   (quieter during play, so the real boxes stay the focus) */
body:not([data-screen="lobby"]) .scene-wall { opacity: 0.5; }
.scene-wall {
  position: absolute; inset: 0; transition: opacity 0.6s;
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, transparent 30%, rgba(0, 0, 0, 0.85) 92%);
  mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, transparent 30%, rgba(0, 0, 0, 0.85) 92%);
}
.scene-wall-boxes {
  position: absolute; inset: 0;
  background-color: rgba(var(--orn-rgb), 0.12);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='68' viewBox='0 0 104 68'%3E%3Crect x='3' y='3' width='98' height='62' rx='3' fill='none' stroke='black' stroke-width='1.4'/%3E%3Crect x='7' y='7' width='90' height='54' rx='2' fill='none' stroke='black' stroke-opacity='.4'/%3E%3Crect x='42' y='13' width='20' height='8' rx='1.5'/%3E%3Ccircle cx='52' cy='38' r='3.4'/%3E%3Cpath d='M50.5 40h3l1.4 8.5h-5.8z'/%3E%3C/svg%3E") 0 0 / 104px 68px repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='68' viewBox='0 0 104 68'%3E%3Crect x='3' y='3' width='98' height='62' rx='3' fill='none' stroke='black' stroke-width='1.4'/%3E%3Crect x='7' y='7' width='90' height='54' rx='2' fill='none' stroke='black' stroke-opacity='.4'/%3E%3Crect x='42' y='13' width='20' height='8' rx='1.5'/%3E%3Ccircle cx='52' cy='38' r='3.4'/%3E%3Cpath d='M50.5 40h3l1.4 8.5h-5.8z'/%3E%3C/svg%3E") 0 0 / 104px 68px repeat;
}

.scene-dust { position: absolute; inset: 0; }
.scene-dust i {
  position: absolute; bottom: -12px; border-radius: 50%;
  background: var(--orn-hi); box-shadow: 0 0 6px rgba(var(--orn-rgb), 0.9);
  animation: dustRise linear infinite;
}
@keyframes dustRise {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--drift, 0), -112vh, 0); }
}
.scene-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- shared surfaces --------------------------------------------- */

.deco {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.deco::before {
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1px solid var(--rule-soft); border-radius: calc(var(--r) - 3px);
}
/* Stepped Deco corners in gold, drawn with masks so every finish re-tints them */
.corners::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none; background: var(--orn);
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 17V9h4V5h4V1h8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") top left / 18px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M17 17V9h-4V5H9V1H1' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") top right / 18px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 1v8h4v4h4v4h8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") bottom left / 18px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M17 1v8h-4v4H9v4H1' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") bottom right / 18px no-repeat;
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 17V9h4V5h4V1h8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") top left / 18px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M17 17V9h-4V5H9V1H1' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") top right / 18px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M1 1v8h4v4h4v4h8' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") bottom left / 18px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath d='M17 1v8h-4v4H9v4H1' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") bottom right / 18px no-repeat;
}

/* Brass number plate: boxes, answers, steps, milestones */
.plate {
  display: inline-grid; place-items: center; min-width: 34px; height: 28px; padding: 3px 7px 0;
  border-radius: 3px; background: var(--metal); color: var(--metal-ink);
  font-family: var(--display); font-size: 18px; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.5);
}

.chip {
  display: inline-block; padding: 5px 9px 2px; border-radius: 3px;
  background: var(--metal); color: var(--metal-ink);
  font-family: var(--display); font-size: 15px; line-height: 1; word-spacing: 0.18em; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Loot token: a round deposit-box coin ringed in the tier's colour */
.loot {
  --loot: var(--t-cobweb); --loot-rgb: var(--t-cobweb-rgb);
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.16), transparent 55%),
    radial-gradient(circle, rgba(var(--loot-rgb), 0.2) 0 60%, rgba(var(--ink-0-rgb), 0.9) 62%);
  box-shadow: inset 0 0 0 1.5px var(--loot), 0 2px 6px rgba(0, 0, 0, 0.45);
}
.loot .emo { font-size: 15px; }
.loot-diamond { --loot: var(--t-diamond); --loot-rgb: var(--t-diamond-rgb); }
.loot-gold { --loot: var(--t-gold); --loot-rgb: var(--t-gold-rgb); }
.loot-silver { --loot: var(--t-silver); --loot-rgb: var(--t-silver-rgb); }
.loot-key { --loot: var(--t-key); --loot-rgb: var(--t-key-rgb); }
.loot-cobweb { --loot: var(--t-cobweb); --loot-rgb: var(--t-cobweb-rgb); }
.loot-cobweb .emo { opacity: 0.75; }
.loot .loot-art { display: block; width: 76%; height: 76%; overflow: visible; }
.loot-cobweb .loot-art { opacity: 0.9; }

.rule-div {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 14px;
  color: var(--orn); font-weight: 600; font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
}
.rule-div::before, .rule-div::after { content: ""; flex: 1; height: 1px; }
.rule-div::before { background: linear-gradient(90deg, transparent, var(--rule)); }
.rule-div::after { background: linear-gradient(90deg, var(--rule), transparent); }

/* ---------- buttons ----------------------------------------------------- */

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px; padding: 4px 20px 0; border: 0; border-radius: var(--r-sm);
  font-family: var(--ui); font-weight: 600; font-size: 13px; letter-spacing: 0.26em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: transform 0.12s var(--ease), filter 0.15s, box-shadow 0.15s, background 0.2s, color 0.2s;
}
.btn .ic { width: 19px; height: 19px; margin-top: -3px; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-gold {
  background: var(--metal); color: var(--metal-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 10px 30px rgba(var(--orn-rgb), 0.22);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.07); }
.btn-gold:disabled {
  background: rgba(var(--ink-2-rgb), 0.92); color: var(--muted); text-shadow: none; cursor: default;
  box-shadow: inset 0 0 0 1px var(--rule-soft);
}

.btn-line {
  background: rgba(var(--orn-rgb), 0.05); color: var(--orn-hi);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.btn-line::before {
  content: ""; position: absolute; inset: 4px; border: 1px solid var(--rule-faint); border-radius: 2px; pointer-events: none;
}
.btn-line:hover { background: rgba(var(--orn-rgb), 0.11); }
.btn-sm { min-height: 40px; font-size: 11.5px; letter-spacing: 0.22em; padding: 3px 14px 0; }

.icon-btn {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm); border: 1px solid var(--rule); background: rgba(var(--ink-2-rgb), 0.72);
  color: var(--orn); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: rgba(var(--orn-rgb), 0.1); color: var(--orn-hi); }
#btn-sound .snd-off { display: none; }
#btn-sound[aria-pressed="false"] .snd-on { display: none; }
#btn-sound[aria-pressed="false"] .snd-off { display: block; }

.link-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.link-row .btn { width: auto; }

/* ---------- top bar ----------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 10px;
  height: 64px; max-width: 1120px; margin: 0 auto; padding: 0 16px;
}
.brand {
  margin-right: auto; display: inline-flex; align-items: center; gap: 9px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font-family: var(--display); font-size: 20px; line-height: 1; color: var(--ivory); letter-spacing: 0.04em;
  transition: opacity 0.3s;
}
.brand .ic { width: 18px; height: 18px; color: var(--orn); margin-top: -4px; }
body[data-screen="lobby"] .brand { opacity: 0; pointer-events: none; }
.topbar-right { display: flex; gap: 8px; }

.streak-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px 0 10px;
  border-radius: var(--r-sm); border: 1px solid var(--rule); background: rgba(var(--ink-2-rgb), 0.72);
  color: var(--ivory); cursor: pointer; font-family: var(--display); font-size: 17px; line-height: 1;
}
.streak-chip .ic { color: var(--muted); }
.streak-chip b { font-weight: 400; padding-top: 3px; }
.streak-chip.is-live .ic { color: var(--orn-hi); filter: drop-shadow(0 0 6px rgba(var(--orn-rgb), 0.8)); }
/* The streak flame flickers (faster once today's vault is cracked) */
.streak-chip .ic, .streak-hero .ic { transform-origin: 50% 88%; animation: flameFlicker 2.6s ease-in-out infinite; }
.streak-chip.is-live .ic, .streak-hero .ic { animation-duration: 1.4s; }
@keyframes flameFlicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  20% { transform: scale(1.06, 0.95) rotate(-4deg); }
  45% { transform: scale(0.95, 1.08) rotate(3deg); }
  70% { transform: scale(1.03, 0.97) rotate(-2deg); }
}

/* ---------- lobby -------------------------------------------------------- */

.lobby { max-width: 500px; margin: 0 auto; padding: 0 16px 56px; text-align: center; }

/* ---------- full pages: My Player, Friends -------------------------------- */

.page { max-width: 640px; margin: 0 auto; padding: 4px 18px 64px; }
.page-head { margin-bottom: 18px; }
.page-head .vm-back { margin-bottom: 14px; }
.page-title { margin-top: 6px; font-size: 34px; }
.page-body > .sheet-lead:first-child { margin-top: 0; }
.page.enter { animation: dealIn 0.35s var(--ease) both; }

.lobby-hero {
  position: relative; height: var(--door); margin: 0 auto;
  display: grid; place-items: center;
}
.lobby-door {
  position: absolute; left: 50%; top: 0; width: var(--door); height: var(--door);
  transform: translateX(-50%); transition: transform 0.6s var(--ease), opacity 0.6s;
}
.door-svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.65)); }
.st-face-a { stop-color: var(--ink-4); }
.st-face-b { stop-color: var(--ink-1); }
.st-hi { stop-color: var(--orn-hi); }
.st-mid { stop-color: var(--orn); }
.st-lo { stop-color: var(--orn-lo); }
.d-frame { fill: none; stroke: rgba(var(--orn-rgb), 0.34); stroke-width: 2; }
.d-frame.soft { stroke: rgba(var(--orn-rgb), 0.14); stroke-width: 1.5; }
.d-body { fill: url(#liDoorFace); stroke: url(#liDoorGold); stroke-width: 9; }
.d-bolt, .d-knob { fill: url(#liDoorGold); }
.d-glint { fill: #fff; opacity: 0.35; }
.d-rule { fill: none; stroke: rgba(var(--orn-rgb), 0.55); stroke-width: 1.6; }
.d-rule.soft { stroke: rgba(var(--orn-rgb), 0.2); stroke-width: 1; }
.d-rays line { stroke: rgba(var(--orn-rgb), 0.26); stroke-width: 1.3; }
.d-plate { fill: var(--ink-1); stroke: url(#liDoorGold); stroke-width: 4; }
.d-dial { animation: dialSpin 140s linear infinite; }
.d-dial line { stroke: rgba(var(--orn-rgb), 0.5); stroke-width: 1; }
.d-dial line.major { stroke: var(--orn); stroke-width: 2.2; }
.d-num { fill: var(--orn); font-family: var(--ui); font-weight: 700; font-size: 11px; text-anchor: middle; dominant-baseline: central; letter-spacing: 0.04em; }
.d-spoke { stroke: url(#liDoorGold); stroke-width: 9; stroke-linecap: round; }
.d-hub-core { fill: var(--ink-1); }
.d-hinge { fill: var(--ink-3); stroke: url(#liDoorGold); stroke-width: 2.5; }
.d-hinge-pin { stroke: rgba(var(--orn-rgb), 0.6); stroke-width: 3; stroke-linecap: round; }
@keyframes dialSpin { to { transform: rotate(360deg); } }

/* Idle: every few seconds someone tests the handle */
.d-wheel { animation: wheelIdle 7s var(--ease) infinite; }
@keyframes wheelIdle {
  0%, 74% { transform: rotate(0); }
  80% { transform: rotate(34deg); }
  86% { transform: rotate(-9deg); }
  91%, 100% { transform: rotate(0); }
}

/* Tap the door: its face turns a full circle on the hinges while the wheel and
   the dial spin with it (just for fun) */
.lobby-hero[data-act="turn-vault"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lobby-door.is-turning .d-turn { animation: faceTurn 1.3s cubic-bezier(0.35, 0.05, 0.2, 1); }
@keyframes faceTurn { 0% { transform: rotate(0); } 64% { transform: rotate(372deg); } 82% { transform: rotate(355deg); } 100% { transform: rotate(360deg); } }
.lobby-door.is-turning .d-turn-wheel { animation: wheelTurn 1.3s cubic-bezier(0.3, 0.1, 0.2, 1); }
.lobby-door.is-turning .d-turn-dial { animation: dialTurn 1.3s var(--ease); }
.lobby-door.is-turning .door-svg { animation: doorClunk 1.3s; }
@keyframes wheelTurn { 0% { transform: rotate(0); } 62% { transform: rotate(380deg); } 80% { transform: rotate(352deg); } 100% { transform: rotate(360deg); } }
@keyframes dialTurn { 0% { transform: rotate(0); } 35% { transform: rotate(-200deg); } 65% { transform: rotate(-80deg); } 100% { transform: rotate(-360deg); } }
@keyframes doorClunk { 0%, 58%, 100% { transform: none; } 66% { transform: scale(0.985); } 78% { transform: scale(1.006); } }

/* "Crack the vault": dial the combination, turn the wheel, retract the bolts,
   swing the door open on its hinges, and let the light out. */
.lobby-door { transform-origin: 5% 50%; }
.lobby-hero::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: calc(var(--door) * 0.86); aspect-ratio: 1;
  border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(0.6);
  background: radial-gradient(circle, rgba(255, 238, 196, 0.6) 0%, rgba(var(--orn-rgb), 0.22) 38%, transparent 70%);
  transition: opacity 0.5s 1s, transform 0.8s 1s var(--ease);
}
.lobby.is-opening .lobby-hero::before { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
.lobby.is-opening .d-dial { animation: dialCombo 0.95s var(--ease) forwards; }
.lobby.is-opening .d-wheel { animation: wheelOpen 0.8s 0.3s cubic-bezier(0.5, 0, 0.3, 1) both; }
.lobby.is-opening .d-bolts { transform-origin: 0 0; animation: boltsRetract 0.32s 0.95s ease-in both; }
.lobby.is-opening .lobby-door {
  transform: translateX(-50%) perspective(1400px) rotateY(-104deg);
  opacity: 0;
  transition: transform 0.62s cubic-bezier(0.55, 0, 0.6, 1) 1.02s, opacity 0.3s ease-in 1.34s;
}
.lobby.is-opening .lobby-card, .lobby.is-opening .plaque, .lobby.is-opening .tagline, .lobby.is-opening .link-row {
  opacity: 0; transform: translateY(14px); transition: opacity 0.35s, transform 0.35s;
}
@keyframes dialCombo {
  0% { transform: rotate(0); }
  35% { transform: rotate(-250deg); }
  65% { transform: rotate(-110deg); }
  100% { transform: rotate(-330deg); }
}
@keyframes wheelOpen { from { transform: rotate(0); } to { transform: rotate(270deg); } }
@keyframes boltsRetract { to { transform: scale(0.92); } }

.plaque {
  position: relative; z-index: 1; padding: 14px 26px 11px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--ink-1); border: 1px solid var(--rule);
  box-shadow: 0 0 0 4px var(--ink-1), 0 0 0 5px var(--rule-soft), 0 20px 50px rgba(0, 0, 0, 0.7);
}
.wordmark {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 11vw, 66px); line-height: 0.95; letter-spacing: 0.03em; white-space: nowrap;
  color: var(--orn-hi);
  /* A slow gold shimmer sweeps across the letters every few seconds */
  background: linear-gradient(105deg, var(--orn-lo) 0%, var(--orn) 32%, #FFF4D6 47%, var(--orn) 60%, var(--orn-lo) 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6));
  animation: titleShimmer 7s ease-in-out infinite;
}
@keyframes titleShimmer { 0%, 52% { background-position: 100% 0; } 82%, 100% { background-position: 0% 0; } }
.plaque-sub { margin-top: 8px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.42em; text-transform: uppercase; color: var(--ivory-2); }
/* ...and a glint of light crosses the nameplate in time with it */
.plaque::after {
  content: ""; position: absolute; top: -50%; bottom: -50%; left: -40%; width: 26%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 214, 0.13), transparent);
  transform: skewX(-18deg); animation: plaqueGlint 7s ease-in-out infinite;
}
@keyframes plaqueGlint { 0%, 52% { left: -40%; } 82%, 100% { left: 130%; } }
.tagline { margin: 24px auto 26px; max-width: 320px; color: var(--muted); font-size: 13.5px; line-height: 1.75; letter-spacing: 0.03em; }

.lobby-card { text-align: left; padding: 28px 26px 24px; transition: opacity 0.35s, transform 0.35s; }
.lc-top { display: flex; align-items: center; gap: 10px; }
.lc-date { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; padding-top: 3px; }
.lc-label { margin-top: 24px; }
.lc-cat { margin-top: 8px; font-family: var(--display); font-size: clamp(30px, 8vw, 38px); line-height: 1; letter-spacing: 0.02em; color: var(--ivory); }
.lc-q { margin: 12px 0 24px; color: var(--ivory-2); font-size: 14px; line-height: 1.65; }
.lc-q b { color: var(--ivory); font-weight: 600; }

.lc-facts { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lc-facts li {
  padding: 13px 4px 11px; text-align: center; border-radius: var(--r-sm);
  background: rgba(var(--ink-0-rgb), 0.55); border: 1px solid var(--rule-soft);
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.lc-facts b { display: block; margin-bottom: 5px; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1; letter-spacing: 0; color: var(--orn-hi); }

.lc-status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px;
  padding: 12px 14px 10px; border-radius: var(--r-sm); background: rgba(var(--ink-0-rgb), 0.55); border: 1px solid var(--rule-soft);
}
.lc-status .big { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--ivory); }
.lc-status .big small { font-size: 15px; color: var(--muted); }
.lc-status .right { text-align: right; font-size: 13px; color: var(--muted); }
.lc-status .right b { display: block; color: var(--ivory); font-size: 15px; }
.lc-status .right b.lc-title { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.lc-title .ticon { width: 20px; height: 20px; }
.lc-status .medal-row { justify-content: flex-start; margin-top: 6px; }
.lc-players { margin: 16px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; }
.lc-players b { color: var(--orn-hi); font-family: var(--display); font-weight: 400; font-size: 14px; }
.lc-players .live { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(var(--gold-rgb), 0.9); animation: livePulse 1.8s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: 0.35; } }
.rerun-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

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

.game {
  max-width: 540px; margin: 0 auto; padding: 0 16px calc(112px + env(safe-area-inset-bottom));
  display: grid; gap: 18px;
}
body.is-done .game { padding-bottom: 56px; }

.vault-meta .vm-row { display: flex; align-items: center; gap: 10px; }
.vm-cat { font-family: var(--display); font-size: 21px; letter-spacing: 0.02em; line-height: 1; padding-top: 3px; }
.vm-tag {
  margin-left: auto; padding: 4px 8px 2px; border-radius: 3px; border: 1px solid var(--rule);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--orn);
}
/* Back to the main page, once a vault is cracked */
.vm-back {
  display: inline-flex; align-items: center; gap: 2px; margin: 0 0 12px -6px; padding: 7px 12px 5px 4px;
  background: none; border: 0; border-radius: var(--r-sm); cursor: pointer;
  color: var(--orn); font-family: var(--ui); font-weight: 700; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}
.vm-back .ic { width: 17px; height: 17px; margin-top: -3px; transform: rotate(180deg); }
.vm-back:hover { color: var(--orn-hi); background: rgba(var(--orn-rgb), 0.08); }
.vm-q { margin: 10px 0 16px; color: var(--muted); font-size: 13.5px; letter-spacing: 0.02em; }
.vm-q b { color: var(--ivory); }

/* The valuable on offer, inside its timer dial */
.valuable {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center;
  padding: 18px 18px 20px;
  background:
    radial-gradient(circle at 72px 50%, rgba(var(--orn-rgb), 0.14), transparent 140px),
    var(--panel);
}
.valuable.enter { animation: dealIn 0.5s var(--ease) both; }
@keyframes dealIn {
  from { transform: translateY(20px) scale(0.96) rotate(-1.2deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.dial { position: relative; width: 110px; height: 110px; flex: none; }
.dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dial .emo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; }
.dial .emo .ticon { width: 1em; height: 1em; }
.dial-secs {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  min-width: 44px; padding: 4px 9px 1px; border-radius: 999px; text-align: center;
  background: var(--ink-1); border: 1px solid var(--rule); color: var(--orn-hi);
  font-family: var(--display); font-size: 13px; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.t-rim { fill: rgba(var(--ink-0-rgb), 0.6); stroke: var(--rule); stroke-width: 1; }
/* The combination bezel clicks round one notch-pair per second (spring = the "click") */
.t-bezel { transform-origin: 60px 60px; transition: transform 0.42s var(--spring); }
.valuable.enter .t-bezel { animation: bezelIn 0.9s var(--ease) backwards; }
@keyframes bezelIn { from { transform: rotate(210deg); } }
.t-notch { stroke: rgba(var(--orn-rgb), 0.5); stroke-width: 1.3; stroke-linecap: round; transition: stroke 0.3s; }
.t-notch.major { stroke: var(--orn); stroke-width: 2.4; }
.t-pointer { fill: var(--orn-hi); transition: fill 0.3s; }
.t-track { fill: none; stroke: rgba(var(--orn-rgb), 0.13); stroke-width: 5; }
.t-arc { fill: none; stroke: var(--orn-hi); stroke-width: 5; stroke-linecap: round; transition: stroke 0.3s; }
.t-face { fill: var(--ink-2); stroke: var(--rule-soft); }
.dial.is-urgent .t-arc, .dial.is-urgent .t-notch { stroke: var(--ruby); }
.dial.is-urgent .t-pointer { fill: var(--ruby); }
.dial.is-urgent .dial-secs { color: #fff; background: var(--ruby); border-color: var(--ruby); animation: urgent 1s steps(2) infinite; }
@keyframes urgent { 50% { box-shadow: 0 0 0 4px rgba(var(--ruby-rgb), 0.3); } }

.val-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 10px; }
.val-top .kicker { white-space: nowrap; }
.val-name {
  margin: 0 0 6px; font-family: var(--display); font-weight: 400;
  font-size: clamp(22px, 6vw, 28px); line-height: 1.1; letter-spacing: 0.02em; color: var(--ivory); overflow-wrap: anywhere;
}
.val-hint { margin: 0; color: var(--muted); font-size: 13.5px; letter-spacing: 0.02em; }
.pips { display: flex; gap: 4px; }
.pip { width: 12px; height: 4px; border-radius: 2px; background: var(--rule-soft); }
.pip.done { background: var(--orn); }
.pip.now { background: var(--ivory); }

.panel-card { padding: 20px; }
.panel-card.enter { animation: dealIn 0.45s var(--ease) both; }
.ready-card { text-align: center; padding: 24px 20px; }
.ready-card .locks { display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; color: var(--orn); }
.ready-card .locks .ic { width: 18px; height: 18px; }
.ready-card h2, .reveal-card h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.05; }
.ready-card p { margin: 10px 0 0; color: var(--ivory-2); }
.reveal-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.reveal-card h2 { margin-top: 6px; }
/* The vault wheel turns a notch per opened box, then swings the vault open */
.reveal-wheel { width: 66px; height: 66px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5)); }
.wheel-svg { display: block; width: 100%; height: 100%; }
.w-ring { fill: rgba(var(--ink-0-rgb), 0.55); stroke: var(--orn); stroke-width: 2.5; }
.w-stud { fill: var(--orn); opacity: 0.75; }
.w-turn { transform-origin: 50px 50px; transition: transform 0.5s var(--spring); }
.w-spoke { stroke: var(--orn-hi); stroke-width: 5; stroke-linecap: round; }
.w-knob { fill: var(--orn-hi); }
.w-core { fill: var(--ink-1); }
.running { font-family: var(--display); font-size: 46px; line-height: 0.85; color: var(--ivory); font-variant-numeric: tabular-nums; }
.running small { font-size: 17px; color: var(--muted); }
.running .bump { display: inline-block; animation: bump 0.3s var(--spring); }
@keyframes bump { 0% { transform: scale(1.3); color: var(--orn-hi); } 100% { transform: none; } }

/* ---------- action bar -------------------------------------------------- */

.actionbar { margin-top: 14px; }
.actionbar .key {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  padding: 3px 6px 1px; border-radius: 3px; border: 1px solid currentColor; opacity: 0.5;
  font-size: 11px; letter-spacing: 0.06em;
}
body.is-done .actionbar { display: none; }

/* ---------- the deposit boxes ------------------------------------------- */

.board-end {
  display: flex; align-items: center; gap: 10px; margin: 0 0 9px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--orn);
}
.board-end::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rule), transparent); }
.board-end.bottom { margin: 9px 0 0; }
.board-end .ic { width: 11px; height: 11px; }

.boxes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.box {
  position: relative; width: 100%; min-height: var(--box-h);
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center;
  padding: 0 12px 0 0; border-radius: var(--r-sm); text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(var(--ink-3-rgb), 0.9), rgba(var(--ink-2-rgb), 0.9));
  border: 1px solid var(--rule-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 2px 0 rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.box .plate { justify-self: center; min-width: 30px; height: 24px; font-size: 15px; }
.box .content { display: flex; align-items: center; gap: 10px; min-width: 0; }
.box .emo { font-size: 24px; flex: none; }
.box .txt { display: flex; flex-direction: column; min-width: 0; padding-top: 3px; }
.box .nm { font-weight: 500; font-size: 14px; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box .val { font-size: 11.5px; color: var(--ivory-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box .empty { font-size: 10.5px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); padding-top: 3px; }
.box .empty .on-hover { display: none; }
.box .kh { width: 18px; height: 18px; color: rgba(var(--orn-rgb), 0.3); }
.box .lock { width: 18px; height: 18px; color: var(--orn); }
.box .lock .shackle { transform-box: fill-box; transform-origin: 50% 100%; }

.box.is-empty .plate { background: transparent; color: var(--orn); box-shadow: inset 0 0 0 1px var(--rule); }
body.is-playing .box.is-empty:hover { border-color: var(--rule); background: linear-gradient(180deg, rgba(var(--orn-rgb), 0.09), rgba(var(--ink-2-rgb), 0.9)); }
@media (hover: hover) {
  body.is-playing .box.is-empty:hover .empty .idle { display: none; }
  body.is-playing .box.is-empty:hover .empty .on-hover { display: inline; color: var(--orn-hi); }
}
body:not(.is-playing) .box { cursor: default; }

.box.is-filled { border-color: var(--rule); color: var(--ivory); }
.box.is-selected {
  border-color: var(--orn-hi); color: var(--ivory);
  background: linear-gradient(180deg, rgba(var(--orn-rgb), 0.16), rgba(var(--ink-2-rgb), 0.92));
  box-shadow: 0 0 0 1px var(--orn-hi), 0 0 26px rgba(var(--orn-rgb), 0.28);
  animation: selectGlow 1.6s ease-in-out infinite;
}
.box.is-selected .content { opacity: 0.85; }
.box.is-selected .plate { background: var(--metal); color: var(--metal-ink); box-shadow: none; }
.box .tap-hint { font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--orn-hi); white-space: nowrap; padding-top: 2px; }
@keyframes selectGlow { 50% { box-shadow: 0 0 0 1px var(--orn-hi), 0 0 34px rgba(var(--orn-rgb), 0.45); } }

.box.just-locked { animation: thunk 0.45s var(--ease); }
.box.just-locked .lock .shackle { animation: shackleDrop 0.45s var(--spring); }
@keyframes thunk {
  0% { transform: scale(1.03); box-shadow: 0 0 0 1px var(--orn-hi), 0 0 40px rgba(var(--orn-rgb), 0.6); }
  45% { transform: scale(0.985); }
  100% { transform: none; }
}
@keyframes shackleDrop { 0% { transform: translateY(-40%); } 100% { transform: translateY(0); } }
.box.denied { animation: shake 0.32s; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.box .timed-out { width: 14px; height: 14px; color: var(--ruby); margin-left: 4px; }

/* revealed boxes */
.box.flipping { animation: flip 0.5s var(--ease); }
@keyframes flip {
  0% { transform: perspective(700px) rotateX(0); }
  42% { transform: perspective(700px) rotateX(88deg); }
  100% { transform: perspective(700px) rotateX(0); }
}
.box .payout { display: flex; align-items: center; gap: 6px; padding-left: 6px; }
.box .payout .loot { width: 30px; height: 30px; }
.box .payout .loot .emo { font-size: 16px; }
.box .payout b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1; padding-top: 3px; min-width: 22px; }
.box .payout small { display: block; font-family: var(--ui); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.box.t-diamond { border-color: rgba(var(--t-diamond-rgb), 0.7); background: linear-gradient(90deg, rgba(var(--t-diamond-rgb), 0.16), rgba(var(--ink-2-rgb), 0.9) 70%); }
.box.t-gold { border-color: rgba(var(--t-gold-rgb), 0.7); background: linear-gradient(90deg, rgba(var(--t-gold-rgb), 0.16), rgba(var(--ink-2-rgb), 0.9) 70%); }
.box.t-silver { border-color: rgba(var(--t-silver-rgb), 0.55); background: linear-gradient(90deg, rgba(var(--t-silver-rgb), 0.13), rgba(var(--ink-2-rgb), 0.9) 70%); }
.box.t-key { border-color: rgba(var(--t-key-rgb), 0.6); background: linear-gradient(90deg, rgba(var(--t-key-rgb), 0.14), rgba(var(--ink-2-rgb), 0.9) 70%); }
.box.t-cobweb { border-color: rgba(var(--t-cobweb-rgb), 0.5); background: linear-gradient(90deg, rgba(var(--t-cobweb-rgb), 0.1), rgba(var(--ink-2-rgb), 0.9) 70%); }

/* ---------- the vault report (results) ---------------------------------- */

.report { padding: 22px 20px 20px; }
.report.enter { animation: dealIn 0.5s var(--ease) both; }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rp-head .kicker:last-child { white-space: nowrap; }
.rp-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.rp-big { font-family: var(--display); font-size: 62px; line-height: 0.85; color: var(--ivory); letter-spacing: -0.01em; }
.rp-big small { font-size: 21px; color: var(--muted); letter-spacing: 0; }
.rp-title { text-align: right; padding-bottom: 2px; }
.rp-title .t-icon { line-height: 0; }
.rp-title .t-icon .ticon { width: 32px; height: 32px; }
.rp-title .t-name { font-family: var(--display); font-size: 21px; line-height: 1.05; color: var(--orn-hi); }
.rp-title .t-line { margin-top: 4px; font-size: 12px; color: var(--muted); }

.medal-row { display: flex; justify-content: space-between; gap: 4px; margin: 18px 0 10px; }
.medal-row .m { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.medal-row .loot { width: 100%; max-width: 36px; height: auto; aspect-ratio: 1; }
.medal-row .loot .emo { font-size: 17px; }
.medal-row .m small { font-family: var(--display); font-size: 12px; color: var(--muted); }
.medal-row.mini { gap: 3px; margin: 0; justify-content: flex-start; }
.medal-row.mini .loot { width: 18px; height: 18px; max-width: 18px; box-shadow: inset 0 0 0 1px var(--loot); }
.medal-row.mini .loot .emo { font-size: 10px; }

.rp-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin: 2px 0 18px; font-size: 12.5px; color: var(--muted); }
.rp-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rp-meta .ic { width: 15px; height: 15px; color: var(--orn); margin-top: -3px; }
.rp-meta .haul-mini { gap: 10px; }
.rp-meta .loot { width: 20px; height: 20px; }
.rp-meta .loot .emo { font-size: 11px; }

.rank-card { padding: 16px 16px 12px; margin-bottom: 14px; }
.rank-card .rc-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.rc-rank { font-family: var(--display); font-size: 30px; line-height: 0.95; color: var(--ivory); }
.rc-rank small { font-family: var(--ui); font-weight: 600; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.rc-pct { text-align: right; }
.rc-pct b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1; color: var(--orn-hi); }
.rc-pct span { font-size: 12px; color: var(--muted); }
.rc-caption { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.rc-empty { padding: 6px 0; text-align: center; color: var(--ivory-2); font-size: 14px; }
.rc-empty .btn { width: auto; margin-top: 10px; }
.rc-loading { height: 8px; margin: 14px 0; border-radius: 4px; background: linear-gradient(90deg, var(--rule-faint), var(--rule-soft), var(--rule-faint)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.skyline { position: relative; margin-top: 14px; }
.skyline-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sk-bar { fill: rgba(var(--orn-rgb), 0.4); }
.sk-bar.is-you { fill: var(--orn-hi); }
.sk-base { stroke: var(--rule); stroke-width: 1; }
.sk-axis { fill: var(--muted); font-family: var(--ui); font-weight: 600; font-size: 10px; text-anchor: middle; }
.sk-you-mark { fill: var(--orn-hi); }
.sk-you-label { fill: var(--ivory); font-family: var(--ui); font-weight: 700; font-size: 9px; letter-spacing: 0.16em; text-anchor: middle; }
.sk-hit { fill: transparent; cursor: pointer; }
.sk-tip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 8px)); pointer-events: none;
  padding: 7px 10px 5px; border-radius: var(--r-sm); white-space: nowrap;
  background: var(--ink-1); border: 1px solid var(--rule); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  font-size: 12.5px; color: var(--ivory);
}
.sk-tip b { color: var(--orn-hi); }

.new-relics { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px 10px; }
.new-relics .nr-list { display: flex; gap: 6px; flex-wrap: wrap; }
.new-relics .nr-text { font-size: 13px; color: var(--ivory-2); }
.new-relics .nr-text b { display: block; color: var(--orn-hi); font-size: 14px; }

.rp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-actions .btn { padding: 4px 10px 0; letter-spacing: 0.16em; white-space: nowrap; }
.rp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule-soft);
  font-size: 13px; color: var(--muted);
}
.rp-foot b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.1; color: var(--ivory); font-variant-numeric: tabular-nums; }
.rp-foot .right { text-align: right; }
/* Next drop: the countdown, and when it lands (12 PM Central) */
[data-countdown] { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc-status [data-countdown], .rp-foot b[data-countdown] { color: #fff; }
.lc-status [data-countdown] { display: block; margin: 6px 0 3px; font-size: 24px; line-height: 1; }
.rp-foot b[data-countdown] { margin-top: 4px; font-size: 20px; line-height: 1; }
/* Alarm-clock digits (seven segments, drawn in app.js) */
[data-countdown].is-clock { filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.45)); }
.seg, .seg-colon { display: inline-block; height: 1em; vertical-align: -0.1em; overflow: visible; }
.seg { width: 0.58em; margin: 0 0.03em; transform: skewX(-7deg); }
.seg-colon { width: 0.24em; transform: skewX(-7deg); }
.seg polygon { fill: rgba(255, 255, 255, 0.08); }
.seg polygon.on, .seg-colon rect { fill: #fff; }
.tock .seg-colon rect { opacity: 0.3; }
[data-countdown].is-open { color: var(--orn-hi); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.drop-at { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--dim); }
.rp-foot .progress { display: block; width: 120px; height: 4px; margin: 6px 0 0 auto; border-radius: 2px; background: var(--rule-soft); overflow: hidden; }
.rp-foot .progress i { display: block; height: 100%; background: var(--orn); }

/* ---------- the real ranking -------------------------------------------- */

.answers { margin-top: 6px; }
.answers-head { display: flex; align-items: center; gap: 14px; margin: 0 0 6px; }
.answers-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1; }
.answers-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rule), transparent); }
.answers-list { list-style: none; margin: 0; padding: 0; }
.answer {
  display: grid; grid-template-columns: 42px 48px minmax(0, 1fr); gap: 4px 12px; align-items: start;
  padding: 16px 0; border-bottom: 1px solid var(--rule-soft);
}
.answer .plate { margin-top: 10px; min-width: 34px; }
.a-emo {
  width: 48px; height: 48px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 27px;
  background: rgba(var(--ink-2-rgb), 0.85); border: 1px solid var(--rule-soft);
}
.a-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.a-name { font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em; }
.a-val { font-family: var(--display); font-size: 17px; line-height: 1; color: var(--orn-hi); white-space: nowrap; }
.a-fact { margin: 6px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.a-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; }
.a-you {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 1px 4px; border-radius: 999px;
  background: rgba(var(--ink-2-rgb), 0.9); border: 1px solid var(--rule-soft); font-weight: 700;
}
.a-you .loot { width: 20px; height: 20px; }
.a-you .loot .emo { font-size: 11px; }
.a-crowd { color: var(--ivory-2); }
.a-crowd b { color: var(--ivory); }
.a-src { color: var(--dim); }
.a-src a { color: var(--muted); text-underline-offset: 3px; }
.a-src a:hover { color: var(--ivory); }
.page-foot { margin: 26px 0 0; text-align: center; font-size: 13px; color: var(--dim); letter-spacing: 0.04em; }
.page-foot button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- menu drawer -------------------------------------------------- */

.drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0; padding: 0;
  width: min(390px, 94vw); height: 100%; max-height: none; max-width: none;
  border: 0; border-right: 1px solid var(--rule);
  background:
    radial-gradient(120% 50% at 0% 0%, rgba(var(--orn-rgb), 0.08), transparent 60%),
    var(--ink-1);
  color: var(--ivory); overflow-y: auto;
}
/* While a menu or sheet is open, the page behind it must not scroll
   (otherwise scrolling the rules drags the lobby down underneath). */
html:has(dialog[open]) { overflow: hidden; }
.drawer, .sheet { overscroll-behavior: contain; }
.drawer::backdrop, .sheet::backdrop {
  background: rgba(2, 4, 9, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.drawer[open] { animation: drawerIn 0.32s var(--ease); }
@keyframes drawerIn { from { transform: translateX(-100%); } }
.drawer.closing { animation: drawerOut 0.26s cubic-bezier(0.4, 0, 0.9, 0.6) forwards; }
.drawer.closing::backdrop { animation: backdropOut 0.26s forwards; }
@keyframes drawerOut { to { transform: translateX(-100%); } }
@keyframes backdropOut { to { opacity: 0; } }
.drawer-inner { min-height: 100%; display: flex; flex-direction: column; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.drawer-head .deco-title { font-size: 26px; }
.menu-today { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 16px 16px 14px; width: 100%; text-align: left; cursor: pointer; color: var(--ivory); }
.menu-today:hover { border-color: var(--orn); }
.menu-today .mt-cat { font-family: var(--display); font-size: 20px; line-height: 1.05; letter-spacing: 0.02em; }
.menu-today .mt-status { grid-column: 1; font-size: 13px; color: var(--ivory-2); }
.menu-today .ic { grid-row: 1 / span 3; grid-column: 2; color: var(--orn); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 14px 13px;
  text-align: left; cursor: pointer; color: var(--ivory); transition: border-color 0.15s, background 0.15s;
}
.tile:hover { border-color: var(--orn); background: rgba(var(--orn-rgb), 0.07); }
.tile .ic { width: 22px; height: 22px; color: var(--orn); }
.tile b { font-weight: 600; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; }
.tile small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); letter-spacing: 0.02em; text-transform: none; font-weight: 600; }
.menu-setting {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 14px 16px 12px;
  width: 100%; cursor: pointer; color: var(--ivory); text-align: left;
}
.menu-setting b { font-weight: 600; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; }
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--rule); background: rgba(var(--ink-0-rgb), 0.7); flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dim); transition: transform 0.2s var(--ease), background 0.2s; }
.switch.on::after { transform: translateX(20px); background: var(--orn-hi); }

/* ---------- sheets (archive, streaks, relics, stats, credits, how to) --- */

.sheet {
  width: min(580px, calc(100% - 24px)); max-height: min(88dvh, 860px); padding: 0;
  border: 1px solid var(--rule); border-radius: var(--r);
  background:
    radial-gradient(120% 40% at 50% 0%, rgba(var(--orn-rgb), 0.07), transparent 70%),
    var(--ink-1);
  color: var(--ivory); overflow-y: auto;
  box-shadow: 0 0 0 4px var(--ink-1), 0 0 0 5px var(--rule-soft), 0 40px 90px rgba(0, 0, 0, 0.75);
}
.sheet[open] { animation: sheetIn 0.3s var(--ease); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.sheet-inner { padding: 20px 20px 24px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head .deco-title { font-size: 25px; }
.sheet-lead { margin: -2px 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

/* how to play */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; font-size: 14px; line-height: 1.65; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; color: var(--ivory-2); }
.steps .plate { margin-top: -2px; }
.steps b { color: var(--ivory); }
.legend { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 12px 0 0 52px; }
.legend > span {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px 5px 7px; border-radius: var(--r-sm);
  background: rgba(var(--ink-2-rgb), 0.9); border: 1px solid var(--rule-soft); font-size: 13px;
}
.legend .loot { width: 26px; height: 26px; }
.legend .loot .emo { font-size: 14px; }
.legend .lg-txt small { margin-left: 8px; font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.legend b { margin-left: auto; font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--orn-hi); }

/* archive */
.vault-list { display: grid; gap: 8px; }
.vault-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  width: 100%; padding: 14px 16px 12px; text-align: left; cursor: pointer; color: var(--ivory);
}
.vault-row:hover { border-color: var(--orn); }
.vault-row .vr-cat { display: block; font-family: var(--display); font-size: 19px; line-height: 1; }
.vault-row .vr-date { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.vault-row .vr-side { text-align: right; font-size: 12px; color: var(--muted); }
.vault-row .vr-side b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ivory); }
.vault-row .vr-cta { font-weight: 700; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orn-hi); }
.vault-row.is-today { border-color: var(--orn); }
.forging { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--rule-soft); border-radius: var(--r); }
.forging b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ivory-2); margin-bottom: 4px; }

/* streaks & rewards */
.streak-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; }
.streak-hero .sh-main { display: flex; align-items: center; gap: 14px; }
.streak-hero .ic { width: 46px; height: 46px; color: var(--orn-hi); filter: drop-shadow(0 0 12px rgba(var(--orn-rgb), 0.6)); }
.streak-hero .sh-num { font-family: var(--display); font-size: 42px; line-height: 0.85; }
.streak-hero .sh-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ivory-2); }
.streak-hero .sh-best { text-align: right; font-size: 12px; color: var(--muted); }
.streak-hero .sh-best b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--ivory); }
.track { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.track li { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px 9px 12px; }
.track li.locked .insignia { filter: grayscale(0.7) brightness(0.62); opacity: 0.9; }
.track .tr-title { display: block; font-weight: 600; font-size: 13.5px; }
.track .tr-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.track .tr-state { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.track li.done .tr-state { color: var(--orn-hi); }
.track .tr-state .ic { width: 18px; height: 18px; color: var(--orn-hi); }
.finishes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.finish {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; text-align: left;
  cursor: pointer; color: var(--ivory); border-radius: var(--r); border: 1px solid var(--rule-soft); background: rgba(var(--ink-2-rgb), 0.85);
}
.finish:disabled { cursor: default; }
.finish.is-on { border-color: var(--orn-hi); box-shadow: 0 0 0 1px var(--orn-hi); }
.finish .swatch {
  height: 56px; border-radius: var(--r-sm); position: relative; overflow: hidden;
  background: radial-gradient(circle at 30% 120%, var(--sw-orn) 0 22%, transparent 23%), radial-gradient(130% 120% at 50% 0%, var(--sw-ink-hi), var(--sw-ink));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.finish .swatch::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% -40%, var(--sw-ray) 0deg 2deg, transparent 2deg 8deg);
  opacity: 0.45;
}
.finish b { font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.finish small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.finish .lockbadge { position: absolute; top: 18px; right: 18px; display: flex; align-items: center; gap: 5px; padding: 4px 8px 2px; border-radius: 3px; background: rgba(0, 0, 0, 0.7); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--ivory); }
.finish .lockbadge .ic { width: 12px; height: 12px; margin-top: -2px; }
.finish:disabled .swatch { filter: grayscale(0.7) brightness(0.6); }
.finish[data-id="midnight"] { --sw-ink: #0A1120; --sw-ink-hi: #1F2C49; --sw-orn: #D9B25F; --sw-ray: rgba(217, 178, 95, 0.3); }
.finish[data-id="emerald"] { --sw-ink: #06171A; --sw-ink-hi: #173F39; --sw-orn: #D9B25F; --sw-ray: rgba(217, 178, 95, 0.3); }
.finish[data-id="oxblood"] { --sw-ink: #19090D; --sw-ink-hi: #3F1D26; --sw-orn: #E2A47A; --sw-ray: rgba(226, 164, 122, 0.3); }
.finish[data-id="noir"] { --sw-ink: #0A0A0B; --sw-ink-hi: #26262A; --sw-orn: #E6DCC6; --sw-ray: rgba(230, 220, 198, 0.28); }
.finish[data-id="amethyst"] { --sw-ink: #140A22; --sw-ink-hi: #3A2159; --sw-orn: #E8B4A0; --sw-ray: rgba(232, 180, 160, 0.3); }
.finish[data-id="gilded"] { --sw-ink: #0C0A06; --sw-ink-hi: #2C2414; --sw-orn: #F0C24B; --sw-ray: rgba(240, 194, 75, 0.34); }

/* relics */
.relic-count { display: flex; align-items: baseline; gap: 8px; margin: -6px 0 16px; color: var(--ivory-2); }
.relic-count b { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--orn-hi); }
.relics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Relic trophies (drawn in art.js) */
.trophy { display: inline-grid; place-items: center; flex: none; width: 40px; height: 48px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.trophy .trophy-art { display: block; width: 100%; height: 100%; overflow: visible; }
.relic .trophy { width: 70px; height: 84px; margin-top: 2px; }
.relic:not(.is-locked) .trophy { background: radial-gradient(circle at 50% 38%, rgba(var(--orn-rgb), 0.2), transparent 62%); }
.relic.is-locked .trophy { filter: grayscale(1) brightness(0.3) contrast(1.15); opacity: 0.85; }
.trophy.sm { width: 26px; height: 31px; }
.toast .trophy { width: 32px; height: 38px; }
.relic { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 8px 12px; }
.relic b { font-weight: 600; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.25; }
.relic small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.relic.is-locked b { color: var(--muted); }
.relic .when { font-size: 10.5px; color: var(--orn); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.stat { padding: 12px 2px 9px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1; }
.stat span { display: block; margin-top: 6px; font-size: 9px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stat-extra { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 13.5px; color: var(--ivory-2); }
.stat-extra b { color: var(--ivory); }
.dist { display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 26px minmax(0, 168px) 1fr; gap: 8px; align-items: center; font-size: 13px; }
.dist-row .d-icon { display: grid; place-items: center; }
.dist-row .d-icon .ticon { width: 20px; height: 20px; }
.dist-row .d-name { color: var(--ivory-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.dist-row .d-name small { color: var(--dim); }
.dist-bar {
  height: 22px; min-width: 26px; border-radius: 3px; display: flex; align-items: center; justify-content: flex-end;
  padding: 2px 8px 0; background: rgba(var(--orn-rgb), 0.16); font-weight: 700; font-size: 12px; color: var(--ivory-2);
}
.dist-row.is-today .dist-bar { background: var(--metal); color: var(--metal-ink); }

/* credits */
.credits { text-align: center; padding: 26px 18px 22px; }
.credits .wordmark { font-size: 34px; }
.crew { list-style: none; margin: 24px 0 4px; padding: 0; display: grid; gap: 20px; }
.crew li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crew .name { font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: 0.04em; color: var(--ivory); }

/* My Player */
.player-card { display: flex; align-items: center; gap: 18px; padding: 18px 20px; }
/* Title medals (drawn in art.js) */
.insignia-wrap { display: grid; place-items: center; flex: none; width: 44px; height: 44px; }
.insignia-wrap .insignia { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45)); }
.insignia-wrap.lg { width: 84px; height: 84px; }
.insignia-wrap.lg .insignia { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55)); }
.insignia-wrap.is-none .insignia { opacity: 0.75; }
.pl-id { flex: 1; min-width: 0; }
.pl-tier { margin-top: 5px; font-family: var(--display); font-size: 32px; line-height: 1; color: var(--ivory); }
.pl-next { margin-top: 6px; font-size: 13px; color: var(--ivory-2); }
.pl-id .progress { display: block; height: 4px; margin-top: 9px; border-radius: 2px; background: var(--rule-soft); overflow: hidden; }
.pl-id .progress i { display: block; height: 100%; background: var(--orn); }
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; }

.perf { padding: 14px 14px 10px; }
.perf-chart { position: relative; }
.pc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.pc-grid { stroke: var(--rule-faint); stroke-width: 1; }
.pc-ylab { fill: var(--muted); font-family: var(--ui); font-weight: 600; font-size: 10px; text-anchor: end; dominant-baseline: central; }
.pc-xlab { fill: var(--muted); font-family: var(--ui); font-weight: 600; font-size: 10px; }
.pc-area { fill: rgba(var(--orn-rgb), 0.1); }
.pc-line { fill: none; stroke: var(--orn); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pc-avg { stroke: var(--ivory-2); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.55; }
.pc-avg-lab {
  fill: var(--ivory-2); font-family: var(--ui); font-weight: 700; font-size: 10px; letter-spacing: 0.06em; text-anchor: start;
  paint-order: stroke; stroke: var(--ink-2); stroke-width: 3px; stroke-linejoin: round;
}
.pc-dot { fill: var(--ink-1); stroke: var(--orn-hi); stroke-width: 2; }
.pc-dot.is-on { fill: var(--orn-hi); }
.pc-cross { stroke: var(--rule); stroke-width: 1; }
.pc-hit { fill: transparent; cursor: crosshair; }
.perf-note { margin: 8px 0 2px; text-align: center; font-size: 13px; color: var(--ivory-2); }
.perf-note b { color: var(--ivory); }

.haul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.haul-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px 10px; text-align: center; }
.haul-tile .loot { width: 32px; height: 32px; }
.haul-tile .loot .emo { font-size: 17px; }
.haul-tile b { font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1; padding-top: 2px; }
.haul-tile > span:not(.loot) { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ivory-2); line-height: 1.3; }
.haul-tile small { font-size: 10.5px; color: var(--muted); }
.pl-ranks { margin: 0; text-align: center; font-size: 14px; color: var(--ivory-2); }
.pl-ranks b { color: var(--orn-hi); }

.recent { display: grid; gap: 6px; }
.recent-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  width: 100%; padding: 11px 14px 9px; text-align: left; cursor: pointer; color: var(--ivory);
}
.recent-row:hover { border-color: var(--orn); }
.rr-cat { display: block; font-family: var(--display); font-size: 18px; line-height: 1.05; }
.rr-date { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.rr-score { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rr-score b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ivory); }
.rr-score small { display: block; font-weight: 700; color: var(--orn); }

/* ---------- accounts & friends ------------------------------------------- */

/* Avatar: the Google photo, or a brass coin with an initial */
.avatar {
  --av: 28px;
  display: inline-grid; place-items: center; flex: none; width: var(--av); height: var(--av);
  border-radius: 50%; overflow: hidden; padding-top: 0.12em;
  background: var(--metal); color: var(--metal-ink);
  font-family: var(--display); font-size: calc(var(--av) * 0.46); line-height: 1;
  box-shadow: 0 0 0 1px var(--rule), 0 2px 6px rgba(0, 0, 0, 0.45);
}
.avatar:has(img) { padding: 0; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar .ic { width: 58%; height: 58%; margin-top: -0.12em; }
.avatar.md { --av: 40px; }
.avatar.lg { --av: 60px; }

.badge-dot {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 3px 6px 0; border-radius: 999px;
  background: var(--metal); color: var(--metal-ink); font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--ink-1), 0 0 12px rgba(var(--orn-rgb), 0.45);
}
#btn-menu.has-badge::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--orn-hi); box-shadow: 0 0 0 2px var(--ink-1), 0 0 8px rgba(var(--orn-rgb), 0.9);
}

/* Menu: who you are, above today's vault */
.menu-account {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 10px; padding: 12px 14px 10px 12px;
  text-align: left; cursor: pointer; color: var(--ivory); transition: border-color 0.15s, background 0.15s;
}
.menu-account:hover { border-color: var(--orn); background: rgba(var(--orn-rgb), 0.07); }
.ma-text { flex: 1; min-width: 0; padding-top: 2px; }
.ma-text b { display: block; font-weight: 600; font-size: 14px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-text small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.menu-account > .ic { color: var(--orn); }
.tile .badge-dot { position: absolute; top: 12px; right: 12px; }
/* An odd tile out runs the full width, laid out sideways */
.tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.tiles .tile:last-child:nth-child(odd) small { margin-top: 2px; }

/* Vault report: how your friends did */
.friends-card { padding: 14px 16px 10px; margin-bottom: 14px; }
.friends-card:empty { display: none; }
.fc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.fc-sub { margin: 6px 0 4px; font-size: 12.5px; color: var(--muted); }
.fc-empty { margin: 10px 0 6px; font-size: 13.5px; line-height: 1.6; color: var(--ivory-2); }
.fc-empty b { color: var(--orn-hi); letter-spacing: 0.08em; white-space: nowrap; }
.fc-cta { width: auto; margin: 6px 0 6px; }
.fr-list { display: grid; grid-template-columns: minmax(0, 1fr); container-type: inline-size; }
/* Narrow leaderboards: names and titles first; the loot is one tap away */
@container (max-width: 560px) {
  .fr-row .medal-row.mini { display: none; }
}
.fr-row + .fr-row { border-top: 1px solid var(--rule-soft); }
.fr-row > summary, .fr-row.is-waiting { display: flex; align-items: center; gap: 10px; padding: 10px 2px 8px 6px; }
.fr-rank { flex: none; width: 14px; margin-right: -2px; padding-top: 3px; text-align: center; font-family: var(--display); font-size: 15px; line-height: 1; color: var(--orn); }
.fr-row.is-you > summary, .fr-row.is-you.is-waiting {
  background: linear-gradient(90deg, rgba(var(--orn-rgb), 0.12), rgba(var(--orn-rgb), 0) 85%); border-radius: var(--r-sm);
}

/* Player titles beside names: a small badge in the title's colour */
.ptitle {
  display: inline-flex; align-items: center; justify-content: center; position: relative; top: -1px;
  margin-left: 7px; padding: 4px 7px 2px; border-radius: 4px; vertical-align: middle;
  font-family: var(--ui); font-style: normal; font-weight: 700; font-size: 9px; line-height: 1;
  letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.pt-rookie { background: #5B6272; color: #F3F5F8; }
/* Each badge wears the colours of the finish it unlocks */
.pt-lookout { background: #121214; color: #EFE6D4; box-shadow: inset 0 0 0 1px rgba(239, 230, 212, 0.55), 0 1px 2px rgba(0, 0, 0, 0.35); } /* Noir */
.pt-infiltrator { background: #9EE5B1; color: #0D3B1F; } /* Emerald */
.pt-safecracker { background: #7A4BD0; color: #F6F0FF; }
.pt-mastermind {
  background: linear-gradient(180deg, #FFE7A6 0%, #F2C14E 55%, #C9921E 100%); color: #2A1B03;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 10px rgba(242, 193, 78, 0.35);
}
.pt-admin { background: #8E1F27; color: #FFEDEE; }
/* My Player: the title as a nameplate */
.pl-tier .ptitle {
  top: 0; margin: 2px 0 0; padding: 7px 14px 3px; border-radius: 6px;
  font-family: var(--display); font-size: 26px; font-weight: 400; letter-spacing: 0.02em; text-transform: none;
}
.tr-title .ptitle, .fin-needs .ptitle { margin-left: 0; }
/* A name and its badge: the name truncates first; with no room left the badge
   wraps under it instead of being cut off */
.name-tag { display: flex; flex-wrap: wrap; align-items: center; column-gap: 7px; row-gap: 4px; min-width: 0; }
.nt-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-tag .ptitle, .name-tag .you-tag { flex: none; margin: 0; top: 0; }
/* Your card on the Friends page: centred beside your name, a little larger (never bigger than the name) */
.me-name { display: flex; align-items: center; gap: 10px; }
.me-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name .ptitle { flex: none; margin: 0; top: 0; padding: 6px 10px 4px; font-size: 11px; border-radius: 5px; }
.you-tag {
  margin-left: 7px; padding: 2px 6px 1px; border-radius: 3px; background: var(--metal); color: var(--metal-ink);
  font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; vertical-align: 2px;
}
.fr-row > summary { cursor: pointer; list-style: none; }
.fr-row > summary::-webkit-details-marker { display: none; }
.fr-row > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 3px 3px 2px;
  border-right: 1.5px solid var(--orn); border-bottom: 1.5px solid var(--orn);
  transform: rotate(45deg); transition: transform 0.2s var(--ease);
}
.fr-row[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
/* Friends page: rankings already open, so no deal-in when the list refreshes */
.fr-row.is-shown .fr-board { animation: none; }
.fr-row > summary:hover .fr-name { color: var(--orn-hi); }
.fr-name { flex: 1; min-width: 0; padding-top: 2px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.fr-name small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.fr-wait { font-size: 12px; font-weight: 600; color: var(--dim); text-align: right; }
.is-waiting .avatar { filter: grayscale(0.7); opacity: 0.7; }
.fr-score { min-width: 62px; text-align: right; white-space: nowrap; font-size: 12px; color: var(--muted); }
.fr-score b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ivory); }
.fr-score small { display: block; margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--dim); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.fr-board { list-style: none; margin: 0 0 12px; padding: 2px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; animation: dealIn 0.3s var(--ease) both; }
.fr-board li {
  display: grid; grid-template-columns: 28px 20px minmax(0, 1fr) auto 34px; gap: 9px; align-items: center;
  padding: 5px 9px 4px 6px; border-radius: var(--r-sm); background: rgba(var(--ink-2-rgb), 0.9); border: 1px solid var(--rule-faint);
  font-size: 13px;
}
.fr-board .plate { min-width: 26px; height: 21px; padding: 2px 5px 0; font-size: 13px; }
.fr-board .emo { font-size: 17px; }
.fr-board .nm { padding-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-board .loot { width: 22px; height: 22px; }
.fr-board .loot .emo { font-size: 12px; }
.fr-board b { padding-top: 2px; text-align: right; font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--orn-hi); }

/* Friends sheet */
.invite-note {
  margin: 0 0 14px; padding: 11px 14px 9px; border-radius: var(--r-sm); text-align: center;
  background: rgba(var(--orn-rgb), 0.08); border: 1px solid var(--rule-soft); font-size: 13.5px; color: var(--ivory-2);
}
.invite-note b { color: var(--orn-hi); letter-spacing: 0.1em; white-space: nowrap; }
.signin-slot { display: grid; justify-items: center; gap: 10px; min-height: 48px; margin: 8px 0 4px; }
.signin-slot .rc-loading { width: min(260px, 100%); }
/* Google's button frame is a light page: matching its colour scheme keeps the frame
   transparent (otherwise Chrome paints a white box around the dark pill). */
.signin-slot iframe { color-scheme: light; }
.fine { margin: 12px 0 0; text-align: center; font-size: 12px; line-height: 1.6; color: var(--dim); }
.signin-slot .fine { margin: 0; }
.fine a { color: var(--muted); text-underline-offset: 3px; }
.fine a:hover { color: var(--ivory); }

.me-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.me-text { flex: 1; min-width: 0; }
.me-name { margin-top: 5px; font-family: var(--display); font-size: 26px; line-height: 1.05; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-code { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.me-code b { color: var(--orn-hi); font-size: 14px; letter-spacing: 0.14em; white-space: nowrap; }
.save-status { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.save-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.save-status[data-state="saved"]::before { background: var(--orn-hi); box-shadow: 0 0 8px rgba(var(--orn-rgb), 0.8); }
.save-status[data-state="saving"]::before { background: var(--orn); animation: livePulse 1s ease-in-out infinite; }
.save-status[data-state="error"] { color: #D98A8E; }
.save-status[data-state="error"]::before { background: var(--ruby); }

/* Username: pick one right after signing in, change it any time */
.name-card { margin-top: 10px; padding: 14px 14px 4px; border-radius: var(--r-sm); border: 1px solid var(--rule-soft); background: rgba(var(--ink-2-rgb), 0.9); }
.name-card.is-new { border-color: var(--rule); background: linear-gradient(180deg, rgba(var(--orn-rgb), 0.1), rgba(var(--ink-2-rgb), 0.9)); }
.name-card > p:not(.fine) { margin: 6px 0 12px; font-size: 13px; line-height: 1.55; color: var(--ivory-2); }
.name-card .fine { margin-top: 8px; text-align: left; }
.fp-name small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.me-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.me-actions .btn { padding: 3px 8px 0; letter-spacing: 0.16em; white-space: nowrap; }

.add-friend, .dev-login, .name-form { display: flex; gap: 8px; width: 100%; }
.add-friend .btn, .dev-login .btn, .name-form .btn { width: auto; flex: none; }
.text-in {
  flex: 1; min-width: 0; height: 40px; padding: 3px 14px 0; border-radius: var(--r-sm);
  border: 1px solid var(--rule); background: rgba(var(--ink-0-rgb), 0.6); color: var(--ivory);
  font-family: var(--ui); font-weight: 600; font-size: 16px; letter-spacing: 0.08em;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.text-in::placeholder { color: var(--dim); text-transform: none; }
.text-in:focus, .text-in:focus-visible { outline: none; border-color: var(--orn); box-shadow: 0 0 0 3px rgba(var(--orn-rgb), 0.18); }

.fp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.fp-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: var(--r-sm);
  background: rgba(var(--ink-2-rgb), 0.9); border: 1px solid var(--rule-soft);
}
.fp-name { flex: 1; min-width: 0; padding-top: 2px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.fp-pending { padding: 2px 4px 0; font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.btn-xs { width: auto; min-height: 30px; padding: 3px 11px 0; font-size: 10px; letter-spacing: 0.18em; }
.btn-xs.btn-line::before { inset: 3px; }
.btn.is-armed { background: rgba(var(--ruby-rgb), 0.14); color: #FFB9BB; box-shadow: inset 0 0 0 1px rgba(var(--ruby-rgb), 0.6); }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--ui); font-weight: 600; font-size: 12px;
  letter-spacing: 0.06em; color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ivory); }
.link-btn.danger { color: #D98A8E; }
.link-btn.danger:hover { color: #FFB9BB; }
.acct-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--rule-soft); }

@media (max-width: 479px) {
  .fr-row .medal-row.mini { display: none; }
}

/* Version stamp, bottom-right of the main screen */
.version {
  position: fixed; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2; pointer-events: none;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim);
}
body:not([data-screen="lobby"]) .version { display: none; }
@media (max-width: 919px) {
  /* Phones: sit at the bottom-right of the page instead of floating over the buttons */
  .version { position: relative; right: auto; bottom: auto; text-align: right; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
}

/* ---------- intro countdown ---------------------------------------------- */

.intro {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(var(--ink-2-rgb), 0.92), rgba(var(--ink-0-rgb), 0.98));
}
.intro .in-cat { margin-top: 10px; font-family: var(--display); font-size: clamp(34px, 9vw, 52px); line-height: 1; color: var(--ivory); }
.intro .in-q { margin: 12px auto 0; max-width: 300px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
/* Solid colour on purpose: gradient-clipped text can vanish while it animates in Chrome. */
.intro .in-count {
  min-height: 1em; margin-top: 26px; font-family: var(--display); font-size: 92px; line-height: 1; color: var(--orn-hi);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 46px rgba(var(--orn-rgb), 0.55);
}
.intro .in-count.pop { animation: countPop 0.42s var(--spring); }
@keyframes countPop { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- toast & confetti ------------------------------------------- */

.toast {
  position: fixed; left: 50%; top: 14px; z-index: 100; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px; padding: 11px 16px 9px;
  transform: translate(-50%, -24px); opacity: 0; pointer-events: none;
  background: var(--ink-1); color: var(--ivory); border: 1px solid var(--rule); border-radius: var(--r-sm);
  box-shadow: 0 0 0 3px var(--ink-1), 0 0 0 4px var(--rule-soft), 0 14px 34px rgba(0, 0, 0, 0.55);
  font-weight: 600; font-size: 13.5px; letter-spacing: 0.02em; transition: transform 0.25s var(--ease), opacity 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .t-kick { display: block; color: var(--orn); font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; }

.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -24px; border-radius: 1px; }

/* ---------- responsive --------------------------------------------------- */

@media (max-width: 919px) {
  .topbar { height: 58px; }
  .dial { width: 96px; height: 96px; }
  .dial .emo { font-size: 40px; }
  .valuable { gap: 16px; padding: 16px 16px 18px; background: radial-gradient(circle at 64px 50%, rgba(var(--orn-rgb), 0.14), transparent 120px), var(--panel); }

  /* Phones: keep the valuable pinned while the boxes scroll under it.
     (Block layout, because a sticky grid item can't leave its own row.) */
  .game { display: block; }
  .game > * + * { margin-top: 18px; }
  body.is-playing .col-left, body.is-revealing .col-left {
    position: sticky; top: 0; z-index: 15; margin: 0 -16px; padding: 8px 16px 6px;
    transition: background-color 0.2s, box-shadow 0.2s;
  }
  body.is-scrolled.is-playing .col-left, body.is-scrolled.is-revealing .col-left {
    background-color: rgba(var(--ink-1-rgb), 0.97);
    box-shadow: 0 1px 0 var(--rule-soft), 0 14px 26px -14px rgba(0, 0, 0, 0.95);
  }

  .actionbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    padding: 20px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--ink-1) 62%, rgba(var(--ink-1-rgb), 0));
  }
  .actionbar .btn { display: flex; max-width: 508px; margin: 0 auto; }
  .actionbar .key { display: none; }
}

@media (min-width: 920px) {
  .topbar { padding: 0 28px; }
  .game {
    max-width: 1040px; padding: 6px 28px 64px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 44px; row-gap: 30px; align-items: start;
  }
  .col-left { position: sticky; top: 16px; }
  body.is-done .col-left { position: static; }
  .answers { grid-column: 1 / -1; }
  .answers-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 44px; }
  .dial { width: 124px; height: 124px; }
  .dial .emo { font-size: 54px; }
  .valuable { padding: 22px 22px 24px; gap: 22px; }
  .val-name { font-size: clamp(24px, 2.4vw, 31px); }
  :root { --door: min(54vh, 500px); }
}

@media (max-width: 430px) {
  .wide-only { display: none; }
  .rp-score { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rp-title { text-align: left; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .rp-title .t-line { flex-basis: 100%; margin-top: 0; }
  .recent-row .medal-row { display: none; }
  .player-card { gap: 14px; padding: 16px; }
  .insignia-wrap.lg { width: 68px; height: 68px; }
  .haul-tile small { font-size: 10px; }
  .stat b { font-size: 18px; }
  .stat span { font-size: 8px; letter-spacing: 0.1em; }
  .rp-big { font-size: 56px; }
  .legend { margin-left: 0; }
}

@media (max-height: 700px) and (max-width: 919px) {
  :root { --box-h: 42px; }
  .dial { width: 84px; height: 84px; }
  .dial .emo { font-size: 34px; }
  .valuable { padding: 12px 14px 15px; }
}

@media (max-width: 599px) {
  .sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 90dvh;
    border-radius: 14px 14px 0 0; border-bottom: 0;
  }
  .sheet[open] { animation: sheetUp 0.32s var(--ease); }
  @keyframes sheetUp { from { transform: translateY(40%); opacity: 0.4; } }
}

/* ---------- multiplayer --------------------------------------------------- */

/* Menu: Multiplayer and Credits each run the full width, laid out sideways */
.tiles .tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
.tiles .tile.wide small { margin-top: 2px; }

/* The party code */
.mp-code { padding: 18px 18px 16px; text-align: center; }
.mp-code-value {
  margin: 8px 0 14px; padding-left: 0.22em; font-family: var(--display); font-size: 46px; line-height: 1; letter-spacing: 0.22em;
  color: var(--orn-hi); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--orn-rgb), 0.35);
}
.mp-code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-code-actions .btn { white-space: nowrap; }
.mp-start { margin: 4px 0 6px; }
.mp-go { margin-top: 12px; }
.mp-code-in { text-transform: uppercase; letter-spacing: 0.3em; }
.mp-code-in::placeholder { letter-spacing: 0.08em; }

/* Seats */
.fp-row.is-away { opacity: 0.6; }
.mp-seat-open {
  padding: 11px 12px 9px; border-radius: var(--r-sm); border: 1px dashed var(--rule-soft); text-align: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim);
}
.host-tag {
  flex: none; padding: 2px 6px 1px; border-radius: 3px; border: 1px solid var(--orn); color: var(--orn-hi);
  font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}

/* Picking the vault */
.mp-packs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-pack {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px 10px; text-align: left; cursor: pointer;
  color: var(--ivory); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.mp-pack:hover { border-color: var(--orn); background: rgba(var(--orn-rgb), 0.06); }
.mp-pack.is-on {
  border-color: var(--orn-hi); box-shadow: 0 0 0 1px var(--orn-hi);
  background: linear-gradient(180deg, rgba(var(--orn-rgb), 0.16), rgba(var(--ink-2-rgb), 0.92));
}
.mp-pack b { display: block; font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; }
.mp-pack small { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.mp-pack-emo { display: grid; place-items: center; flex: none; width: 36px; height: 36px; font-size: 24px; }
.mp-pack-emo .ic { width: 26px; height: 26px; color: var(--orn); }
.mp-packs.is-view { grid-template-columns: 1fr; }
.mp-packs.is-view .mp-pack { cursor: default; }
.mp-waiting { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; padding: 12px; font-size: 13px; color: var(--ivory-2); }
.mp-waiting .live {
  flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 8px rgba(var(--gold-rgb), 0.9); animation: livePulse 1.8s ease-in-out infinite;
}
.mp-live { margin-top: 18px; text-align: center; }
.mp-live h2 { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.05; }
.mp-live p { margin: 8px 0 14px; color: var(--ivory-2); font-size: 13.5px; }
.mp-foot { margin-top: 22px; text-align: center; }
.mp-last { margin-bottom: 14px; padding: 14px 16px 12px; }
.mp-last ol { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 6px; }
.mp-last li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.mp-last .plate { min-width: 26px; height: 22px; font-size: 14px; }
.mp-last-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 2px; font-weight: 600; }
.mp-last li b { font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--orn-hi); }

/* ---------- the party game ---------- */

/* A box a player never filled (they stepped away mid-game) */
.loot.loot-none { background: none; box-shadow: inset 0 0 0 1px var(--rule-soft); }
.fr-board li.is-empty .nm { color: var(--dim); }
.avatar.xs { --av: 22px; box-shadow: 0 0 0 1px var(--rule), 0 1px 3px rgba(0, 0, 0, 0.5); }
.avatar.is-me { box-shadow: 0 0 0 2px var(--orn-hi), 0 0 10px rgba(var(--orn-rgb), 0.6); }
.avatar.is-auto { filter: grayscale(0.6); opacity: 0.75; }

/* Who's locked in */
.pg-players { margin-top: 12px; }
.pg-roster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-roster li {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 10px 3px 4px; border-radius: 999px;
  background: rgba(var(--ink-2-rgb), 0.9); border: 1px solid var(--rule-soft); font-size: 12px; font-weight: 600; color: var(--ivory-2);
  transition: border-color 0.2s, color 0.2s;
}
.pg-roster li.is-in { border-color: var(--rule); color: var(--ivory); }
.pg-roster li.is-you { border-color: var(--orn); }
.pg-roster li.is-away { opacity: 0.55; }
.pg-nm { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 2px; }
.pg-st { display: inline-flex; align-items: center; min-width: 14px; }
.pg-st .ic { width: 14px; height: 14px; color: var(--orn-hi); }
.pg-st b { padding-top: 2px; font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--orn-hi); }
.pg-dots { display: inline-flex; gap: 2px; }
.pg-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); animation: pgDot 1.2s ease-in-out infinite; }
.pg-dots i:nth-child(2) { animation-delay: 0.2s; }
.pg-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes pgDot { 50% { background: var(--orn-hi); transform: translateY(-2px); } }
.pg-wait { margin: 8px 0 0; min-height: 1.2em; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.pg-wait.is-in { color: var(--orn-hi); }

/* Get ready */
.pg-ready { text-align: center; padding: 24px 20px 18px; }
.pg-ready h2 { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 6vw, 38px); line-height: 1.05; }
.pg-ready p { margin: 10px auto 0; max-width: 340px; color: var(--muted); font-size: 13.5px; }
.pg-ready p b { color: var(--ivory); }
.pg-ready .in-count {
  min-height: 1em; margin-top: 12px; font-family: var(--display); font-size: 72px; line-height: 1; color: var(--orn-hi);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 46px rgba(var(--orn-rgb), 0.55);
}
.pg-ready .in-count.pop { animation: countPop 0.42s var(--spring); }

/* Where everyone put it */
.pg-reveal { padding: 18px 18px 14px; }
.pg-rv-item { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; }
.pg-rv-item .emo { flex: none; font-size: 40px; }
.pg-rv-item h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.05; }
.pg-rv-item p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.pg-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.pg-track li {
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 5px 0 7px;
  border-radius: var(--r-sm); background: rgba(var(--ink-0-rgb), 0.35); border: 1px solid var(--rule-faint);
}
.pg-track li.has { border-color: var(--rule-soft); background: rgba(var(--orn-rgb), 0.06); }
.pg-track li.mine { border-color: var(--orn); background: rgba(var(--orn-rgb), 0.13); }
.pg-slot { padding-top: 2px; font-family: var(--display); font-size: 14px; line-height: 1; color: var(--orn); }
.pg-track li.has .pg-slot { color: var(--orn-hi); }
.pg-who { display: flex; flex-direction: column; align-items: center; }
.pg-who .avatar + .avatar { margin-top: -6px; }
.pg-rv-note { margin: 12px 0 10px; text-align: center; font-size: 13px; color: var(--ivory-2); }
.pg-timer { display: block; height: 3px; border-radius: 2px; background: var(--rule-faint); overflow: hidden; }
.pg-timer i { display: block; height: 100%; background: var(--orn); transform-origin: left; animation: pgTimer linear forwards; }
@keyframes pgTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.box.is-current { border-color: var(--orn-hi); box-shadow: 0 0 0 1px var(--orn-hi), 0 0 22px rgba(var(--orn-rgb), 0.35); }

/* Party results */
.pg-podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 18px 0 6px; }
.pg-step { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 31%; min-width: 0; }
.pg-step-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 2px; font-size: 13px; font-weight: 600; }
.pg-step.is-you .pg-step-name { color: var(--orn-hi); }
.pg-step-score { font-family: var(--display); font-size: 22px; line-height: 1; color: var(--ivory); }
.pg-step-base {
  display: grid; place-items: center; width: 100%; border-radius: 4px 4px 0 0; background: var(--metal); color: var(--metal-ink);
  font-family: var(--display); font-style: normal; font-size: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.pg-step.p1 .pg-step-base { height: 64px; }
.pg-step.p2 .pg-step-base { height: 44px; filter: saturate(0.15) brightness(1.08); }
.pg-step.p3 .pg-step-base { height: 30px; filter: sepia(0.5) hue-rotate(-18deg) saturate(1.3) brightness(0.82); }
.pg-podium.solo .pg-step { width: 40%; }
.pg-awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pg-award { padding: 11px 12px 9px; text-align: center; }
.pg-award b { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pg-award small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.pg-standings { margin-top: 4px; }
.pg-order { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule-soft); }
.pg-order summary { padding: 6px 0; cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--orn); }
.pg-order ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.pg-order li { display: grid; grid-template-columns: 30px 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.pg-order .plate { min-width: 26px; height: 22px; font-size: 14px; }
.pg-order .emo { font-size: 18px; }
.pg-order .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 2px; font-weight: 600; }
.pg-order .val { padding-top: 2px; text-align: right; font-size: 12px; color: var(--muted); }
.pg-source { margin: 8px 0 0; font-size: 11px; color: var(--dim); }
.pg-again { margin-top: 16px; }

@media (max-width: 919px) {
  /* Phones: the item and who's locked in stay pinned while the boxes scroll under them */
  .party-game.is-live .col-left {
    position: sticky; top: 0; z-index: 15; margin: 0 -16px; padding: 8px 16px 6px;
    transition: background-color 0.2s, box-shadow 0.2s;
  }
  body.is-scrolled .party-game.is-live .col-left {
    background-color: rgba(var(--ink-1-rgb), 0.97);
    box-shadow: 0 1px 0 var(--rule-soft), 0 14px 26px -14px rgba(0, 0, 0, 0.95);
  }
  .party-game .pg-players { margin-top: 8px; }
  .pg-order li { grid-template-columns: 30px 26px minmax(0, 1fr); }
  .pg-order .val { grid-column: 3; margin-top: -4px; text-align: left; }
}
@media (max-width: 480px) {
  .mp-code-actions { grid-template-columns: 1fr; }
  /* Invites: the buttons go under the name */
  .mp-invite { flex-wrap: wrap; }
  .mp-invite .fp-name { flex-basis: calc(100% - 40px); }
  .mp-invite .fp-actions { flex-basis: 100%; justify-content: flex-end; }
}
@media (max-width: 430px) {
  .mp-packs { grid-template-columns: 1fr; }
  .mp-code-value { font-size: 40px; }
  .pg-rv-item .emo { font-size: 32px; }
}

/* ---------- the Archive Pass ---------------------------------------------- */

.pass-card { margin-bottom: 16px; padding: 18px 18px 14px; text-align: center; }
.pass-card.nudge { animation: passNudge 0.6s var(--spring); }
@keyframes passNudge { 35% { transform: scale(1.025); box-shadow: 0 0 0 1px var(--orn-hi), 0 0 30px rgba(var(--orn-rgb), 0.35); } }
.pass-price { margin: 6px 0 14px; }
.pass-price b { display: block; font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; color: var(--orn-hi); }
.pass-price small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.pass-perks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 9px; text-align: left; }
.pass-perks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.pass-perks .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--orn); }
.pass-perks b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ivory); }
.pass-perks small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.pass-note { margin: 0 0 8px; font-size: 12.5px; line-height: 1.55; color: var(--ivory-2); }
.pass-card .fine { margin-top: 10px; }
.vault-row.is-locked .vr-cat { color: var(--ivory-2); }
.vault-row .vr-lock { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.vault-row .vr-lock .ic { width: 13px; height: 13px; color: var(--orn); }

/* Unlimited mode */
.unlimited-card { margin-bottom: 16px; padding: 16px 18px; }
.unlimited-card h3 { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.05; color: var(--ivory); }
.unlimited-card h3 .ic { width: 26px; height: 26px; color: var(--orn-hi); }
.unlimited-card p { margin: 8px 0 12px; font-size: 13px; line-height: 1.55; color: var(--ivory-2); }
.unlimited-card .uc-stats { margin: -4px 0 12px; color: var(--muted); }
.uc-stats b, .ul-best b { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--orn-hi); }
.ul-best { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.pt-pass { background: linear-gradient(180deg, #FFFFFF 0%, #DCE3EA 55%, #A9B5C1 100%); color: #12161B; }

/* The Platinum finish (Archive Pass): brushed platinum on graphite */
body[data-finish="platinum"] {
  --ink-0: #07080A; --ink-1: #0E1014; --ink-2: #15181D; --ink-3: #1D2128; --ink-4: #2B3039;
  --ink-0-rgb: 7, 8, 10; --ink-1-rgb: 14, 16, 20; --ink-2-rgb: 21, 24, 29; --ink-3-rgb: 29, 33, 40;
  --orn: #C9D3DD; --orn-hi: #F2F6FA; --orn-lo: #7D8895; --orn-rgb: 201, 211, 221;
  --metal: linear-gradient(180deg, #FFFFFF 0%, #E3E9EF 40%, #B8C3CE 75%, #93A0AD 100%);
  --metal-ink: #12161B;
}
.finish[data-id="platinum"] { --sw-ink: #0E1014; --sw-ink-hi: #2B3039; --sw-orn: #C9D3DD; --sw-ray: rgba(201, 211, 221, 0.3); }

/* ---------- ads --------------------------------------------------------- */
/* Side rails in the margins of wide screens, a row at the bottom of each page.
   Never during a round, never for Archive Pass holders. */
.ad-rail, .ad-bottom { display: none; }
body.ads-on .ad-bottom:not([hidden]) { display: block; }
@media (min-width: 1440px) { body.ads-on .ad-rail:not([hidden]) { display: block; } }
body.is-playing .ad-rail, body.is-playing .ad-bottom,
body.is-revealing .ad-rail, body.is-revealing .ad-bottom,
body[data-screen="party-game"] .ad-rail, body[data-screen="party-game"] .ad-bottom { display: none !important; }
.ad-rail { position: fixed; top: 96px; z-index: 5; width: 160px; }
.ad-rail.left { left: 16px; }
.ad-rail.right { right: 16px; }
.ad-bottom { position: relative; z-index: 1; max-width: 728px; margin: 6px auto 34px; padding: 0 16px; }
.ad-label { display: block; margin-bottom: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); text-align: center; }
.house-ad { display: flex; align-items: center; gap: 14px; padding: 22px 16px 14px; }
.house-ad .ad-label { position: absolute; top: 7px; left: 14px; margin: 0; }
.house-ad.rail { flex-direction: column; gap: 10px; padding: 28px 12px 14px; text-align: center; }
.house-ad.rail .ad-label { left: 0; right: 0; }
.ha-art { flex: none; display: grid; place-items: center; width: 52px; height: 52px; color: var(--orn); }
.ha-art .ic { width: 34px; height: 34px; }
.house-ad.rail .ha-art { width: 78px; height: 78px; }
.house-ad.rail .ha-art .ic { width: 50px; height: 50px; }
.ha-text { flex: 1; min-width: 0; }
.ha-text b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.1; color: var(--ivory); }
.ha-text small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.house-ad .btn { flex: none; width: auto; }
.house-ad.rail .btn { width: 100%; }
.adsbygoogle.rail { min-height: 600px; }
.adsbygoogle.banner { min-height: 90px; }
@media (max-width: 560px) {
  .house-ad.banner { flex-wrap: wrap; }
  .house-ad.banner .ha-text { flex-basis: calc(100% - 66px); }
  .house-ad.banner .btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scene-dust { display: none; }
}
