/* ============================================================
   Visual identity: "ink & amber"
   Deep blue-black surfaces, warm amber accent, a framed board with
   original geometric pieces. Pack colors override the --sq-* and
   --piece-* tokens at runtime.
   ============================================================ */
:root {
  --bg: #0e1016; --surface: #161a23; --surface-2: #1e2330; --line: #2a3142;
  --text: #e9ecf2; --muted: #8b93a7;
  --accent: #f2b33d; --accent-ink: #1b1405; --accent-soft: rgba(242, 179, 61, .16);
  --violet: #8f8cff; --good: #2fbf8f; --bad: #e5484d;
  --graph-fill: #e9ecf2; --arrow: #f2b33d;
  --frame: #222838; --frame-text: #8d97ad;
  --sq-light: #e6dfd0; --sq-dark: #58788a;
  --piece-w: #fbf8f2; --piece-b: #1f2a33;
  --radius: 14px;
  --font: "Outfit", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: radial-gradient(1200px 600px at 80% -10%, #1a1f33 0%, transparent 60%), var(--bg);
       background-attachment: fixed; color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-weight: 800; } h2 { font-weight: 700; } h3 { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); min-height: 1.2em; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.accent { color: var(--accent); }

/* ---------- nav ---------- */
nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; padding: 12px 24px;
      background: rgba(14, 16, 22, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 21px; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.links { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.links a { color: var(--muted); padding: 6px 12px; border-radius: 999px; font-weight: 500; }
.links a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.links a.active { color: var(--accent-ink); background: var(--accent); }
.user { display: flex; gap: 12px; align-items: center; }
.nav-stats { display: flex; gap: 6px; }
.nav-stat { display: flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
            color: var(--text); font-size: 14px; transition: border-color .15s, transform .15s; }
.nav-stat small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-stat b { font-variant-numeric: tabular-nums; }
.nav-stat i { font-style: normal; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.nav-stat.respect b { color: var(--accent); }
.nav-stat.respect b::before { content: '✦ '; font-size: 12px; }
a.nav-stat:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.nav-stat.bump { animation: respect-bump .9s cubic-bezier(.3, 1.6, .5, 1); border-color: var(--accent); box-shadow: 0 0 18px rgba(242, 179, 61, .45); }
.nav-stat.spend { animation: respect-bump .6s ease; }
@keyframes respect-bump { 30% { transform: scale(1.15); } }
.nav-name { font-weight: 600; }
.respect-toast { color: var(--accent); font-weight: 800; }
.respect-line { display: inline-block; margin: 6px 0; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
                font-weight: 800; animation: rise .5s .2s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.respect-toast::before { content: '✦ '; }
@media (max-width: 700px) { .nav-stat i, .nav-name { display: none; } }
.icon-btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; width: 36px; height: 36px; cursor: pointer;
            font-size: 16px; display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.icon-btn:hover { transform: scale(1.08); border-color: var(--accent); }
.icon-btn.off { opacity: .6; }
main { max-width: 1240px; margin: 0 auto; padding: 28px 16px 60px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface-2); color: var(--text);
       border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font: 600 15px var(--font); cursor: pointer;
       transition: transform .12s, background .12s, border-color .12s; }
.btn:hover { border-color: #3a4358; background: #252b3a; text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: #ffc25a; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn.big { padding: 13px 24px; font-size: 17px; }
.btn.wide { width: 100%; }
label { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
                          background: var(--bg); color: var(--text); font: 16px var(--font); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin: 40px auto; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 6px; }
.chip.win { background: rgba(47, 191, 143, .15); border-color: rgba(47, 191, 143, .4); color: var(--good); }
.page-head { margin-bottom: 20px; } .page-head p { max-width: 640px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; margin: 10px 0 56px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); max-width: 540px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 22px; border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), transparent); border: 1px solid var(--line); }
.feature .num { font-weight: 800; color: var(--accent); font-size: 14px; letter-spacing: .1em; }
.feature h3 { margin-top: 8px; }
.feature p { color: var(--muted); margin: 0; }

/* ---------- board pages layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 660px) minmax(300px, 1fr); gap: 24px; align-items: start; }
.board-col { position: relative; }
.side { max-height: calc(100vh - 120px); overflow: auto; }
.player { display: flex; align-items: center; gap: 10px; padding: 10px 4px; min-height: 52px; position: relative; }
.pname { font-weight: 700; }
.clock { margin-left: auto; background: var(--surface); border: 1px solid var(--line); padding: 4px 14px; border-radius: 10px;
         font: 700 22px ui-monospace, "Cascadia Mono", monospace; min-width: 96px; text-align: right; color: var(--muted); }
.clock.running { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.clock.low.running { background: var(--bad); color: #fff; }
.status { margin: 12px 0; }
.status.good { color: var(--good); } .status.bad { color: var(--bad); }
.note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin: 8px 0; }
.win { color: var(--good); font-weight: 700; } .loss { color: var(--bad); font-weight: 700; } .draw { color: var(--muted); }

/* ---------- board ---------- */
.board { position: relative; width: 100%; aspect-ratio: 1; user-select: none; touch-action: none; container-type: inline-size; }
.frame { position: absolute; inset: 0; background: var(--frame); border-radius: 16px; padding: 4.2cqw;
         box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
.inner { position: relative; width: 100%; height: 100%; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.squares { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; }
.ranks, .files { position: absolute; display: flex; color: var(--frame-text); font-size: 2.3cqw; font-weight: 600; pointer-events: none; }
.ranks { left: 0; top: 4.2cqw; bottom: 4.2cqw; width: 4.2cqw; flex-direction: column; }
.files { bottom: 0; left: 4.2cqw; right: 4.2cqw; height: 4.2cqw; text-transform: uppercase; }
.ranks span, .files span { flex: 1; display: flex; align-items: center; justify-content: center; }
.sq { position: relative; display: flex; align-items: center; justify-content: center; }
.sq.light { background: var(--sq-light); } .sq.dark { background: var(--sq-dark); }
.sq::before { content: ''; position: absolute; inset: 0; pointer-events: none; transition: background .15s; }
.sq.last::before { background: rgba(242, 179, 61, .26); box-shadow: inset 0 0 0 .4cqw rgba(242, 179, 61, .7); }
.sq.selected::before { background: rgba(242, 179, 61, .45); box-shadow: inset 0 0 1.6cqw rgba(255, 214, 120, .9); }
.sq.check::before { background: radial-gradient(circle, rgba(255, 80, 86, 1) 0%, rgba(229, 72, 77, .55) 42%, transparent 72%);
                    animation: check-pulse 1.1s ease-in-out infinite; }
.sq.mated::before { background: radial-gradient(circle, rgba(255, 60, 70, 1) 0%, rgba(160, 20, 30, .7) 55%, rgba(60, 0, 10, .35) 100%); }
@keyframes check-pulse { 50% { opacity: .55; transform: scale(.92); } }
.sq.target::after { content: ''; position: absolute; width: 24%; height: 24%; transform: rotate(45deg); border-radius: 22%;
                    background: rgba(14, 16, 22, .3); transition: transform .12s, background .12s; }
.sq.target:hover::after { background: var(--accent); transform: rotate(45deg) scale(1.35); }
.sq.target-capture::after { content: ''; position: absolute; inset: 5%; border-radius: 24%; box-shadow: inset 0 0 0 .75cqw rgba(14, 16, 22, .32); transition: box-shadow .12s; }
.sq.target-capture:hover::after { box-shadow: inset 0 0 0 .75cqw var(--accent); }
.sq.target:hover, .sq.target-capture:hover { cursor: pointer; }

/* pieces */
.piece { position: relative; z-index: 1; width: 90%; height: 90%; overflow: visible;
         filter: drop-shadow(0 .45cqw .3cqw rgba(0, 0, 0, .38)); transition: transform .12s; }
.sq.own .piece { cursor: grab; }
.sq.own:hover .piece { transform: translateY(-.5cqw) scale(1.04); }
.sq.selected .piece { transform: translateY(-.7cqw) scale(1.07); filter: drop-shadow(0 1.2cqw .8cqw rgba(0, 0, 0, .4)); }
.piece * { fill: currentColor; stroke: var(--edge); stroke-width: 3.4; stroke-linejoin: round; }
.piece .detail { fill: var(--edge); stroke: none; }
.piece .cut { fill: none; stroke: var(--edge); stroke-width: 4; stroke-linecap: round; }
.piece.pw { color: var(--piece-w); --edge: #161b24; }
.piece.pb { color: var(--piece-b); --edge: #e4dfd2; }
.piece.sliding { z-index: 6; }
.piece.ghost { position: fixed; z-index: 1000; pointer-events: none; transform: scale(1.15); filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .45)); }

/* arrows draw themselves in */
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.arrow { opacity: .88; }
.arrow.new path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .22s ease-out forwards; }
.arrow.new polygon { opacity: 0; animation: fade-in .1s .18s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

.mark { position: absolute; top: .3cqw; right: .3cqw; z-index: 5; font-size: 2.2cqw; font-weight: 800; color: #fff;
        min-width: 4.4cqw; height: 4.4cqw; border-radius: 1.2cqw; display: flex; align-items: center; justify-content: center;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .5); transform: rotate(-6deg); animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } }

/* ---------- effects layer ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.burst { position: absolute; width: 0; height: 0; }
.burst i { position: absolute; left: -.6cqw; top: -.6cqw; width: 1.2cqw; height: 1.2cqw; border-radius: 30%; background: var(--c);
           box-shadow: 0 0 1cqw var(--c); animation: shard .55s cubic-bezier(.15, .7, .3, 1) forwards; }
.burst i.ring { left: -6cqw; top: -6cqw; width: 12cqw; height: 12cqw; border-radius: 50%; background: none; box-shadow: none;
                border: .5cqw solid rgba(255, 214, 120, .9); animation: ring .45s ease-out forwards; }
@keyframes shard { from { transform: translate(0, 0) scale(1.2); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(180deg); opacity: 0; } }
@keyframes ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }

/* ---------- checkmate ---------- */
.frame.quake { animation: quake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes quake {
  10%, 90% { transform: translate(-1px, 1px); } 20%, 80% { transform: translate(3px, -2px); }
  30%, 50%, 70% { transform: translate(-5px, 2px) rotate(-.4deg); } 40%, 60% { transform: translate(5px, -1px) rotate(.4deg); }
}
.piece.tipping { animation: topple 1.1s cubic-bezier(.5, 0, .3, 1) forwards; z-index: 6; }
.piece.tipped { transform: translate(14%, 22%) rotate(84deg) scale(.92); filter: grayscale(.5) brightness(.85) drop-shadow(0 .4cqw .3cqw rgba(0, 0, 0, .5)); }
@keyframes topple {
  0% { transform: none; }
  8%, 24% { transform: rotate(-9deg); } 16%, 32% { transform: rotate(9deg); }
  45% { transform: rotate(-4deg); }
  85% { transform: translate(14%, 18%) rotate(92deg) scale(.92); }
  100% { transform: translate(14%, 22%) rotate(84deg) scale(.92); filter: grayscale(.5) brightness(.85) drop-shadow(0 .4cqw .3cqw rgba(0, 0, 0, .5)); }
}
.piece.victor { z-index: 6; animation: victor 1.6s ease-in-out infinite; }
@keyframes victor {
  0%, 100% { filter: drop-shadow(0 0 .6cqw rgba(255, 200, 90, .9)) drop-shadow(0 0 2cqw rgba(242, 179, 61, .6)); transform: translateY(-.4cqw); }
  50% { filter: drop-shadow(0 0 1.2cqw rgba(255, 220, 130, 1)) drop-shadow(0 0 3.5cqw rgba(242, 179, 61, .8)); transform: translateY(-1cqw) scale(1.05); }
}
.mate-fx { position: absolute; inset: 0; overflow: hidden; border-radius: 16px; transition: opacity .6s; }
.mate-fx.out { opacity: 0; }
.mf-vignette { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(10, 4, 8, .72) 100%);
               animation: fade-in .4s forwards; opacity: 0; }
.mf-ring { position: absolute; width: 20cqw; height: 20cqw; margin: -10cqw 0 0 -10cqw; border-radius: 50%;
           border: 1.2cqw solid rgba(255, 90, 90, .9); box-shadow: 0 0 4cqw rgba(255, 70, 70, .8), inset 0 0 3cqw rgba(255, 70, 70, .6);
           animation: shock 1s cubic-bezier(.1, .7, .3, 1) forwards; }
.mf-ring.r2 { border-color: rgba(255, 214, 120, .9); box-shadow: 0 0 4cqw rgba(242, 179, 61, .8); animation-delay: .15s; opacity: 0; }
@keyframes shock { from { transform: scale(.1); opacity: 1; } to { transform: scale(7); opacity: 0; } }
.mf-confetti { position: absolute; width: 0; height: 0; }
.mf-confetti i { position: absolute; width: var(--w); height: calc(var(--w) * .45); background: var(--c); border-radius: 2px; opacity: 0;
                 animation: confetti 1.9s var(--d) cubic-bezier(.12, .8, .3, 1) forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 22cqw)) rotate(var(--r)); opacity: 0; }
}
.mf-banner { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; }
.mf-title { display: flex; justify-content: center; gap: .4cqw; font: 900 9cqw/1 var(--font); letter-spacing: .02em; }
.mf-title span { display: inline-block; color: #fff; opacity: 0;
                 text-shadow: 0 0 2cqw rgba(242, 179, 61, .9), 0 .6cqw 0 #b3741a, 0 1cqw 2cqw rgba(0, 0, 0, .6);
                 animation: slam .5s calc(.35s + var(--i) * .045s) cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes slam { from { opacity: 0; transform: translateY(-6cqw) scale(2.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
.mf-sub { margin-top: 2cqw; font: 700 3.4cqw var(--font); color: var(--accent); letter-spacing: .3em; text-transform: uppercase; opacity: 0;
          animation: fade-in .4s 1s forwards; text-shadow: 0 .3cqw 1cqw rgba(0, 0, 0, .7); }

@media (prefers-reduced-motion: reduce) {
  .frame.quake, .piece.victor, .sq.check::before, .mf-title span, .mf-ring, .mf-confetti i, .burst i { animation-duration: .01s !important; }
}
.promo { position: absolute; inset: 0; z-index: 10; background: rgba(14, 16, 22, .78); backdrop-filter: blur(3px); border-radius: 16px;
         display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.promo p { margin: 0; font-weight: 700; }
.promo > div { display: flex; gap: 10px; }
.promo button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; width: 14cqw; height: 14cqw; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.promo button:hover { border-color: var(--accent); }
.promo .promo-cancel { width: auto; height: auto; padding: 6px 16px; color: var(--muted); font: 600 14px var(--font); border-radius: 999px; }

/* ---------- move list ---------- */
.movelist { display: grid; grid-template-columns: 40px 1fr 1fr; gap: 2px 6px; max-height: 300px; overflow: auto;
            background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 12px 0; font-variant-numeric: tabular-nums; }
.movelist:empty { display: none; }
.mn { color: var(--muted); }
.mv { padding: 1px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.mv:hover { background: var(--surface-2); }
.mv.cur { background: var(--accent-soft); color: var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; transform: rotate(45deg); }

/* ---------- matchmaking ---------- */
.pool { text-transform: capitalize; margin-top: 18px; }
.tcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tc { padding: 14px; font-size: 18px; border-radius: 12px; }
.seek { text-align: center; padding: 22px; background: var(--surface-2); border-radius: var(--radius); margin: 16px 0; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- bots ---------- */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bot-card { display: flex; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
            color: var(--text); transition: transform .15s, border-color .15s; }
.bot-card:hover { text-decoration: none; transform: translateY(-2px); border-color: hsl(var(--hue) 60% 55%); }
.bot-card h3 { margin: 0; } .bot-card p { margin: 4px 0 0; font-size: 14px; }
.bot-card .style { color: hsl(var(--hue) 70% 70%); font-weight: 600; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 34px;
          background: linear-gradient(145deg, hsl(var(--hue) 55% 42%), hsl(var(--hue) 45% 22%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.avatar.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 22px; }
.avatar.mono { position: relative; font: 800 22px var(--font); letter-spacing: .02em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.avatar.sm.mono { font-size: 14px; }
.avatar .flag { position: absolute; right: -6px; bottom: -6px; font-size: 20px; line-height: 1; text-shadow: none; }

/* ---------- rating change after a game ---------- */
.rating-change { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; animation: rise .5s cubic-bezier(.2, 1.4, .4, 1); }
.rating-change .big { font: 900 40px/1 var(--font); }
.rating-change.up .big { color: var(--good); text-shadow: 0 0 18px rgba(47, 191, 143, .45); }
.rating-change.down .big { color: var(--bad); }
.spinner.inline { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; margin: 0 6px 0 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.9); } }

/* ---------- game review: icons, coach, key moments ---------- */
.move-icon { flex: none; vertical-align: middle; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.mv .move-icon { margin-right: 2px; }
.mark.icon { background: none !important; box-shadow: none; min-width: 0; height: auto; top: -.6cqw; right: -.6cqw; transform: none; border-radius: 0;
             animation: icon-drop .45s cubic-bezier(.3, 1.7, .5, 1); }
.mark.icon .move-icon { width: 5.2cqw; height: 5.2cqw; filter: drop-shadow(0 .4cqw .6cqw rgba(0, 0, 0, .5)); }
@keyframes icon-drop { from { transform: translateY(-2cqw) scale(0) rotate(-30deg); } }
.classes tr { transition: opacity .2s; } .classes tr.zero { opacity: .4; }
.classes td:nth-child(2) { display: flex; align-items: center; gap: 8px; }
.coach { --cc: var(--accent); display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 12px; }
.coach-face { flex: none; width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 30px;
              background: linear-gradient(145deg, var(--surface-2), var(--bg)); border: 2px solid var(--cc); box-shadow: 0 0 18px color-mix(in srgb, var(--cc) 40%, transparent);
              transition: border-color .3s, box-shadow .3s; }
.coach.talk .coach-face span { animation: nod .5s ease; display: inline-block; }
@keyframes nod { 30% { transform: rotate(-12deg) translateY(-2px); } 60% { transform: rotate(6deg); } }
.coach-bubble { position: relative; flex: 1; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--bg); border: 1px solid var(--line);
                border-left: 3px solid var(--cc); transition: border-color .3s; min-height: 92px; }
.coach.talk .coach-bubble { animation: bubble-in .35s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes bubble-in { from { opacity: .3; transform: translateX(-6px); } }
.coach-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.coach-head > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.explain-text p { margin: 4px 0; line-height: 1.45; }
.voice-btn { width: 32px; height: 32px; font-size: 15px; flex: none; }
.moments { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.moment { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
          color: var(--text); font: 600 13px var(--font); cursor: pointer; transition: transform .15s, border-color .15s; }
.moment:hover { transform: translateY(-2px); border-color: var(--accent); }
.evaltext { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%) rotate(-90deg); transform-origin: center; font-size: 10px; font-weight: 800;
            color: #333; mix-blend-mode: difference; white-space: nowrap; }
.acc small { display: block; font-size: 11px; }

/* ---------- opening names ---------- */
.opening-name { margin: 0 0 8px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-height: 18px; animation: fade-in .3s; }
.opening-name span { font-weight: 800; font-size: 11px; color: #d8c29d; background: rgba(167, 134, 90, .18); border: 1px solid rgba(167, 134, 90, .4);
                     padding: 1px 7px; border-radius: 6px; letter-spacing: .04em; }
.opening-name:empty { display: none; }

/* ---------- streaks ---------- */
.nav-stat.streak b { color: var(--muted); }
.nav-stat.streak.hot b { color: #ff9f43; text-shadow: 0 0 12px rgba(255, 140, 50, .55); }
.nav-stat.streak.hot { border-color: rgba(255, 140, 50, .45); }
.nav-stat.streak.hot b { animation: flicker 2.4s ease-in-out infinite; display: inline-block; }
@keyframes flicker { 50% { transform: scale(1.08) rotate(-3deg); } }
.streak-card .streak-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; }
.streak-card .streak-big b { font: 900 44px/1 var(--font); color: #ff9f43; text-shadow: 0 0 22px rgba(255, 140, 50, .4); }

/* ---------- friends ---------- */
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
               background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); vertical-align: 1px; }
.friends-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.friend-tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: 12px; }
.friend-list { display: grid; gap: 8px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
              animation: card-in .35s both; transition: border-color .15s; }
.friend-row:hover { border-color: #3a4358; }
.fr-who { position: relative; display: flex; align-items: center; gap: 12px; color: var(--text); flex: 1; min-width: 0; }
.fr-who:hover { text-decoration: none; } .fr-who > span:last-child { display: flex; flex-direction: column; }
.fr-who .online-dot { left: 34px; top: -2px; }
.fr-actions { display: flex; align-items: center; gap: 8px; }
.pr-friend { margin-left: 6px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rematch-note { border-left-color: var(--violet); animation: card-in .35s both, glow-violet 2s ease-in-out infinite; }
@keyframes glow-violet { 50% { box-shadow: 0 0 20px rgba(143, 140, 255, .35); } }

/* ---------- floating background pieces ---------- */
.bg-deco { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-deco span { position: absolute; width: var(--s); height: var(--s); opacity: .06; animation: bg-float var(--t) ease-in-out infinite alternate; animation-delay: var(--d); }
.bg-deco .piece { width: 100%; height: 100%; filter: blur(.5px); }
.bg-deco .piece * { stroke-width: 2; }
@keyframes bg-float { from { transform: translateY(0) rotate(var(--r0)); } to { transform: translateY(-40px) rotate(var(--r1)); } }

/* ---------- duel intro ---------- */
.duel-overlay { position: fixed; inset: 0; z-index: 3000; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2vw;
                padding: 0 5vw; overflow: hidden; cursor: pointer; transition: opacity .45s; }
.duel-overlay.out { opacity: 0; }
.duel-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(28, 30, 48, .92), rgba(8, 9, 14, .97));
           animation: fade-in .3s; backdrop-filter: blur(6px); }
.duel-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .05) 0 50%, rgba(0, 0, 0, .25) 50% 100%);
                   animation: split-in .6s cubic-bezier(.2, .9, .3, 1); }
@keyframes split-in { from { transform: scaleX(0); } }
.duel-card { position: relative; justify-self: center; width: min(320px, 34vw); padding: 28px 20px; border-radius: 22px; text-align: center;
             background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .14);
             box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.duel-card.left { animation: slide-l .65s cubic-bezier(.2, 1.2, .35, 1) both; border-color: rgba(255, 255, 255, .35); }
.duel-card.right { animation: slide-r .65s cubic-bezier(.2, 1.2, .35, 1) both; }
@keyframes slide-l { from { transform: translateX(-70vw) skewX(12deg); opacity: 0; } }
@keyframes slide-r { from { transform: translateX(70vw) skewX(-12deg); opacity: 0; } }
.duel-piece { font-size: 70px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5)); }
.duel-card.left .duel-piece { color: #fff; } .duel-card.right .duel-piece { color: #1b1f2a; text-shadow: 0 0 2px #fff, 0 0 18px rgba(255, 255, 255, .3); }
.duel-name { font: 800 clamp(20px, 2.4vw, 30px)/1.1 var(--font); margin-top: 10px; word-break: break-word; }
.duel-elo { margin-top: 6px; font: 700 18px var(--font); color: var(--accent); }
.duel-side { margin-top: 10px; font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.duel-center { position: relative; width: 220px; height: 260px; display: flex; align-items: center; justify-content: center; }
.sword { position: absolute; width: 46px; height: 230px; left: 50%; top: 50%; margin: -115px 0 0 -23px; transform-origin: 50% 50%; }
.sword-svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); }
.sword.s1 { animation: swing-1 .7s .15s cubic-bezier(.5, 0, .4, 1.5) both; }
.sword.s2 { animation: swing-2 .7s .15s cubic-bezier(.5, 0, .4, 1.5) both; }
@keyframes swing-1 { from { transform: translate(-260px, -120px) rotate(-120deg); opacity: 0; } 70% { opacity: 1; } to { transform: rotate(-38deg); } }
@keyframes swing-2 { from { transform: translate(260px, -120px) rotate(120deg); opacity: 0; } 70% { opacity: 1; } to { transform: rotate(38deg); } }
.clash-flash { position: absolute; left: 50%; top: 42%; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%; opacity: 0;
               background: radial-gradient(circle, #fff 0%, rgba(255, 220, 140, .9) 18%, rgba(242, 179, 61, .35) 40%, transparent 70%);
               animation: flash .5s .62s ease-out both; }
@keyframes flash { 0% { opacity: 0; transform: scale(.2); } 25% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.6); } }
.sparks { position: absolute; left: 50%; top: 42%; }
.sparks i { position: absolute; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(#fff, var(--accent)); opacity: 0;
            animation: spark .55s calc(.64s + var(--d)) ease-out both; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(200deg) scale(.4); } }
.duel-vs { position: absolute; bottom: 0; font: 900 64px/1 var(--font); letter-spacing: .04em; color: #fff; opacity: 0;
           text-shadow: 0 0 24px rgba(242, 179, 61, .9), 0 4px 0 #b3741a; animation: vs-in .45s .75s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes vs-in { from { opacity: 0; transform: scale(3) rotate(-8deg); } to { opacity: 1; transform: none; } }
.duel-sub { position: absolute; bottom: -34px; white-space: nowrap; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12px;
            animation: fade-in .4s 1s both; }
@media (max-width: 700px) {
  .duel-overlay { grid-template-columns: 1fr; grid-template-rows: auto auto auto; padding: 20px; gap: 0; }
  .duel-card { width: min(300px, 80vw); padding: 16px; } .duel-piece { font-size: 44px; }
  .duel-center { height: 200px; transform: scale(.8); }
}

/* ---------- players & profiles ---------- */
.search-box { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
              transition: border-color .2s, box-shadow .2s; max-width: 640px; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box input { border: 0; background: transparent; margin: 0; font-size: 17px; }
.search-box input:focus { outline: none; }
.player-list { display: grid; gap: 8px; margin-top: 12px; transition: opacity .2s; }
.player-list.loading { opacity: .5; }
.player-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface);
              border: 1px solid var(--line); color: var(--text); animation: card-in .35s calc(var(--i) * 30ms) both; transition: transform .15s, border-color .15s; }
.player-row:hover { transform: translateX(4px); border-color: var(--accent); text-decoration: none; }
.pr-main { display: flex; flex-direction: column; min-width: 0; } .pr-main b { font-size: 16px; }
.pr-ratings { margin-left: auto; display: flex; gap: 12px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.pr-ratings .main { color: var(--text); font-weight: 700; }
.pr-go { color: var(--muted); transition: transform .15s; } .player-row:hover .pr-go { transform: translateX(4px); color: var(--accent); }
.p-avatar { flex: none; width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff;
            background: linear-gradient(145deg, hsl(var(--hue) 60% 50%), hsl(calc(var(--hue) + 40) 55% 30%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.online-dot { position: absolute; left: 50px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--good); border: 2px solid var(--surface);
              box-shadow: 0 0 10px var(--good); animation: blink 2.4s infinite; }
.online-dot.inline { position: static; display: inline-block; vertical-align: -1px; border: 0; width: 9px; height: 9px; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 640px) { .pr-ratings span:not(.main) { display: none; } }

.profile-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 28px; border-radius: 22px;
                background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); margin-bottom: 16px; animation: card-in .5s both; }
.ph-pattern { position: absolute; inset: 0; opacity: .14; pointer-events: none;
              background: conic-gradient(var(--light) 25%, var(--dark) 0 50%, var(--light) 0 75%, var(--dark) 0) 0 0 / 56px 56px;
              mask-image: linear-gradient(100deg, transparent 35%, #000 100%); }
.profile-hero .p-avatar { width: 84px; height: 84px; border-radius: 26px; font-size: 30px; position: relative; }
.ph-main { position: relative; flex: 1; min-width: 240px; } .ph-main h1 { margin-bottom: 4px; }
.ph-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.big-chip { font-size: 14px; padding: 6px 14px; margin: 0; } .respect-chip { color: var(--accent); border-color: rgba(242, 179, 61, .4); }
.ph-actions { position: relative; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-grid .panel { margin: 0; }
.wld { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.wld b { display: block; font-size: 32px; } .wld span { color: var(--muted); font-size: 13px; }
.wld-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; background: var(--bg); }
.wld-bar i { height: 100%; animation: grow .9s .2s cubic-bezier(.2, .8, .3, 1) both; transform-origin: left; }
.wld-bar .w { background: var(--good); } .wld-bar .d { background: #5b6478; } .wld-bar .l { background: var(--bad); }
@keyframes grow { from { transform: scaleX(0); } }
.rating-line { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 7px 0; border-top: 1px solid var(--line); text-transform: capitalize; }
.rating-line:first-of-type { border-top: 0; } .rating-line small { grid-column: 1 / -1; text-transform: none; }
.hl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hl-grid > div { padding: 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.hl-grid b { display: block; font-size: 20px; } .hl-grid span { font-size: 12px; color: var(--muted); }
.profile-board { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); aspect-ratio: 2; border-radius: 10px; overflow: hidden; border: 5px solid var(--frame); }
.profile-board span { position: absolute; left: 50%; top: 50%; width: 46%; height: 92%; transform: translate(-50%, -50%); }
.profile-board .piece { width: 100%; height: 100%; color: inherit; }
.challenge-panel { border-color: var(--accent); animation: card-in .35s both; }
.tc-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pill { border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 7px 14px; border-radius: 999px; font: 600 14px var(--font); cursor: pointer; transition: all .15s; }
.pill:hover { border-color: var(--accent); } .pill.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; } label.inline select { margin: 0; width: auto; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }

/* incoming challenge pop-up */
.invite { position: fixed; right: 20px; bottom: 20px; z-index: 2500; display: flex; gap: 14px; width: min(380px, calc(100vw - 40px)); padding: 16px;
          border-radius: 18px; background: var(--surface-2); border: 1px solid var(--accent); box-shadow: 0 20px 50px rgba(0, 0, 0, .55), 0 0 30px rgba(242, 179, 61, .2);
          animation: invite-in .5s cubic-bezier(.2, 1.3, .4, 1); }
.invite.out { animation: invite-out .3s forwards; }
@keyframes invite-in { from { transform: translateX(120%) rotate(6deg); opacity: 0; } }
@keyframes invite-out { to { transform: translateX(120%); opacity: 0; } }
.invite-swords { font-size: 34px; animation: wiggle 1.2s ease-in-out infinite; }
@keyframes wiggle { 50% { transform: rotate(-12deg) scale(1.1); } }
.invite-body { flex: 1; } .invite .row { margin: 10px 0 6px; }
.invite-timer { height: 3px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.invite-timer i { display: block; height: 100%; background: var(--accent); animation: shrink 60s linear forwards; transform-origin: left; }
@keyframes shrink { to { transform: scaleX(0); } }

/* ---------- more motion everywhere ---------- */
.elo-chip { font-size: 13px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.board { animation: board-in .55s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes board-in { from { opacity: 0; transform: scale(.94) rotateX(8deg); } }
.player { animation: fade-in .4s .15s both; }
.movelist .mv:last-child { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.clock.running { animation: clock-glow 2s ease-in-out infinite; }
@keyframes clock-glow { 50% { box-shadow: 0 0 18px rgba(242, 179, 61, .55); } }
.clock.low.running { animation: clock-panic .5s ease-in-out infinite; }
@keyframes clock-panic { 50% { transform: scale(1.06); box-shadow: 0 0 18px rgba(229, 72, 77, .7); } }
.status h2 { animation: slam-in .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes slam-in { from { opacity: 0; transform: scale(1.6); letter-spacing: .2em; } }
.status b { display: inline-block; animation: fade-in .3s; }
.note { animation: card-in .35s both; }
.btn.primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
                      transform: translateX(-120%); transition: transform .6s; pointer-events: none; }
.btn.primary:hover::after { transform: translateX(120%); }
[data-tilt] { transform-style: preserve-3d; transition: transform .2s ease-out; will-change: transform; }
.big-rating small { font-size: .35em; color: var(--muted); }
.chip, .title-chip { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.links a { position: relative; }
.links a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
                  transform: scaleX(0); transition: transform .25s; }
.links a:hover:not(.active)::after { transform: scaleX(1); }
.toast { transition: transform .3s, opacity .3s; }
.logo { transition: transform .3s; } .logo:hover { transform: rotate(-4deg) scale(1.05); }

/* ---------- home: landing extras ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.stat-strip > div { text-align: center; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.stat-strip b { display: block; font-size: 28px; color: var(--text); }
.how, .bot-strip, .cta-band { margin: 46px 0; }
.how h2, .bot-strip h2 { text-align: center; margin-bottom: 22px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 24px; border-radius: var(--radius); background: linear-gradient(160deg, var(--surface), transparent); border: 1px solid var(--line); position: relative; }
.step > span { position: absolute; top: -14px; left: 20px; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
               display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: 0 6px 16px rgba(242, 179, 61, .35); }
.step h3 { margin-top: 8px; }
.bot-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bot-chip { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
            color: var(--text); transition: transform .15s, border-color .15s; }
.bot-chip:hover { transform: translateY(-3px); border-color: hsl(var(--hue) 60% 55%); text-decoration: none; }
.bot-chip small { display: block; color: var(--muted); font-size: 12px; } .bot-chip b { font-size: 14px; }
.cta-band { text-align: center; padding: 40px 20px; border-radius: 20px; border: 1px solid var(--line);
            background: radial-gradient(ellipse at 50% 0%, rgba(242, 179, 61, .16), transparent 70%), var(--surface); }

/* ---------- home: dashboard ---------- */
.dash-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-hero h1 { font-size: 38px; margin-bottom: 4px; }
.quick-play { display: flex; gap: 10px; flex-wrap: wrap; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 104px; padding: 14px 12px; border-radius: 16px; color: var(--text);
         background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); transition: transform .15s, border-color .15s, box-shadow .15s; }
.quick:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(242, 179, 61, .18); text-decoration: none; }
.quick:active { transform: scale(.96); }
.quick span { font-size: 22px; } .quick b { font-size: 18px; } .quick small { color: var(--muted); font-size: 12px; }
.quick.more { background: transparent; border-style: dashed; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dash-grid > .panel { margin: 0; }
.dash-grid > .panel:first-child { grid-column: span 2; }
.dash-recent { grid-column: 1 / -1; }
.dash-card { color: var(--text); display: block; transition: transform .15s, border-color .15s; }
.dash-card:hover { transform: translateY(-3px); border-color: #3a4358; text-decoration: none; }
.big-num { font: 800 30px var(--font); margin: 4px 0 10px; color: var(--accent); }
.rec { display: flex; align-items: center; gap: 14px; margin: 10px 0; } .rec p { margin: 2px 0 0; }
.mini-swatch { width: 54px; height: 54px; border-radius: 14px; border: 4px solid var(--frame); flex: none; }
@media (max-width: 900px) { .dash-grid, .steps, .stat-strip { grid-template-columns: 1fr 1fr; } .dash-grid > .panel:first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .dash-grid, .steps, .stat-strip { grid-template-columns: 1fr; } }

/* ---------- play hub ---------- */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.play-layout aside > .panel { margin-bottom: 14px; }
.mode-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.mode-toggle .muted { padding: 0 10px; }
.mode { border: 0; background: transparent; color: var(--muted); font: 600 14px var(--font); padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.mode.on { background: var(--accent); color: var(--accent-ink); }
.pool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; position: relative; overflow: hidden; }
.pool-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; }
.pool-card[data-pool=bullet]::before { background: #ffd166; } .pool-card[data-pool=blitz]::before { background: #ff7b54; } .pool-card[data-pool=rapid]::before { background: #6ee7b7; }
.pool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pool-head h3 { margin: 0; } .pool-head p { margin: 2px 0 0; }
.pool-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.pool-rating { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.pool-rating b { font-size: 22px; }
.pool-card .tcgrid { grid-template-columns: repeat(3, 1fr); }
.tc-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px; border-radius: 12px; cursor: pointer;
          background: var(--bg); border: 1px solid var(--line); color: var(--text); font-family: var(--font); transition: transform .12s, border-color .15s, background .15s; }
.tc-btn b { font-size: 20px; } .tc-btn small { color: var(--muted); font-size: 12px; }
.tc-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.tc-btn:active { transform: scale(.96); }
.tc-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.seek { display: flex; align-items: center; gap: 18px; text-align: left; border: 1px solid var(--accent); background: var(--accent-soft); animation: card-in .3s; }
.seek p { margin: 2px 0 0; } .seek .btn { margin-left: auto; }
.seek-anim { display: flex; gap: 5px; }
.seek-anim span { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); animation: hop 1s ease-in-out infinite; }
.seek-anim span:nth-child(2) { animation-delay: .15s; } .seek-anim span:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 50% { transform: translateY(-8px) rotate(45deg); opacity: .5; } }
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 14px; }
.live-stats b { display: block; font-size: 24px; color: var(--accent); } .live-stats span { font-size: 12px; color: var(--muted); }
.live-stats > div:first-child b::before { content: '● '; font-size: 12px; color: var(--good); vertical-align: middle; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.challenge-link { display: flex; gap: 6px; margin-top: 10px; } .challenge-link input { margin: 0; font-size: 13px; }
.quick-links { padding: 8px; }
.quick-links a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); transition: background .15s, transform .15s; }
.quick-links a:hover { background: var(--surface-2); text-decoration: none; transform: translateX(3px); }
.quick-links a > span { font-size: 22px; width: 36px; text-align: center; } .quick-links small { display: block; color: var(--muted); }
.recent { list-style: none; padding: 0; margin: 0; }
.recent li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.recent li:first-child { border-top: 0; } .recent li a { margin-left: auto; }
.res { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.res.win { background: var(--good); } .res.loss { background: var(--bad); } .res.draw, .res.aborted { background: #5b6478; }
.center { text-align: center; } .big-icon { font-size: 54px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@media (max-width: 960px) { .play-layout { grid-template-columns: 1fr; } }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.settings-section h3 { display: flex; align-items: center; gap: 10px; }
.sec-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
            background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting p { margin: 2px 0 0; max-width: 520px; }
.setting select { width: auto; min-width: 130px; margin: 0; }
.preview { position: sticky; top: 80px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; margin: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: background .2s, border-color .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted);
                      transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), background .2s; }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.range { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.range input { margin: 0; padding: 0; accent-color: var(--accent); }
.range output { min-width: 42px; text-align: right; color: var(--muted); }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } .preview { position: static; } }

/* ---------- premoves & drawings ---------- */
.sq.premove::before { background: rgba(143, 140, 255, .42); box-shadow: inset 0 0 0 .4cqw rgba(143, 140, 255, .8); }
.sq.selected.pre::before { background: rgba(143, 140, 255, .45); box-shadow: inset 0 0 1.6cqw rgba(170, 165, 255, .9); }
.sq.target.pre::after { background: rgba(143, 140, 255, .55); }
.sq.target-capture.pre::after { box-shadow: inset 0 0 0 .75cqw rgba(143, 140, 255, .6); }
.piece.ghosted { opacity: .55; }
.sq.hl-o::before { background: rgba(242, 170, 40, .55); }
.sq.hl-g::before { background: rgba(60, 190, 110, .55); }
.sq.hl-r::before { background: rgba(230, 70, 70, .6); }
.sq.hl-b::before { background: rgba(80, 150, 240, .55); }
.arrow.drawn { opacity: .9; }
.board.no-coords .ranks, .board.no-coords .files { visibility: hidden; }

/* ---------- material counter ---------- */
.material { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; min-height: 22px; }
.material .cap-group { display: inline-flex; }
.material .cap-group .piece { width: 18px; height: 18px; margin-right: -7px; filter: none; cursor: default; }
.material .cap-group:last-of-type .piece:last-child { margin-right: 0; }
.material .lead { font-size: 13px; color: var(--muted); margin-left: 6px; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }

/* ---------- puzzle levels ---------- */
.puzzle-progress { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line);
                   border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.puzzle-progress > div:not(.bar) { display: flex; flex-direction: column; }
.puzzle-progress b { font-size: 26px; }
.puzzle-progress .bar { flex: 1; min-width: 160px; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.puzzle-progress .bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #ffd27a); }
.level-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; margin-bottom: 14px; }
.chapter { margin-bottom: 18px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), transparent); }
.chapter.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), 0 12px 30px rgba(242, 179, 61, .08); }
.chapter.future { opacity: .55; }
.chapter.future .level-grid { grid-template-columns: repeat(25, 1fr); gap: 3px; }   /* far-off chapters collapse into a compact strip */
.chapter.future .lvl { aspect-ratio: auto; height: 22px; border-radius: 5px; padding: 0; }
.chapter.future .lvl span, .chapter.future .lvl small { display: none; }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chapter-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.ch-num { width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.lvl { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
       display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; text-align: center;
       transition: transform .12s, border-color .12s; overflow: hidden; }
.lvl span { font-weight: 800; font-size: 18px; line-height: 1; }
.lvl small { font-size: 9px; color: var(--muted); line-height: 1.1; max-height: 2.2em; overflow: hidden; }
a.lvl:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.lvl.open { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.lvl.solved { background: rgba(47, 191, 143, .12); border-color: rgba(47, 191, 143, .45); }
.lvl.solved small { color: var(--good); font-size: 14px; }
.lvl.perfect small { color: var(--accent); }
.lvl.locked { opacity: .4; }
@media (max-width: 700px) { .level-grid { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Google button & placement ---------- */
.btn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; width: 100%; padding: 11px 16px; }
.btn.google:hover { background: #f4f6fb; }
.btn.google svg { width: 18px; height: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.placement-result { text-align: center; }
.placement-result .big-rating { font: 900 72px/1 var(--font); color: var(--accent); margin: 10px 0; text-shadow: 0 0 30px rgba(242, 179, 61, .35); }
.stat-row { display: flex; justify-content: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.stat-row > div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.stat-row b { display: block; font-size: 22px; }
.progress-dots { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.progress-dots i { width: 12px; height: 6px; border-radius: 3px; background: var(--line); }
.progress-dots i.done { background: var(--accent); }
.bubble { position: absolute; left: 60px; top: -34px; max-width: 320px; background: var(--text); color: var(--bg); padding: 8px 14px;
          border-radius: 14px 14px 14px 4px; font-weight: 600; font-size: 14px; z-index: 20; opacity: 0; transform: translateY(6px);
          transition: opacity .2s, transform .2s; pointer-events: none; }
.bubble.show { opacity: 1; transform: none; }

/* ---------- review ---------- */
.board-col:has(.evalbar) { padding-left: 34px; }
.evalbar { position: absolute; left: 0; top: 0; bottom: 0; width: 22px; background: #2b3242; border-radius: 999px; overflow: hidden;
           display: flex; flex-direction: column-reverse; border: 1px solid var(--line); }
.evalbar.flipped { flex-direction: column; }
.evalfill { background: var(--graph-fill); height: 50%; transition: height .3s; }
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffd27a); transition: width .2s; }
.acc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.acc > div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.accnum { display: block; font-size: 30px; font-weight: 800; color: var(--accent); }
.graph { width: 100%; height: 80px; background: #2b3242; border-radius: 10px; cursor: pointer; display: block; }
.classes { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.classes td { padding: 3px 4px; } .classes td:first-child, .classes td:last-child { text-align: center; width: 40px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 7px; color: #fff;
         font-weight: 800; font-size: 12px; padding: 0 4px; vertical-align: middle; }
.explain { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 64px; }
.nav { display: flex; gap: 6px; margin: 12px 0; } .nav .btn { flex: 1; border-radius: 10px; }
textarea { font-family: ui-monospace, "Cascadia Mono", monospace; }

/* ---------- packs ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pack.locked { opacity: .7; }
.pack.locked .mini { filter: saturate(.6); }
.pack.affordable { border-color: rgba(242, 179, 61, .55); box-shadow: 0 0 0 1px rgba(242, 179, 61, .25), 0 10px 30px rgba(242, 179, 61, .12); }
.pack.owned { border-color: rgba(47, 191, 143, .35); }
.pack .btn.wide { margin-top: 6px; }
.btn.buy b { margin-left: 4px; }
.packs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.balance { display: flex; flex-direction: column; align-items: flex-end; padding: 12px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--accent); }
.balance b { font-size: 30px; color: var(--accent); line-height: 1.1; }
.mini { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); aspect-ratio: 1; border-radius: 10px; overflow: hidden; margin-bottom: 12px; border: 6px solid var(--frame); }
.mini span { position: absolute; width: 42%; height: 42%; top: 29%; display: flex; }
.mini span:nth-of-type(1) { left: 6%; } .mini span:nth-of-type(2) { right: 6%; }
.mini .piece { width: 100%; height: 100%; color: inherit; }

/* ---------- profile / tables ---------- */
.title-chip { font-size: 13px; background: var(--accent); color: var(--accent-ink); padding: 3px 10px; border-radius: 999px; vertical-align: middle; font-weight: 700; }
.ratings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rating { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.rating span { text-transform: capitalize; color: var(--muted); font-size: 14px; } .rating b { font-size: 28px; }
.games { width: 100%; border-collapse: collapse; } .games td, .games th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.games th { color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; text-transform: capitalize; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line);
         padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); z-index: 2000; }

/* ============================================================
   Decoration & motion
   ============================================================ */
/* faint chessboard pattern + soft colour orbs behind everything */
/* A large, gently drifting chessboard in perspective, fading out toward the bottom */
body::before { content: ''; position: fixed; inset: -10% -10% 0; z-index: -1; pointer-events: none; opacity: .09;
  background: conic-gradient(#d9dcff 25%, transparent 0 50%, #d9dcff 0 75%, transparent 0) 0 0 / 120px 120px;
  transform: perspective(900px) rotateX(48deg) translateY(-6%) scale(1.5); transform-origin: 50% 0%;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
  animation: board-drift 40s linear infinite; }
@keyframes board-drift { to { background-position: 0 240px; } }
/* Soft coloured light behind everything */
body::after { content: ''; position: fixed; inset: -20vmax; z-index: -2; pointer-events: none;
  background: radial-gradient(42vmax 42vmax at 85% 0%, rgba(242, 179, 61, .16), transparent 60%),
              radial-gradient(38vmax 38vmax at 0% 85%, rgba(143, 140, 255, .14), transparent 60%),
              radial-gradient(30vmax 30vmax at 55% 55%, rgba(47, 191, 143, .06), transparent 65%);
  animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(3vmax, -2vmax) rotate(4deg); } }

/* page transition */
.page-enter { animation: page-in .38s cubic-bezier(.2, .8, .3, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

/* staggered entrances for grids */
.bot-card, .lvl, .feature, .pack, .rating { animation: card-in .45s cubic-bezier(.2, .8, .3, 1) backwards; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* buttons: press + ripple */
.btn { position: relative; overflow: hidden; }
.btn:active { transform: translateY(0) scale(.96); transition-duration: .05s; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .25;
          transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.icon-btn:active { transform: scale(.9); }
.lvl:active, .bot-card:active { transform: scale(.97); }

/* logo + nav touches */
.logo { display: inline-flex; align-items: center; gap: 6px; }
.logo:hover { text-shadow: 0 0 18px rgba(242, 179, 61, .55); }
.links a { transition: background .15s, color .15s, transform .15s; }
.links a:hover { transform: translateY(-1px); }
.links a.active { box-shadow: 0 4px 14px rgba(242, 179, 61, .3); }

/* headings get an accent underline */
.page-head h1, main > h2:first-child { position: relative; display: inline-block; padding-bottom: 6px; }
.page-head h1::after, main > h2:first-child::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 46px;
  border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--violet)); }

/* cards glow a little on hover */
.card, .panel, .feature, .pack { transition: border-color .2s, box-shadow .2s, transform .2s; }
.feature:hover, .pack:hover { transform: translateY(-3px); border-color: #3a4358; box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
.hero h1 .accent { background: linear-gradient(90deg, var(--accent), #ffd27a 50%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* home hero: floating decorative pieces around the board */
.hero { position: relative; }
.hero-deco { position: absolute; width: 64px; height: 64px; pointer-events: none; opacity: .5; animation: float 6s ease-in-out infinite; }
.hero-deco .piece { width: 100%; height: 100%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .4)); }
.hero-deco.d1 { right: -10px; top: -26px; animation-delay: -1s; transform: rotate(12deg); }
.hero-deco.d2 { right: 45%; bottom: -30px; width: 46px; height: 46px; animation-delay: -3s; opacity: .35; }
.hero-deco.d3 { left: -30px; top: 8px; width: 40px; height: 40px; animation-delay: -4.5s; opacity: .3; }
@keyframes float { 50% { translate: 0 -14px; rotate: -6deg; } }

/* toast slides in */
.toast { animation: toast-in .35s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px); } }

/* footer */
footer { max-width: 1240px; margin: 20px auto 0; padding: 26px 16px 34px; border-top: 1px solid var(--line); color: var(--muted);
         display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }
footer a { color: var(--muted); } footer a:hover { color: var(--text); }
footer nav { all: unset; display: flex; gap: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
}

@media (max-width: 900px) {
  .layout, .hero { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .side { max-height: none; }
  nav { gap: 12px; padding: 10px 16px; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .bubble { left: 0; top: -40px; }
}

/* ---------- sign-up / login: two options ---------- */
.auth-card { max-width: 440px; }
.auth-option { display: flex; gap: 12px; align-items: flex-start; }
.auth-option > div { flex: 1; min-width: 0; }
.auth-option p { margin: 6px 0 0; }
.opt-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 8px;
  font: 800 12px var(--font); background: var(--accent-soft); color: var(--accent); }
.auth-fields > b { display: block; margin: 6px 0 6px; }

/* ---------- account settings ---------- */
.acct-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 12px; }
.acct-form input { flex: 1 1 180px; margin: 0; width: auto; }
.chip.ok { background: rgba(47, 191, 143, .15); border-color: rgba(47, 191, 143, .4); color: var(--good); margin: 0 0 0 6px; }
.account .setting > span, .account .setting > b { text-align: right; overflow-wrap: anywhere; }

/* ---------- analysis board ---------- */
.an-head { display: flex; align-items: center; justify-content: space-between; }
.an-head h2 { margin: 0; }
.an-eval { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 10px; }
.an-eval b { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.an-lines { display: grid; gap: 6px; min-height: 40px; }
.an-line { display: flex; gap: 10px; align-items: baseline; text-align: left; width: 100%; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: 13px/1.4 var(--font); cursor: pointer; }
.an-line:hover { border-color: var(--accent); }
.an-line b { flex: none; min-width: 52px; font-variant-numeric: tabular-nums; }
.an-line b.pos { color: #f4f1ea; } .an-line b.neg { color: var(--muted); }
.an-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.an-moves { min-height: 40px; max-height: 220px; }
.an-moves:empty { display: grid; }
.an-moves:empty::before { content: 'No moves yet: play one on the board.'; grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding: 6px 8px; }
.mv.empty { cursor: default; color: var(--muted); }
.an-tools .btn { flex: 1 1 auto; }
.an-load summary { cursor: pointer; color: var(--accent); font-size: 14px; margin: 6px 0; }
.an-load textarea { width: 100%; margin: 6px 0; }
#toAnalysis { margin: 4px 0 12px; }

/* ---------- badges ---------- */
.badges-panel { margin-bottom: 20px; }
.badges-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.badges-head h3 { margin: 0; }
.seg { display: flex; gap: 6px; }
.seg .pill { padding: 5px 12px; font-size: 13px; }
.badge-progress { height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; margin: 12px 0 16px; }
.badge-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffd889); }
.badge-group h4 { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 14px 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); }
.ach .b-icon { font-size: 30px; line-height: 1.2; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  background: var(--bg); margin-bottom: 6px; }
.ach b { font-size: 14px; } .ach small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.ach .b-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.ach.earned { border-color: rgba(242, 179, 61, .45); background: linear-gradient(180deg, rgba(242, 179, 61, .12), var(--surface-2)); }
.ach.earned .b-icon { background: radial-gradient(circle, rgba(242, 179, 61, .35), rgba(242, 179, 61, .08)); box-shadow: 0 0 0 2px rgba(242, 179, 61, .5); }
.ach.earned .b-meta { color: var(--accent); }
.ach.locked .b-icon { filter: grayscale(1); opacity: .45; }
.ach.locked b { color: var(--muted); }
.b-prog { width: 80%; height: 4px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-top: 8px; }
.b-prog i { display: block; height: 100%; background: var(--accent); }
.earned-only .ach.locked, .earned-only .badge-group.none-earned { display: none; }
.empty-earned { display: none; } .earned-only .empty-earned { display: block; }

/* badge unlocked pop-up */
.badge-pop { position: fixed; left: 50%; top: 76px; z-index: 3000; transform: translateX(-50%); width: min(420px, calc(100vw - 32px));
  display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; color: var(--text); text-decoration: none;
  background: linear-gradient(135deg, #2a2312, var(--surface-2)); border: 1px solid rgba(242, 179, 61, .55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 30px rgba(242, 179, 61, .2); animation: badge-in .55s cubic-bezier(.2, 1.4, .4, 1); }
.badge-pop:hover { text-decoration: none; }
.badge-pop.out { animation: badge-out .4s forwards; }
.bp-row { display: flex; align-items: center; gap: 12px; }
.bp-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bp-row small { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.bp-icon { font-size: 28px; flex: none; animation: wiggle 1.2s ease-in-out 2; }
.bp-reward { flex: none; font-weight: 800; color: var(--accent); }
@keyframes badge-in { from { opacity: 0; transform: translate(-50%, -20px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes badge-out { to { opacity: 0; transform: translate(-50%, -16px) scale(.96); } }
@media (max-width: 560px) { .badge-grid { grid-template-columns: repeat(2, 1fr); } .an-eval b { font-size: 24px; } }

/* ---------- Bot of the Day ---------- */
.nav-daily { color: #ffd889 !important; }
.daily-strip { --hue: 45; display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 0 0 20px; border-radius: 16px; color: var(--text);
  background: linear-gradient(100deg, hsla(var(--hue), 60%, 40%, .28), rgba(242, 179, 61, .10) 60%, var(--surface));
  border: 1px solid rgba(242, 179, 61, .4); transition: transform .15s, box-shadow .15s; flex-wrap: wrap; }
.daily-strip:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 0 24px rgba(242, 179, 61, .15); }
.daily-strip .avatar { background: hsl(var(--hue), 45%, 38%); }
.ds-main { display: flex; flex-direction: column; min-width: 0; }
.ds-main small { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.ds-main b { font-size: 18px; }
.ds-victor { flex: 1; color: var(--muted); font-size: 14px; min-width: 200px; }
.ds-victor b { color: var(--text); }
.ds-cta { font-weight: 800; color: var(--accent); white-space: nowrap; }

.daily-hero { --hue: 45; position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center;
  padding: 36px; border-radius: 24px; margin: 10px 0 24px; border: 1px solid rgba(242, 179, 61, .35);
  background: linear-gradient(120deg, hsla(var(--hue), 55%, 30%, .55), var(--surface) 65%); }
.dh-glow { position: absolute; inset: -40% auto auto -10%; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(242, 179, 61, .25), transparent 65%); animation: dh-pulse 4s ease-in-out infinite; }
@keyframes dh-pulse { 50% { transform: scale(1.12); opacity: .7; } }
.dh-bot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar.xl { width: 132px; height: 132px; border-radius: 36px; font-size: 44px; background: hsl(var(--hue), 45%, 38%);
  box-shadow: 0 0 0 4px rgba(242, 179, 61, .55), 0 18px 40px rgba(0, 0, 0, .45); }
.avatar.xl.mono { font-size: 42px; }
.dh-tag { font: 800 11px var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 999px; }
.dh-main { position: relative; }
.dh-main h1 { font-size: 44px; margin: 4px 0 6px; }
.dh-meta { margin: 0 0 8px; } .dh-meta b { color: var(--accent); }
.dh-quote { font-style: italic; color: #f4e2b8; margin: 10px 0 18px; }
.dh-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dh-reward { font-weight: 700; color: var(--accent); }
.daily-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.daily-grid .hall { grid-column: 1 / -1; }
.victor { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; color: var(--text);
  background: linear-gradient(120deg, rgba(242, 179, 61, .22), rgba(242, 179, 61, .05)); border: 1px solid rgba(242, 179, 61, .5); }
.victor:hover { text-decoration: none; border-color: var(--accent); }
.victor > span:last-child { display: flex; flex-direction: column; }
.victor b { font-size: 20px; } .victor small { color: var(--muted); }
.victor-crown { font-size: 34px; filter: drop-shadow(0 0 10px rgba(242, 179, 61, .6)); animation: wiggle 2.4s ease-in-out infinite; }
.victor.empty { background: var(--bg); border-style: dashed; border-color: var(--line); }
.victor.empty .victor-crown { filter: grayscale(1); opacity: .5; animation: none; }
.daily-result { text-align: center; }
.daily-result h2 { font-size: 26px; }
.daily-result.first h2 { color: var(--accent); text-shadow: 0 0 24px rgba(242, 179, 61, .45); }
.daily-result .row { justify-content: center; }
.respect-win { font: 900 34px var(--font); color: var(--accent); margin: 8px 0; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.crown-rain { position: fixed; inset: 0; pointer-events: none; z-index: 2900; overflow: hidden; }
.crown-rain span { position: absolute; top: -40px; font-size: var(--s); color: var(--accent); animation: crown-fall var(--t) var(--d) ease-in forwards; }
@keyframes crown-fall { to { transform: translateY(110vh) rotate(300deg); opacity: .2; } }
@media (max-width: 760px) {
  .daily-hero { grid-template-columns: 1fr; padding: 24px 18px; text-align: center; }
  .dh-actions { justify-content: center; }
  .dh-main h1 { font-size: 32px; }
  .daily-grid { grid-template-columns: 1fr; }
}
