/* Shaxmat web: the same design tokens as the app (DesignSystem.swift). */
:root {
  --bg: #f3f1ec; --surface: #ffffff; --muted-bg: #f0eee8; --sidebar: #e9e6df; --border: rgba(0,0,0,.08);
  --text: #161a22; --text2: #6b7280; --accent: #22b98c; --on-accent: #05261b;
  --win: #1fa56a; --loss: #d93d42; --draw: #7c8494; --gold: #f2b84b; --streak: #ff7a3d; --violet: #7c6cf2; --cyan: #19b8cc;
  --hero-a: #1b2740; --hero-b: #2e3f6e; --icon-cut: var(--sidebar);
  --shadow: 0 4px 14px rgba(0,0,0,.05);
  --radius: 20px;
  --sidebar-w: 272px;
  --tabbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1117; --surface: #171b23; --muted-bg: #1f2430; --sidebar: #0a0d12; --border: rgba(255,255,255,.07);
  --text: #f2f3f5; --text2: #9aa3b2; --accent: #3ddba8; --win: #34c77e; --loss: #f0575c; --draw: #9aa3b2;
  --shadow: 0 4px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1117; --surface: #171b23; --muted-bg: #1f2430; --sidebar: #0a0d12; --border: rgba(255,255,255,.07);
    --text: #f2f3f5; --text2: #9aa3b2; --accent: #3ddba8; --win: #34c77e; --loss: #f0575c; --draw: #9aa3b2;
    --shadow: 0 4px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
       -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.hidden { display: none !important; }
.muted { color: var(--text2); }
.small { font-size: 12.5px; }
h1 { margin: 0 0 2px; font-size: clamp(24px, 3vw, 30px); letter-spacing: -.02em; font-weight: 800; }
h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
p { margin: 0 0 18px; }
a { color: inherit; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; flex: none; }
.overline { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
           padding: 22px 12px 16px; background: var(--sidebar); border-right: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 24px; letter-spacing: -.01em; padding: 0 12px 22px; }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; padding: 5px; flex: none;
             background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.logo-mark svg, .logo-mark img { width: 100%; height: 100%; }
.nav { display: grid; gap: 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 13px; text-decoration: none;
         font-size: 16.5px; font-weight: 550; color: var(--text); transition: background .15s; }
.nav a svg { width: 24px; height: 24px; color: var(--text2); transition: color .15s; }
.nav a:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.nav a.active { background: var(--surface); font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.nav a.active svg { color: var(--accent); }
.nav a.active::after { content: ""; position: absolute; right: 12px; width: 4px; height: 18px; border-radius: 4px; background: var(--accent); }
.nav a.active { --icon-cut: var(--surface); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.profile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; text-decoration: none;
           background: color-mix(in srgb, var(--surface) 65%, transparent); }
.profile-text { display: grid; min-width: 0; }
.profile-text strong { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text small { color: var(--text2); font-size: 13px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); padding: 0 12px; min-width: 0; }
.status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text2); flex: none; }
.status.on .dot { background: var(--win); }
.status.wait .dot { background: var(--gold); }
.status.bad .dot { background: var(--loss); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.tabbar { display: none; }
.view { display: none; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 28px 40px; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head small { display: block; font-size: 12.5px; margin-top: 2px; }
.link { color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.pills { display: flex; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--surface);
        border: 1px solid var(--border); font-size: 14px; }
.pill svg { width: 16px; height: 16px; }
.flame { color: var(--streak); }
.accent { color: var(--accent); }

/* ---------- controls ---------- */
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--text2); letter-spacing: .02em; }
.field input { background: var(--muted-bg); border: 1px solid transparent; border-radius: 12px; padding: 11px 13px; outline: none; width: 100%; }
.field input:focus { border-color: var(--accent); }
.tabs, .seg { display: flex; background: var(--muted-bg); border-radius: 12px; padding: 3px; gap: 3px; margin: 0 0 16px; }
.tabs button, .seg button { flex: 1; padding: 9px 8px; border-radius: 9px; font-weight: 650; color: var(--text2); white-space: nowrap; min-width: 0; }
.tabs button.active, .seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin: 8px 0 18px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 4px; text-align: center; font-weight: 750;
        font-variant-numeric: tabular-nums; transition: transform .12s, background .15s; }
