/* Fonts served from this site (no request to Google). Licence: SIL Open Font License. */
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../../uploads/2026/11/dm-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../../uploads/2026/11/dm-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('../../../uploads/2026/11/figtree-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('../../../uploads/2026/11/figtree-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('../../../uploads/2026/11/unbounded-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('../../../uploads/2026/11/unbounded-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --sea: #0F3446;
  --sea-deep: #0A2533;
  --sea-up: #134457;
  --grid: rgba(255,255,255,0.05);
  --panel: rgba(4, 22, 31, 0.5);
  --panel-line: rgba(255,255,255,0.08);
  --paper: #F6F4EE;
  --paper-2: #EAE6DB;
  --ink: #17222B;
  --ink-soft: #5B6670;
  --on-sea: #E7EEF1;
  --on-sea-soft: #9DB4BF;
  --marigold: #FFB703;
  --win: #2A9D8F;
  --win-soft: #6FD3C6;
  --lose: #E0533D;
  --lose-soft: #FF8A75;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 64px),
    radial-gradient(ellipse at 50% -10%, #165068 0%, var(--sea) 45%, var(--sea-deep) 100%);
  background-attachment: fixed;
  color: var(--on-sea);
  font: 16px/1.5 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(8, 31, 43, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--panel-line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo span { color: var(--marigold); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--on-sea-soft); padding: 8px 12px; border-radius: 999px; white-space: nowrap; position: relative; }
.nav a:hover { color: var(--on-sea); }
.nav a.on { color: var(--ink); background: var(--paper); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--lose); color: #fff; font-size: 11px; font-weight: 800; }
.me { display: flex; align-items: center; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.06); }
.me-chip:hover { background: rgba(255,255,255,.12); }
.me-chip .nm { font-weight: 700; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip .rt { font: 500 12px var(--mono); color: var(--marigold); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 72px; display: flex; flex-direction: column; gap: 28px; }
.view { display: flex; flex-direction: column; gap: 28px; animation: rise .35s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Type ---------- */
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 6vw, 58px); line-height: 1.02; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 em { font-style: normal; color: var(--marigold); }
h2 { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.2; margin: 0; text-wrap: balance; }
h3 { font-size: 16px; margin: 0; font-weight: 700; }
p { margin: 0; }
.lead { color: var(--on-sea-soft); font-size: 18px; max-width: 52ch; }
.muted { color: var(--on-sea-soft); }
.small { font-size: 13px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-sea-soft); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Surfaces ---------- */
.panel { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel.tight { padding: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .g2, .g3 { grid-template-columns: 1fr; } }

/* ---------- Controls ---------- */
.btn { font: 700 15px var(--body); border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; background: var(--marigold); color: var(--ink); text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; filter: none; transform: none; }
.btn.big { font-size: 17px; padding: 16px 26px; }
.btn.ghost { background: transparent; color: var(--on-sea); box-shadow: inset 0 0 0 2px rgba(157,180,191,.5); }
.btn.light { background: var(--paper); color: var(--ink); }
.btn.danger { background: transparent; color: var(--lose-soft); box-shadow: inset 0 0 0 2px rgba(255,138,117,.5); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--on-sea-soft); }
input, select { font: 600 16px var(--body); color: var(--ink); background: var(--paper); border: 0; border-radius: 12px; padding: 12px 14px; width: 100%; }
input.code-in { font-family: var(--mono); letter-spacing: .3em; text-transform: uppercase; }
.seg { display: inline-flex; gap: 4px; background: rgba(0,0,0,.25); padding: 4px; border-radius: 999px; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--on-sea-soft); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--ink); }
.error { color: var(--lose-soft); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Avatars and tiers ---------- */
.av { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 19px; line-height: 1; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.av.sm { width: 28px; height: 28px; font-size: 15px; }
.av.lg { width: 88px; height: 88px; font-size: 46px; }
.av.xl { width: 104px; height: 104px; font-size: 56px; }
.av.guest { background: #3B5562; }
.tier { display: inline-block; width: fit-content; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.1); color: var(--on-sea); white-space: nowrap; }
.tier.Beginner { background: #3B5562; }
.tier.Amateur { background: #2F6C61; }
.tier.Intermediate { background: #2A7A9D; }
.tier.Advanced { background: #5B57C9; }
.tier.Expert { background: #A04BB4; }
.tier.Master { background: #C9622F; }
.tier.Grandmaster { background: linear-gradient(90deg, #FFB703, #FB8500); color: var(--ink); }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.joinbox { display: flex; gap: 8px; max-width: 360px; }
.joinbox input { flex: 1; min-width: 0; }
.statcard { background: var(--paper); color: var(--ink); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.statcard .who { display: flex; gap: 14px; align-items: center; }
.statcard .rating { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.statcard .muted { color: var(--ink-soft); }
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini { background: var(--paper-2); border-radius: 12px; padding: 10px; text-align: center; }
.mini b { display: block; font: 500 20px var(--mono); }
.mini span { font-size: 11px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.statcard.dark { background: var(--panel); color: var(--on-sea); box-shadow: none; border: 1px solid var(--panel-line); }
.statcard.dark .mini { background: rgba(255,255,255,.06); }
.statcard.dark .mini span, .statcard.dark .muted { color: var(--on-sea-soft); }
.invite-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg, rgba(255,183,3,.18), rgba(255,183,3,.05)); border: 1px solid rgba(255,183,3,.4); border-radius: var(--r); padding: 12px 16px; }

/* ---------- Category cards ---------- */
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .groups { grid-template-columns: 1fr; } }
.gcard { --c: #2A9D8F; position: relative; overflow: hidden; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 55%, #0A2533) 0%, color-mix(in srgb, var(--c) 18%, #0A2533) 100%); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); transition: transform .18s, box-shadow .18s; }
.gcard:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0,0,0,.35); }
.gcard .gi { font-size: 40px; line-height: 1; }
.gcard .gn { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.15; }
.gcard .gd { font-size: 14px; color: rgba(231,238,241,.82); }
.gcard .gm { font: 500 12px var(--mono); color: rgba(231,238,241,.75); }
.gcard::after { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.18); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.25); color: var(--on-sea); text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; }
.chip:hover { background: rgba(0,0,0,.4); }
.chip.on { background: var(--paper); color: var(--ink); }
.subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.scard { --c: #2A9D8F; display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-line); transition: transform .15s, border-color .15s, background .15s; }
.scard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 14%, rgba(4,22,31,.5)); }
.scard .si { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; flex: none; background: color-mix(in srgb, var(--c) 30%, transparent); }
.scard .sn { font-weight: 700; line-height: 1.2; }
.scard .sc { font: 500 12px var(--mono); color: var(--on-sea-soft); }
.groupsec { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; }
.groupsec .gh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.searchbar input { max-width: 340px; }

/* ---------- Category page ---------- */
.cat-hero { --c: #2A9D8F; border-radius: 24px; padding: 28px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 50%, #0A2533), color-mix(in srgb, var(--c) 12%, #0A2533)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.cat-hero .ci { font-size: 64px; line-height: 1; }
.mode { display: flex; flex-direction: column; gap: 12px; }
.mode .mi { font-size: 30px; }
.mode p { color: var(--on-sea-soft); flex: 1; }

/* ---------- Queue ---------- */
.radar { width: 180px; height: 180px; border-radius: 50%; margin: 0 auto; position: relative; background: radial-gradient(circle, rgba(255,183,3,.15) 0 30%, transparent 31%), repeating-radial-gradient(circle, transparent 0 28px, rgba(255,255,255,.08) 28px 29px); border: 1px solid rgba(255,183,3,.4); overflow: hidden; display: grid; place-items: center; }
.radar::before { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(255,183,3,.45), transparent 25%); animation: spin 2.4s linear infinite; }
.radar .av { position: relative; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Game ---------- */
.game { display: flex; flex-direction: column; gap: 16px; max-width: 760px; width: 100%; margin: 0 auto; }
.scorestrip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.pchip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(0,0,0,.25); border: 2px solid transparent; flex: none; transition: border-color .2s; }
.pchip.me { border-color: var(--marigold); }
.pchip .nm { font-weight: 700; font-size: 14px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .sc { font: 500 14px var(--mono); }
.pchip .st { font-size: 12px; }
.pchip .st.ok { color: var(--win-soft); }
.pchip .st.wait { color: var(--on-sea-soft); }
.pchip .rw { font-size: 11px; letter-spacing: 1px; color: var(--marigold); }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.duel .side { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: rgba(0,0,0,.25); border: 2px solid transparent; min-width: 0; }
.duel .side.right { flex-direction: row-reverse; text-align: right; }
.duel .side.me { border-color: var(--marigold); }
.duel .side .info { min-width: 0; }
.duel .side .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel .side .sc { font: 500 24px var(--mono); line-height: 1; }
.duel .side .st { font-size: 12px; }
.duel .mid { font-family: var(--display); font-weight: 800; color: var(--marigold); }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--marigold); border-radius: 99px; transform-origin: left; }
.timer.low i { background: var(--lose); }
.qcard { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.3); animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { transform: scale(.97); opacity: .3; } to { transform: none; opacity: 1; } }
.qcard .qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.qcard .qtext { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 3.6vw, 28px); line-height: 1.2; text-wrap: balance; }
.qcard img { max-height: 160px; width: auto; max-width: 100%; border-radius: 8px; align-self: flex-start; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.dpill { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; color: #fff; }
.dpill.d1 { background: #2A9D8F; } .dpill.d2 { background: #2A7A9D; } .dpill.d3 { background: #C9622F; } .dpill.d4 { background: #A0334B; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }
.opt { font: 700 17px var(--body); color: var(--ink); background: var(--paper-2); border: 3px solid transparent; border-radius: 14px; padding: 15px 14px; min-height: 62px; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; transition: transform .12s, border-color .12s, background .12s; }
.opt .k { font: 500 13px var(--mono); color: var(--ink-soft); flex: none; }
.opt:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); }
.opt:disabled { cursor: default; }
.opt.chosen { border-color: var(--marigold); background: #FFF1C9; }
.opt.right { background: #BFE8E2; border-color: var(--win); }
.opt.wrong { background: #F9CFC6; border-color: var(--lose); }
.opt.faded { opacity: .5; }
.opt .who { margin-left: auto; display: flex; gap: 2px; }
.status { text-align: center; font-weight: 700; font-size: 17px; min-height: 1.5em; }
.status .w { color: var(--win-soft); } .status .l { color: var(--lose-soft); }
.expl { background: rgba(255,255,255,.06); border-left: 4px solid var(--marigold); border-radius: 10px; padding: 12px 14px; font-size: 15px; animation: rise .3s ease; }
.bigcount { font-family: var(--display); font-weight: 800; font-size: 96px; line-height: 1; color: var(--marigold); text-align: center; animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; text-align: center; }
.vs .p { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vs .p .nm { font-family: var(--display); font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.vs .x { font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--marigold); }

/* ---------- Lobby ---------- */
.bigcode { font-family: var(--mono); font-size: clamp(44px, 12vw, 80px); letter-spacing: .18em; color: var(--marigold); line-height: 1; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share input { flex: 1 1 220px; font: 500 14px var(--mono); }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.people li { display: flex; align-items: center; gap: 8px; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 700; animation: pop .3s ease; }
.people li.me { box-shadow: 0 0 0 3px var(--marigold); }
.people li small { color: var(--ink-soft); font-weight: 600; }
.settings { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Results ---------- */
.result-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result-head .medal { font-size: 64px; line-height: 1; animation: pop .5s ease; }
.delta { font: 500 15px var(--mono); }
.delta.up { color: var(--win-soft); } .delta.down { color: var(--lose-soft); }
.ratingchange { display: flex; align-items: baseline; gap: 10px; justify-content: center; font-family: var(--display); font-size: 28px; font-weight: 800; }

/* ---------- Tables / lists ---------- */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board li { display: grid; grid-template-columns: 2.2em auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.22); text-decoration: none; }
.board li a { text-decoration: none; }
.board li.me { box-shadow: inset 0 0 0 2px var(--marigold); }
.board .rk { font-family: var(--mono); color: var(--on-sea-soft); text-align: right; }
.board .rk.top { color: var(--marigold); }
.board .nmw { min-width: 0; display: flex; flex-direction: column; }
.board .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sub { font-size: 12px; color: var(--on-sea-soft); }
.board .val { font: 500 16px var(--mono); text-align: right; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hist li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.22); }
.hist .oc { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; width: 46px; text-align: center; }
.hist .oc.win { background: rgba(42,157,143,.3); color: var(--win-soft); }
.hist .oc.loss { background: rgba(224,83,61,.25); color: var(--lose-soft); }
.hist .oc.draw, .hist .oc.solo { background: rgba(255,255,255,.1); color: var(--on-sea-soft); }
.review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.review li { padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.22); display: flex; flex-direction: column; gap: 4px; }
.review .ok { color: var(--win-soft); font-weight: 700; }
.review .no { color: var(--lose-soft); font-weight: 700; }
.empty { color: var(--on-sea-soft); padding: 18px; text-align: center; border: 1px dashed var(--panel-line); border-radius: var(--r); }

/* ---------- Profile ---------- */
.prof { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.prof .bigrating { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 14px; }
.kpi b { display: block; font: 500 24px var(--mono); }
.kpi span { font-size: 12px; color: var(--on-sea-soft); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--win); }
.avpick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avpick button { border: 2px solid transparent; background: rgba(0,0,0,.2); border-radius: 12px; font-size: 22px; padding: 6px; cursor: pointer; }
.avpick button.on { border-color: var(--marigold); }
.colpick { display: flex; gap: 8px; flex-wrap: wrap; }
.colpick button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colpick button.on { border-color: var(--paper); }

/* ---------- Modal and toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(3, 14, 20, .7); display: grid; place-items: center; padding: 16px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--sea); border: 1px solid var(--panel-line); border-radius: 22px; padding: 22px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; animation: pop .25s ease; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal .x { margin-left: auto; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--on-sea-soft); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--paper); color: var(--ink); font-weight: 700; padding: 12px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: rise .25s ease; max-width: calc(100% - 32px); text-align: center; }
.toast.err { background: var(--lose); color: #fff; }

.foot { color: var(--on-sea-soft); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .me-chip .nm { display: none; }
  .topbar-in { gap: 8px; }
  .logo { font-size: 16px; }
  .minis { grid-template-columns: repeat(2, 1fr); }
  .duel .side .sc { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Competitive platform (v4) ---------- */
.tier.Novice { background: #2F6C61; }
.tier.Elite { background: linear-gradient(90deg, #E9B949, #FFB703 40%, #F6F4EE); color: var(--ink); }
.bell { position: relative; background: rgba(255,255,255,.06); border: 0; border-radius: 999px; width: 38px; height: 38px; cursor: pointer; font-size: 17px; }
.bell:hover { background: rgba(255,255,255,.12); }
.bell .badge { position: absolute; top: -2px; right: -4px; margin: 0; }
.lvl { font: 700 12px var(--body); letter-spacing: .04em; padding: 3px 9px; border-radius: 99px; background: rgba(255,183,3,.16); color: var(--marigold); }
.xpbar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; max-width: 420px; }
.xpbar i { display: block; height: 100%; background: var(--marigold); border-radius: 99px; }
.xpbar.light { background: var(--paper-2); max-width: none; }
.scroll-x { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.lb-controls { display: flex; flex-direction: column; gap: 10px; }
.lb-controls .seg { flex-wrap: nowrap; }
.lb-controls .seg button:disabled { opacity: .35; cursor: default; }
.mypos { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: rgba(255,183,3,.1); border: 1px solid rgba(255,183,3,.35); }
.lbt { width: 100%; border-collapse: collapse; min-width: 560px; }
.lbt th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-sea-soft); padding: 8px 10px; border-bottom: 1px solid var(--panel-line); }
.lbt td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.lbt .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbt .strong { color: var(--marigold); font-weight: 600; }
.lbt tr.me td { background: rgba(255,183,3,.08); }
.lbt .rk { font-family: var(--mono); color: var(--on-sea-soft); width: 3em; }
.lbt .rk.top { color: var(--marigold); }
.lbt .pl { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.lbt .pl .nmw { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lbt .pl .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbt a { text-decoration: none; }
.chart { background: var(--panel); border: 1px solid var(--panel-line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ch-title { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 15px; }
.ch-title .mono { color: var(--on-sea-soft); font-weight: 500; font-size: 13px; }
.ch-wrap { position: relative; }
.ch-svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.ch-grid { stroke: rgba(255,255,255,.08); stroke-width: 1; }
.ch-ax { fill: var(--on-sea-soft); font: 500 11px var(--mono); }
.ch-line { fill: none; stroke: var(--marigold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: rgba(255,183,3,.10); stroke: none; }
.ch-dot, .ch-hdot { fill: var(--marigold); stroke: var(--sea); stroke-width: 2; }
.ch-cross { stroke: rgba(231,238,241,.4); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-fill { fill: var(--marigold); }
.ch-bar:hover .ch-fill { fill: #FFC93D; }
.ch-tip { position: absolute; pointer-events: none; background: var(--paper); color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 12px; display: flex; flex-direction: column; min-width: 120px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.strip { display: flex; gap: 4px; flex-wrap: wrap; }
.res { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font: 700 12px var(--mono); }
.res.win { background: #2A9D8F; color: #fff; }
.res.loss { background: #E0533D; color: #fff; }
.res.draw { background: #5B6670; color: #fff; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid transparent; }
.ach .medal { font-size: 26px; line-height: 1; }
.ach b { display: block; }
.ach .tierlbl { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ach.bronze { border-color: rgba(205,127,50,.55); } .ach.bronze .tierlbl { color: #E2A36B; }
.ach.silver { border-color: rgba(192,192,192,.55); } .ach.silver .tierlbl { color: #D6DDE1; }
.ach.gold { border-color: rgba(255,183,3,.6); } .ach.gold .tierlbl { color: var(--marigold); }
.ach.diamond { border-color: rgba(125,211,252,.65); } .ach.diamond .tierlbl { color: #9BDCFF; }
.ach.locked { opacity: .5; border-style: dashed; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notes a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.2); text-decoration: none; }
.notes li.new a { box-shadow: inset 3px 0 0 var(--marigold); }
.rewards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rw-item { display: flex; flex-direction: column; align-items: center; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--panel-line); animation: pop .4s ease; }
.rw-item b { font-family: var(--display); font-size: 20px; }
.rw-item span { font-size: 12px; color: var(--on-sea-soft); text-transform: capitalize; }
.rw-item.gold, .rw-item.diamond { border-color: rgba(255,183,3,.6); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--marigold); }
.linkbtn { background: none; border: 0; color: var(--on-sea-soft); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--lose-soft); }
.hist .oc.void { background: rgba(255,255,255,.08); color: var(--on-sea-soft); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seg button { white-space: nowrap; }

/* ---------- Daily, events, feed (v4.1) ---------- */
.ok { color: var(--win-soft); }
.daily-hero { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.daily-hero > .stack { flex: 1; min-width: 260px; max-width: 640px; }
.daily-hero .btn.big { align-self: flex-start; }
.dl-result { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.dl-result .muted { color: var(--ink-soft); }
.dl-result b { font-family: var(--display); font-size: 22px; }
.dl-result b.big { font-size: 34px; }
.hubcard { text-decoration: none; transition: transform .15s, border-color .15s; border-color: rgba(255,183,3,.35); }
.hubcard:hover { transform: translateY(-2px); border-color: var(--marigold); }
.hub-t { font-family: var(--display); font-size: 18px; line-height: 1.2; }
.hub-ev { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.2); text-decoration: none; }
.evgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.evcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--panel-line); text-decoration: none; transition: transform .15s, border-color .15s; }
.evcard:hover { transform: translateY(-2px); border-color: rgba(255,183,3,.5); }
.evcard.monthly { border-color: rgba(201,98,47,.5); }
.ev-title { font-family: var(--display); font-size: 17px; line-height: 1.25; }
.ev-st { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.1); }
.ev-st.live { background: rgba(42,157,143,.3); color: var(--win-soft); }
.ev-st.done { color: var(--on-sea-soft); }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.feed .fi { width: 22px; text-align: center; flex: none; }
.feed .ft { min-width: 0; }
.feed a { text-decoration: none; }
.odot { width: 10px; height: 10px; border-radius: 50%; background: #5B6670; margin-left: -14px; margin-top: 22px; border: 2px solid var(--sea); flex: none; }
.odot.on { background: #3FD08A; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badgechip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.08); border: 1px solid var(--panel-line); }
.badgechip.gold { border-color: rgba(255,183,3,.6); }
.badgechip.silver { border-color: rgba(214,221,225,.5); }
.badgechip.bronze { border-color: rgba(226,163,107,.55); }
.nav a { padding: 8px 10px; }

/* ---------- Rematch and match summary (v4.2) ---------- */
.pending-rm { display: inline-flex; align-items: center; padding: 12px 18px; border-radius: 999px; background: rgba(255,183,3,.12); border: 1px solid rgba(255,183,3,.4); font-weight: 700; }
.hist li.link { cursor: pointer; transition: background .15s; }
.hist li.link:hover { background: rgba(255,255,255,.08); }
.mq { gap: 8px; }
.mq-ans { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--panel-line); }
.review .no, .mq .no { color: var(--lose-soft); font-weight: 700; }

/* ---------- Shuffle (v4.3) ---------- */
.btn.shuffle { background: linear-gradient(135deg, #FFB703, #FB8500); box-shadow: 0 6px 20px rgba(251,133,0,.35); }
.btn.shuffle:hover { filter: brightness(1.08); }
.shuffle-pick { font-size: 18px; padding: 10px 18px; border-radius: 999px; background: rgba(255,183,3,.14); border: 1px solid rgba(255,183,3,.5); animation: pop .5s ease; }

/* ---------- Custom quizzes (v4.4) ---------- */
.create-hero { display: flex; flex-direction: column; gap: 18px; max-width: 880px; }
.big-input { font-size: 20px; padding: 18px 20px; border-radius: 16px; }
.create-strip { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px 20px; border-radius: 20px; background: linear-gradient(120deg, rgba(108,99,255,.28), rgba(255,183,3,.14)); border: 1px solid rgba(255,183,3,.35); }
.create-strip input { min-width: 0; flex: 1; }
.building { flex-direction: row; align-items: center; gap: 14px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,183,3,.25); border-top-color: var(--marigold); animation: spin 0.9s linear infinite; flex: none; }
.qzcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--panel-line); text-decoration: none; transition: transform .15s, border-color .15s; }
.qzcard:hover { transform: translateY(-2px); border-color: rgba(108,99,255,.7); }
.quiz-hero { display: flex; gap: 20px; flex-wrap: wrap; padding: 26px; border-radius: 24px; background: linear-gradient(135deg, rgba(108,99,255,.35), rgba(10,37,51,.6)); border: 1px solid rgba(108,99,255,.45); }
.eq textarea, .eq input, .eq select { font: 600 15px var(--body); }
textarea { width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; background: var(--paper); color: var(--ink); resize: vertical; }
.eq-ans { display: grid; gap: 6px; }
.stars { display: flex; gap: 4px; }
.stars button { background: none; border: 0; font-size: 28px; color: rgba(255,255,255,.25); cursor: pointer; }
.stars button.on, .stars button:hover { color: var(--marigold); }
.akey { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.credits { color: var(--on-sea-soft); font-size: 12px; text-align: center; padding: 0 16px 24px; }
.credits a { color: inherit; }

/* Highlighted own row in tables stays a table row (the .me rule above is for the header chip) */
tr.me{display:table-row}

/* ===== v4.16: homepage hierarchy (competitive / casual), your day, smart search, H2H, achievements, dropdowns ===== */
.home-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pz { position: relative; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.pz-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pz-t { font: 900 13px var(--body); letter-spacing: .12em; text-transform: uppercase; }
.pz-s { font-size: 12px; font-weight: 700; opacity: .8; }
.comp-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; }
.cbtn { display: flex; align-items: center; gap: 14px; text-align: left; border: 0; cursor: pointer; font: inherit; border-radius: 22px; padding: 18px 20px; transition: transform .18s, box-shadow .18s, background .18s; min-width: 0; }
.cbtn .ci { font-size: 40px; line-height: 1; transition: transform .3s; flex: none; }
.cbtn .cb { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cbtn b { font-weight: 900; font-size: clamp(16px, 2vw, 21px); letter-spacing: .01em; line-height: 1.1; }
.cbtn small { font-weight: 700; font-size: 12px; opacity: .7; line-height: 1.3; }
.cbtn.play { background: #fff; color: #1B1B1B; box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.cbtn.room { background: rgba(255,255,255,.18); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.cbtn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.24); }
.cbtn.room:hover { background: rgba(255,255,255,.28); }
.cbtn:hover .ci { transform: rotate(-10deg) scale(1.12); }
.h-joinrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-joinrow .small { font-weight: 800; opacity: .9; }
.h-joinrow input { width: 110px !important; flex: none; padding: 8px 12px; }
.pz.casual { padding-top: 16px; border-top: 1px dashed rgba(255,255,255,.4); }
.sq { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(0,0,0,.14); border-radius: 20px; padding: 12px 14px; }
.sq-t { display: flex; flex-direction: column; font-weight: 900; font-size: 18px; margin-right: auto; }
.sq-t small { font-size: 12px; font-weight: 700; opacity: .8; }
.sq-b { display: flex; gap: 8px; flex-wrap: wrap; }
.sqd { border: 0; cursor: pointer; font: 900 14px var(--body); letter-spacing: .06em; padding: 11px 16px; border-radius: 14px; color: #1B1B1B; transition: transform .15s, box-shadow .15s; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.sqd.d1 { background: #8CF0C4; } .sqd.d2 { background: #FFD23F; } .sqd.d3 { background: #FF8A75; }
.sqd:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.sqd:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
@media (max-width: 640px) { .comp-row { grid-template-columns: 1fr; } .sq-t { margin-right: 0; width: 100%; } .sq-b { width: 100%; } .sqd { flex: 1; } }

/* Your day */
.today .panel { display: flex; flex-direction: column; gap: 12px; }
.today-big { font: 900 22px var(--body); }
.today-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.today-stats > div, .h2h-stats > div { background: rgba(255,255,255,.06); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.today-stats b, .h2h-stats b { font: 900 20px var(--body); }
.today-stats span, .h2h-stats span { font-size: 12px; color: var(--on-sea-soft); }
.today-nudge { margin: 0; color: var(--marigold); font-weight: 700; }
.today-ach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ta { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.06); color: inherit; text-decoration: none; transition: background .15s, transform .15s; min-width: 0; }
.ta:hover { background: rgba(255,255,255,.11); transform: translateY(-2px); }
.ta-i { font-size: 28px; flex: none; }
.ta-b { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.ta-b b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-opp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.to { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.06); min-width: 0; }
.to-a { display: flex; gap: 8px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.to .nm, .ac-o .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .today-stats { grid-template-columns: repeat(2, 1fr); } .today-ach, .today-opp { grid-template-columns: 1fr; } }

/* Smart challenge search */
.chal-form { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; color: var(--ink); border-radius: 16px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.35); max-height: 340px; overflow-y: auto; animation: ddIn .16s ease; }
.ac-o { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.ac-o:hover, .ac-o.hl { background: rgba(108,99,255,.12); }
.ac-o .muted, .ac-empty, .ac-dym { color: var(--ink-soft); }
.ac-dym { padding: 8px 10px 4px; font-size: 13px; }
.ac-dym b { color: #6C63FF; }
.ac-empty { padding: 12px; font-size: 14px; }

/* Head-to-head */
.h2h { display: flex; flex-direction: column; gap: 12px; }
.h2h-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.h2h-side { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.h2h-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.h2h-big { font: 900 clamp(34px, 6vw, 52px) var(--display); letter-spacing: -.02em; }
.h2h-big .w { color: var(--win-soft); } .h2h-big .l { color: var(--lose-soft); }
.h2h-bar { height: 10px; border-radius: 99px; background: var(--lose); overflow: hidden; }
.h2h-bar i { display: block; height: 100%; background: var(--win); border-radius: 99px; }
.h2h-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.h2h-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.h2h-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); cursor: pointer; }
.h2h-list li:hover { background: rgba(255,255,255,.1); }
.h2h-list .oc { min-width: 28px; text-align: center; }
@media (max-width: 600px) { .h2h-stats { grid-template-columns: repeat(2, 1fr); } }

/* Achievements */
.achs2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ach2 { display: flex; gap: 12px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--panel-line); opacity: .85; transition: transform .15s, opacity .15s; }
.ach2:hover { opacity: 1; transform: translateY(-2px); }
.ach2.got { opacity: 1; background: linear-gradient(135deg, rgba(255,183,3,.14), rgba(255,255,255,.04)); border-color: rgba(255,183,3,.4); }
.ach-ic { position: relative; flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: rgba(255,255,255,.08); }
.ach2:not(.got) .ach-ic { filter: grayscale(1); }
.ach2.got.t-bronze .ach-ic { background: linear-gradient(135deg, #E3A36B, #A0582A); }
.ach2.got.t-silver .ach-ic { background: linear-gradient(135deg, #F2F5F7, #9AA7B1); }
.ach2.got.t-gold .ach-ic { background: linear-gradient(135deg, #FFE27A, #E0A100); }
.ach2.got.t-diamond .ach-ic { background: linear-gradient(135deg, #B9F3FF, #5AA9E6); }
.ach-lock { position: absolute; right: -4px; bottom: -4px; font-size: 14px; font-style: normal; filter: none; }
.ach-b { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.ach-b p { margin: 0; }
.ach-h { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ach-tier { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--on-sea-soft); }
.ach-done { font-size: 12px; font-weight: 800; color: var(--win-soft); }
.ach-p { font-size: 12px; color: var(--on-sea-soft); }
.ach-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.ach-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #FFB703, #FF6B1A); transition: width .6s ease; }
.ach-meta { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ach-r { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.08); }
.r-common { color: #C9D3D9; } .r-uncommon { color: #6FD3C6; } .r-rare { color: #7EB6FF; } .r-epic { color: #C79BFF; } .r-legendary { color: #FFB703; }

/* Dropdowns */
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.dd { position: relative; display: block; width: 100%; }
.dd .dd-src { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; font: 600 16px var(--body); color: var(--ink); background: var(--paper); border: 2px solid transparent; border-radius: 14px; padding: 11px 14px; cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.16); transition: border-color .15s, box-shadow .15s, background .15s; }
.dd-btn:hover { background: #fff; border-color: rgba(108,99,255,.4); box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 10px 22px rgba(0,0,0,.22); }
.dd.open .dd-btn, .dd-btn:focus-visible { outline: none; background: #fff; border-color: #6C63FF; box-shadow: 0 0 0 4px rgba(108,99,255,.28), 0 10px 22px rgba(0,0,0,.22); }
.dd-btn:disabled { opacity: .55; cursor: not-allowed; }
.dd-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: none; width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .65; transition: transform .2s ease; }
.dd.open .dd-chev { transform: translateY(2px) rotate(225deg); }
.dd-list { position: fixed; z-index: 10000; overflow-y: auto; overscroll-behavior: contain; background: #fff; color: var(--ink); border-radius: 16px; padding: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.38), 0 0 0 1px rgba(0,0,0,.06); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top center; transition: opacity .15s ease, transform .18s cubic-bezier(.2,.9,.3,1.15); }
.dd-list.up { transform: translateY(6px) scale(.98); transform-origin: bottom center; }
.dd-list.open { opacity: 1; transform: none; }
.dd-g { font: 800 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 10px 12px 4px; }
.dd-o { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; font: 600 15px var(--body); cursor: pointer; transition: background .12s; }
.dd-o.hl { background: rgba(108,99,255,.1); }
.dd-o.on { background: #6C63FF; color: #fff; }
.dd-o.on::after { content: "✓"; margin-left: auto; font-weight: 900; }
.dd-o.off { opacity: .4; cursor: default; }
select { appearance: none; -webkit-appearance: none; border-radius: 14px; padding-right: 40px; cursor: pointer; box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.16); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317222B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; transition: box-shadow .15s; }
select:focus { box-shadow: 0 0 0 4px rgba(108,99,255,.28); }
@media (prefers-reduced-motion: reduce) { .dd-list, .dd-chev, .dd-btn, .cbtn, .sqd, .ach2, .ta { transition: none; } .ac-list { animation: none; } }

/* ===== v4.17: lobby, player intro, countdown, sound controls, achievement pop-up, results ===== */
.lob { display: flex; flex-direction: column; gap: 16px; }
.lob-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lob-pill { font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 99px; background: rgba(255,183,3,.14); color: var(--marigold); }
.lob-pill::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 7px; animation: lobBlink 1.4s ease-in-out infinite; }
.lob-pill.ok { background: rgba(42,157,143,.18); color: var(--win-soft); }
@keyframes lobBlink { 50% { opacity: .25; } }
.lob-stage { position: relative; overflow: hidden; border-radius: 32px; padding: clamp(26px, 5vw, 48px) 16px 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(108,99,255,.45), rgba(10,37,51,.2) 60%), linear-gradient(160deg, #182A52, #0B1F2D); box-shadow: 0 24px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08); }
.lob.ready .lob-stage { background: radial-gradient(120% 90% at 50% 0%, rgba(42,157,143,.5), rgba(10,37,51,.2) 60%), linear-gradient(160deg, #123F45, #0B1F2D); }
.lob-rings { position: absolute; left: 50%; top: 44%; width: 0; height: 0; pointer-events: none; }
.lob-rings i { position: absolute; left: -160px; top: -160px; width: 320px; height: 320px; border-radius: 50%; border: 2px solid rgba(255,255,255,.12); animation: lobRing 3.6s ease-out infinite; }
.lob-rings i:nth-child(2) { animation-delay: 1.2s; } .lob-rings i:nth-child(3) { animation-delay: 2.4s; }
@keyframes lobRing { from { transform: scale(.35); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.lob-slots { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.lob-row { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 20px); flex-wrap: wrap; }
.lob-empties { display: flex; gap: 10px; justify-content: center; }
.lob-p { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; max-width: 170px; }
.lob-av { position: relative; display: grid; place-items: center; border-radius: 50%; padding: 6px; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--pc, #6C63FF) 55%, transparent), transparent 70%); }
.lob-av::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 2px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.35); filter: blur(3px); z-index: -1; }
.lob-p.me .lob-av { box-shadow: 0 0 0 3px var(--pc, #6C63FF); }
.lob-nm { font: 900 clamp(15px, 2.2vw, 20px) var(--body); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lob-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.lob-tags em { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.12); }
.lob-tags em.h { background: var(--marigold); color: #1B1B1B; } .lob-tags em.r { font-family: var(--mono); } .lob-tags em.a { background: rgba(224,83,61,.3); }
.lob-p.away { opacity: .5; filter: grayscale(.8); }
.lob-p.enter { animation: lobEnter .75s cubic-bezier(.2,1.4,.35,1) both; }
.lob-p.enter .lob-nm { animation: lobName .6s .3s ease both; }
@keyframes lobEnter { 0% { transform: translateY(-60px) scale(.4); opacity: 0; } 60% { transform: translateY(8px) scale(1.08); opacity: 1; } 100% { transform: none; } }
@keyframes lobName { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lob-vs { font: 900 clamp(22px, 4vw, 34px) var(--display); color: var(--marigold); text-shadow: 0 4px 0 rgba(0,0,0,.3); animation: lobVs 2.4s ease-in-out infinite; }
@keyframes lobVs { 50% { transform: scale(1.12) rotate(-4deg); } }
.lob-p.empty { opacity: .65; }
.lob-p.empty .lob-av { width: 64px; height: 64px; border: 2px dashed rgba(255,255,255,.35); background: none; }
.lob-p.empty .lob-nm { font-size: 12px; font-weight: 700; color: var(--on-sea-soft); }
.lob-q { font: 900 24px var(--display); opacity: .5; animation: lobBlink 2s ease-in-out infinite; }
.lob-msg { position: relative; margin: 10px 0 0; font: 900 clamp(22px, 4.6vw, 40px) var(--display); letter-spacing: .02em; line-height: 1.1; }
.lob.ready .lob-msg { color: var(--win-soft); animation: lobPop .5s ease both; }
@keyframes lobPop { from { transform: scale(.9); opacity: .2; } to { transform: none; opacity: 1; } }
.lob-sub { position: relative; margin: 0; font-weight: 700; color: var(--on-sea-soft); }
.lob-dots { display: flex; gap: 8px; }
.lob-dots i { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: lobDot 1.2s ease-in-out infinite; }
.lob-dots i:nth-child(2) { animation-delay: .15s; } .lob-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes lobDot { 0%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-8px); opacity: 1; } }
.lob-ctl { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lob-start { min-width: min(100%, 340px); font-size: 20px; }
.lob-start:not(:disabled) { animation: ctaPulse 2.4s ease-in-out infinite; }
.lob-wait { margin: 0; font-weight: 800; color: var(--on-sea-soft); }
.lob-invite { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; padding: 18px; border-radius: 22px; background: var(--panel); border: 1px solid var(--panel-line); }
.lob-code { display: flex; flex-direction: column; gap: 4px; }
.lob-code .bigcode { border: 0; cursor: pointer; background: none; color: inherit; padding: 0; transition: transform .15s; }
.lob-code .bigcode:hover { transform: scale(1.04); }
.room-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(108,99,255,.12); font-size: 14px; font-weight: 600; line-height: 1.4; }

/* Player introduction and countdown */
.cd-ov { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; color: #fff; text-align: center;
  background: radial-gradient(90% 70% at 50% 45%, rgba(108,99,255,.55), rgba(5,12,24,.94) 70%); backdrop-filter: blur(6px); animation: cdIn .3s ease both; }
.cd-ov.out { animation: cdOut .38s ease both; }
@keyframes cdIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cdOut { to { opacity: 0; transform: scale(1.06); } }
.cd-players { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 30px); flex-wrap: wrap; transition: transform .5s ease, opacity .5s ease; }
.cd-ov.counting .cd-players { transform: translateY(-10px) scale(.78); opacity: .55; }
.cd-p { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: cdP .7s cubic-bezier(.2,1.4,.35,1) both; }
.cd-p b { font: 900 clamp(16px, 2.6vw, 24px) var(--body); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-p small { opacity: .75; } .cd-p em { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--pc); }
.cd-av { border-radius: 50%; padding: 6px; background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--pc) 60%, transparent), transparent 70%); }
.cd-p.me .cd-av { box-shadow: 0 0 0 3px var(--pc); }
@keyframes cdP { from { transform: translateY(40px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.cd-vs { font: 900 clamp(26px, 5vw, 44px) var(--display); color: var(--marigold); animation: cdVs .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes cdVs { from { transform: scale(3); opacity: 0; } to { transform: none; opacity: 1; } }
.cd-num { font: 900 clamp(110px, 26vw, 230px) var(--display); line-height: 1; height: 1em; text-shadow: 0 10px 0 rgba(0,0,0,.25), 0 0 60px rgba(255,255,255,.35); opacity: 0; }
.cd-num.show { animation: cdNum .95s cubic-bezier(.15,1.3,.4,1) both; }
.cd-num.go { color: var(--marigold); animation: cdGo .85s cubic-bezier(.15,1.3,.4,1) both; }
@keyframes cdNum { 0% { transform: scale(2.4); opacity: 0; } 25% { transform: scale(.94); opacity: 1; } 40% { transform: scale(1.04); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: .15; transform: scale(.85); } }
@keyframes cdGo { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 40% { transform: scale(1.18) rotate(2deg); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.cd-cap { font: 900 14px var(--body); letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.cd-ov.many .cd-vs { font-size: 22px; }

/* Sound control */
.snd-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; font-size: 18px; background: rgba(255,255,255,.08); color: inherit; transition: background .15s, transform .15s; }
.snd-btn:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.snd-panel { position: fixed; z-index: 9500; width: 250px; padding: 14px 16px; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; animation: ddIn .16s ease; }
.snd-top { display: flex; align-items: center; justify-content: space-between; }
.snd-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.snd-row input[type=range] { width: 100%; padding: 0; background: none; box-shadow: none; accent-color: #6C63FF; }
.snd-panel .muted { color: var(--ink-soft); margin: 0; }
.sw { position: relative; width: 46px; height: 26px; flex: none; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 99px; background: #C9CED3; transition: background .2s; }
.sw span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.sw input:checked + span { background: #6C63FF; } .sw input:checked + span::after { transform: translateX(20px); }
.sw input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* Achievement pop-up */
.achpop { position: fixed; z-index: 9600; left: 50%; top: 18px; display: flex; align-items: center; gap: 14px; width: min(440px, calc(100vw - 24px)); padding: 14px 18px; border-radius: 22px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #24324F, #13223A); color: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,183,3,.45); transform: translateX(-50%); animation: apIn .6s cubic-bezier(.2,1.4,.35,1) both; }
.achpop.out { animation: apOut .45s ease both; }
@keyframes apIn { from { transform: translate(-50%, -140%) scale(.8); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes apOut { to { transform: translate(-50%, -140%); opacity: 0; } }
.ap-ic { position: relative; flex: none; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 32px; background: linear-gradient(135deg, #E3A36B, #A0582A); animation: apIc .9s .2s cubic-bezier(.2,1.6,.4,1) both; }
.achpop.t-silver .ap-ic { background: linear-gradient(135deg, #F2F5F7, #9AA7B1); } .achpop.t-gold .ap-ic { background: linear-gradient(135deg, #FFE27A, #E0A100); } .achpop.t-diamond .ap-ic { background: linear-gradient(135deg, #B9F3FF, #5AA9E6); }
@keyframes apIc { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.ap-b { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-l { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--marigold); }
.ap-b b { font: 900 19px var(--body); }
.ap-d { font-size: 13px; opacity: .85; }
.ap-t { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.achpop.rare { box-shadow: 0 24px 70px rgba(255,183,3,.35), inset 0 0 0 2px rgba(255,210,63,.9); background: linear-gradient(135deg, #3B2A63, #16223F); }
.ap-rays { position: absolute; left: 47px; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; background: repeating-conic-gradient(from 0deg, rgba(255,210,63,.22) 0 10deg, transparent 10deg 30deg); border-radius: 50%; animation: apRays 6s linear infinite; pointer-events: none; }
@keyframes apRays { to { transform: rotate(360deg); } }

/* Results */
.res-winner { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 auto 6px; text-align: center; animation: cdP .8s cubic-bezier(.2,1.4,.35,1) both; }
.res-winner b { font: 900 clamp(20px, 3.4vw, 28px) var(--display); }
.res-winner.me b { color: var(--marigold); }
.rw-crown { font-size: 34px; margin-bottom: -14px; z-index: 1; animation: rwCrown 1.6s ease-in-out infinite; }
@keyframes rwCrown { 50% { transform: translateY(-6px) rotate(-6deg); } }
.rw-av { border-radius: 50%; padding: 6px; background: radial-gradient(circle at 50% 65%, rgba(255,210,63,.55), transparent 70%); box-shadow: 0 0 40px rgba(255,210,63,.35); }
.res-win .medal { animation: resWin 1s cubic-bezier(.2,1.6,.4,1) both; display: inline-block; }
@keyframes resWin { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.res-lose .medal { animation: resLose 1.2s ease both; display: inline-block; filter: grayscale(.4); }
@keyframes resLose { 0% { transform: translateY(-30px); opacity: 0; } 60% { transform: translateY(4px); opacity: 1; } 75% { transform: translateX(-4px); } 90% { transform: translateX(3px); } 100% { transform: none; } }
.res-fx { position: fixed; inset: 0; pointer-events: none; z-index: 8000; overflow: hidden; }
.res-fx i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: resConf linear both; }
@keyframes resConf { to { transform: translateY(110vh) rotate(720deg); } }
@media (max-width: 560px) { .lob-row { gap: 6px; } .lob-vs { font-size: 18px; } .cd-ov.many .cd-players { gap: 6px; } }
@media (prefers-reduced-motion: reduce) {
  .lob-rings i, .lob-dots i, .lob-vs, .lob-p.enter, .cd-p, .cd-vs, .cd-num.show, .cd-num.go, .achpop, .ap-rays, .rw-crown, .res-win .medal, .res-lose .medal, .lob-start { animation: none !important; }
  .cd-num.show, .cd-num.go { opacity: 1; }
}
@media (max-width: 560px) {
  .lob-row.n3, .lob-row.n4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; justify-items: center; }
  .lob-row.n3 .lob-vs, .lob-row.n4 .lob-vs { display: none; }
  .cd-ov.many .cd-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .cd-ov.many .cd-vs { display: none; }
}

/* ===== v4.18: Map Challenge, 3D avatars everywhere ===== */
.av .av3 { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; border-radius: inherit; }
.mc-slot { margin-bottom: 14px; }
.mc { position: relative; height: clamp(260px, 44vh, 480px); border-radius: 26px; overflow: hidden; background: radial-gradient(120% 100% at 50% 40%, #0F2C47 0%, #050C18 75%); box-shadow: 0 24px 60px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.08); }
.mc.cine { position: fixed; inset: 0; height: auto; z-index: 8500; border-radius: 0; }
.mc-view, .mc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mc-load { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--on-sea-soft); font-weight: 700; text-align: center; padding: 20px; }
.mc-load .spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--marigold); animation: mcSpin .9s linear infinite; }
@keyframes mcSpin { to { transform: rotate(360deg); } }
.mc-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mc-lbl { position: absolute; left: 0; top: 0; margin: -36px 0 0 -2px; padding: 3px 9px 3px 6px; border-radius: 99px; font: 800 12px var(--body); color: #fff; background: rgba(8,18,32,.78); box-shadow: 0 4px 12px rgba(0,0,0,.35); white-space: nowrap; transform-origin: 0 0; translate: -50% 0; }
.mc-lbl i { font-style: normal; margin-right: 4px; }
.mc-lbl.far { font-size: 10px; padding: 2px 7px 2px 5px; margin-top: -26px; }
.mc-lbl.cur { background: var(--marigold); color: #1B1B1B; }
.mc-lbl[data-w="0"] { box-shadow: inset 0 0 0 2px #FF6B1A; } .mc-lbl[data-w="1"] { box-shadow: inset 0 0 0 2px #19B3A6; } .mc-lbl[data-w="-1"] { box-shadow: inset 0 0 0 2px #FFD23F; }
.mc-tag { position: absolute; left: 0; top: 0; translate: -50% -100%; padding: 2px 8px; border-radius: 8px; font: 900 11px var(--body); color: #fff; background: var(--pc); box-shadow: 0 3px 10px rgba(0,0,0,.35); white-space: nowrap; }
.mc-hud { position: absolute; left: 0; right: 0; top: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 2; }
.mc-route { display: flex; align-items: center; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.mc-route::-webkit-scrollbar { display: none; }
.mc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 99px; background: rgba(8,18,32,.72); color: #fff; font: 800 11px var(--body); white-space: nowrap; flex: none; }
.mc-chip i { font-style: normal; } .mc-chip b { font-weight: 800; }
.mc-chip.cur { background: var(--marigold); color: #1B1B1B; animation: mcPulse 1.6s ease-in-out infinite; }
.mc-chip.w0 { background: #FF6B1A; } .mc-chip.w1 { background: #19B3A6; } .mc-chip.wt { background: #9A7B1E; }
@keyframes mcPulse { 50% { box-shadow: 0 0 0 4px rgba(255,183,3,.35); } }
.mc-line { width: 14px; height: 2px; background: rgba(255,255,255,.35); flex: none; }
.mc-sc { display: flex; align-items: center; gap: 8px; align-self: flex-start; padding: 5px 10px; border-radius: 14px; background: rgba(8,18,32,.75); color: #fff; }
.mc-pl { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; }
.mc-pl b { font: 900 18px var(--display); } .mc-pl.p0 b { color: #FF8A4C; } .mc-pl.p1 b { color: #4FD1C5; }
.mc-pl .av { width: 24px; height: 24px; font-size: 13px; }
.mc-pn { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-vs { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.mc-city { position: absolute; left: 12px; right: 12px; bottom: -0; top: auto; display: none; }
.mc .mc-hud .mc-city { position: static; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; align-self: flex-start; padding: 6px 12px; border-radius: 14px; background: rgba(8,18,32,.75); color: #fff; font-size: 12px; font-weight: 700; }
.mc-cn { font: 900 15px var(--body); }
.mc-cs { display: flex; gap: 6px; align-items: center; } .mc-cs b { font: 900 15px var(--mono); } .mc-cs b.p0 { color: #FF8A4C; } .mc-cs b.p1 { color: #4FD1C5; } .mc-cs i { font-style: normal; opacity: .5; }
.mc.cine .mc-hud { padding-top: 14px; }
.mc.cine .mc-hud .mc-sc, .mc.cine .mc-hud .mc-city { display: none; }
.mc-cine { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 70px 16px 30px; color: #fff; text-align: center; z-index: 3; }
.mc.cine .mc-cine { background: radial-gradient(70% 60% at 50% 50%, transparent 40%, rgba(3,8,18,.55)); }
.mci-title { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: mciIn .8s cubic-bezier(.2,1.2,.35,1) both; }
.mci-title span { font: 900 13px var(--body); letter-spacing: .3em; text-transform: uppercase; color: var(--marigold); }
.mci-title b { font: 900 clamp(28px, 6vw, 56px) var(--display); line-height: 1.05; text-shadow: 0 6px 24px rgba(0,0,0,.6); }
.mci-title em { font-style: normal; font-size: clamp(16px, 3vw, 24px); letter-spacing: .05em; }
.mci-players { display: flex; align-items: center; gap: clamp(10px, 5vw, 60px); }
.mci-p { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: mciP .8s cubic-bezier(.2,1.4,.35,1) both; }
.mci-p .c3 { border-radius: 50%; background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--pc) 60%, transparent), transparent 70%); }
.mci-p b { font: 900 clamp(16px, 2.6vw, 22px) var(--body); text-shadow: 0 3px 10px rgba(0,0,0,.6); }
.mci-p em { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--pc); }
.mci-vs { font: 900 clamp(24px, 5vw, 40px) var(--display); color: var(--marigold); animation: cdVs .6s .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes mciIn { from { opacity: 0; transform: translateY(-24px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes mciP { from { opacity: 0; transform: translateY(40px) scale(.6); } to { opacity: 1; transform: none; } }
.mci-note { padding: 8px 16px; border-radius: 99px; background: rgba(8,18,32,.75); font-weight: 800; font-size: 14px; animation: mciIn .6s ease both; }
.mci-city, .mci-next { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: auto; margin-top: 4vh; animation: mciIn .8s cubic-bezier(.2,1.2,.35,1) both; }
.mci-city span, .mci-next span { font: 900 12px var(--body); letter-spacing: .25em; text-transform: uppercase; color: var(--marigold); text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.mci-city b, .mci-next b { font: 900 clamp(34px, 8vw, 72px) var(--display); line-height: 1; text-transform: uppercase; text-shadow: 0 8px 30px rgba(0,0,0,.7); }
.mci-city em, .mci-next em { font-style: normal; font-weight: 800; font-size: 15px; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.mci-strip { margin-top: auto; display: flex; align-items: center; gap: 14px; padding: 8px 18px; border-radius: 99px; background: rgba(8,18,32,.8); font-weight: 900; animation: mciIn .6s ease both; }
.mci-strip span { color: var(--pc); } .mci-strip i { font-style: normal; color: var(--marigold); }
.mci-res { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: auto; margin-bottom: 4vh; padding: 18px 26px; border-radius: 26px; background: rgba(8,18,32,.84); box-shadow: 0 20px 50px rgba(0,0,0,.45); animation: mciP .7s cubic-bezier(.2,1.4,.35,1) both; max-width: min(560px, 92vw); }
.mci-res.me { box-shadow: 0 0 0 2px var(--marigold), 0 20px 60px rgba(255,183,3,.3); }
.mci-k { font: 900 11px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--on-sea-soft); }
.mci-res b { font: 900 clamp(22px, 4.6vw, 38px) var(--display); line-height: 1.1; }
.mci-res.final b { font-size: clamp(30px, 7vw, 60px); text-transform: uppercase; }
.mci-sc { display: flex; gap: 10px; align-items: baseline; font-weight: 800; } .mci-sc b { font: 900 22px var(--mono); }
.mci-sc .p0 b { color: #FF8A4C; } .mci-sc .p1 b { color: #4FD1C5; } .mci-sc i { font-style: normal; opacity: .5; }
.mci-tally { font-weight: 800; font-size: 14px; color: var(--marigold); }
.mc-count { font: 900 clamp(110px, 26vw, 220px) var(--display); line-height: 1; opacity: 0; text-shadow: 0 10px 0 rgba(0,0,0,.25), 0 0 60px rgba(255,255,255,.4); }
.mc-count.show { animation: cdNum .95s cubic-bezier(.15,1.3,.4,1) both; }
.mc-count.go { color: var(--marigold); animation: cdGo .9s cubic-bezier(.15,1.3,.4,1) both; }
.mc:not(.cine) .mc-count { font-size: clamp(70px, 16vw, 140px); }
.cbtn.mapbtn { position: relative; overflow: hidden; width: 100%; background: linear-gradient(120deg, #123E5C, #1E6A93 55%, #2F8F5B); color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,214,120,.55); }
.cbtn.mapbtn .cb { position: relative; z-index: 1; }
.newb { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: .1em; padding: 2px 7px; border-radius: 99px; background: var(--marigold); color: #1B1B1B; vertical-align: middle; margin-left: 6px; }
.mapbtn-globe { position: absolute; right: -30px; top: 50%; width: 120px; height: 120px; margin-top: -60px; border-radius: 50%; opacity: .35;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 1px, transparent 1px 15px), repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 15px), radial-gradient(circle at 35% 35%, #7FD3A8, #1E6A93 70%);
  animation: mapGlobe 12s linear infinite; background-size: 30px 100%, 100% 15px, 100% 100%; }
@keyframes mapGlobe { to { background-position: 120px 0, 0 0, 0 0; } }
.map-rules { padding: 14px 16px; border-radius: 16px; background: rgba(42,157,143,.14); font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.map-rules ol { margin: 0; padding-left: 20px; }
.mp-routes { display: flex; flex-direction: column; gap: 8px; }
.mp-route { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 12px 14px; border-radius: 16px; border: 2px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.mp-route:hover { transform: translateY(-1px); background: rgba(255,255,255,.09); }
.mp-route.on { border-color: var(--marigold); background: rgba(255,183,3,.1); }
.mp-route b { font-size: 16px; } .mp-route small { opacity: .7; font-weight: 700; }
.mp-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; font-weight: 700; }
.mp-chain i { font-style: normal; opacity: .5; }
.res-winner.lose { opacity: .9; } .res-winner.lose b { font-size: 16px; color: var(--on-sea-soft); }
.ap-me { position: relative; margin-left: auto; flex: none; } .ap-me .av { width: 44px; height: 44px; }
@media (max-width: 600px) { .mc { height: 38vh; min-height: 240px; border-radius: 20px; } .mc-chip b { display: none; } .mc-chip.cur b { display: inline; } .mci-players .c3 { --s: 92px !important; } }
@media (prefers-reduced-motion: reduce) { .mci-title, .mci-p, .mci-vs, .mci-city, .mci-next, .mci-res, .mapbtn-globe, .mc-chip.cur { animation: none !important; } }

/* ===== v4.19: live online counter, Random Journey ===== */
.live-pill { position: relative; display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 12px 6px 10px; border-radius: 99px; background: rgba(0,0,0,.22); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .0; transition: opacity .4s; flex-wrap: wrap; }
.live-pill.ready { opacity: 1; }
.live-pill b { font: 900 15px var(--display); letter-spacing: 0; display: inline-block; }
.live-pill b.bump { animation: lpBump .6s cubic-bezier(.2,1.6,.4,1); }
.lp-dot { width: 9px; height: 9px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 0 rgba(61,220,132,.7); animation: lpPulse 2s ease-out infinite; flex: none; }
.lp-s { font-weight: 700; letter-spacing: .02em; text-transform: none; opacity: .85; }
.lp-s::before { content: "·"; margin-right: 7px; }
@keyframes lpPulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.65); } 70% { box-shadow: 0 0 0 9px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
@keyframes lpBump { 0% { transform: scale(1.5); color: #3DDC84; } 100% { transform: none; } }
.cbtn.rjbtn { position: relative; overflow: hidden; width: 100%; background: linear-gradient(120deg, #3B2A63, #7A4FD0 55%, #D0453B); color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,255,255,.35); }
.cbtn.rjbtn .cb { position: relative; z-index: 1; }
.rj-dice { position: absolute; right: 18px; top: 50%; font-size: 46px; opacity: .25; transform: translateY(-50%) rotate(-20deg); animation: rjPlane 6s ease-in-out infinite; }
@keyframes rjPlane { 0%, 100% { transform: translate(0, -50%) rotate(-20deg); } 50% { transform: translate(-14px, -62%) rotate(-12deg); } }
#modal-body:has(.rj) { max-width: 780px; width: min(780px, 96vw); }
.rj { display: flex; flex-direction: column; gap: 14px; }
.rj-head { text-align: center; } .rj-head h2 { margin: 4px 0 0; }
.rj-k { font: 900 12px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--marigold); }
.rj-cards { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.rj-card { --cc: #1E6A93; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 12px 14px; border-radius: 22px; text-align: center; min-height: 150px; justify-content: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--cc) 85%, white 0%), color-mix(in srgb, var(--cc) 45%, #0B1F2D)); color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.15); transition: background .3s; }
.rj-card::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 22px), repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 1px, transparent 1px 22px); pointer-events: none; }
.rj-l { font: 900 10px var(--body); letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.rj-flag { font-size: 44px; line-height: 1.1; }
.rj-card b { font: 900 clamp(18px, 3.4vw, 26px) var(--display); text-transform: uppercase; line-height: 1.05; }
.rj-card em { font-style: normal; font-size: 12px; font-weight: 700; opacity: .85; }
.rj-card.spin .rj-flag, .rj-card.spin b { filter: blur(1.2px); }
.rj-card.land { animation: rjLand .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes rjLand { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.rj-arrow { font-size: 30px; color: var(--marigold); animation: rjPlane 3s ease-in-out infinite; }
.rj-map { position: relative; height: clamp(220px, 38vh, 340px); border-radius: 22px; overflow: hidden; background: radial-gradient(120% 100% at 50% 40%, #0F2C47 0%, #050C18 75%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.rj-view { position: absolute; inset: 0; } .rj-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rj-lbls { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.rj-chain { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.rj-stop { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: rgba(255,255,255,.08); font-weight: 800; font-size: 13px; animation: rjStop .5s cubic-bezier(.2,1.4,.4,1) both; }
.rj-stop i { font-style: normal; } .rj-stop.a, .rj-stop.b { background: var(--marigold); color: #1B1B1B; }
.rj-to { opacity: .5; font-weight: 900; }
@keyframes rjStop { from { opacity: 0; transform: translateY(8px) scale(.8); } to { opacity: 1; transform: none; } }
.rj-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 13px; color: var(--on-sea-soft); }
.rj-stats b { color: #fff; font: 900 16px var(--display); }
.rj-meta { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--on-sea-soft); text-align: center; }
.rj-info { display: flex; flex-direction: column; gap: 10px; min-height: 20px; }
.rj-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rj-foot { text-align: center; margin: 0; }
@media (max-width: 600px) { .rj-cards { grid-template-columns: 1fr; } .rj-arrow { transform: rotate(90deg); justify-self: center; animation: none; } .rj-card { min-height: 120px; } .rj-btns { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .lp-dot, .rj-dice, .rj-arrow, .rj-stop, .rj-card.land { animation: none !important; } }

/* ===== v4.20: simpler Map Challenge start ===== */
#modal-body:has(.ms) { max-width: 560px; }
.ms { display: flex; flex-direction: column; gap: 12px; }
.ms-head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.ms-head h2 { margin: 0; }
.ms-k { font: 900 12px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--marigold); }
.ms-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.ms-steps span { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.06); font-size: 12px; color: var(--on-sea-soft); line-height: 1.25; }
.ms-steps i { font-style: normal; font-size: 22px; margin-bottom: 2px; }
.ms-steps b { color: #fff; font-size: 13px; }
.ms-big { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 0; border-radius: 20px; cursor: pointer; text-align: left; font: inherit; color: #fff; transition: transform .15s, box-shadow .15s; }
.ms-big:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.3); }
.ms-big.rnd { background: linear-gradient(120deg, #3B2A63, #7A4FD0 55%, #D0453B); box-shadow: 0 10px 26px rgba(0,0,0,.25), inset 0 0 0 2px rgba(255,255,255,.3); }
.ms-big.find { background: linear-gradient(120deg, #123E5C, #1E6A93 55%, #2F8F5B); box-shadow: 0 10px 26px rgba(0,0,0,.25), inset 0 0 0 2px rgba(255,214,120,.45); }
.ms-i { font-size: 34px; flex: none; }
.ms-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ms-t b { font: 900 19px var(--body); } .ms-t small { font-size: 13px; opacity: .85; font-weight: 600; }
.ms-go { font-size: 22px; font-weight: 900; opacity: .8; transition: transform .15s; } .ms-big:hover .ms-go { transform: translateX(4px); }
.ms-more { align-self: center; border: 0; background: none; color: var(--on-sea-soft); font: 700 14px var(--body); cursor: pointer; padding: 6px 10px; border-radius: 10px; }
.ms-more:hover { color: #fff; background: rgba(255,255,255,.06); }
.ms-more span { display: inline-block; transition: transform .2s; } .ms-more.open span { transform: rotate(180deg); }
.ms-routes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; animation: ddIn .2s ease; }
.ms-route { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 12px; border-radius: 14px; border: 2px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.ms-route:hover { border-color: var(--marigold); background: rgba(255,183,3,.08); transform: translateY(-1px); }
.ms-route.on { border-color: var(--marigold); opacity: .7; }
.ms-flags { font-size: 15px; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; } .ms-flags i { font-style: normal; opacity: .4; font-size: 11px; }
.ms-route b { font-size: 14px; } .ms-route small { font-size: 12px; opacity: .7; font-weight: 600; }
@media (max-width: 520px) { .ms-routes { grid-template-columns: 1fr; } .ms-steps span { font-size: 11px; } }

/* ===== v4.20.1: big 3D players on the map ===== */
.mc-pls { position: absolute; left: 10px; right: 10px; bottom: 6px; display: flex; justify-content: space-between; pointer-events: none; z-index: 2; }
.mc-pc { display: flex; flex-direction: column; align-items: center; gap: 0; animation: mciP .7s cubic-bezier(.2,1.4,.35,1) both; }
.mc-pc .c3 { border-radius: 50%; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--pc) 55%, transparent), transparent 68%); filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.mc-pc b { margin-top: -6px; padding: 2px 10px; border-radius: 99px; background: var(--pc); color: #fff; font: 900 12px var(--body); box-shadow: 0 3px 10px rgba(0,0,0,.35); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc[data-stage="lobby"] .mc-pls, .mc[data-stage="world"] .mc-pls, .mc[data-stage="zoom"] .mc-pls, .mc[data-stage="players"] .mc-pls { display: none; }
.mc.cine .mc-pls { top: 54px; bottom: auto; }
.mc.cine .mc-pc .c3 { --s: 120px !important; }
@media (max-width: 600px) { .mc-pc .c3 { --s: 74px !important; } .mc.cine .mc-pc .c3 { --s: 96px !important; } }


/* ===== v4.21: streak rewards, weekly season, sharing, reports, legal pages, onboarding ===== */
.stk { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.stk-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.stk-r { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stk-i { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px 12px; border-radius: 14px; border: 1px solid rgba(127,127,127,.25); background: rgba(127,127,127,.06); cursor: pointer; font: inherit; color: inherit; overflow: hidden; transition: transform .15s; }
.stk-i:hover { transform: translateY(-2px); }
.stk-i.got { border-color: rgba(233,185,73,.7); background: rgba(233,185,73,.12); }
.stk-sw { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.2); }
.stk-i:not(.got) .stk-sw { filter: saturate(.55) brightness(.9); }
.stk-d { font-weight: 800; font-size: 13px; }
.stk-n { font-size: 11px; opacity: .7; }
.stk-p { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(127,127,127,.18); }
.stk-p i { display: block; height: 100%; background: linear-gradient(90deg, #FF6B2C, #E9B949); }
.rw-pop { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rw-big { width: 88px; height: 88px; border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.15), 0 0 40px rgba(233,185,73,.6); animation: rwpop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes rwpop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.colpick .rwc { outline: 2px dashed rgba(233,185,73,.8); outline-offset: 2px; }
.colpick .lockc { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 13px; cursor: pointer; opacity: .55; filter: saturate(.5); }

.season-slot:empty { display: none; }
.season { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ss-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ss-l li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; }
.ss-l li.me { background: rgba(233,185,73,.16); }
.ss-r { text-align: center; font-weight: 800; }
.ss-n { display: flex; align-items: center; gap: 8px; min-width: 0; color: inherit; text-decoration: none; font-weight: 700; }
.ss-n > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-c { font-size: 12px; }

.dl-marks { font-size: 22px; letter-spacing: 2px; margin: 4px 0 10px; }

.q-flag { margin-left: auto; background: none; border: 0; padding: 2px 6px; font: inherit; font-size: 12px; opacity: .55; cursor: pointer; color: inherit; border-radius: 8px; }
.q-flag:hover, .q-flag:focus-visible { opacity: 1; background: rgba(127,127,127,.15); }
.qmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review .q-flag { align-self: flex-start; margin-left: 0; padding-left: 0; }
.qr-r { display: flex; flex-direction: column; gap: 6px; }

.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; font-size: 13px; }
.foot-links a { text-decoration: none; font-weight: 600; }
.foot-links a:hover { text-decoration: underline; }
.legal { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.legal h1 { font-size: clamp(28px, 5vw, 42px); margin: 4px 0 10px; }
.legal h2 { font-size: 20px; margin: 22px 0 6px; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal textarea, .legal input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.legal-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal-t th, .legal-t td { text-align: left; padding: 8px; border-bottom: 1px solid rgba(127,127,127,.25); vertical-align: top; }
.tbl-wrap { overflow-x: auto; }
.ok-box { border-left: 4px solid #3FA34D; }

.onb { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.onb h2 { margin: 0; }
.onb-e { font-size: 54px; line-height: 1; }
.onb-av { display: grid; place-items: center; min-height: 130px; }
.onb-dots { display: flex; gap: 6px; margin: 4px 0; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(127,127,127,.35); }
.onb-dots i.on { width: 22px; border-radius: 6px; background: #E9B949; }
.onb .btn { width: 100%; }
.onb-skip { font-size: 13px; opacity: .7; }

@media (max-width: 520px) {
  .stk-r { gap: 6px; }
  .stk-sw { width: 28px; height: 28px; }
  .dl-marks { font-size: 18px; }
}


/* ===== v4.24: Quiz by Year ===== */
.cbtn.yrbtn { position: relative; overflow: hidden; width: 100%; text-decoration: none; background: linear-gradient(120deg, #0F4C5C, #1F8A70 50%, #E9B949); color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,255,255,.35); }
.cbtn.yrbtn:hover { transform: translateY(-2px); }
.cbtn.yrbtn .cb { position: relative; z-index: 1; }
.yr-mini { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: Unbounded, sans-serif; font-weight: 800; font-size: 40px; opacity: .22; letter-spacing: -.02em; animation: yrTick 5s steps(1) infinite; }
@keyframes yrTick { 0% { opacity: .22; } 50% { opacity: .3; } }
.yrs-head h1 { font-size: clamp(30px, 6vw, 52px); margin: 4px 0; }
.yr-decs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.yr-decs button { font: inherit; font-weight: 800; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(127,127,127,.35); background: transparent; color: inherit; cursor: pointer; }
.yr-decs button.on { background: #E9B949; color: #1B1B1B; border-color: #E9B949; }
.yr-line { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; position: relative; }
.yr-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; border-radius: 20px; text-decoration: none; color: #fff; overflow: hidden;
  background: linear-gradient(150deg, hsl(var(--h) 55% 34%), hsl(calc(var(--h) + 40) 60% 22%)); box-shadow: 0 8px 22px rgba(0,0,0,.2), inset 0 0 0 1px rgba(255,255,255,.12); transition: transform .18s, box-shadow .18s; }
.yr-card:hover, .yr-card:focus-visible { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 14px 30px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,255,255,.35); }
.yr-card.empty { filter: grayscale(.7); opacity: .7; }
.yr-y { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.02em; }
.yr-n { font-size: 11px; font-weight: 800; letter-spacing: .08em; opacity: .9; }
.yr-n b { font-size: 15px; }
.yr-sz { display: flex; gap: 3px; font-size: 11px; opacity: .8; }
.yr-sz i { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); }
.yr-sz.sS i:nth-child(1), .yr-sz.sM i:nth-child(-n+2), .yr-sz.sL i { background: #E9B949; }
.yr-t { font-size: 14px; letter-spacing: 2px; min-height: 18px; }
.yr-card { padding-right: 44px; }
.yr-go { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 12px; }
.yr-hero { position: relative; border-radius: 26px; padding: 22px 22px 26px; margin: 10px 0 14px; color: #fff; text-align: center;
  background: radial-gradient(circle at 20% 0%, hsl(var(--h) 70% 45% / .7), transparent 60%), linear-gradient(150deg, hsl(var(--h) 55% 30%), hsl(calc(var(--h) + 40) 60% 18%)); }
.yr-big { font-family: Unbounded, sans-serif; font-size: clamp(64px, 16vw, 140px); line-height: .95; margin: 6px 0; letter-spacing: -.04em; }
.yr-nav { display: flex; justify-content: space-between; }
.yr-nav a { color: #fff; text-decoration: none; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); }
.yr-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.yr-topics button { font: inherit; font-weight: 700; padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(127,127,127,.35); background: transparent; color: inherit; cursor: pointer; }
.yr-topics button small { opacity: .6; margin-left: 4px; font-weight: 600; }
.yr-topics button.on { background: #1F8A70; color: #fff; border-color: #1F8A70; }
.yr-play { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
@media (max-width: 520px) { .yr-play { grid-template-columns: 1fr; } .yr-line { grid-template-columns: repeat(2, 1fr); } .yr-y { font-size: 28px; } .yr-mini { font-size: 30px; } }


/* ===== v4.25: Live Quiz ===== */
.cbtn.lqbtn { position: relative; overflow: hidden; width: 100%; text-decoration: none; background: linear-gradient(120deg, #46178F, #8A3FFC 55%, #E2483D); color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,255,255,.35); }
.cbtn.lqbtn .cb { position: relative; z-index: 1; }
.lq-mini { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: Unbounded, sans-serif; font-weight: 800; font-size: 38px; opacity: .22; }
.lq-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: center; padding: 26px; border-radius: 26px; color: #fff; background: linear-gradient(135deg, #2B0F5E, #6A2BD1 60%, #E2483D); margin-bottom: 16px; }
.lq-hero h1 { font-size: clamp(30px, 5vw, 48px); margin: 0; }
.lq-hero .lead { color: rgba(255,255,255,.9); }
.lq-hero-pin { justify-self: center; background: #fff; color: #222; border-radius: 18px; padding: 16px 22px; text-align: center; transform: rotate(3deg); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.lq-hero-pin span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.lq-hero-pin b { font-family: Unbounded, sans-serif; font-size: 34px; }
.lq-qlist { display: flex; flex-direction: column; gap: 8px; }
.lq-qc { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(127,127,127,.08); }
.lq-qc img, .lq-qc-ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.lq-qc-ph { display: grid; place-items: center; background: linear-gradient(135deg, #6A2BD1, #E2483D); color: #fff; font-weight: 900; font-size: 24px; }
.lq-hist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lq-hist li { display: flex; flex-direction: column; }
.ed-cover { height: 54px; border-radius: 8px; }
.eq-more { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eq-more select { width: auto; }
.eq-move { margin-left: auto; display: flex; gap: 4px; }

/* Host screen: made for a projector or TV, landscape */
body.lq-hosting .credits { display: none; }
body.lq-hosting #app { max-width: none; }
.lq-host { min-height: 78vh; display: flex; flex-direction: column; gap: 12px; }
.lq-lobby { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 18px; min-height: 72vh; }
.lq-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; background: #fff; color: #1b1b1b; border-radius: 24px; padding: 22px; }
.lq-join .label { color: #666; }
.lq-url { font-size: clamp(18px, 2.4vw, 30px); }
.lq-pin { font-family: Unbounded, sans-serif; font-size: clamp(48px, 7vw, 96px); letter-spacing: .04em; line-height: 1; }
.lq-qr { width: min(240px, 60%); aspect-ratio: 1; }
.lq-qr svg { width: 100%; height: 100%; }
.lq-room { display: flex; flex-direction: column; gap: 12px; }
.lq-sets { display: flex; flex-wrap: wrap; gap: 8px; }
.lq-sets .chip { cursor: pointer; border: 0; font: inherit; }
.lq-players { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.lq-p { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(255,255,255,.12); border: 0; color: inherit; font: inherit; font-weight: 800; font-size: 18px; cursor: pointer; }
.lq-p.new { animation: lqIn .5s cubic-bezier(.2,1.6,.4,1); }
.lq-p.sure { background: #E2483D; }
.lq-p.sure::after { content: '✕ remove?'; font-size: 12px; }
@keyframes lqIn { from { transform: scale(.2) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.lq-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lq-qtext { font-size: clamp(26px, 3.6vw, 52px); text-align: center; margin: 8px auto; max-width: 1100px; background: #fff; color: #1b1b1b; border-radius: 18px; padding: 16px 22px; line-height: 1.2; }
.lq-get { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6vh; }
.lq-qn { font-weight: 900; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.lq-getbar { width: min(520px, 80%); height: 10px; border-radius: 6px; background: rgba(255,255,255,.18); overflow: hidden; }
.lq-getbar i { display: block; height: 100%; background: #E8A317; animation: lqGet 3.5s linear forwards; }
@keyframes lqGet { from { width: 0; } to { width: 100%; } }
.lq-dbl { font-weight: 900; color: #E8A317; }
.lq-q { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.lq-mid { display: grid; grid-template-columns: 120px 1fr 120px; gap: 14px; align-items: center; }
.lq-img { max-height: 32vh; max-width: 100%; justify-self: center; border-radius: 14px; }
.lq-noimg { height: 1px; }
.lq-timer { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.lq-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.lq-timer circle { fill: none; stroke-width: 4; }
.lq-timer .bg { stroke: rgba(255,255,255,.15); }
.lq-timer .fg { stroke: #E8A317; stroke-dasharray: 119.4; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
.lq-timer.low .fg { stroke: #E2483D; }
.lq-tnum { position: relative; font-family: Unbounded, sans-serif; font-size: 38px; font-weight: 800; }
.lq-ans { text-align: center; display: flex; flex-direction: column; }
.lq-ans b { font-family: Unbounded, sans-serif; font-size: 34px; }
.lq-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lq-tile { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 14px; background: var(--c); color: #fff; font-weight: 800; font-size: clamp(18px, 2.2vw, 32px); min-height: 12vh; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); transition: opacity .3s, transform .3s; }
.lq-tiles.small .lq-tile { min-height: 0; font-size: clamp(15px, 1.6vw, 22px); padding: 12px 16px; }
.lq-tile.dim { opacity: .35; }
.lq-tile.ok { transform: scale(1.02); box-shadow: 0 0 0 4px #fff, inset 0 -6px 0 rgba(0,0,0,.18); }
.lq-sh { font-size: 1.3em; }
.lq-ck { margin-left: auto; font-size: 1.4em; }
.lq-ctl { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.lq-dist { display: flex; justify-content: center; align-items: flex-end; gap: 22px; height: 210px; }
.lq-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lq-bar i { display: block; width: 86px; background: var(--c); border-radius: 8px 8px 0 0; animation: lqGrow .6s ease-out; transform-origin: bottom; }
.lq-bar span { font-size: 22px; }
.lq-bar b { font-family: Unbounded, sans-serif; font-size: 24px; }
.lq-bar:not(.ok) { opacity: .5; }
@keyframes lqGrow { from { transform: scaleY(0); } }
.lq-expl { text-align: center; max-width: 900px; margin: 0 auto; opacity: .85; }
.lq-board { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lq-board h1 { font-size: clamp(30px, 4vw, 54px); }
.lq-top5 { list-style: none; padding: 0; margin: 0; width: min(900px, 100%); display: flex; flex-direction: column; gap: 10px; }
.lq-top5 li { display: grid; grid-template-columns: 50px auto 1fr auto auto; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 14px; background: #fff; color: #1b1b1b; font-size: clamp(18px, 2vw, 28px); animation: lqSlide .5s var(--d) both; }
.lq-top5 li:first-child { background: #E8A317; }
@keyframes lqSlide { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.lq-rk { font-family: Unbounded, sans-serif; font-weight: 800; }
.lq-up { color: #2BA84A; font-weight: 900; font-size: .7em; }
.lq-sc { font-family: Unbounded, sans-serif; font-weight: 800; }
.lq-final { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.lq-final h1 { font-size: clamp(30px, 4vw, 54px); }
.lq-podium { display: grid; grid-template-columns: repeat(3, minmax(140px, 240px)); align-items: end; gap: 16px; }
.lq-pod { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: lqRise .8s var(--d) both; }
.lq-pod.empty { visibility: hidden; }
@keyframes lqRise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.lq-pn { font-size: clamp(18px, 2vw, 28px); }
.lq-ps { font-family: Unbounded, sans-serif; font-weight: 800; }
.lq-step { width: 100%; display: grid; place-items: center; font-family: Unbounded, sans-serif; font-size: 40px; font-weight: 800; color: #1b1b1b; border-radius: 12px 12px 0 0; }
.lq-pod.r1 .lq-step { height: 170px; background: #E8A317; }
.lq-pod.r2 .lq-step { height: 120px; background: #C9CED8; }
.lq-pod.r3 .lq-step { height: 90px; background: #D08B4E; }
.lq-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.lq-facts div { background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px 16px; display: flex; flex-direction: column; }
.lq-facts b { font-size: 20px; }
.lq-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lq-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: lqFall linear infinite; }
@keyframes lqFall { to { transform: translateY(110vh) rotate(720deg); } }

/* Player screen: big touch buttons, works in portrait and landscape */
.lq-player, .lq-jbox, .lq-msg { min-width: 0; }
.lq-chars { max-width: 100%; }
.lq-player { width: 100%; max-width: 720px; margin: 0 auto; min-height: 70vh; display: flex; flex-direction: column; gap: 12px; }
.lq-jbox { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; padding-top: 4vh; }
.lq-jbox h1 { font-size: clamp(28px, 7vw, 42px); }
.lq-pinin, .lq-nick { font-size: 30px !important; text-align: center; font-weight: 800; letter-spacing: .1em; padding: 16px !important; }
.lq-nick { letter-spacing: 0; }
.lq-me { display: grid; place-items: center; min-height: 140px; }
.lq-chars { display: flex; gap: 6px; overflow-x: auto; padding: 4px; }
.lq-chars button { border: 2px solid transparent; border-radius: 50%; background: none; padding: 2px; cursor: pointer; flex: none; }
.lq-chars button.on { border-color: #E8A317; }
.lq-pbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(127,127,127,.12); }
.lq-pbar span { display: flex; align-items: center; gap: 8px; }
.lq-msg { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; flex: 1; padding: 24px; border-radius: 22px; }
.lq-locked { background: var(--c); color: #fff; }
.lq-big { font-size: 72px; line-height: 1; }
.lq-res.ok { background: #2BA84A; color: #fff; }
.lq-res.no { background: #C0392B; color: #fff; }
.lq-plus { font-family: Unbounded, sans-serif; font-size: 34px; font-weight: 800; }
.lq-pq { font-weight: 800; font-size: 20px; text-align: center; background: #fff; color: #1b1b1b; border-radius: 14px; padding: 12px; }
.lq-ptimer { height: 8px; border-radius: 5px; background: rgba(127,127,127,.2); overflow: hidden; }
.lq-ptimer i { display: block; height: 100%; width: 100%; background: #E8A317; }
.lq-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 56vh; }
.lq-btns.n2 { grid-template-columns: 1fr; }
.lq-btn { border: 0; border-radius: 18px; background: var(--c); color: #fff; font: inherit; font-weight: 900; font-size: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.2); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.lq-btn:active { transform: scale(.97); }
.lq-btn .lq-sh { font-size: 56px; line-height: 1; }
@media (max-width: 760px) {
  .lq-hero { grid-template-columns: 1fr; } .lq-hero-pin { display: none; }
  .lq-lobby { grid-template-columns: 1fr; } .lq-mid { grid-template-columns: 80px 1fr 80px; }
  .lq-tiles { grid-template-columns: 1fr; } .lq-podium { grid-template-columns: repeat(3, 1fr); gap: 6px; } .lq-dist { gap: 10px; } .lq-bar i { width: 52px; }
  .lq-qc { grid-template-columns: 44px 1fr; } .lq-qc > .row { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (orientation: landscape) and (max-height: 520px) { .lq-btns { min-height: 62vh; } .lq-btn .lq-sh { font-size: 36px; } }


/* ===== v4.26: simpler homepage, categories and quiz editor ===== */
.hs-main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.hs-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; border: 0; cursor: pointer; font: inherit; color: #fff; text-decoration: none; border-radius: 22px; padding: 18px 18px 16px; min-height: 170px; box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,255,255,.18); transition: transform .16s, box-shadow .16s; }
.hs-btn:hover, .hs-btn:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,255,255,.4); }
.hs-btn.play { background: linear-gradient(140deg, #E2483D, #B4234F); }
.hs-btn.room { background: linear-gradient(140deg, #2F6FDE, #233C9A); }
.hs-btn.create { background: linear-gradient(140deg, #1F8A70, #0F4C5C); }
.hs-i { font-size: 36px; line-height: 1; }
.hs-btn b { font-weight: 900; font-size: clamp(16px, 1.8vw, 20px); letter-spacing: .01em; line-height: 1.1; }
.hs-btn small { font-weight: 600; font-size: 13px; opacity: .9; line-height: 1.35; }
.hs-go { margin-top: auto; font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.18); }
.hs-join { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.08); }
.hs-join input { width: 150px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; text-align: center; }
.hs-more { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.hs-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hs-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid rgba(127,127,127,.25); background: rgba(127,127,127,.07); color: inherit; text-decoration: none; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.hs-tile:hover { background: rgba(127,127,127,.14); }
.hs-ti { font-size: 24px; flex: none; }
.hs-tb { display: flex; flex-direction: column; min-width: 0; }
.hs-tb b { font-size: 14px; }
.hs-tb small { font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .hs-main { grid-template-columns: 1fr; } .hs-btn { min-height: 0; } .hs-tiles { grid-template-columns: 1fr 1fr; } }

.cg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cg { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, transparent), rgba(127,127,127,.06)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.cg-main { display: flex; gap: 12px; color: inherit; text-decoration: none; }
.cg-i { font-size: 34px; line-height: 1; flex: none; }
.cg-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cg-b b { font-size: 18px; }
.cg-b small { opacity: .75; font-size: 13px; line-height: 1.35; }
.cg-n { font-size: 12px; font-weight: 700; opacity: .7; }
.cg-act { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-more.on { background: rgba(127,127,127,.2); }
.cg-subs { display: grid; grid-template-columns: 1fr; gap: 8px; }

.ed-top .ed-title-in { font-size: 22px; font-weight: 800; padding: 14px 16px; }
.ed-adv { margin-top: 6px; }
.ed-adv summary, .eqs-more summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.ed-adv summary small { font-weight: 500; opacity: .6; margin-left: 6px; }
.eqs { gap: 10px; }
.eqs-tools { display: flex; gap: 4px; }
.eqs-t { width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(127,127,127,.3); background: transparent; color: inherit; cursor: pointer; font-size: 15px; }
.eqs-t:hover { background: rgba(127,127,127,.15); }
.eqs-img { max-height: 120px; border-radius: 10px; align-self: flex-start; }
.eqs .eq-q { font-size: 18px; font-weight: 700; }
.eqs-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eqs-o { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--oc); color: #fff; cursor: pointer; box-shadow: inset 0 0 0 3px transparent; }
.eqs-o.on { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px #3DDC84; }
.eqs-s { font-size: 18px; flex: none; width: 22px; text-align: center; }
.eqs-o .eq-o { flex: 1; min-width: 0; background: rgba(255,255,255,.18); border: 0; color: #fff; font-weight: 700; padding: 10px; border-radius: 10px; }
.eqs-o .eq-o::placeholder { color: rgba(255,255,255,.75); }
.eqs-o .eq-ci { position: absolute; opacity: 0; pointer-events: none; }
.eqs-ok { flex: none; font: inherit; font-size: 12px; font-weight: 800; padding: 8px 10px; border: 0; border-radius: 999px; background: rgba(0,0,0,.22); color: #fff; white-space: nowrap; cursor: pointer; min-height: 36px; }
.eqs-o.on .eqs-ok { background: #3DDC84; color: #0B2E1C; }
.eqs-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ed-addq { width: 100%; }
@media (max-width: 600px) { .eqs-ans { grid-template-columns: 1fr; } }


/* v4.26: on phones the main menu is a tab bar at the bottom, so every section is one tap away */
@media (max-width: 640px) {
  #nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: space-around; gap: 0; overflow: visible; width: auto; max-width: none;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(8, 30, 42, .97); border-top: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); }
  #nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 6px 2px; border-radius: 12px; white-space: nowrap; min-width: 0; }
  #nav a::before { font-size: 20px; line-height: 1; }
  #nav a[data-nav="home"]::before { content: "🎮"; }
  #nav a[data-nav="categories"]::before { content: "🗂️"; }
  #nav a[data-nav="create"]::before { content: "✨"; }
  #nav a[data-nav="leaderboard"]::before { content: "🏆"; }
  #nav a[data-nav="friends"]::before { content: "👥"; }
  #nav a .badge { position: absolute; margin-left: 18px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.in-game #nav { display: none; }
  body.in-game { padding-bottom: 0; }
}

/* v4.27 Map Challenge on the homepage */
.hs-map { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 12px; padding: 14px 18px; border: 0; border-radius: 20px; cursor: pointer; font: inherit; color: #fff; text-align: left; background: radial-gradient(120% 160% at 0% 0%, #1E5A8A 0%, #0B2340 55%, #061427 100%); box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,210,63,.35); transition: transform .16s, box-shadow .16s; position: relative; overflow: hidden; }
.hs-map::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 34px), repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 34px); pointer-events: none; }
.hs-map:hover, .hs-map:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,210,63,.7); }
.hs-mg { font-size: 40px; line-height: 1; animation: hsSpin 8s linear infinite; }
@keyframes hsSpin { 50% { transform: rotate(-12deg) scale(1.06); } }
.hs-mt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.hs-mt b { font-weight: 900; font-size: clamp(16px, 1.8vw, 20px); letter-spacing: .02em; color: #FFD23F; }
.hs-mt small { font-weight: 600; font-size: 13px; opacity: .9; line-height: 1.35; }
.hs-map .hs-go { margin-top: 0; white-space: nowrap; flex: none; }
.hs-tiles { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .hs-map { flex-wrap: wrap; } .hs-map .hs-go { width: 100%; text-align: center; } .hs-tiles { grid-template-columns: 1fr; } }

/* v4.27 Map Challenge: city results and sudden death */
.mci-sc small, .mc-cs small { font-size: 11px; font-weight: 800; opacity: .7; text-transform: uppercase; letter-spacing: .08em; margin-left: 4px; }
.mci-sdn { padding: 4px 12px; border-radius: 99px; background: #C1121F; color: #fff; font-weight: 900; font-size: 13px; }
.mc-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 4; }
.mc-fx i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: mcFall 2.4s cubic-bezier(.3,.6,.5,1) both; }
@keyframes mcFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(720deg); opacity: .2; } }
.mc.sd { box-shadow: 0 24px 60px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,59,59,.55); }
.mc.sd .mc-view::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(75% 70% at 50% 50%, transparent 45%, rgba(170,0,20,.5)); animation: sdPulse 1.1s ease-in-out infinite; }
@keyframes sdPulse { 50% { opacity: .45; } }
.mc[data-stage="sdTie"] .mc-cine { background: radial-gradient(60% 60% at 50% 50%, rgba(120,0,10,.55), rgba(3,8,18,.85)); }
.sd-tie { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: sdShake .5s .1s both; }
.sd-tie b { font: 900 clamp(34px, 8vw, 80px) var(--display); line-height: 1; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.7); animation: sdSlam .55s cubic-bezier(.2,1.5,.4,1) both; }
.sd-tie strong { font: 900 clamp(40px, 11vw, 110px) var(--display); line-height: .95; color: #FF2E3E; letter-spacing: .02em; text-shadow: 0 0 40px rgba(255,46,62,.75), 0 8px 0 rgba(0,0,0,.35); animation: sdSlam .6s .45s cubic-bezier(.2,1.6,.4,1) both, sdGlow 1s 1.1s ease-in-out infinite; }
.sd-tie em { font-style: normal; font-weight: 800; font-size: 15px; opacity: 0; animation: mciIn .5s 1.2s ease both; }
@keyframes sdSlam { 0% { transform: scale(2.6); opacity: 0; filter: blur(8px); } 100% { transform: scale(1); opacity: 1; filter: none; } }
@keyframes sdGlow { 50% { text-shadow: 0 0 70px rgba(255,46,62,1), 0 8px 0 rgba(0,0,0,.35); } }
@keyframes sdShake { 0%, 100% { transform: none; } 20% { transform: translate(-8px, 3px); } 40% { transform: translate(7px, -4px); } 60% { transform: translate(-5px, 2px); } 80% { transform: translate(3px, -1px); } }
.sd-fly { margin-top: 2vh; padding: 6px 16px; border-radius: 99px; background: #C1121F; font: 900 13px var(--body); letter-spacing: .2em; text-transform: uppercase; animation: mciIn .5s ease both; }
.sd-city span { color: #FF5A66 !important; }
.sd-city b { color: #fff; animation: sdSlam .7s 1.4s cubic-bezier(.2,1.4,.4,1) both; }
.sd-city em { animation: mciIn .5s 1.9s ease both; }
.mc[data-stage="sdCount"] .sd-city b, .mc[data-stage="sdCount"] .sd-city em { animation: none; }
.mc-count.sdc { color: #FF2E3E; text-shadow: 0 0 50px rgba(255,46,62,.8), 0 10px 0 rgba(0,0,0,.3); }
.mc-count.sdc.go { color: #FFD23F; }
.sd-win { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 28px; border-radius: 28px; background: rgba(8,18,32,.86); box-shadow: 0 0 0 3px var(--pc), 0 0 80px color-mix(in srgb, var(--pc) 60%, transparent); animation: mciP .7s cubic-bezier(.2,1.4,.35,1) both; position: relative; }
.sd-win .rw-crown { font-size: 40px; animation: sdSlam .6s .3s both; }
.sd-win .c3 { border-radius: 50%; background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--pc) 65%, transparent), transparent 70%); }
.sd-win b { font: 900 clamp(24px, 5vw, 44px) var(--display); line-height: 1.05; }
.sd-win strong { font: 900 18px var(--body); color: #FFD23F; text-transform: uppercase; letter-spacing: .08em; }
.sd-win em { font-style: normal; font-weight: 700; font-size: 14px; opacity: .85; }
.sd-none { background: #8A0F1A !important; }
.mc-sdpin { position: absolute; left: 0; top: 0; pointer-events: none; }
.mc-sdpin i { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; background: #FF2E3E; box-shadow: 0 0 0 3px #fff, 0 0 24px #FF2E3E; }
.mc-sdpin i::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid #FF2E3E; animation: sdRing 1.2s ease-out infinite; }
@keyframes sdRing { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.mc-sdpin span { position: absolute; left: 0; top: -46px; translate: -50% 0; padding: 3px 10px; border-radius: 99px; background: #C1121F; color: #fff; font: 900 13px var(--body); white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.mc-chip.sdc { background: #C1121F; color: #fff; }
.mc .mc-hud .mc-city.sd { background: rgba(140,10,22,.9); }
.sd-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.sd-tag { padding: 4px 12px; border-radius: 99px; background: #C1121F; color: #fff; font: 900 12px var(--body); letter-spacing: .14em; text-transform: uppercase; animation: sdPulse 1.1s ease-in-out infinite; }
.sd-head #t-sec { margin-left: auto; }
.sd-timer i { background: #E5484D !important; }
.sd-wait { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 18px; border-radius: 20px; border: 2px solid rgba(229,72,77,.5); background: rgba(229,72,77,.08); }
.sd-wait b { font: 900 clamp(26px, 5vw, 40px) var(--display); }

.mc[data-stage="sdCount"] .mc-cine { justify-content: flex-start; }
.mc[data-stage="sdCount"] .mc-count.sdc { margin: auto 0; }
.mc[data-stage="sdCount"] .mci-city { margin-bottom: 0; }

/* v4.27.3 PLAY AT MY RATING: the natural first choice */
.hs-main { grid-template-columns: 1.3fr 1fr 1fr; align-items: stretch; }
.hs-btn.play { position: relative; min-height: 190px; padding: 20px 20px 18px; transform-origin: 50% 60%; animation: hsPlayPulse 2.8s ease-in-out infinite; transition: transform .22s cubic-bezier(.2,1.2,.4,1), box-shadow .22s, filter .22s; z-index: 1; }
.hs-btn.play::before { content: ""; position: absolute; inset: -3px; border-radius: 25px; pointer-events: none; background: linear-gradient(140deg, rgba(255,214,120,.55), rgba(255,90,110,.15) 45%, rgba(255,214,120,.45)); filter: blur(10px); opacity: .55; z-index: -1; animation: hsPlayGlow 2.8s ease-in-out infinite; }
.hs-btn.play b { font-size: clamp(18px, 2.1vw, 23px); }
.hs-btn.play .hs-i { font-size: 42px; }
.hs-btn.play .hs-go { background: rgba(255,255,255,.95); color: #B4234F; box-shadow: 0 4px 12px rgba(0,0,0,.18); transition: transform .2s; }
.hs-btn.play:hover, .hs-btn.play:focus-visible { animation-play-state: paused; transform: translateY(-4px) scale(1.025); filter: brightness(1.06); box-shadow: 0 18px 38px rgba(226,72,61,.45), 0 0 0 2px rgba(255,255,255,.55) inset; }
.hs-btn.play:hover .hs-go, .hs-btn.play:focus-visible .hs-go { transform: translateX(4px); }
.hs-btn.play:active { transform: translateY(-1px) scale(.985); transition-duration: .08s; }
@keyframes hsPlayPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 24px rgba(0,0,0,.22), 0 0 0 0 rgba(255,120,110,0), inset 0 0 0 2px rgba(255,255,255,.22); }
  50% { transform: scale(1.012); box-shadow: 0 14px 30px rgba(0,0,0,.24), 0 0 26px 4px rgba(255,120,110,.35), inset 0 0 0 2px rgba(255,255,255,.34); }
}
@keyframes hsPlayGlow { 0%, 100% { opacity: .35; } 50% { opacity: .75; } }
@media (max-width: 900px) { .hs-main { grid-template-columns: 1fr 1fr; } .hs-btn.play { grid-column: 1 / -1; min-height: 160px; } }
@media (max-width: 640px) { .hs-main { grid-template-columns: 1fr; } .hs-btn.play { min-height: 170px; } }
@media (prefers-reduced-motion: reduce) { .hs-btn.play, .hs-btn.play::before { animation: none; } }

.lob-cancel { min-width: 160px; font-weight: 800; }


/* ---------- Saving, My quizzes and Community quizzes (4.32) ---------- */
.vis-opts { display: grid; gap: 10px; margin: 12px 0 14px; }
.vis-opt { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid rgba(127,127,127,.28); background: rgba(127,127,127,.07); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.vis-opt b { font-size: 16px; }
.vis-opt:hover { border-color: rgba(255,183,3,.6); }
.vis-opt.on { border-color: var(--marigold); background: rgba(255,183,3,.14); }
.vis-b { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .06em; padding: 5px 8px; border-radius: 999px; }
.vis-b.pub { background: rgba(42,157,143,.22); color: var(--win-soft); }
.vis-b.priv { background: rgba(255,255,255,.1); color: var(--on-sea); }
.vis-b.draft { background: rgba(255,183,3,.18); color: var(--marigold); }
.mq-list { display: flex; flex-direction: column; gap: 8px; }
.mq-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: rgba(127,127,127,.08); }
.mq-title { font-weight: 700; font-size: 16px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.mq-title:hover { text-decoration: underline; }
.mq-act { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cq { cursor: pointer; }
.cq .ev-title { color: inherit; text-decoration: none; }
.cq-act { gap: 6px; margin-top: auto; padding-top: 4px; }
.cq-cats { gap: 6px; flex-wrap: wrap; }
.cq-cats .chip { cursor: pointer; font: inherit; font-size: 13px; }
@media (max-width: 640px) {
  .mq-act { justify-content: flex-start; width: 100%; }
}

.lq-plus.lq-minus { color: var(--lose-soft); }


/* ---------- v4.33: leaderboard show between Live Quiz questions ---------- */
.lqb { --d0: .4s; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; min-height: 70vh; }
.lqb-stage, .lqf-hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 12px; border-radius: 28px; overflow: hidden; isolation: isolate; text-align: center;
  background: radial-gradient(circle at 50% 48%, rgba(255,183,3,.30), rgba(255,183,3,.06) 45%, rgba(255,183,3,0) 70%); }
.lqb-rays { position: absolute; inset: -60%; z-index: -1; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.07) 0 7deg, transparent 7deg 18deg); opacity: 0; animation: lqbRays 24s linear infinite, lqbIn .8s var(--d0) forwards; }
.lqb-burst { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, #fff, rgba(255,210,63,.6) 40%, transparent 70%); opacity: 0; pointer-events: none; }
.k-new .lqb-burst, .k-first .lqb-burst { animation: lqbBurst 1.1s var(--d0) ease-out; }
.lqb-title { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 4.2vw, 60px); letter-spacing: .04em; color: var(--marigold); text-shadow: 0 4px 0 rgba(0,0,0,.35); opacity: 0; animation: lqbTitle .7s calc(var(--d0) - .15s) cubic-bezier(.2,1.6,.4,1) forwards; }
.k-new .lqb-title { background: linear-gradient(90deg, #FFD23F, #FF6B35, #FFD23F); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; animation: lqbTitle .7s calc(var(--d0) - .15s) cubic-bezier(.2,1.6,.4,1) forwards, lqbShine 1.6s linear infinite; }
.k-none .lqb-title { color: var(--on-sea); opacity: 1; animation: none; }
.lqb-stars { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 18px; }
.lqb-star { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; transform: scale(.3) translateY(40px); animation: lqbStar .9s var(--d) cubic-bezier(.2,1.5,.4,1) forwards; }
.lqb-crown { font-size: 44px; line-height: 1; margin-bottom: -14px; z-index: 2; animation: lqbCrown 1s calc(var(--d) + .35s) cubic-bezier(.3,1.6,.5,1) both; }
.k-keep .lqb-crown { animation: lqbCrown 1s calc(var(--d) + .2s) both, lqbWobble 2.4s calc(var(--d) + 1.2s) ease-in-out infinite; }
.lqb-name { font-family: var(--display); font-size: clamp(22px, 3vw, 42px); line-height: 1.1; overflow-wrap: anywhere; }
.lqb-pts { font-family: var(--mono); font-size: clamp(15px, 1.6vw, 22px); color: var(--marigold); }
.lqb-more { font-family: var(--display); font-size: 24px; align-self: center; }
.lqb-sub { font-size: clamp(15px, 1.6vw, 22px); color: var(--on-sea-soft); opacity: 0; animation: lqbIn .6s calc(var(--d0) + .6s) forwards; }
.k-none .lqb-sub { opacity: 1; animation: none; }
.lqb-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lqb-h { font-size: clamp(18px, 2vw, 26px); color: var(--on-sea-soft); }
.lqb-rank { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lqb-rank li { display: grid; grid-template-columns: 42px auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.94); color: #1b1b1b; font-size: clamp(16px, 1.8vw, 24px); opacity: 0; animation: lqbRow .5s var(--d) cubic-bezier(.2,1.2,.4,1) forwards; }
.lqb-rank li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lqb-rank li.lead { background: linear-gradient(90deg, #FFD23F, #E8A317); box-shadow: 0 6px 22px rgba(232,163,23,.35); }
.lqb-rk { font-family: var(--display); font-weight: 800; text-align: center; }
.lqb-sc { font-family: var(--display); font-weight: 800; text-align: right; min-width: 3ch; }
.lqb-down { color: #C0392B; font-weight: 800; font-size: .8em; }
.lqb-rest { margin: 0; }
.lqb-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 6px; }
.lqb-cd { display: inline-block; font-family: var(--display); font-size: clamp(15px, 1.6vw, 22px); padding: 8px 18px; border-radius: 999px; background: rgba(255,255,255,.1); }
.lqb-cd.hot { background: var(--marigold); color: var(--ink); animation: lqbPulse .5s ease-in-out infinite alternate; }
.lqb-cd b { font-size: 1.4em; }
.c3.spin .c3-turn { animation: c3spinNow 1.4s linear infinite; }
.c3.dance .c3-turn { animation: c3danceNow .9s ease-in-out infinite; }
@keyframes c3spinNow { to { transform: rotateY(360deg); } }
@keyframes c3danceNow { 0%,100% { transform: rotateY(-25deg) translateY(0); } 50% { transform: rotateY(25deg) translateY(-6%); } }
@keyframes lqbRays { to { transform: rotate(360deg); } }
@keyframes lqbIn { to { opacity: 1; } }
@keyframes lqbBurst { 0% { opacity: 0; transform: scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: scale(40); } }
@keyframes lqbTitle { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes lqbShine { to { background-position: -200% 0; } }
@keyframes lqbStar { to { opacity: 1; transform: none; } }
@keyframes lqbCrown { from { opacity: 0; transform: translateY(-120px) rotate(-30deg); } to { opacity: 1; transform: none; } }
@keyframes lqbWobble { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes lqbRow { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes lqbPulse { to { transform: scale(1.07); } }
/* Final results */
.lqf { gap: 16px; }
.lqf-intro { animation: lqfIntro 2s ease forwards; }
.lqf-hero { --d0: 1.8s; width: min(1100px, 100%); min-height: 320px; }
.lqf-title { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5vw, 72px); color: var(--marigold); text-shadow: 0 5px 0 rgba(0,0,0,.35); opacity: 0; animation: lqbTitle .8s 1.7s cubic-bezier(.2,1.6,.4,1) forwards; }
.lqf-after { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(1100px, 100%); opacity: 0; animation: lqbIn .6s 2.9s forwards; }
.lqf-rank { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); text-align: left; }
@keyframes lqfIntro { 0% { opacity: 0; transform: scale(.8); } 15%, 75% { opacity: 1; transform: scale(1); } 100% { opacity: .55; transform: scale(.7); } }
/* Phones */
.lqp-board .lq-big { font-family: var(--display); }
.lqp-board.me-lead h2 { color: var(--marigold); }
.lqp-pts { font-family: var(--display); font-size: 22px; }
@media (max-width: 900px) { .lqb { grid-template-columns: 1fr; min-height: 0; } .lqb-foot { align-items: center; } }
@media (prefers-reduced-motion: reduce) { .lqb-rays, .c3.spin .c3-turn, .c3.dance .c3-turn, .lqb-cd.hot { animation: none !important; opacity: 1; } }

.c3.kneel .c3-turn, .c3.stretch .c3-turn, .c3.pump .c3-turn, .c3.flex .c3-turn { animation: c3danceNow .7s ease-in-out infinite; }

/* ===== v4.34: Play a Friend duel ===== */
.duel.fr .side { position: relative; transition: box-shadow .35s, border-color .35s; }
.duel.fr .side.lead { border-color: var(--marigold); box-shadow: 0 0 0 1px var(--marigold), 0 0 24px rgba(255, 196, 60, .45); }
.duel.fr .side .crown { position: absolute; top: -15px; left: 12px; font-size: 20px; line-height: 1; animation: rwCrown 1.6s ease-in-out infinite; pointer-events: none; }
.duel.fr .side.right .crown { left: auto; right: 12px; }
.duel.fr .side.pop .sc { display: inline-block; animation: frPop .7s ease; }
.duel.fr .side.pop .av { animation: frBump .6s ease; }
.duel.fr .mid { display: flex; flex-direction: column; align-items: center; line-height: 1; text-align: center; }
.duel.fr .mid small { font: 600 11px var(--mono); color: var(--on-sea-soft); margin-top: 5px; white-space: nowrap; }
.duel.fr.swap .mid { animation: frSwap .8s ease; }
@keyframes frPop { 30% { transform: scale(1.4); color: var(--win-soft); } }
@keyframes frBump { 35% { transform: translateY(-6px) scale(1.06); } }
@keyframes frSwap { 40% { transform: scale(1.5) rotate(-8deg); color: #fff; } }
.dres { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 14px; max-width: 560px; margin: 4px auto 14px; text-align: center; }
.dres .dp { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.dres .dp b { font: 800 18px var(--display); overflow-wrap: anywhere; }
.dres .dp .sc { font: 600 26px var(--mono); line-height: 1; }
.dres .dp.win { animation: frWin .9s cubic-bezier(.2,1.5,.4,1) both; }
.dres .dp.win .sc { color: var(--marigold); }
.dres .dp.lose { opacity: .82; filter: grayscale(.35); animation: frLose 1s .2s ease both; }
.dres .dp .rw-crown { margin-bottom: -10px; }
.dres .vsx { font: 900 22px var(--display); color: var(--marigold); align-self: center; }
@keyframes frWin { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes frLose { from { transform: translateY(-12px); opacity: 0; } }
.rm-big { font-size: 20px; letter-spacing: .04em; padding: 16px 30px; animation: frPulse 1.8s ease-out infinite; }
@keyframes frPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 196, 60, .55); } 70%, 100% { box-shadow: 0 0 0 16px rgba(255, 196, 60, 0); } }
@media (max-width: 520px) { .dres .dp b { font-size: 15px; } .dres .dp .sc { font-size: 22px; } .duel.fr .mid small { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .duel.fr .side .crown, .duel.fr .side.pop .sc, .duel.fr .side.pop .av, .duel.fr.swap .mid, .dres .dp, .rm-big { animation: none !important; } }

.duel.fr .side.pop .sc, .duel.fr .side.pop .av, .duel.fr.swap .mid { animation-delay: var(--fd, 0ms); }

/* ===== v4.35: Play a Friend, find a friend by username ===== */
.pf-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 6px 0 14px; text-align: center; }
.pf-p { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 12px 8px; border-radius: 18px; background: rgba(0,0,0,.06); border: 2px dashed transparent; }
.pf-p b { font: 800 16px var(--display); overflow-wrap: anywhere; line-height: 1.15; }
.pf-p.opp { border-color: rgba(108,99,255,.35); }
.pf-p.opp.picked { border-style: solid; border-color: var(--marigold); box-shadow: 0 0 22px rgba(255,196,60,.35); animation: pfIn .55s cubic-bezier(.2,1.5,.4,1) both; }
.pf-q { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font: 900 42px var(--display); color: rgba(108,99,255,.55); background: rgba(108,99,255,.1); }
.pf-x { font: 900 26px var(--display); color: var(--marigold); }
.pf-sw { position: relative; }
.pf-sw input { width: 100%; }
.pf-link { display: block; margin: 12px auto 0; text-align: center; }
@keyframes pfIn { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 420px) { .pf-q { width: 72px; height: 72px; font-size: 32px; } .pf-p b { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .pf-p.opp.picked { animation: none; } }

/* ===== v4.36: question and answers fit on the screen while a race or the map is shown ===== */
@media (max-width: 760px), (max-height: 860px) {
  #race-slot.qmode .rx { height: clamp(110px, 20vh, 210px); }
  #race-slot.qmode .race svg { max-height: 20vh; width: auto; max-width: 100%; margin: 0 auto; }
  #race-slot.qmode .race-hud { padding-top: 4px; padding-bottom: 4px; }
}
@media (max-width: 760px) {
  #game .qcard { padding: 14px 16px; }
  #g-opts { gap: 8px; }
  #g-opts .opt { min-height: 50px; padding-top: 10px; padding-bottom: 10px; }
  #g-strip .duel .side { padding: 6px 8px; }
}

.pf-link.btn { margin: -4px 0 12px; font-size: 14px; }

.ms-big.friend .ms-i { background: rgba(255,196,60,.18); }

/* v4.39 Map Challenge result */
.dres .dp-wl{display:inline-block;font-weight:900;font-size:12px;letter-spacing:.12em;color:#1a1a1a;background:#FFC43C;border-radius:999px;padding:3px 10px;margin-bottom:4px}
.dres .dp-cw{display:block;font-weight:700;font-size:14px;margin-top:2px}
@media (max-width:560px){.ms-steps{display:grid;grid-template-columns:1fr 1fr}}

/* v4.41 Map Challenge: landmark pop-ups on arrival */
.mc-lm{position:absolute;left:0;right:0;bottom:clamp(64px,15%,150px);display:flex;justify-content:center;align-items:flex-end;gap:clamp(10px,3vw,26px);pointer-events:none;z-index:4}
.mc-lm .lm{--lmw:#fff6df;display:flex;flex-direction:column;align-items:center;gap:6px;color:#FFD23F;opacity:0;transform:translateY(34px) scale(.3);transform-origin:50% 100%;animation:lmPop .75s cubic-bezier(.34,1.56,.64,1) calc(.3s + var(--i) * .2s) forwards,lmOut .45s ease-in calc(3.6s + var(--i) * .08s) forwards}
.mc-lm .lm:nth-child(2){color:#7FE3D8}.mc-lm .lm:nth-child(3){color:#FF9E6B}
.mc-lm .lm:nth-child(2) svg{width:clamp(84px,22vw,140px)}
.mc-lm svg{display:block;width:clamp(66px,17vw,110px);height:auto;fill:currentColor;filter:drop-shadow(0 8px 12px rgba(0,0,0,.5))}
.mc-lm b{font-weight:800;font-size:clamp(10px,2.5vw,13px);line-height:1.15;color:#fff;background:rgba(8,18,32,.78);padding:4px 9px;border-radius:999px;max-width:130px;text-align:center;box-shadow:0 4px 12px rgba(0,0,0,.35)}
@keyframes lmPop{0%{opacity:0;transform:translateY(34px) scale(.3)}55%{opacity:1;transform:translateY(-8px) scale(1.14)}78%{transform:translateY(3px) scale(.95)}100%{opacity:1;transform:none}}
@keyframes lmOut{to{opacity:0;transform:translateY(-16px) scale(.85)}}
@media (prefers-reduced-motion:reduce){.mc-lm .lm{animation:lmFade 4s linear calc(var(--i) * .1s) forwards;transform:none}@keyframes lmFade{0%,100%{opacity:0}10%,85%{opacity:1}}}
