:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --ink: #16161d;
  --ink-2: #4a4a57;
  --muted: #7b7a86;
  --card: #fffdf8;
  --accent: #ff5a36;
  --blue: #3d5afe;
  --lime: #c8f560;
  --yellow: #ffd23f;
  --pink: #ff3d8b;
  --green: #00b37e;
  --gold: #ffc531;
  --silver: #c9d2de;
  --bronze: #e39a5b;
  --surface: #fff;
  --on-bright: #16161d;
  --bar: #16161d;
  --dot: rgba(22, 22, 29, 0.09);
  --tint-blue: #eef0ff;
  --tint-red: #ffd9d0;
  --tint-win: #eaffd0;
  --tint-me: #fff8db;
  --tint-gold: #fff6d6;
  --border: rgba(22, 22, 29, 0.13);
  --border-strong: rgba(22, 22, 29, 0.28);
  --line: 1px solid var(--border);
  --shadow-sm: 0 1px 2px rgba(22, 22, 29, 0.06);
  --shadow: 0 1px 2px rgba(22, 22, 29, 0.05), 0 6px 18px rgba(22, 22, 29, 0.06);
  --shadow-lg: 0 2px 6px rgba(22, 22, 29, 0.06), 0 16px 40px rgba(22, 22, 29, 0.1);
  --r: 14px;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'Space Mono', ui-monospace, monospace;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --paper: #14141b;
  --paper-2: #262630;
  --ink: #ece8df;
  --ink-2: #b9b6c2;
  --muted: #8d8a98;
  --card: #1d1d26;
  --surface: #272733;
  --bar: #0b0b10;
  --dot: rgba(236, 232, 223, 0.07);
  --tint-blue: #1f2440;
  --tint-red: #4a2018;
  --tint-win: #1d3519;
  --tint-me: #3a3215;
  --tint-gold: #3a3215;
  --border: rgba(236, 232, 223, 0.12);
  --border-strong: rgba(236, 232, 223, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; font-weight: 800; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 600; color: var(--ink-2); }

/* ---------- primitives ---------- */
.card {
  background: var(--card);
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--line); border-radius: 12px; background: var(--card);
  padding: 11px 18px; font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(0.96); }