.chip:active { transform: scale(.96); }
.chip small { display: block; font-size: 10.5px; font-weight: 550; color: var(--text2); }
.chip.active { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chip.active small { color: var(--on-accent); opacity: .8; }
.primary { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--on-accent);
           font-weight: 800; padding: 14px; border-radius: 13px; font-size: 16px; transition: transform .12s, filter .15s; }
.primary:hover { filter: brightness(1.05); }
.primary:active, .secondary:active { transform: scale(.97); }
.primary svg, .secondary svg { width: 18px; height: 18px; }
.primary.small { padding: 10px 12px; font-size: 14.5px; }
.primary:disabled { opacity: .5; cursor: default; }
.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--muted-bg); font-weight: 700;
             padding: 11px 14px; border-radius: 12px; transition: transform .12s; }
.secondary.small { padding: 8px 12px; font-size: 14px; }
.secondary.danger { color: var(--loss); }
.secondary:disabled { opacity: .45; cursor: default; }
.secondary.on-dark { background: rgba(255,255,255,.1); color: #fff; }
.icon { width: 34px; height: 34px; border-radius: 50%; background: var(--muted-bg); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.icon svg { width: 17px; height: 17px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.pane { margin-top: 4px; }
.waiting { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 14px 0 4px; }
.code { font: 800 46px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; padding: 6px 0 6px .14em; user-select: all; }
/* ---------- account and friends ---------- */
.stack { display: grid; gap: 16px; }
.card.narrow, #view-friends > *, #view-notifications > .card { max-width: 640px; }
.field small { font-size: 12.5px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; background: var(--muted-bg); border: 1px solid transparent; border-radius: 12px; padding: 11px 13px; outline: none; }
.search-row input:focus { border-color: var(--accent); }
.search-row .primary { width: auto; flex: none; padding: 10px 18px; }
.friend-list { display: grid; gap: 8px; }
.friend-list:empty::after { content: attr(data-empty); color: var(--text2); font-size: 14px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted-bg) 60%, transparent); }
.friend-row.plain { background: none; padding: 0; margin-bottom: 18px; }
.friend-row .meta { flex: 1; min-width: 0; display: grid; }
.friend-row .meta strong, .friend-row .meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-row .meta small { color: var(--text2); font-size: 12.5px; }
.friend-row .acts { display: flex; gap: 6px; flex: none; }
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
          background: #2e3f6e; color: #fff; font-weight: 800; }
.avatar.on::after, .avatar.off::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
          border: 2px solid var(--surface); background: var(--draw); }
.avatar.on::after { background: var(--win); }
#friendFound:not(:empty) { margin-top: 14px; display: grid; gap: 10px; }
.note { padding: 11px 13px; border-radius: 12px; font-size: 14px; background: color-mix(in srgb, var(--accent) 13%, transparent); }
@media (max-width: 480px) { .friend-row .acts .secondary.small { padding: 8px 10px; font-size: 13px; } }
.error { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--loss) 14%, transparent); border: 1px solid color-mix(in srgb, var(--loss) 35%, transparent); }
.advanced { color: var(--text2); font-size: 13px; }
.advanced summary { cursor: pointer; }
.advanced .field { margin-top: 10px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--muted-bg); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.tiny { display: inline-block; width: 12px; height: 12px; border-width: 2px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-weight: 650; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { width: 46px; height: 28px; border-radius: 99px; background: var(--muted-bg); position: relative; transition: background .2s; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings .field:last-child { margin: 16px 0 0; }

/* ---------- board ---------- */
.board-frame { position: relative; }
.board-wrap { position: relative; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 8px; overflow: hidden; width: 100%;
         background-size: 100% 100%; box-shadow: 0 14px 34px rgba(0,0,0,.22); touch-action: none; user-select: none; -webkit-user-select: none; }
.sq { position: relative; display: grid; place-items: center; background: var(--light); aspect-ratio: 1; min-width: 0; min-height: 0; }
.sq.dark { background: var(--dark); }
.sq.last::before, .sq.sel::before { content: ""; position: absolute; inset: 0; background: var(--last); }
.sq.sel::before { background: var(--select); }
.sq.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, #e5484d, rgba(229,72,77,.55) 45%, rgba(229,72,77,0) 72%); }
.sq.hint::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: var(--hint); z-index: 2; pointer-events: none; }
.sq.hint.cap::after { width: 92%; height: 92%; background: transparent; border: max(3px, .55vmin) solid var(--hint); }
.piece { position: relative; width: 90%; height: 90%; display: block; z-index: 1; pointer-events: none; }
.piece svg, .piece img, .ghost svg, .ghost img { width: 100%; height: 100%; display: block; object-fit: contain; }
.sq.lifted .piece { opacity: .25; }
.coord { position: absolute; font-size: clamp(8px, 1.5vmin, 12px); font-weight: 750; z-index: 2; pointer-events: none; color: var(--coord-on-light); }
.sq.dark .coord { color: var(--coord-on-dark); }
.coord.file { right: 4%; bottom: 1%; }
.coord.rank { left: 4%; top: 1%; }
.ghost { position: fixed; pointer-events: none; z-index: 50; transform: translate(-50%, -50%) scale(1.15); }
.board.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.promotion { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); border-radius: 8px; z-index: 10; }
.promotion .choices { display: flex; gap: 8px; background: var(--surface); padding: 10px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.promotion button { width: min(76px, 17vw); aspect-ratio: 1; border-radius: 12px; background: var(--muted-bg); padding: 4px; }
.promotion button svg, .promotion button img { width: 100%; height: 100%; }

/* ---------- dashboard ---------- */
.dash { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(280px, .95fr);
        grid-template-areas: "hero hero daily" "recent stats daily"; align-items: start; }
.hero { grid-area: hero; } .daily { grid-area: daily; } .recent { grid-area: recent; } .stats { grid-area: stats; }
.hero { position: relative; overflow: hidden; padding: 26px; border: 0; color: #fff; min-height: 300px;
        background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); box-shadow: 0 18px 36px rgba(27,39,64,.25); }
.hero-body { position: relative; z-index: 1; max-width: 400px; display: grid; gap: 12px; }
.hero h2 { font-size: clamp(20px, 2.4vw, 24px); }
.hero .overline { color: var(--accent); }
.hero-chips { grid-template-columns: repeat(4, 1fr); margin: 2px 0; }
.hero-chips .chip { background: rgba(255,255,255,.09); border-color: transparent; color: #fff; }
.hero-chips .chip small { color: rgba(255,255,255,.6); }
.hero-chips .chip.active { background: var(--accent); color: var(--on-accent); }
.hero-chips .chip.active small { color: var(--on-accent); }
.hero-art { position: absolute; right: -30px; top: 50%; width: 330px; height: 330px; transform: translateY(-50%); pointer-events: none; }
.hero-grid { position: absolute; inset: 30px; transform: rotate(-12deg); opacity: .16;
             background: repeating-conic-gradient(#fff 0 25%, transparent 0 50%) 0 0 / 25% 25%; border-radius: 6px; }
.hero-knight { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; transform: translate(-60%, -50%) rotate(-6deg);
               filter: drop-shadow(0 10px 16px rgba(0,0,0,.4)); }
.hero-knight svg, .hero-knight img { width: 100%; height: 100%; }
.daily { display: grid; gap: 12px; }
.game-list { display: grid; gap: 8px; }
.game-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted-bg) 60%, transparent);
            text-align: left; width: 100%; transition: background .15s, transform .12s; }
.game-row:hover { background: var(--muted-bg); }
.game-row:active { transform: scale(.99); }
.badge { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; flex: none; }
.badge.win { background: var(--win); } .badge.loss { background: var(--loss); } .badge.draw, .badge.unknown { background: var(--draw); }
.badge.unknown { font-size: 11px; }
.game-row .meta { flex: 1; min-width: 0; display: grid; }
.game-row .meta strong, .game-row .meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-row .meta small, .game-row .when small { color: var(--text2); font-size: 12.5px; }
.game-row .when { display: grid; justify-items: end; font-variant-numeric: tabular-nums; flex: none; }
.game-row > svg { color: var(--text2); width: 14px; height: 14px; opacity: .7; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 26px 10px; color: var(--text2); }
.empty strong { color: var(--text); font-size: 16px; }
.empty .secondary { margin-top: 6px; }
.stats { display: grid; gap: 16px; }
.stats .card-head { margin: 0; }
.stats-top { display: flex; align-items: center; gap: 18px; }
.ring { --w: 0; --d: 0; width: 108px; height: 108px; border-radius: 50%; flex: none; display: grid; place-items: center;
        background: conic-gradient(var(--win) 0 calc(var(--w) * 1%), var(--draw) 0 calc((var(--w) + var(--d)) * 1%), var(--loss) 0 calc(var(--l, 0) * 1% + (var(--w) + var(--d)) * 1%), var(--muted-bg) 0); }