.btn:active:not(:disabled) { filter: brightness(0.9); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.danger { background: var(--tint-red); }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 0.9rem; border-radius: 10px; }
.btn.xs { padding: 4px 8px; font-size: 0.85rem; border-radius: 8px; box-shadow: var(--shadow-sm); }
.btn.huge { padding: 16px 28px; font-size: 1.25rem; border-radius: 14px; box-shadow: var(--shadow); }
.icon-btn { border: none; background: none; font-size: 1.2rem; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.field input, .picker input {
  border: var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); font-size: 1.1rem; font-weight: 600; width: 100%;
  outline: none; transition: box-shadow 0.15s;
}
.field input:focus, .picker input:focus { box-shadow: 0 0 0 4px rgba(61, 90, 254, 0.25); }
.grow { flex: 1; min-width: 0; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.av {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c, var(--paper-2)); border: var(--line);
  font-size: 1.5rem; line-height: 1;
}
.av.sm { width: 32px; height: 32px; font-size: 1.05rem; border-width: 2px; }
.tag { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; font-weight: 600; background: var(--surface); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- home ---------- */
.home-inner { max-width: 880px; margin: 0 auto; padding: 48px 16px 64px; display: grid; gap: 22px; }
.hero { text-align: center; display: grid; gap: 14px; justify-items: center; }
.logo { display: inline-flex; align-items: center; gap: 12px; position: relative; }
.logo-sticker {
  position: absolute; top: -18px; left: -34px; z-index: 2; 
  background: var(--accent); color: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: 1.15rem; padding: 2px 10px; letter-spacing: -0.01em;
}
.logo-w {
  font-family: var(--serif); font-weight: 600; font-size: 6.4rem; line-height: 0.8;
  background: var(--yellow); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: 1.2em; height: 1.2em; display: grid; place-items: center; padding-top: 0.08em;
}
.logo-text { font-weight: 800; font-size: 3.4rem; line-height: 0.85; text-align: left; letter-spacing: -0.04em; text-transform: uppercase; }
.tagline { font-size: 1.25rem; max-width: 520px; margin: 0; color: var(--ink-2); }
.tagline em { font-style: normal; background: var(--lime); padding: 0 4px; border-radius: 4px; color: var(--on-bright); }

.profile-card { display: grid; gap: 16px; }
.profile-row { display: flex; gap: 16px; align-items: flex-end; }
.avatar-btn {
  width: 74px; height: 74px; border-radius: 50%; border: var(--line); background: var(--yellow); box-shadow: var(--shadow);
  font-size: 2.6rem; display: grid; place-items: center; transition: transform 0.15s; flex: none;
}
.avatar-btn:hover {  }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.av-opt {
  aspect-ratio: 1; border: 2px solid transparent; border-radius: 12px; background: var(--paper);
  font-size: 1.5rem; display: grid; place-items: center; transition: transform 0.12s, background 0.12s;
}
.av-opt:hover { transform: scale(1.12); background: var(--surface); border-color: var(--ink); }
.av-opt.on { background: var(--yellow); border-color: var(--ink); box-shadow: var(--shadow-sm); transform: scale(1.06); }

.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.join-card, .host-card { display: grid; gap: 14px; align-content: start; }
.host-card { background: var(--tint-blue); }
.host-card p { margin: 0; }
.host-card .btn { margin-top: auto; }
.code-input { font-family: var(--mono) !important; letter-spacing: 0.4em; text-transform: uppercase; font-size: 1.6rem !important; text-align: center; }

.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.how div { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 0.92rem; color: var(--ink-2); }
.how b {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center;
  background: var(--card); color: var(--ink); font-size: 0.9rem;
}

/* ---------- game bar ---------- */
.gamebar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; background: var(--paper); border-bottom: var(--line);
}
.mini-logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.mini-logo em { font-style: normal; color: var(--accent); }
.mini-logo span { font-family: var(--serif); background: var(--yellow); border: 1px solid var(--border); border-radius: 7px; padding: 0 5px; margin-right: 2px; }
.code-chip {
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 4px 12px; font-family: var(--mono); font-size: 1rem; letter-spacing: 0.15em;
}
.code-chip small { font-family: var(--display); letter-spacing: 0; color: var(--muted); font-weight: 600; margin-right: 4px; }
.gamebar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.conn { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--border); margin-right: 6px; }
.conn.ok { background: var(--green); }
.conn.bad { background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- lobby ---------- */
.lobby-grid {
  max-width: 1180px; margin: 0 auto; padding: 24px 16px 120px;
  display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start;
}
.code-card { text-align: center; display: grid; gap: 10px; background: var(--yellow); }
.big-code { display: flex; justify-content: center; gap: 8px; }
.big-code span {
  font-family: var(--mono); font-size: 2.7rem; width: 1.3em; height: 1.55em; display: grid; place-items: center;
  background: var(--surface); border: var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.animate .big-code span { animation: drop 0.5s cubic-bezier(0.3, 1.6, 0.6, 1) both; animation-delay: calc(var(--i) * 0.07s); }
@keyframes drop { from { transform: translateY(-6px); opacity: 0; } }
.code-actions { display: flex; justify-content: center; }
.share-url { word-break: break-all; color: var(--ink-2); }

.players-card { grid-column: 1; }
.players-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.count { background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 0.85rem; padding: 2px 9px; }
.players { display: grid; gap: 8px; }
.player { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 12px; }
.player.enter { animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.6, 1); }
.player.is-me { background: var(--paper); }
.player.offline { opacity: 0.4; }
.player.ghost .av { background: transparent; border-style: dashed; color: var(--muted); }
.player .pname { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.pscore { font-family: var(--mono); font-size: 0.95rem; }
.pactions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.player:hover .pactions { opacity: 1; }
.xbtn { border: none; background: none; padding: 4px 6px; border-radius: 6px; font-size: 0.85rem; }
.xbtn:hover { background: rgba(0, 0, 0, 0.08); }
.av-edit { position: relative; padding: 0; cursor: pointer; transition: transform 0.15s; }
.av-edit:hover { transform: scale(1.05); }
.av-edit i {
  position: absolute; right: -5px; bottom: -4px; font-style: normal; font-size: 0.65rem; background: var(--ink); color: var(--paper);
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--card);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

.setup-card { grid-column: 2; grid-row: 1 / span 3; display: grid; gap: 18px; }
.setup-card h2 small { font-size: 0.85rem; font-weight: 400; letter-spacing: 0; }
.matchup { display: grid; gap: 10px; position: relative; }
.page-card {
  position: relative; display: flex; gap: 14px; align-items: center; padding: 14px; padding-top: 18px;
  border: var(--line); border-radius: 14px; background: var(--surface); min-height: 104px;
}
.slot-label {
  position: absolute; top: -12px; left: 14px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; background: var(--lime);
}
.slot-label.target { background: var(--accent); color: #fff; }
.pc-thumb { width: 72px; height: 72px; flex: none; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); background: var(--paper-2); }
.pc-thumb.none { display: grid; place-items: center; font-size: 2rem; }
.pc-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pc-text b { font-size: 1.3rem; line-height: 1.15; }
.pc-text small { color: var(--ink-2); font-size: 0.9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-text .warn { color: var(--accent); font-weight: 600; }
.pc-actions { display: flex; flex-direction: column; gap: 6px; }
.swap {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: var(--line); background: var(--yellow); font-weight: 800; font-size: 1.1rem;
  box-shadow: var(--shadow-sm); transition: transform 0.2s;
}
.swap:hover { transform: translate(-50%, -50%) rotate(180deg); }
.shimmer { background: linear-gradient(90deg, var(--paper-2), var(--surface), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1s infinite linear; border-radius: 6px; }
.shimmer.line { height: 18px; }
.shimmer.line.short { width: 60%; height: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.settings { display: grid; gap: 14px; }
.setting-label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: 6px; }
.lvl-easy { --lvl: #c8f560; }
.lvl-medium { --lvl: #ffd23f; }
.lvl-hard { --lvl: #ff9a5a; }
.lvl-chaos { --lvl: #c58bff; }
.lvl-tag {
  display: inline-block; vertical-align: middle; background: var(--lvl); color: var(--on-bright); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 10px; font-size: 0.85rem; font-weight: 700; letter-spacing: 0;
}
.plan { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-chip {
  position: relative; display: grid; justify-items: center; gap: 0; min-width: 64px; padding: 6px 8px 5px;
  background: var(--lvl); border: 1px solid var(--border); border-radius: 12px; font: inherit; line-height: 1.1;
}
button.plan-chip { box-shadow: var(--shadow-sm); transition: transform 0.1s; }
button.plan-chip:hover {  }
.plan-chip small { font-family: var(--mono); font-size: 0.7rem; }
.plan-chip span { font-size: 1.3rem; }
.plan-chip b { font-size: 0.75rem; }
.plan-chip i {
  position: absolute; top: -9px; right: -8px; font-style: normal; font-weight: 800; font-size: 0.7rem; background: var(--accent); color: #fff;
  border: 1px solid var(--border); border-radius: 999px; padding: 0 5px;
}
.plan-chip.done { opacity: 0.4; filter: grayscale(0.6); }
.plan-chip.done small::after { content: ' ✓'; }
.plan-chip.next { outline: 3px solid var(--blue); outline-offset: 2px; }
.fills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.85rem; color: var(--ink-2); }
.all-done { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0 4px; }
.all-done .big-emoji { font-size: 3.5rem; }
.next-up { margin: 0; font-size: 1.1rem; }
.waiting .plan { justify-content: center; }
.cd-final { background: var(--accent); color: #fff; font-weight: 800; padding: 6px 16px; border-radius: 999px; border: 2px solid #fff; animation: pulse-final 0.8s infinite alternate; }
@keyframes pulse-final { to { transform: scale(1.06); } }
#round-box.final { background: var(--accent); }
.x2 { color: var(--accent); }
.res-actions .lvl-tag { font-size: 0.8rem; margin-left: 4px; }
.setting { display: grid; gap: 6px; }
.setting-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.seg { display: flex; border: var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { flex: 1; border: none; background: none; padding: 9px 6px; font-weight: 600; font-size: 0.92rem; border-left: 1px solid var(--border); transition: background 0.12s; }
.seg button:first-child { border-left: none; }
.seg button:hover { background: var(--paper); }
.seg button.on { background: var(--ink); color: var(--paper); }
.toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle {
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px 6px 6px;
  background: var(--surface); font-weight: 600; font-size: 0.92rem;
}
.toggle .knob { width: 34px; height: 20px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--border); position: relative; transition: background 0.15s; }
.toggle .knob::after { content: ''; position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform 0.15s; }
.toggle.on .knob { background: var(--lime); }
.toggle.on .knob::after { transform: translateX(14px); }

.waiting { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 20px 0; }
.waiting h2 { font-size: 1.7rem; }
.waiting p { margin: 0; max-width: 440px; }
.spinner-globe { font-size: 4rem; animation: spin 3s linear infinite; }
@keyframes spin { to {  } }
.rules { display: grid; gap: 8px; text-align: left; background: var(--paper); border-radius: 12px; padding: 14px 18px; font-weight: 600; font-size: 0.95rem; }

.standings-card { grid-column: 1; display: grid; gap: 12px; }
.standings { display: grid; gap: 8px; }
.stand-row { display: grid; grid-template-columns: 22px 32px minmax(0, 1fr) 70px auto; align-items: center; gap: 8px; }
.animate .stand-row { animation: slidein 0.4s both; animation-delay: calc(var(--i) * 0.06s + 0.2s); }
@keyframes slidein { from { transform: translateX(-16px); opacity: 0; } }
.stand-pos { font-family: var(--mono); color: var(--muted); }
.stand-row .av { background: var(--c); }
.stand-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stand-name small { font-size: 0.75rem; }
.stand-bar { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.stand-bar span { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 99px; }
.animate .stand-bar span { animation: grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 0.06s + 0.3s); }
@keyframes grow { from { width: 0; } }
.stand-score { font-family: var(--mono); text-align: right; display: flex; gap: 6px; align-items: baseline; justify-content: flex-end; }
.stand-score small { color: var(--green); font-size: 0.75rem; }

/* ---------- countdown ---------- */
.countdown { position: fixed; inset: 0; z-index: 100; background: rgba(22, 22, 29, 0.92); color: #fff; display: grid; place-items: center; padding: 16px; animation: fadein 0.3s; }
@keyframes fadein { from { opacity: 0; } }
.cd-inner { text-align: center; display: grid; gap: 24px; justify-items: center; }
.cd-round { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 600; color: var(--yellow); }
.cd-pages { display: flex; align-items: center; gap: 20px; }
.cd-page {
  width: 220px; background: #fff; color: var(--on-bright); border-radius: 18px; border: 3px solid #fff; padding: 14px; display: grid; gap: 6px; justify-items: center;
  animation: flipin 0.6s cubic-bezier(0.3, 1.5, 0.6, 1) both;
}
.cd-page.goal { animation-delay: 0.35s; background: var(--accent); color: #fff; }
.cd-page img, .cd-page > span { width: 110px; height: 110px; border-radius: 14px; object-fit: cover; font-size: 3.4rem; display: grid; place-items: center; background: var(--paper-2); }
.cd-page small { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600; font-size: 0.72rem; opacity: 0.75; }
.cd-page b { font-size: 1.35rem; line-height: 1.15; }
@keyframes flipin { from { transform: perspective(600px) rotateY(90deg) scale(0.8); opacity: 0; } }
.cd-arrow { font-size: 2.6rem; font-weight: 800; color: var(--yellow); }
.cd-num { font-family: var(--mono); font-size: 7rem; line-height: 1; min-height: 1em; }
.cd-num.pop { animation: numpop 0.9s ease-out; }
.cd-num.go { color: var(--lime); animation: numpop 0.5s ease-out; }
@keyframes numpop { from { transform: scale(1.8); opacity: 0; } 30% { transform: scale(1); opacity: 1; } }
.cd-note { color: var(--yellow); font-weight: 600; }

/* ---------- results ---------- */
.results-inner { max-width: 1100px; margin: 0 auto; padding: 28px 16px 130px; display: grid; gap: 26px; }
.res-head { text-align: center; display: grid; gap: 8px; }
.res-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; }
.matchline { margin: 0; font-size: 1.1rem; font-weight: 600; }
.matchline a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--lime); }
.matchline span { color: var(--accent); margin: 0 6px; }
.my-line { margin: 0; }
.my-line b { background: var(--yellow); padding: 0 6px; border-radius: 4px; }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; min-height: 360px; padding-top: 20px; }
.step { width: 190px; display: flex; flex-direction: column; align-items: center; }
.pod-player { display: grid; justify-items: center; gap: 4px; padding-bottom: 12px; text-align: center; position: relative; }
.pod-av {
  width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--border); background: var(--c, var(--paper-2)); font-size: 2.8rem;
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.p1 .pod-av { width: 108px; height: 108px; font-size: 3.6rem; }
.pod-name { font-weight: 800; font-size: 1.2rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-meta { font-size: 0.85rem; color: var(--ink-2); font-family: var(--mono); }
.crown { position: absolute; top: -40px; font-size: 2.6rem; animation: crown 1.6s ease-in-out infinite alternate; }
@keyframes crown { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.pod-block {
  width: 100%; border: var(--line); border-bottom: none; border-radius: 14px 14px 0 0; display: grid; place-items: center; align-content: start;
  padding-top: 14px; gap: 2px; box-shadow: var(--shadow); position: relative;
}
.pod-block span { font-family: var(--mono); font-size: 3rem; line-height: 1; }
.pod-block em { font-style: normal; font-weight: 800; font-family: var(--mono); font-size: 0.95rem; }
.p1 .pod-block { height: 190px; background: var(--gold); }
.p2 .pod-block { height: 140px; background: var(--silver); }
.p3 .pod-block { height: 100px; background: var(--bronze); }
.step.empty { opacity: 0.4; }
.step.empty .pod-av { background: transparent; border-style: dashed; box-shadow: none; }
.podium { border-bottom: var(--line); }

.animate .step { animation: rise 0.7s cubic-bezier(0.3, 1.4, 0.6, 1) both; transform-origin: bottom; }
.animate .step.p3 { animation-delay: 0.2s; }
.animate .step.p2 { animation-delay: 0.7s; }
.animate .step.p1 { animation-delay: 1.3s; }
.animate .pod-player { animation: fadein 0.4s both; }
.animate .p3 .pod-player { animation-delay: 0.6s; }
.animate .p2 .pod-player { animation-delay: 1.1s; }
.animate .p1 .pod-player { animation-delay: 1.8s; }
@keyframes rise { from { transform: scaleY(0); opacity: 0; } }

.awards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.award {
  display: flex; gap: 12px; align-items: center; background: var(--card); border: var(--line); border-radius: 14px; padding: 10px 16px 10px 10px;
  box-shadow: var(--shadow-sm); animation: pop 0.4s both; animation-delay: calc(2s + var(--i) * 0.12s);
}
.results-inner:not(.animate) .award { animation: none; }
.award-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--c); border: 1px solid var(--border); display: grid; place-items: center; font-size: 1.5rem; }
.award > span:last-child { display: grid; }
.award small { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; font-weight: 600; color: var(--ink-2); }
.award em { font-style: normal; font-size: 0.82rem; color: var(--muted); }

.res-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.res-cols h2 { margin-bottom: 14px; }
.routes { display: grid; gap: 14px; }
.route { border-left: 6px solid var(--c); padding-left: 12px; }
.route.gaveup, .route.dnf { opacity: 0.7; }
.route-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.route-head .av { background: var(--c); }
.route-place { font-family: var(--mono); font-weight: 700; min-width: 34px; }
.route-stats { color: var(--ink-2); font-size: 0.88rem; }
.pts { font-family: var(--mono); background: var(--lime); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; font-size: 0.85rem; }
.bonus { background: var(--yellow); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; font-size: 0.78rem; font-weight: 600; }
.path { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; justify-content: inherit; }
.chip { font-size: 0.82rem; border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.chip:hover { background: var(--paper); }
.chip.start { background: var(--lime); }
.chip.goal { background: var(--accent); color: #fff; }
.path .arrow { color: var(--muted); font-size: 0.8rem; }
.spec-hero .path { justify-content: center; }
.res-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.res-actions.sticky {
  position: sticky; bottom: 12px; z-index: 30; align-items: center; background: var(--card); border: var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 12px; margin: 0 auto; width: fit-content; max-width: 100%;
}
.res-actions.sticky .btn.huge { padding: 12px 22px; font-size: 1.1rem; }
body[data-screen='results'] .res-actions.sticky { bottom: 74px; }
.waiting-line { margin: 0; padding: 4px 10px; font-weight: 600; }
.rank-card { overflow: hidden; }
.rank-table { display: grid; }
.rank-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 70px 56px 64px; align-items: center; gap: 4px 8px;
  padding: 10px 8px; border-bottom: 1px solid var(--paper-2); border-left: 5px solid var(--c, transparent);
}
.animate .rank-row:not(.head) { animation: slidein 0.4s both; animation-delay: calc(var(--i) * 0.08s + 0.1s); }
.rank-row.head { border-left-color: transparent; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); font-weight: 600; padding-top: 0; border-bottom: var(--line); }
.rank-row.is-me { background: var(--tint-me); }
.rank-row.gaveup, .rank-row.dnf { color: var(--muted); }
.rk { font-size: 1.4rem; text-align: center; font-family: var(--mono); }
.rank-row:not(.finished) .rk { font-size: 1.1rem; }
.rk-who { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rk-who .av { background: var(--c); }
.rk-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .num { font-family: var(--mono); text-align: right; }
.rank-row.head span:nth-child(n+3) { text-align: right; }
.rk-path { grid-column: 2 / -1; }
.rk-path .path { gap: 3px 5px; }
.rk-path .chip { font-size: 0.75rem; padding: 1px 7px; }
.stand-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.final .podium { min-height: 400px; }
.final-table { overflow-x: auto; }
.final-table h2 { margin-bottom: 12px; }
.final-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.final-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); padding: 6px 8px; border-bottom: var(--line); }
.final-table td { padding: 8px; border-bottom: 1px solid var(--paper-2); white-space: nowrap; }
.final-table td:nth-child(2) { display: flex; align-items: center; gap: 8px; }
.final-table td .av { background: var(--c); }
.final-table .num { font-family: var(--mono); }
.final-table th:nth-child(n+3) { text-align: left; }
.final-table tr:first-child td { background: var(--tint-gold); }
.final-table .pos { font-family: var(--mono); color: var(--muted); }

/* ---------- reactions + floaters + toasts ---------- */
.reactions {
  position: fixed; left: 16px; bottom: 16px; z-index: 40; display: flex; gap: 2px; background: var(--card); border: var(--line);
  border-radius: 999px; padding: 4px 6px; box-shadow: var(--shadow);
}
.reactions button { border: none; background: none; font-size: 1.35rem; width: 38px; height: 38px; border-radius: 50%; transition: transform 0.12s; }
.reactions button:hover { transform: scale(1.3) translateY(-3px); background: var(--paper); }
.reactions button:active { transform: scale(0.9); }
body[data-screen='race'] .reactions { left: auto; right: 316px; bottom: 14px; }
.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.floater { position: absolute; bottom: -60px; display: grid; justify-items: center; gap: 2px; animation: floatup 3.2s ease-out forwards; }
.floater .fe { font-size: 3rem; }
.floater small { font-size: 0.75rem; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); white-space: nowrap; }
@keyframes floatup {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  10% { opacity: 1; transform: translate(0, -60px) scale(1.1); }
  100% { transform: translate(var(--drift), -75vh) scale(0.9); opacity: 0; }
}
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-sm);
  animation: toastin 0.35s cubic-bezier(0.3, 1.5, 0.6, 1); transition: opacity 0.4s, transform 0.4s;
}
.toast.finish { background: var(--green); }
.toast.bad, .toast.giveup { background: var(--accent); }
.toast.join { background: var(--blue); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastin { from { transform: translateY(-20px) scale(0.9); opacity: 0; } }
body[data-screen='race'] .toasts { top: 110px; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 150; }

/* ---------- dialogs ---------- */
.picker { border: var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
.picker::backdrop { background: rgba(22, 22, 29, 0.5); }
.picker-inner { padding: 18px; display: grid; gap: 12px; }
.picker-head { display: flex; justify-content: space-between; align-items: center; }
.picker-results { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.pick-row { display: flex; gap: 12px; align-items: center; text-align: left; border: 2px solid transparent; background: none; padding: 6px; border-radius: 10px; }
.pick-row:hover { border-color: var(--ink); background: var(--surface); }
.pick-row img, .pick-row .noimg { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: none; background: var(--paper-2); display: grid; place-items: center; }
.pick-row span { display: grid; }
.pick-row small { color: var(--muted); }
.pad { padding: 10px; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .setup-card, .players-card, .standings-card { grid-column: 1; grid-row: auto; }
  .setup-card { order: 3; }
  .standings-card { order: 4; }
  .res-cols { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 34px minmax(0, 1fr) 52px 40px 50px; padding: 8px 4px; font-size: 0.9rem; }
  .rk-path { grid-column: 1 / -1; }
  .res-actions.sticky { width: 100%; }
  .res-actions.sticky .btn.huge { flex: 1; font-size: 0.95rem; padding: 10px 12px; }
  .race-body { grid-template-columns: 1fr; }
  .board {
    position: fixed; right: 0; top: 0; bottom: 0; width: min(330px, 88vw); z-index: 60; border-left: var(--line);
    transform: translateX(100%); transition: transform 0.25s; box-shadow: -6px 0 0 rgba(0, 0, 0, 0.1);
  }
  body.board-open .board { transform: none; }
  .board-toggle { display: inline-flex !important; }
  .board-close { display: block; }
  body[data-screen='race'] .reactions { opacity: 0.6; transition: opacity 0.2s; }
  body[data-screen='race'] .reactions:hover, body[data-screen='race'] .reactions:active { opacity: 1; }
  .article-wrap { border-right: none; }
  body[data-screen='race'] .reactions { right: 16px; }
}
@media (max-width: 640px) {
  .home-inner { padding-top: 28px; }
  .logo-w { font-size: 4.6rem; }
  .logo-text { font-size: 2.5rem; }
  .logo-sticker { font-size: 0.95rem; left: -18px; top: -16px; }
  .tagline { font-size: 1.05rem; }
  .home-actions { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr 1fr; }
  .race-top { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .goal-chip { max-width: none; flex: 1; }
  .race-actions { margin-left: 0; width: 100%; }
  .race-actions .btn { flex: 1; padding: 6px 4px; font-size: 0.82rem; }
  .stat-box { min-width: 54px; padding: 3px 8px; }
  .article { padding: 14px 16px 90px; font-size: 16px; }
  .article .art-title { font-size: 1.8rem; }
  .article .infobox, .article .sidebar, .article figure, .article .thumb, .article table.vertical-navbox { float: none; width: 100%; max-width: 100%; margin: 1em 0; }
  .trail { padding: 6px 16px; }
  .podium { gap: 6px; min-height: 300px; }
  .step { width: 31%; }
  .pod-av { width: 58px; height: 58px; font-size: 2rem; }
  .p1 .pod-av { width: 74px; height: 74px; font-size: 2.6rem; }
  .pod-name { font-size: 0.95rem; max-width: 100%; }
  .pod-meta { font-size: 0.7rem; }
  .p1 .pod-block { height: 150px; } .p2 .pod-block { height: 110px; } .p3 .pod-block { height: 80px; }
  .pod-block span { font-size: 2.2rem; }
  .cd-pages { flex-direction: column; gap: 10px; }
  .cd-page { width: 240px; }
  .cd-page img, .cd-page > span { width: 70px; height: 70px; }
  .cd-arrow {  font-size: 1.8rem; }
  .cd-num { font-size: 5rem; }
  .seg { flex-wrap: wrap; }
  .seg button { font-size: 0.82rem; padding: 8px 4px; }
  .gamebar { padding: 8px 12px; gap: 8px; }
  .reactions button { width: 32px; height: 32px; font-size: 1.1rem; }
  .spec-goal { flex-direction: column; }
}

/* ---------- theme + ads (shared across bondia.sh games) ---------- */
/* Bright fills keep dark text in both themes. */
:is(.slot-label, .plan-chip, .pod-block, .award-icon, .chip.start, .pts, .bonus, .logo-w, .logo-q, .avatar-btn, .av-opt.on, .swap,
  .my-line b, .race-banner, .mini-logo span, .code-card, .cd-page:not(.goal)) { color: var(--on-bright); }
:root[data-theme='dark'] .code-card { background: var(--card); color: var(--ink); border-top: 8px solid var(--yellow); }
:root[data-theme='dark'] .big-code span { background: var(--surface); }
:root[data-theme='dark'] .article-wrap { border-right-color: var(--paper-2); }
.floating-theme { position: fixed; top: 12px; right: 12px; z-index: 50; }
body:not([data-screen='home']) .floating-theme { display: none; }
.ad-slot { max-width: 970px; margin: 0 auto 120px; padding: 0 16px; text-align: center; }
.ad-slot small { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ---------- quiz ---------- */
:root { --a0: #e5323b; --a1: #1f6fd1; --a2: #e0a100; --a3: #2b9a3e; }
.logo-q {
  font-family: var(--mono); font-size: 5.6rem; line-height: 1; background: var(--pink); color: #fff !important;
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); width: 1.25em; height: 1.25em; display: grid; place-items: center; padding-bottom: 0.045em; /* optically centres the ? */
}
.mini-logo span { font-family: var(--mono); }
select.input, textarea.input {
  font: inherit; border: var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); color: var(--ink); width: 100%;
}
textarea.input { min-height: 220px; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; resize: vertical; }
.custom-help { font-size: 0.85rem; color: var(--ink-2); display: grid; gap: 4px; }
.custom-help code { font-family: var(--mono); background: var(--paper); padding: 1px 5px; border-radius: 4px; }
.custom-status { font-size: 0.85rem; font-weight: 600; }
.custom-status.bad { color: var(--accent); }
.custom-status.ok { color: var(--green); }
.setup-note { font-size: 0.85rem; color: var(--muted); margin: -4px 0 0; }

#play { min-height: 100dvh; display: flex; flex-direction: column; }
.q-wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 18px 16px 140px; display: grid; gap: 16px; }
.q-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-count { font-family: var(--mono); font-size: 1rem; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 12px; }
.pill { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; font-weight: 700; background: var(--surface); }
.pill.easy { background: var(--lime); color: var(--on-bright); }
.pill.medium { background: var(--yellow); color: var(--on-bright); }
.pill.hard { background: #ff9a5a; color: var(--on-bright); }
.pill.x2 { background: var(--accent); color: #fff; }
.q-answered { margin-left: auto; font-weight: 700; font-size: 0.9rem; color: var(--ink-2); }
.timer { display: flex; align-items: center; gap: 10px; }
.timer-bar { flex: 1; height: 12px; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; background: var(--surface); }
.timer-bar span { display: block; height: 100%; background: var(--green); transition: width 0.2s linear, background 0.3s; }
.timer-bar span.low { background: var(--accent); }
.timer-num { font-family: var(--mono); font-size: 1.6rem; min-width: 2.4ch; text-align: right; }
.q-card { background: var(--card); border: var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 26px 24px; text-align: center; }
.q-card h1 { font-size: clamp(1.4rem, 3.6vw, 2.3rem); line-height: 1.2; letter-spacing: -0.02em; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ans {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 16px 18px; text-align: left;
  border: var(--line); border-radius: 16px; background: var(--ac); color: #fff; font-weight: 800; font-size: 1.15rem;
  box-shadow: var(--shadow); transition: transform 0.1s, opacity 0.2s, filter 0.2s;
}
.ans:hover:not(:disabled) {  box-shadow: var(--shadow-sm); }
.ans:active:not(:disabled) {  box-shadow: var(--shadow-sm); }
.ans:disabled { cursor: default; }
.ans .shape { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.6rem; background: rgba(0, 0, 0, 0.18); border-radius: 12px; }
.ans .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.ans .cnt { font-family: var(--mono); font-size: 1.1rem; background: rgba(0, 0, 0, 0.22); border-radius: 10px; padding: 4px 10px; }
.ans .bar { position: absolute; left: 0; bottom: 0; height: 6px; width: var(--w, 0%); background: rgba(255, 255, 255, 0.7); border-radius: 0 6px 0 14px; transition: width 0.6s; }
.answers.locked .ans:not(.picked) { opacity: 0.35; filter: saturate(0.5); }
.ans.picked { outline: 4px solid var(--ink); outline-offset: 3px; }
.answers.revealed .ans:not(.correct) { opacity: 0.35; filter: grayscale(0.6); }
.answers.revealed .ans.correct { transform: scale(1.02); }
.answers.revealed .ans.correct::after {
  content: '✓'; position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; background: var(--green);
  border: var(--line); display: grid; place-items: center; font-size: 1.1rem;
}
.answers.two { grid-template-columns: 1fr 1fr; }

.wait-note { text-align: center; font-weight: 700; color: var(--ink-2); }
.wait-note .big { display: block; font-size: 2.6rem; margin-bottom: 4px; }

.get-ready { display: grid; place-items: center; text-align: center; gap: 14px; padding: 12vh 16px; }
.get-ready .gr-num { font-family: var(--mono); font-size: 6rem; line-height: 1; animation: numpop 0.9s ease-out; }
.get-ready h2 { font-size: 2rem; }

.verdict {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; text-align: center;
  border: var(--line); border-radius: 18px; padding: 14px 18px; font-weight: 800; font-size: 1.3rem; box-shadow: var(--shadow);
  animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.verdict.good { background: var(--green); color: #fff; }
.verdict.bad { background: var(--accent); color: #fff; }
.verdict.meh { background: var(--card); }
.verdict small { font-size: 0.95rem; font-weight: 600; opacity: 0.9; }
.verdict .gain { font-family: var(--mono); background: rgba(0, 0, 0, 0.2); padding: 2px 10px; border-radius: 10px; }

.mini-board { display: grid; gap: 8px; }
.mb-row {
  display: grid; grid-template-columns: 30px 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--border); border-left: 7px solid var(--c); border-radius: 12px; padding: 8px 12px; animation: slidein 0.35s both;
  animation-delay: calc(var(--i) * 0.06s);
}
.mb-row.is-me { background: var(--tint-me); }
.mb-row .av { background: var(--c); }
.mb-pos { font-family: var(--mono); text-align: center; }
.mb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-gain { font-family: var(--mono); font-size: 0.85rem; color: var(--green); }
.mb-score { font-family: var(--mono); font-size: 1.1rem; }
.mb-move { font-size: 0.75rem; font-weight: 800; }
.mb-move.up { color: var(--green); }
.mb-move.down { color: var(--accent); }
.mb-me { font-size: 0.9rem; color: var(--ink-2); text-align: center; }

.host-bar {
  display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 0 auto; width: fit-content;
  background: var(--card); border: var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 10px; max-width: calc(100vw - 24px);
}
.q-wrap > .host-bar { margin-top: 4px; }
.get-ready .host-bar { margin-top: 18px; }
.host-bar .auto { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); padding: 0 6px; }

@media (max-width: 640px) {
  .logo-q { font-size: 4rem; }
  .answers { grid-template-columns: 1fr; gap: 10px; }
  .ans { min-height: 70px; font-size: 1.02rem; padding: 12px 14px; }
  .ans .shape { width: 36px; height: 36px; font-size: 1.3rem; }
  .q-card { padding: 18px 14px; }
  .host-bar { width: 100%; }
  .host-bar .btn { flex: 1; padding: 10px 8px; font-size: 0.9rem; }
}

/* ---------- icons ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.btn .i, .icon-btn .i { vertical-align: middle; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); }
.icon-ic { display: inline-grid; place-items: center; }
.tag .i, .pill .i, .toggle .i, .seg .i, .setting-label .i { width: 1em; height: 1em; }
.code-card { background: var(--card); }
:root[data-theme='dark'] .code-card { border-top: var(--line); }

.logo-text small { display: block; font-size: 0.42em; color: var(--accent); }
.big-emoji .i { width: 64px; height: 64px; color: var(--ink-2); }
.spinner-globe .i { width: 56px; height: 56px; color: var(--ink-2); }
.host-mark { color: var(--gold); }
.host-mark .i { width: 0.95em; height: 0.95em; }
.crown .i { width: 40px; height: 40px; color: var(--gold); }
.award-icon .i { width: 22px; height: 22px; }
.rules div { display: flex; align-items: center; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; }
.btn { gap: 6px; }
.wait-note .big .i { width: 40px; height: 40px; }
.verdict .i { width: 1.3em; height: 1.3em; }
.streak { color: var(--accent); }
.streak .i { width: 1em; height: 1em; }

/* ---------- hub link, close room, privacy footer ---------- */
.hub-link {
  position: fixed; top: 12px; left: 12px; z-index: 50; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; background: var(--card); border: var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; font-weight: 700; font-size: 0.9rem; color: var(--ink-2);
}
.hub-link:hover { color: var(--ink); }
body:not([data-screen='home']) .hub-link { display: none; }
.gamebar > a.icon-btn { text-decoration: none; margin-right: -6px; }
.danger-ic:hover { color: var(--accent); }
.site-foot { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); padding: 8px 0 24px; }
.site-foot a, .site-foot button { color: var(--muted); background: none; border: none; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.site-foot a:hover, .site-foot button:hover { color: var(--ink); }

/* ---------- minigames ---------- */
:root { --game: #3d5afe; --game-ink: #fff; }
.logo-tile {
  font-size: 5.6rem; width: 1.25em; height: 1.25em; display: grid; place-items: center; background: var(--game); color: var(--game-ink);
  border-radius: 24px; box-shadow: var(--shadow-lg);
}
.logo-tile > span { width: 56%; height: 56%; display: grid; place-items: center; }
.logo-tile .i { width: 100%; height: 100%; display: block; vertical-align: 0; stroke-width: 1.7; }
.mini-logo { display: inline-flex; align-items: center; gap: 8px; }
.mini-logo #mini-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--game); color: var(--game-ink); }
.mini-logo #mini-icon .i { width: 16px; height: 16px; display: block; vertical-align: 0; }
.btn.primary { background: var(--game); color: var(--game-ink); }

.prompt { background: var(--card); border: var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; text-align: center; }
.prompt h1 { font-size: clamp(1.25rem, 3.2vw, 2rem); line-height: 1.25; letter-spacing: -0.015em; }
.prompt .kicker { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.prompt img.pic { max-height: 220px; max-width: 100%; margin: 0 auto; border-radius: 14px; object-fit: cover; }

/* Head-to-head cards (Higher or Lower) */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.versus .vs { align-self: center; font-weight: 800; color: var(--muted); font-size: 0.9rem; }
.vcard {
  display: grid; gap: 10px; justify-items: center; align-content: start; text-align: center; padding: 18px 14px; min-height: 190px;
  background: var(--card); border: var(--line); border-radius: 18px; box-shadow: var(--shadow); font: inherit; color: inherit; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.vcard:hover:not(:disabled) { border-color: var(--game); transform: translateY(-2px); }
.vcard:disabled { cursor: default; }
.vcard img { width: 100%; max-width: 180px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; border: var(--line); background: var(--paper-2); }
.vcard b { font-size: 1.2rem; line-height: 1.2; }
.vcard small { color: var(--muted); }
.vcard .value { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; }
.vcard.picked { outline: 3px solid var(--game); outline-offset: 2px; }
.revealed .vcard.correct { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 35%, transparent); }
.revealed .vcard:not(.correct) { opacity: 0.6; }
.vcard .cnt { font-size: 0.8rem; color: var(--muted); }

/* Statement list (Fact or Fiction) */
.stmts { display: grid; gap: 10px; }
.stmt {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 14px 16px;
  background: var(--card); border: var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); font: inherit; color: inherit; cursor: pointer;
  transition: border-color 0.15s;
}
.stmt:hover:not(:disabled) { border-color: var(--game); }
.stmt:disabled { cursor: default; }
.stmt .num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--paper-2); font-weight: 800; }
.stmt .txt { font-size: 1.05rem; line-height: 1.4; }
.stmt .tag { font-size: 0.72rem; }
.stmt.picked { outline: 3px solid var(--game); outline-offset: 2px; }
.revealed .stmt.correct { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.revealed .stmt.correct .num { background: var(--accent); color: #fff; }
.revealed .stmt:not(.correct) .num { background: var(--green); color: #fff; }
.stmt .cnt { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }

/* Choice tiles (Shape Shifter) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  padding: 14px; border-radius: 14px; border: var(--line); background: var(--card); box-shadow: var(--shadow-sm); font: inherit; font-weight: 700;
  font-size: 1.05rem; color: inherit; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
}
.tile:hover:not(:disabled) { border-color: var(--game); }
.tile:disabled { cursor: default; }
.tile.picked { outline: 3px solid var(--game); outline-offset: 2px; }
.revealed .tile.correct { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--card)); }
.revealed .tile:not(.correct) { opacity: 0.55; }
.tile .cnt { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }
.outline-svg { width: min(320px, 70vw); height: min(320px, 70vw); margin: 0 auto; display: block; }
.outline-svg path { fill: var(--game); fill-opacity: 0.18; stroke: var(--game); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.world-svg { width: 100%; max-width: 560px; margin: 0 auto; display: block; }
.world-svg path { fill: color-mix(in srgb, var(--ink) 16%, transparent); stroke: var(--card); stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.world-svg path.hit { fill: var(--game); }

/* Number guess (Timeline) */
.numpick { display: grid; gap: 14px; justify-items: center; background: var(--card); border: var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.numpick .big { font-family: var(--mono); font-size: clamp(2.6rem, 9vw, 4rem); line-height: 1; letter-spacing: 0.02em; }
.numpick .row { display: flex; align-items: center; gap: 10px; width: 100%; }
.numpick input[type=range] { flex: 1; accent-color: var(--game); height: 32px; }
.numpick .step { width: 44px; height: 44px; border-radius: 12px; border: var(--line); background: var(--surface); color: inherit; display: grid; place-items: center; cursor: pointer; font-weight: 800; }
.numpick .ends { display: flex; justify-content: space-between; width: 100%; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.numpick .btn { min-width: 200px; }

/* Number line of everyone's guesses on reveal */
.numline { position: relative; height: 92px; margin: 6px 18px 0; }
.numline .axis { position: absolute; left: 0; right: 0; top: 52px; height: 4px; border-radius: 4px; background: var(--paper-2); }
.numline .mark { position: absolute; top: 18px; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; }
.numline .mark .av { width: 30px; height: 30px; font-size: 0.95rem; border-width: 2px; background: var(--c); }
.numline .mark small { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.numline .answer { position: absolute; top: 40px; transform: translateX(-50%); display: grid; justify-items: center; }
.numline .answer b { background: var(--game); color: var(--game-ink); border-radius: 8px; padding: 2px 8px; font-family: var(--mono); font-size: 0.85rem; }
.numline .answer::before { content: ''; width: 3px; height: 18px; background: var(--game); border-radius: 2px; }
.numline .ends { position: absolute; top: 62px; left: 0; right: 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* The growing timeline of events revealed so far */
.timeline-strip { display: grid; gap: 8px; background: var(--card); border: var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.timeline-strip h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.tl-items { display: grid; gap: 6px; position: relative; padding-left: 18px; }
.tl-items::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--paper-2); }
.tl-item { position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 10px; font-size: 0.92rem; text-align: left; }
.tl-item::before { content: ''; position: absolute; left: -17px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--game); }
.tl-item.now { font-weight: 700; }
.tl-item.now::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--game) 30%, transparent); }
.tl-item b { font-family: var(--mono); }

.reveal-note { color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; text-align: center; max-width: 640px; margin: 0 auto; }
.reveal-note a { color: inherit; }
.custom-help code { font-family: var(--mono); }

@media (max-width: 640px) {
  .versus { grid-template-columns: 1fr; }
  .versus .vs { justify-self: center; }
  .vcard { min-height: 0; grid-template-columns: 90px 1fr; text-align: left; justify-items: start; align-items: center; }
  .vcard img { max-width: 90px; }
  .tiles { grid-template-columns: 1fr; }
  .logo-tile { font-size: 4rem; }
}
.vcard .noimg { width: 100%; max-width: 180px; aspect-ratio: 3 / 2; display: grid; place-items: center; background: var(--paper-2); border-radius: 10px; color: var(--muted); }
.vcard .noimg .i { width: 32px; height: 32px; }
.prompt.compact { padding: 14px 18px; gap: 8px; }
.prompt.compact h1 { font-size: 1.05rem; font-weight: 600; }
.prompt.compact img.pic { display: none; }
.reveal-note .timeline-strip { margin-top: 10px; }
.prompt.compact .outline-svg { width: 150px; height: 150px; }