.ring-in { width: 80px; height: 80px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.ring-in b { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ring-in small { color: var(--text2); font-size: 12px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.legend li b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .win { background: var(--win); } .legend .draw { background: var(--draw); } .legend .loss { background: var(--loss); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--muted-bg) 70%, transparent); min-width: 0; }
.tile i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 2px; }
.tile i svg { width: 15px; height: 15px; }
.tile b { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { color: var(--text2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.t-gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.t-violet { color: var(--violet); background: color-mix(in srgb, var(--violet) 15%, transparent); }
.t-cyan { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 15%, transparent); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 96px; margin-top: -6px; }
.week i { flex: none; }
.week div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.week i { width: 100%; border-radius: 5px; background: var(--muted-bg); min-height: 6px; }
.week i.on { background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); }
.week small { font-size: 10.5px; color: var(--text2); font-weight: 600; }
.week b { font-size: 10px; color: var(--text2); min-height: 13px; }
.week .today small { color: var(--text); font-weight: 800; }

/* ---------- play ---------- */
.play.active { display: grid; place-items: start center; }
.lobby-card { width: min(100%, 560px); }

/* ---------- game & puzzles ---------- */
.game.active, .puzzles.active { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.board-col { display: grid; gap: 10px; justify-items: center; --size: min(100%, calc(100dvh - 190px)); }
.board-col > * { width: var(--size); }
.puzzles .board-col { --size: min(100%, calc(100dvh - 90px)); }
.player { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.who { flex: 1; min-width: 0; display: grid; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who strong em { font-style: normal; font-weight: 500; color: var(--text2); font-size: 12px; margin-left: 6px; }
.captured { display: flex; height: 18px; align-items: center; }
.captured .cap-piece { width: 18px; height: 18px; margin-right: -5px; }
.captured .cap-piece svg, .captured .cap-piece img { width: 100%; height: 100%; }
.captured b { font-size: 12px; color: var(--text2); margin-left: 9px; }
.clock { font: 650 25px ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; min-width: 108px; text-align: right;
         padding: 6px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.clock.running { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.clock.low.running { background: var(--loss); color: #fff; }
.side { display: grid; gap: 14px; align-content: start; }
.side .card { padding: 16px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.head-actions { display: flex; gap: 8px; }
.result h2 { margin-bottom: 4px; }
.result .row { margin-top: 6px; }
.draw { display: grid; gap: 10px; }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; background: color-mix(in srgb, var(--streak) 14%, transparent); color: var(--streak); }
.moves-card { display: grid; grid-template-rows: minmax(160px, 1fr) auto; padding: 0 !important; overflow: hidden; }
.moves { padding: 14px 16px; overflow-y: auto; max-height: calc(100dvh - 400px); min-height: 160px; display: grid; grid-template-columns: 34px 1fr 1fr;
         gap: 3px 8px; align-content: start; font-variant-numeric: tabular-nums; }
.moves .no { color: var(--text2); }
.moves .empty-moves { grid-column: 1 / -1; color: var(--text2); text-align: center; padding: 28px 0; }
.moves .mv { padding: 1px 6px; border-radius: 6px; cursor: default; }
.moves.browsable .mv { cursor: pointer; }
.moves.browsable .mv:hover { background: var(--muted-bg); }
.moves .mv.now { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 700; }
.actions { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.actions > * { flex: 1; }
.puzzle-card { display: grid; gap: 12px; }
.puzzle-card .card-head { margin: 0; }
.puzzle-state { padding: 14px; border-radius: 14px; background: var(--muted-bg); font-weight: 650; display: flex; gap: 12px; align-items: center; min-height: 64px; }
.puzzle-state .swatch { width: 30px; height: 30px; border-radius: 9px; flex: none; border: 1px solid var(--border); }
.puzzle-state.good { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.puzzle-state.tip { background: color-mix(in srgb, #f5b83d 22%, transparent); }
.mark { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.mark.glow { background: radial-gradient(circle, rgba(245,184,61,.85), rgba(245,184,61,.5) 55%, rgba(245,184,61,.38));
             box-shadow: inset 0 0 0 max(3px, .5vmin) #f5b83d, inset 0 0 0 calc(max(3px, .5vmin) + 1px) rgba(0,0,0,.25);
             border-radius: 12%; animation: breathe 1.8s ease-in-out infinite; }
.mark.target { margin: 10%; border-radius: 50%; border: max(3px, .55vmin) dashed #f5b83d; background: radial-gradient(circle, #f5b83d 0 22%, rgba(245,184,61,.22) 24%);
               filter: drop-shadow(0 0 1.5px rgba(0,0,0,.45)); }
.sq:has(.piece) .mark.target { margin: 2%; background: rgba(245,184,61,.22); }
@keyframes breathe { 50% { opacity: .72; } }
.puzzle-state.bad { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); }

/* ---------- history ---------- */
.history .filters { max-width: 520px; }
.game-list.big .game-row { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.settings-main, .settings-side { display: grid; gap: 20px; min-width: 0; }
.settings-side { position: sticky; top: 24px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 12px 10px; margin: 8px 0 16px; }
.theme-opt { position: relative; display: grid; gap: 5px; padding: 4px; border-radius: 14px; text-align: center; font-weight: 600; font-size: 12px; color: var(--text2); transition: transform .12s, color .15s; }
.theme-opt:active { transform: scale(.96); }
.theme-opt:hover .theme-swatch { box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.theme-swatch { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--border); background-size: 400% 400%; background-position: 0 0; box-shadow: 0 2px 6px rgba(0,0,0,.1); transition: box-shadow .15s, outline-color .15s; }
.theme-opt.active { color: var(--accent); font-weight: 800; }
.theme-opt.active::after { content: "✓"; position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 11px; line-height: 18px; font-weight: 900; }
.theme-opt.active .theme-swatch { outline: 3px solid var(--accent); outline-offset: -1px; }
.piece-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.piece-opt { display: grid; gap: 10px; padding: 14px; border-radius: 14px; text-align: left; background: color-mix(in srgb, var(--muted-bg) 55%, transparent);
             border: 1.5px solid transparent; transition: border-color .15s, background .15s; }
.piece-opt.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.piece-opt strong { display: flex; align-items: center; gap: 8px; }
.piece-opt strong::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text2) 50%, transparent); flex: none; }
.piece-opt.active strong::before { border-color: var(--accent); background: radial-gradient(var(--accent) 0 4px, transparent 5px); }
.piece-opt small { color: var(--text2); font-size: 12px; }
.piece-sample { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.piece-sample span { aspect-ratio: 1; border-radius: 7px; padding: 2px; display: grid; }
.piece-sample svg, .piece-sample img { width: 100%; height: 100%; }
.foot { padding: 26px 4px 4px; font-size: 12px; color: var(--text2); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "hero hero" "recent daily" "stats daily"; }
}
@media (max-width: 1100px) {
  /* Tablet: the sidebar becomes an icon rail with small labels. */
  :root { --sidebar-w: 92px; }
  .sidebar { padding: 18px 8px; align-items: stretch; }
  .sidebar .logo { justify-content: center; padding: 0 0 18px; }
  .sidebar .logo-text, .profile-text, .sidebar .status span { display: none; }
  .nav a { flex-direction: column; gap: 5px; padding: 12px 4px; font-size: 12px; text-align: center; }
  .nav a svg { width: 26px; height: 26px; }
  .nav a.active::after { right: auto; left: 0; top: 50%; transform: translateY(-50%); }
  .profile { justify-content: center; padding: 8px; }
  .sidebar .status { justify-content: center; }
  .view { padding: 24px 22px 36px; }
  .game.active, .puzzles.active { grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 860px) {
  .game.active, .puzzles.active { grid-template-columns: 1fr; }
  .board-col { --size: min(100%, calc(100dvh - 250px), 680px); }
  .puzzles .board-col { --size: min(100%, calc(100dvh - 200px), 680px); }
  .side { width: min(100%, 680px); justify-self: center; }
  .moves { max-height: 170px; min-height: 90px; }
  .moves-card { grid-template-rows: auto auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-side { position: static; order: -1; }
  .settings-side .board-frame { max-width: 360px; margin: 0 auto; }
  .dash { grid-template-columns: 1fr; grid-template-areas: "hero" "daily" "recent" "stats"; }
  .daily .board-frame { max-width: 420px; width: 100%; margin: 0 auto; }
}
@media (max-width: 720px) {
  /* Phone: top bar + bottom tab bar, no sidebar. */
  :root { --tabbar-h: 64px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20;
            padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
            backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
  .topbar .logo { padding: 0; font-size: 20px; gap: 10px; }
  .topbar .logo-mark { width: 34px; height: 34px; border-radius: 10px; padding: 4px; }
  .topbar .status { padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); max-width: 36vw; margin-left: auto; }
  .topbar .lang-switch { margin-left: 4px; }
  .tabbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
            padding: 6px 6px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 92%, transparent);
            backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 1px; border-radius: 12px; text-decoration: none; font-size: 10px; white-space: nowrap; overflow: hidden; font-weight: 650; color: var(--text2); --icon-cut: var(--surface); }
  .tabbar a svg { width: 25px; height: 25px; }
  .tabbar a.active { color: var(--accent); }
  .main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
  body.in-game .tabbar { display: none; }
  body.in-game .main { padding-bottom: var(--safe-b); }
  .view { padding: 16px 16px 28px; }
  .card { padding: 16px; border-radius: 18px; }
  .page-head { margin-bottom: 16px; }
  .hero { padding: 20px; min-height: 0; }
  .hero-art { width: 150px; height: 150px; right: -18px; top: 6px; transform: none; opacity: .9; }
  .hero-grid { inset: 18px; }
  .hero-knight { width: 76px; height: 76px; }
  .hero-body { max-width: none; }
  .hero h2 { padding-right: 96px; }
  .hero-chips { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .hero-chips .chip { padding: 8px 2px; font-size: 14px; }
  .view.game.active, .view.puzzles.active { padding: 10px 12px 20px; gap: 12px; }
  .board-col { --size: min(100%, calc(100dvh - 210px)); gap: 6px; }
  .puzzles .board-col { --size: min(100%, calc(100dvh - 300px)); }
  .board { border-radius: 4px; }
  .player { min-height: 44px; gap: 10px; }
  .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
  .clock { font-size: 20px; min-width: 86px; padding: 5px 10px; }
  .moves { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; min-height: 0; max-height: none; padding: 10px 12px; gap: 4px; white-space: nowrap; scrollbar-width: none; }
  .moves::-webkit-scrollbar { display: none; }
  .moves .empty-moves { padding: 4px 0; width: 100%; }
  .moves .no { margin-left: 6px; }
  .theme-grid { grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
  .piece-grid { grid-template-columns: 1fr; }
  .code { font-size: 38px; }
  .tabs button, .seg button { font-size: 14px; padding: 9px 4px; }
}
@media (max-width: 380px) {
  .hero-chips { grid-template-columns: repeat(4, 1fr); }
  .hero-chips .chip small { display: none; }
  .tiles b { font-size: 17px; }
  .stats-top { gap: 12px; }
  .ring { width: 92px; height: 92px; }
  .ring-in { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- analysis (Stockfish in the browser) ---------- */
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.analysis-board { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: stretch; }
.analysis-board .board-wrap { aspect-ratio: 1; }
.evalbar { position: relative; border-radius: 8px; overflow: hidden; background: #2a2e37; border: 1px solid var(--border); }
.evalbar .white { position: absolute; left: 0; right: 0; bottom: 0; background: #f2f3f5; transition: height .35s ease; }
.evalbar .label { position: absolute; left: 0; right: 0; font-size: 10px; font-weight: 700; text-align: center; z-index: 1; }
.evalbar .label.top { top: 4px; color: #f2f3f5; } .evalbar .label.bottom { bottom: 4px; color: #161a22; }
.engine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.engine-state { font-size: 12px; color: var(--text2); }
.lines { display: grid; gap: 6px; }
.line { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--muted-bg); cursor: pointer; font-size: 13px; line-height: 1.35; min-width: 0; overflow: hidden; }
.line:hover { outline: 1px solid var(--accent); }
.line .score { min-width: 54px; font-weight: 800; font-variant-numeric: tabular-nums; }
.line .score.w { color: var(--text); } .line .score.b { color: var(--text2); }
.line .pv { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.line .score { flex: none; }
#reviewTitle { white-space: nowrap; }
#reviewCard .engine-head .primary { flex: 0 1 auto; white-space: nowrap; }
.line .pv b { color: var(--text); font-weight: 700; }
.mv .badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 3px; margin-left: 4px; border-radius: 9px; color: #fff; font-size: 10px; font-weight: 800; vertical-align: middle; }
.review-bar { height: 8px; border-radius: 4px; background: var(--muted-bg); overflow: hidden; }
.review-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.review-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.review-sum .who { background: var(--muted-bg); border-radius: 12px; padding: 10px 12px; }
.review-sum .acc { font-size: 22px; font-weight: 800; }
.review-sum .kinds { display: grid; gap: 3px; margin-top: 6px; font-size: 12px; }
.review-sum .kinds span { display: flex; justify-content: space-between; }
.import textarea { width: 100%; min-height: 70px; resize: vertical; border-radius: 10px; border: 1px solid var(--border); background: var(--muted-bg); color: var(--text); padding: 10px; font: 12px ui-monospace, Menlo, monospace; }
.licence { font-size: 11px; color: var(--text2); }
.licence a { color: var(--text2); }

/* ---------- review verdicts on the board ---------- */
.sq.rv::before { content: ""; position: absolute; inset: 0; background: var(--rv); }
.review-badge {
  position: absolute; z-index: 6; width: 5.6%; aspect-ratio: 1; transform: translate(-72%, -28%);
  display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px rgba(255,255,255,.9); pointer-events: none;
  animation: badge-pop .38s cubic-bezier(.2, 1.6, .4, 1) both;
}
.review-badge .glyph { font: 800 clamp(8px, 1.35vmin, 15px)/1 system-ui, sans-serif; letter-spacing: -.5px; }
@keyframes badge-pop { 0% { transform: translate(-72%, -28%) scale(0); } 70% { transform: translate(-72%, -28%) scale(1.25); } 100% { transform: translate(-72%, -28%) scale(1); } }

/* Brilliant: a pulsing turquoise glow and a burst of sparks. */
.review-badge.kind-brilliant { animation: badge-pop .38s cubic-bezier(.2, 1.6, .4, 1) both, glow-pulse 1.1s ease-in-out .38s 3; }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px #fff, 0 0 0 0 rgba(25,184,204,.0); }
                        50% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px #fff, 0 0 18px 8px rgba(25,184,204,.65); } }
.review-badge.kind-brilliant i { position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; border-radius: 50%; background: #7ff3ff;
  animation: spark .7s ease-out .15s both; }
.review-badge.kind-brilliant i:nth-child(2) { --a: 0deg; } .review-badge.kind-brilliant i:nth-child(3) { --a: 45deg; }
.review-badge.kind-brilliant i:nth-child(4) { --a: 90deg; } .review-badge.kind-brilliant i:nth-child(5) { --a: 135deg; }
.review-badge.kind-brilliant i:nth-child(6) { --a: 180deg; } .review-badge.kind-brilliant i:nth-child(7) { --a: 225deg; }
.review-badge.kind-brilliant i:nth-child(8) { --a: 270deg; } .review-badge.kind-brilliant i:nth-child(9) { --a: 315deg; }
@keyframes spark { 0% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
                   100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(-260%) scale(.2); opacity: 0; } }

/* Great: a soft blue glow. */
.review-badge.kind-great { animation: badge-pop .38s cubic-bezier(.2, 1.6, .4, 1) both, great-pulse 1.2s ease-in-out .38s 2; }
@keyframes great-pulse { 50% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px #fff, 0 0 14px 5px rgba(91,139,217,.6); } }

@media (prefers-reduced-motion: reduce) {
  .review-badge, .review-badge.kind-brilliant, .review-badge.kind-great { animation: none; }
  .review-badge.kind-brilliant i { display: none; }
}

/* The board waits while a move is being judged. */
.board-wrap.locked { pointer-events: none; }
.board-wrap.locked::after { content: "Baholanmoqda…"; position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 8;
  padding: 5px 12px; border-radius: 999px; background: rgba(14,17,23,.78); color: #fff; font: 600 12px system-ui, sans-serif; }

/* Profile menu: replaces the Settings link in the nav */
.nav .menu-btn, .tabbar .menu-btn { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.nav .menu-btn { position: relative; display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 13px; width: 100%; font-weight: 600; }
.nav .menu-btn svg { width: 24px; height: 24px; color: var(--text2); }
.nav .menu-btn:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.nav .menu-btn.active { background: var(--surface); font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.06); --icon-cut: var(--surface); }
.nav .menu-btn.active svg, .tabbar .menu-btn.active svg { color: var(--accent); }
.tabbar .menu-btn { display: grid; justify-items: center; gap: 3px; padding: 6px 1px; border-radius: 12px; font-size: 10px; font-weight: 650; color: var(--text2); }
.tabbar .menu-btn svg { width: 25px; height: 25px; }
.menu-pop { position: fixed; z-index: 60; min-width: 210px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.menu-pop.hidden { display: none; }
.menu-pop a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: inherit; font-weight: 600; --icon-cut: var(--surface); }
.menu-pop a svg { width: 20px; height: 20px; color: var(--accent); }
.menu-pop a:hover, .menu-pop a:focus-visible { background: color-mix(in srgb, currentColor 8%, transparent); outline: none; }

/* Language switch: short codes in the top bar and sidebar, full names in Settings. */
.lang-switch { display: inline-flex; background: var(--muted-bg); border-radius: 10px; padding: 2px; gap: 2px; flex: none; }
.lang-switch button { padding: 5px 9px; min-height: 30px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text2); }
.lang-switch button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.side-foot .lang-switch { justify-self: start; margin-left: 12px; }
.topbar .lang-switch { margin-left: 0; }
.seg.lang-full { margin-bottom: 0; }

/* Sign in with Google */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; margin: 0 0 12px;
              border: 1px solid #dadce0; border-radius: 12px; background: #fff; color: #3c4043; font-weight: 650; font-size: 15px; }
.google-btn svg { width: 20px; height: 20px; }
.google-btn:hover { background: #f8f9fa; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 13px; margin: 0 0 12px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* A friend's invitation to a game: a pop-up over everything until it is answered. */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 10, 16, .55);
         backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal.hidden { display: none; }
.modal-card { width: min(380px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; padding: 26px 22px 22px;
              background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal-card h2 { margin: 4px 0 0; font-size: 20px; }
.modal-card .avatar { width: 64px; height: 64px; font-size: 26px; }
.modal-card .row { display: flex; gap: 10px; width: 100%; margin-top: 8px; }
.modal-card .row button { flex: 1; }

/* Time control picker for a game invite. */
.modal-card.wide { width: min(440px, 100%); }
.time-groups { display: grid; gap: 14px; width: 100%; text-align: left; margin: 6px 0 4px; }
.time-groups .overline { margin: 0 0 6px; }
.time-groups .chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.modal-card > #timeClose { width: 100%; }

/* Pre-game VS screen */
.versus { position: fixed; inset: 0; z-index: 400; overflow: hidden; pointer-events: none; }
.versus-half { position: absolute; left: 0; right: 0; height: 50%; display: flex; justify-content: center;
  background: repeating-conic-gradient(#e9e4d8 0 25%, #4a6283 0 50%) 0 0 / 25vmin 25vmin;
  transition: transform .6s cubic-bezier(.2,.9,.25,1); }
.versus-half::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.32); }
.versus-half b { position: relative; z-index: 1; color: #fff; font-size: clamp(22px, 5vw, 38px); font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.6); padding: 9vh 24px; }
.versus-half.top { top: 0; transform: translateY(-100%); align-items: flex-end; }
.versus-half.bottom { bottom: 0; transform: translateY(100%); align-items: flex-start; background-position: 12.5vmin 0; }
.versus.in .versus-half { transform: none; }
.versus.out .versus-half.top { transform: translateY(-100%); transition-duration: .5s; transition-timing-function: ease-in; }
.versus.out .versus-half.bottom { transform: translateY(100%); transition-duration: .5s; transition-timing-function: ease-in; }
.versus-seam { position: absolute; left: 0; right: 0; top: calc(50% - 1.5px); height: 3px; background: #fff; transform: scaleX(0); transition: transform .6s ease .1s, opacity .4s; }
.versus.in .versus-seam { transform: none; }
.versus.out .versus-seam { opacity: 0; }
.versus-vs { position: absolute; left: 50%; top: 50%; color: #fff; font-size: clamp(48px, 12vw, 84px); font-weight: 900; font-style: italic;
  padding: 2px 24px; border-radius: 999px; background: rgba(0,0,0,.55); border: 3px solid rgba(255,255,255,.9); box-shadow: 0 6px 24px rgba(0,0,0,.5);
  transform: translate(-50%, -50%) scale(.2) rotate(-18deg); opacity: 0; }
.versus.in .versus-vs { animation: versus-pop .55s cubic-bezier(.3,1.6,.5,1) .35s forwards; }
.versus.out .versus-vs { animation: versus-out .5s ease-in forwards; }
@keyframes versus-pop { to { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; } }
@keyframes versus-out { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(-50%, -50%) scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .versus-half, .versus-vs, .versus-seam { transition: none; animation: none !important; } }

.daily-list { display: grid; gap: 8px; }
.daily-row { display: flex; align-items: center; gap: 10px; }
.daily-row b { width: 22px; color: var(--text2); }
.daily-row small { flex: 1; }

.tg-wrap { display: flex; justify-content: center; margin: 0 0 12px; }
.tg-wrap .tg-btn { margin: 0; }
.tg-btn[hidden] { display: none; }
