/* Checkm8bot — colours and building blocks kept from the original design; system fonts (no outside font requests). */
:root{
  --navy:#0f172a;--navy2:#1e293b;--navy3:#334155;
  --shield:#3b82f6;--shield2:#60a5fa;--gold:#f59e0b;--gold2:#fbbf24;
  --emerald:#10b981;--ruby:#ef4444;--purple:#7c3aed;--purple2:#a78bfa;
  --bg:#f8f7f4;--white:#fff;--border:#e2e1d9;--border2:#d4d2c8;--border3:#b8b6ae;
  --text:#111;--text2:#6b6b68;--text3:#9ca3af;
  --sq-light:#f0d9b5;--sq-dark:#b58863;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;--mono:ui-monospace,"SFMono-Regular",Consolas,monospace;
  --r8:8px;--r12:12px;--r16:16px;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:var(--font);background:var(--bg);color:var(--text);font-size:14px;line-height:1.5;overflow-x:hidden}
a{color:var(--shield)}
h1{font-size:28px;letter-spacing:-.02em;margin-bottom:8px}h2{font-size:19px;margin-bottom:8px}h3{font-size:15px;margin-bottom:6px}
p{margin-bottom:8px}.muted{color:var(--text2)}.small{font-size:12px}.tiny{font-size:11px}.mono{font-family:var(--mono)}
.hidden{display:none!important}
/* bar */
.brand-bar{background:var(--navy);position:sticky;top:0;z-index:200}
.brand-inner{max-width:1380px;margin:0 auto;padding:0 20px;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.brand-logo{display:flex;align-items:center;gap:8px;color:#fff;font-size:16px;font-weight:700;text-decoration:none}
.b-accent{color:var(--shield2)}
.nav{display:flex;gap:2px;flex-wrap:wrap}
.nav a{color:#cbd5e1;text-decoration:none;font-size:13px;padding:6px 10px;border-radius:var(--r8)}
.nav a:hover,.nav a.active{background:var(--navy3);color:#fff}
.nav-right{display:flex;align-items:center;gap:6px;color:#cbd5e1;font-size:12px}
main{max-width:1380px;margin:0 auto;padding:18px 20px 40px}
.page{display:none}.page.active{display:block}
/* buttons, badges, cards */
.btn{padding:7px 14px;border:1px solid var(--border3);border-radius:var(--r8);background:var(--white);color:var(--text);cursor:pointer;font-size:13px;font-family:var(--font);font-weight:500;display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.btn:hover{background:#f0ede6}.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-p{background:var(--navy);color:#fff;border-color:var(--navy)}.btn-p:hover{background:var(--navy2)}
.btn-s{background:var(--emerald);color:#fff;border-color:var(--emerald)}
.btn-d{background:var(--ruby);color:#fff;border-color:var(--ruby)}
.btn-pm{background:linear-gradient(135deg,#7c3aed,#5b21b6);color:#fff;border:none;font-weight:600}
.btn-lc{background:linear-gradient(135deg,#629924,#4a7a1c);color:#fff;border:none;font-weight:600}
.btn-sm{padding:4px 10px;font-size:12px}
.badge{display:inline-block;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:600}
.bg{background:#dcfce7;color:#15803d}.bb{background:#dbeafe;color:#1d4ed8}.bw{background:#fef3c7;color:#92400e}.br{background:#fee2e2;color:#b91c1c}
.bn{background:#f0ede6;color:var(--text2)}.bpurp{background:#f5f3ff;color:#7c3aed}.btitle{background:#f59e0b;color:#fff}
.card{background:var(--white);border:1px solid var(--border);border-radius:var(--r12);padding:16px 18px;margin-bottom:12px}
.ct{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--text3);margin-bottom:9px}
.mc{background:#f6f5f0;border-radius:var(--r8);padding:12px 14px}.mc-l{font-size:12px;color:var(--text2)}.mc-v{font-size:20px;font-weight:700}
.g2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.g3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.g4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.rb{display:flex;align-items:center;justify-content:space-between;gap:8px}
.inp,.sel,textarea.inp{width:100%;padding:8px 11px;border:1px solid var(--border3);border-radius:var(--r8);background:var(--white);color:var(--text);font-size:13px;font-family:var(--font)}
.inp:focus,.sel:focus{outline:2px solid var(--shield2);border-color:var(--shield)}
.lbl{font-size:12px;color:var(--text2);margin-bottom:3px;display:block;font-weight:500}.fld{margin-bottom:11px}
.tbl{width:100%;border-collapse:collapse;font-size:13px}
.tbl th{text-align:left;padding:7px 10px;border-bottom:1px solid var(--border);color:var(--text2);font-weight:600;font-size:11px;text-transform:uppercase}
.tbl td{padding:8px 10px;border-bottom:1px solid var(--border)}.tbl tr:hover td{background:#f6f5f0}
.tab-bar{display:flex;gap:4px;margin-bottom:12px;border-bottom:1px solid var(--border);padding-bottom:10px;flex-wrap:wrap}
.tb{padding:6px 12px;border:1px solid transparent;border-radius:var(--r8);background:transparent;color:var(--text2);cursor:pointer;font-size:13px;font-family:var(--font);font-weight:500}
.tb:hover{background:#f0ede6}.tb.active{background:var(--navy);color:#fff}
.note{border-left:3px solid var(--shield);background:#eff6ff;padding:10px 12px;border-radius:6px;font-size:13px;margin:8px 0}
.note.warn{border-color:var(--gold);background:#fffbeb}.note.bad{border-color:var(--ruby);background:#fef2f2}.note.ok{border-color:var(--emerald);background:#ecfdf5}
.overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:500;align-items:center;justify-content:center;padding:20px}
.overlay.open{display:flex}
.modal{background:var(--white);border-radius:var(--r16);width:480px;max-width:96vw;max-height:92vh;overflow-y:auto;padding:20px 22px;box-shadow:0 24px 80px rgba(0,0,0,.2)}
.toast{position:fixed;bottom:22px;right:22px;max-width:420px;padding:10px 16px;border-radius:var(--r8);background:var(--navy);color:#fff;font-size:13px;z-index:600;opacity:0;transform:translateY(40px);transition:all .25s;pointer-events:none}
.toast.show{opacity:1;transform:none}.toast.bad{background:#991b1b}
.pulse{width:8px;height:8px;border-radius:50%;background:var(--emerald);display:inline-block;animation:pulse 2s infinite}
@keyframes pulse{50%{opacity:.25}}
/* board */
.play-grid{display:grid;grid-template-columns:28px minmax(280px,560px) minmax(260px,1fr);gap:14px;align-items:start}
.board-wrap{position:relative;width:100%;aspect-ratio:1;user-select:none;touch-action:none}
.board{display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);width:100%;height:100%;border-radius:6px;overflow:hidden;box-shadow:0 4px 18px rgba(0,0,0,.15)}
.sq{position:relative;display:flex;align-items:center;justify-content:center}
.sq.l{background:var(--sq-light)}.sq.d{background:var(--sq-dark)}
.sq img{width:92%;height:92%;pointer-events:none}
.sq.last{box-shadow:inset 0 0 0 999px rgba(155,199,0,.38)}
.sq.sel{box-shadow:inset 0 0 0 999px rgba(20,85,30,.45)}
/* 2026-12-05 owner (dark mode): the glow faded to TRANSPARENT and replaced the square colour, so the page behind the board showed
   through (invisible on the light page, a black blot on the dark one). Now the glow sits on top of the square's own colour. */
.sq.check{background:radial-gradient(circle,#ff3b3b 0%,rgba(231,0,0,.6) 40%,rgba(231,0,0,0) 75%),var(--sq-light)}
.sq.d.check{background:radial-gradient(circle,#ff3b3b 0%,rgba(231,0,0,.6) 40%,rgba(231,0,0,0) 75%),var(--sq-dark)}
.sq.premove{box-shadow:inset 0 0 0 999px rgba(124,58,237,.45)}
.sq.hint::after{content:"";position:absolute;width:28%;height:28%;border-radius:50%;background:rgba(20,85,30,.45)}
.sq.hint.cap::after{width:88%;height:88%;background:transparent;border:5px solid rgba(20,85,30,.45)}
.coord{position:absolute;font-size:10px;font-weight:700;opacity:.75;pointer-events:none}
.coord.f{bottom:1px;right:3px}.coord.r{top:1px;left:3px}
.sq.l .coord{color:var(--sq-dark)}.sq.d .coord{color:var(--sq-light)}
.drag-ghost{position:fixed;pointer-events:none;z-index:400;transform:translate(-50%,-50%)}
.promo{position:absolute;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;gap:6px;z-index:30}
.promo button{width:22%;aspect-ratio:1;border:none;border-radius:8px;background:#fff;cursor:pointer}
.promo img{width:90%}
.eval-bar{width:28px;aspect-ratio:1/20;height:100%;background:#333;border-radius:6px;overflow:hidden;position:relative;align-self:stretch}
.eval-fill{position:absolute;left:0;right:0;bottom:0;background:#f4f4f4;transition:height .3s}
.eval-txt{position:absolute;left:0;right:0;font-size:10px;font-weight:700;text-align:center;z-index:2}
.player-strip{display:flex;justify-content:space-between;align-items:center;padding:6px 2px;font-size:13px}
.clock{font-family:var(--mono);font-size:20px;font-weight:700;padding:3px 10px;border-radius:6px;background:#e5e7eb;min-width:86px;text-align:center}
.clock.run{background:var(--navy);color:#fff}.clock.low{background:var(--ruby);color:#fff}
.caps{font-size:16px;letter-spacing:-2px;min-height:20px}
.moves{max-height:260px;overflow-y:auto;font-family:var(--mono);font-size:13px;display:grid;grid-template-columns:36px 1fr 1fr}
.moves span{padding:2px 6px;cursor:pointer;border-radius:4px}.moves span.n{color:var(--text3);cursor:default}
.moves span.cur{background:#dbeafe}
.cls-best{color:#15803d}.cls-good{color:#334155}.cls-inaccuracy{color:#b45309}.cls-mistake{color:#c2410c}.cls-blunder{color:#b91c1c;font-weight:700}
.coach-pop{border:2px solid var(--purple);background:#faf5ff;border-radius:var(--r12);padding:12px 14px;margin-bottom:10px}
/* chat */
.chat-card .chat-box{height:200px}
.chat-box{height:220px;overflow-y:auto;background:#f6f5f0;border-radius:var(--r8);padding:8px;font-size:13px;margin-bottom:6px}
.chat-box .who{font-weight:600;margin-right:4px}
.emoji-row button{font-size:18px;background:none;border:none;cursor:pointer;padding:2px}
/* ads */
.ad-slot{text-align:center;margin:8px auto;max-width:1380px;padding:0 20px}.ad-slot img{max-width:100%;border-radius:8px}.ad-slot .tiny{color:var(--text3)}
.ad-slot.on{min-height:90px}
.ad-empty{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;border:1.5px dashed var(--border3);border-radius:10px;padding:10px;color:var(--text2);text-decoration:none;font-size:13px;background:#fff;min-height:90px;max-width:728px;margin:0 auto}
.ad-empty:hover{border-color:var(--shield);color:var(--shield)}
.ad-price{font-weight:700;color:#b45309}
.ad-frame{display:block}
.ad-rail{display:none}
@media (min-width:1700px){
  .ad-frame{display:grid;grid-template-columns:160px minmax(0,1380px) 160px;justify-content:center;gap:16px}
  .ad-rail.on{display:block;position:sticky;top:64px;align-self:start;margin-top:18px}
  .ad-rail .ad-empty{flex-direction:column;min-height:600px;width:160px;max-width:160px}
  .ad-rail img{width:160px}
}
.ad-pick{display:flex;flex-direction:column;gap:2px;align-items:flex-start;text-align:left;padding:10px 12px;border:1px solid var(--border3);border-radius:10px;background:#fff;cursor:pointer;font-family:var(--font)}
.ad-pick.sel{border:2px solid var(--navy);background:#f8fafc}
.ad-total{font-size:16px;font-weight:700}
.stat-line{font-size:13px;color:var(--text2);display:flex;align-items:center;gap:2px;flex-wrap:wrap;margin-top:6px}
/* bars */
.bar{height:10px;background:#e5e7eb;border-radius:5px;overflow:hidden}.bar>div{height:100%;background:var(--emerald)}
.bar.weak>div{background:var(--ruby)}.bar.mid>div{background:var(--gold)}
.hero{background:linear-gradient(135deg,var(--navy),#1e3a8a);color:#fff;border-radius:var(--r16);padding:34px 30px;margin-bottom:16px}
.hero p{color:#cbd5e1;max-width:720px}
.price{font-size:30px;font-weight:800}.plan-card ul{margin:8px 0 12px 18px}.plan-card li{margin-bottom:4px}
footer{max-width:1380px;margin:0 auto;padding:16px 20px 30px;color:var(--text2);font-size:12px;display:flex;gap:14px;flex-wrap:wrap}
@media (max-width:900px){.play-grid{grid-template-columns:22px 1fr}.play-grid>.side{grid-column:1/-1}.g3,.g4{grid-template-columns:1fr 1fr}}
@media (max-width:600px){.g2,.g3,.g4{grid-template-columns:1fr}h1{font-size:22px}}

/* home: the original layout, with true content only */
.home-hero{text-align:center;padding:26px 10px 18px}
.home-hero h1{font-size:34px;font-weight:800;letter-spacing:-.03em;margin:12px 0 8px}
.home-hero p{color:var(--text2);max-width:620px;margin:0 auto;font-size:15px}
.pill{display:inline-flex;align-items:center;gap:7px;background:#f5f3ff;color:#6d28d9;border:1px solid #ddd6fe;border-radius:20px;padding:5px 14px;font-size:13px;font-weight:600}
.pill .dot{width:7px;height:7px;border-radius:50%;background:#7c3aed}
.stats-bar{background:var(--navy);color:#fff;border-radius:var(--r12);padding:16px 22px;display:flex;align-items:center;justify-content:space-around;gap:16px;flex-wrap:wrap;margin-bottom:12px}
.stats-bar .st{text-align:center}.stats-bar .v{font-family:var(--mono);font-size:22px;font-weight:700}
.stats-bar .l{font-size:11px;color:#94a3b8;text-transform:uppercase;letter-spacing:.05em}
.stats-bar .new{color:#cbd5e1;font-size:13px;max-width:560px}

/* ── one page (2026-12-05): the board is always the main thing; everything else opens over it ── */
.nav-sep{width:1px;height:20px;background:#334155;margin:0 6px;align-self:center}
.welcome{position:relative;display:block;margin-bottom:12px}
.welcome-text h1{font-size:26px;font-weight:800;letter-spacing:-.02em;margin:8px 0 6px}
.welcome-text p{color:var(--text2);margin-bottom:8px}
.welcome .stats-bar{margin:0;padding:12px 16px;justify-content:space-between}
.welcome-x{position:absolute;top:-6px;right:-4px;border:none;background:none;font-size:22px;color:var(--text3);cursor:pointer;line-height:1}
.welcome-plans{gap:6px}
.chip{display:inline-block;padding:4px 12px;border-radius:20px;border:1px solid var(--border3);font-size:12px;font-weight:600;color:var(--text);text-decoration:none;background:#fff}
.chip-pm{background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9}
.sheet-back{display:none;position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:300}
.sheet-back.open{display:block}
.sheet{position:fixed;top:0;right:0;bottom:0;width:min(760px,100%);background:var(--bg);z-index:310;overflow-y:auto;padding:0 20px 30px;
  transform:translateX(105%);transition:transform .22s ease;box-shadow:-12px 0 40px rgba(0,0,0,.18)}
.sheet.open{transform:none}
.sheet-head{position:sticky;top:0;background:var(--bg);display:flex;align-items:center;justify-content:space-between;padding:14px 0;margin-bottom:6px;border-bottom:1px solid var(--border);z-index:2}
.sheet-head b{font-size:17px}
.sheet .page{display:none}.sheet .page.active{display:block}
@media (max-width:900px){
  .welcome{grid-template-columns:1fr}
}
/* phones: the board first and as big as the screen allows; menus scroll sideways instead of wrapping */
@media (max-width:700px){
  main{padding:8px 8px 30px}
  .brand-inner{padding:6px 10px;gap:6px}
  .nav{flex-wrap:nowrap;overflow-x:auto;width:100%;order:3;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .nav a{white-space:nowrap;padding:6px 9px}
  .welcome{display:none}          /* phones: the board comes first, right under the menu (owner rule: the board is the highlight) */
  #ad-top{display:none}             /* phones: no banner above the board; the bottom banner stays */
  .play-grid{grid-template-columns:14px minmax(0,1fr)!important;gap:6px}
  .play-grid.pg-board{grid-template-columns:minmax(0,1fr)!important}   /* no eval bar: the board gets the whole width */
  .play-grid>.side{grid-column:1/-1}
  .eval-bar{width:14px}
  .player-strip{padding:4px 0}
  .clock{font-size:17px;min-width:70px}
  .sheet{padding:0 12px 24px}
  footer{padding:12px 10px 24px}
}
/* the panel already shows the title; the board always fits the screen height with both clocks visible */
.sheet .page > div > h2:first-child{display:none}
/* 2026-12-06: board size is set once, below (--board) */

.locked-card{border:1.5px solid #ddd6fe;background:#faf5ff}

/* chat at the board's level (owner 2026-12-05: "the chat should be where the board lays"): wide screens put the chat in its own column
   beside the controls, starting at the top of the board and as tall as the board; smaller screens stack it under the controls */
.side-split{display:block}
@media (min-width:1180px){
  .side-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}
  .side-chat .chat-card{margin-bottom:0;display:flex;flex-direction:column;height:min(calc(100vh - 150px), 640px)}
  .side-chat .chat-card .chat-box{flex:1;height:auto;min-height:220px}
}

/* wide screens: the welcome strip is ONE line, so the board and the chat beside it fit on the screen together */
@media (min-width:1180px){
  .welcome{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:10px;padding-right:24px}
  .welcome-text{display:contents}
  .welcome-text h1{font-size:20px;margin:0}
  .welcome-text p{display:none}
  .welcome .stat-line{margin-top:0}
  .welcome-x{top:50%;transform:translateY(-50%)}
  .side-chat .chat-card{height:auto}
}

/* no gap between the board and the controls when the board shrinks to fit the screen; the eval bar is exactly the board's height */
@media (min-width:1180px){
}
#pl-eval{align-self:start}

.li-badge{background:#629924;color:#fff;text-decoration:none}

/* house ads: the space split diagonally, KingGuardAI top-left, DocHeron bottom-right; each triangle is its own link */
.house-ad{position:relative;width:100%;max-width:728px;height:90px;margin:0 auto;border-radius:10px;overflow:hidden;border:1px solid var(--border)}
.house-ad.tall{width:160px;height:600px}
.ha-half{position:absolute;inset:0;display:block;text-decoration:none;transition:filter .15s}
.ha-half:hover{filter:brightness(1.08)}
.ha-kga{background:linear-gradient(135deg,#0f172a,#1e3a8a);color:#fff;clip-path:polygon(0 0,100% 0,0 100%)}
.ha-dh{background:linear-gradient(135deg,#ecfeff,#e0f2fe);color:#0f172a;clip-path:polygon(100% 0,100% 100%,0 100%)}
.ha-text{position:absolute;display:flex;flex-direction:column;gap:1px;font-size:11px;line-height:1.25;max-width:46%}
.ha-text b{font-size:15px;letter-spacing:-.01em}
.ha-text em{font-style:normal;font-weight:700;font-size:11px;margin-top:2px}
.ha-kga .ha-text{top:9px;left:12px}
.ha-kga .ha-text b{color:#fbbf24}
.ha-dh .ha-text{bottom:9px;right:12px;text-align:right;align-items:flex-end}
.ha-dh .ha-text b{color:#0369a1}
.house-ad.tall .ha-text{max-width:120px}
.house-ad.tall .ha-kga .ha-text{top:14px;left:10px}
.house-ad.tall .ha-dh .ha-text{bottom:30px;right:10px}
.ha-book{position:absolute;right:6px;top:5px;font-size:10px;background:rgba(255,255,255,.92);color:#b45309;font-weight:700;padding:2px 7px;border-radius:10px;text-decoration:none;z-index:2;border:1px solid #fde68a}
.house-ad.tall .ha-book{top:auto;bottom:6px;left:6px;right:6px;text-align:center}
@media (min-width:1700px){ .ad-rail .house-ad{width:160px} }
/* house ads, colourful for visibility (owner 2026-12-05) */
.ha-kga{background:linear-gradient(135deg,#7c3aed 0%,#4f46e5 45%,#2563eb 100%);color:#fff}
.ha-dh{background:linear-gradient(135deg,#06b6d4 0%,#0ea5e9 40%,#10b981 100%);color:#fff}
.ha-text{text-shadow:0 1px 2px rgba(0,0,0,.35)}
.ha-kga .ha-text b{color:#fde047}
.ha-dh .ha-text b{color:#fff}
.ha-kga .ha-text{text-align:left;align-items:flex-start}
.ha-text em{background:rgba(255,255,255,.22);padding:1px 7px;border-radius:9px;text-shadow:none}
.house-ad{border:none;box-shadow:0 2px 10px rgba(79,70,229,.25)}
/* tall side spaces: each text stays inside its own triangle, clear of the "Advertise here" tag */
.house-ad.tall .ha-kga .ha-text{top:14px;left:10px;max-width:118px}
.house-ad.tall .ha-dh .ha-text{bottom:52px;right:10px;max-width:96px;font-size:10.5px}
.house-ad.tall .ha-dh .ha-text span{max-width:96px}

/* fair-play lock: during a live game against a person, every kind of help is locked */
.live-lock-note{display:none}
.live-lock .live-lock-note{display:block;position:sticky;top:48px;z-index:150;max-width:1380px;margin:8px auto;padding:10px 16px;border-radius:10px;
  background:#7c2d12;color:#fff;font-weight:600;font-size:13px;text-align:center}
.live-lock #page-play,.live-lock #page-review,.live-lock #page-trainer{filter:blur(7px) grayscale(.6);pointer-events:none;user-select:none}
.live-lock #page-play *,.live-lock #page-review *,.live-lock #page-trainer *{pointer-events:none}

.emoji-pick{display:grid;grid-template-columns:repeat(9,1fr);gap:2px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:6px;margin:6px 0}
.emoji-pick button{font-size:19px;background:none;border:none;cursor:pointer;border-radius:6px;padding:3px 0}
.emoji-pick button:hover{background:#f1f5f9}
.emoji-row{flex-wrap:wrap}

/* special effects: "Blaze" flames burn across the game's side area (chat, reactions) for a few seconds */
.fx-host{position:relative}
.special-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:8px}
.fx-btn{border-color:#fdba74;background:#fff7ed;font-weight:600}
.fx-btn.locked{opacity:.75}
.fx-overlay{position:absolute;inset:-6px;z-index:40;pointer-events:none;overflow:hidden;border-radius:14px;
  background:radial-gradient(ellipse at 50% 110%,rgba(255,120,0,.55),rgba(255,60,0,.25) 45%,transparent 75%);animation:fx-glow 3s ease-out forwards}
.fx-flame{position:absolute;bottom:-40px;animation:fx-rise 1.6s ease-in infinite;filter:drop-shadow(0 0 8px rgba(255,140,0,.9))}
.fx-caption{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);background:rgba(124,45,18,.92);color:#fff;font-weight:800;
  padding:8px 16px;border-radius:20px;font-size:15px;white-space:nowrap;box-shadow:0 0 24px rgba(255,120,0,.8);animation:fx-pop .4s ease-out}
@keyframes fx-rise{0%{transform:translateY(0) scale(.6);opacity:0}15%{opacity:1}100%{transform:translateY(-560px) scale(1.25);opacity:0}}
@keyframes fx-glow{0%{opacity:0}10%{opacity:1}80%{opacity:1}100%{opacity:0}}
@keyframes fx-pop{0%{transform:translate(-50%,-50%) scale(.4)}100%{transform:translate(-50%,-50%) scale(1)}}
@media (prefers-reduced-motion:reduce){.fx-flame{animation:none;display:none}}
/* Blaze: burn across the chat box itself (visible), stronger glow */
.fx-overlay{background:radial-gradient(ellipse at 50% 105%,rgba(255,110,0,.75),rgba(255,60,0,.35) 50%,rgba(255,200,0,.08) 80%,transparent)}
.fx-flame{bottom:-30px;animation-duration:1.3s}
@keyframes fx-rise{0%{transform:translateY(0) scale(.7);opacity:0}12%{opacity:1}100%{transform:translateY(-420px) scale(1.35);opacity:0}}

/* special effects: three motions shared by all effects (rise, fall, burst), plus a flash for Lightning */
.fx-p{position:absolute;filter:drop-shadow(0 0 8px rgba(255,255,255,.7))}
.fx-p.rise{bottom:-30px;animation:fx-rise 1.3s ease-in infinite}
.fx-p.fall{top:-50px;animation:fx-fall 1.5s linear infinite}
.fx-p.burst{left:50%;top:50%;animation:fx-burst 1.1s ease-out infinite}
@keyframes fx-fall{0%{transform:translateY(0) rotate(0);opacity:0}10%{opacity:1}100%{transform:translateY(460px) rotate(200deg);opacity:0}}
@keyframes fx-burst{0%{transform:translate(-50%,-50%) scale(.3);opacity:1}100%{transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.3);opacity:0}}
.fx-overlay.flash::after{content:"";position:absolute;inset:0;background:#fffbe6;animation:fx-flashk .5s ease-out 3}
@keyframes fx-flashk{0%{opacity:.85}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){.fx-p{animation:none;display:none}.fx-overlay.flash::after{display:none}}

.bc-game{display:flex;justify-content:space-between;gap:8px;width:100%;text-align:left;background:none;border:none;border-bottom:1px solid var(--border);padding:7px 4px;cursor:pointer;font-family:var(--font);font-size:13px}
.bc-game:hover{background:#f8fafc}.bc-game.sel{background:#eff6ff;font-weight:700}

/* players in a live game: global and Watch chat are hidden (game chat with the opponent stays) */
.chat-paused{display:none}
.live-lock .chat-card[data-room="global"] > :not(.ct):not(.chat-paused),.live-lock .chat-card[data-room="watch"] > :not(.ct):not(.chat-paused){display:none}
.live-lock .chat-card[data-room="global"] .chat-paused,.live-lock .chat-card[data-room="watch"] .chat-paused{display:block;font-size:13px;color:var(--text2);padding:10px 0}

/* Watch: the chat stays in view (owner 2026-12-05: "I still don't see the global chat") */
.bc-list{max-height:260px;overflow-y:auto}
.watch-grid{display:block}
@media (min-width:1180px){
  .watch-grid{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:14px;align-items:start}
  .watch-chat-col{position:sticky;top:64px}
  .watch-chat-col .chat-card .chat-box{height:min(calc(100vh - 330px),460px)}
  #page-watch .side-chat .chat-card{display:flex;flex-direction:column}
  #page-watch .side-chat .chat-card .chat-box{flex:1;height:auto;min-height:200px}
}

/* world-tournament round: stacked = info, GM lens, Watch chat, games, moves; wide = chat in its own column beside the board */
.bc-side{display:flex;flex-direction:column}
.bc-back{align-self:flex-start}
@media (min-width:1180px){
  .bc-side{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start;
    grid-template-areas:"info chat" "lens chat" "games chat" "moves chat" "back chat"}
  .bc-info{grid-area:info}.bc-lens{grid-area:lens}.bc-chat{grid-area:chat}.bc-games{grid-area:games}.bc-moves{grid-area:moves}.bc-back{grid-area:back}
  .bc-chat .chat-card{display:flex;flex-direction:column}
  .bc-chat .chat-card .chat-box{flex:1;height:auto;min-height:220px}
}

.shop-pack{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}

/* use the empty margins (owner 2026-12-05): the page grows to the full width between the side ad spaces */
@media (min-width:1180px) and (max-width:1699px){ main{max-width:1640px} .welcome,.brand-inner{max-width:1640px} }
@media (min-width:1700px){
  .ad-frame{grid-template-columns:160px minmax(0,1fr) 160px;justify-content:stretch;padding:0 14px}
  .ad-frame main{max-width:none}
}
.bc-side{grid-template-areas:"info chat" "lens chat" "games chat" "back chat"}
@media (min-width:1180px){ .bc-side{grid-template-columns:minmax(300px,1fr) minmax(300px,1.1fr)} }
/* moves under the board, in a row */
.moves-row-card{margin-top:10px}
.moves-row{display:flex;flex-wrap:wrap;gap:4px 14px;max-height:96px;overflow-y:auto;font-family:var(--mono);font-size:13px}
.mv-pair{display:inline-flex;gap:6px;white-space:nowrap}
.mv-pair .n{color:var(--text3)}

/* round view: three columns end on the same line; the games list fills the middle column */
@media (min-width:1180px){
  .bc-side{grid-template-rows:auto auto minmax(140px,1fr) auto;align-items:stretch}
  .bc-side > .card,.bc-side > div > .card{margin-bottom:0}
  .bc-games{display:flex;flex-direction:column;min-height:0}
  .bc-games .bc-list{flex:1;max-height:none;min-height:80px}
  .bc-chat,.bc-chat .chat-card{height:100%}
  .bc-back{align-self:end}
}
/* the Moves card ends the board column exactly (its 12 px bottom margin made the measured height 12 px too tall) */
.moves-row-card{margin-bottom:0}
/* side ad spaces line up with the content: same top and same bottom as the page's content (owner 2026-12-05) */
@media (min-width:1700px){
  .ad-frame{align-items:stretch}
  .ad-rail.on{position:static;align-self:stretch;margin:18px 0 40px;display:flex;flex-direction:column;justify-content:center}
  .ad-rail .ad-empty{height:100%;min-height:420px;max-height:none}
  .ad-rail > div,.ad-rail > a{flex:1}
  .ad-rail img{display:block;margin:auto}
}
/* Watch list: the tables stay inside their column (long tournament names wrapped under the chat and covered the Watch buttons) */
.watch-grid > div{min-width:0}
#world-list .tbl{table-layout:fixed;width:100%}
#world-list .tbl td,#world-list .tbl th{overflow-wrap:anywhere}
#world-list .tbl th:nth-child(2),#world-list .tbl td:nth-child(2){width:30%}
#world-list .tbl th:nth-child(3),#world-list .tbl td:nth-child(3){width:72px}
#world-list .tbl th:nth-child(4),#world-list .tbl td:nth-child(4){width:84px}

.live-lock .live-lock-note{max-width:min(1380px,calc(100% - 40px))}
/* 2026-12-05 Watch: every move can be clicked for study */
.moves-row .mv{cursor:pointer;padding:0 3px;border-radius:4px}
.moves-row .mv:hover{background:rgba(37,99,235,.12)}
.moves-row .mv.sel{background:#2563eb;color:#fff}
/* 2026-12-05 owner (GM Trainer account): Watch squeezed into a 160px strip. CULPRIT: the frame is 3 columns (rail, main, rail); with
   the rails hidden (paid plans have no ads) <main> fell into the first, 160px, column. Each part now has its own column, and
   ad-free plans drop the rail columns so the page uses the full width. */
.ad-frame > #ad-left{grid-column:1}
.ad-frame > main{grid-column:2;min-width:0}
.ad-frame > #ad-right{grid-column:3}
@media (min-width:1100px){
  body.ad-free .ad-frame{grid-template-columns:minmax(0,1380px);justify-content:center}
  body.ad-free .ad-frame > main{grid-column:1}
}

/* ── 2026-12-05 owner: dark mode (Automatic / Light / Dark switch in the top bar; js/theme.js) ─────────────────────────────── */
.theme-sw{display:flex;gap:2px;margin-left:10px;padding:3px;border:1px solid rgba(255,255,255,.18);border-radius:999px}
.theme-sw button{display:flex;align-items:center;justify-content:center;width:28px;height:24px;border:0;border-radius:999px;background:transparent;color:#cbd5e1;cursor:pointer}
.theme-sw button:hover{color:#fff}
.theme-sw button.on{background:rgba(255,255,255,.16);color:#fff}
@media (max-width:700px){ .theme-sw{margin-left:4px} .theme-sw button{width:24px} }
html[data-theme="dark"]{color-scheme:dark;
  --bg:#0f1218;--white:#171b23;--border:#2a303c;--border2:#343b49;--border3:#465063;
  --text:#e5e7eb;--text2:#a3a9b5;--text3:#7b8394;--shield:#60a5fa}
html[data-theme="dark"] .brand-bar{background:#0b0e13;border-bottom:1px solid #1f2530}
html[data-theme="dark"] .btn:hover,html[data-theme="dark"] .tb:hover,html[data-theme="dark"] .bn{background:#222835}
html[data-theme="dark"] .mc,html[data-theme="dark"] .chat-box,html[data-theme="dark"] .tbl tr:hover td{background:#1d222c}
html[data-theme="dark"] .note{background:#13233b}
html[data-theme="dark"] .note.warn{background:#2a2110}
html[data-theme="dark"] .bpurp,html[data-theme="dark"] .pill,html[data-theme="dark"] .chip-pm{background:#251c3d;border-color:#3f2f66;color:#c4b5fd}
html[data-theme="dark"] .coach-pop,html[data-theme="dark"] .locked-card{background:#1e1830;border-color:#4c3a80}
html[data-theme="dark"] .promo button,html[data-theme="dark"] .emoji-pick{background:#1d222c}
html[data-theme="dark"] .fx-btn{background:#2b1d10;border-color:#7c4a1a}
html[data-theme="dark"] .ad-pick.sel,html[data-theme="dark"] .bc-game:hover{background:#1d222c}
html[data-theme="dark"] .bc-game.sel{background:#13233b}
html[data-theme="dark"] .inp,html[data-theme="dark"] .sel,html[data-theme="dark"] textarea.inp{background:#11151c;color:var(--text)}
html[data-theme="dark"] .moves-row .mv:hover{background:rgba(96,165,250,.18)}
html[data-theme="dark"] .modal{border:1px solid var(--border)}
html[data-theme="dark"] .btn-p,html[data-theme="dark"] .tb.active,html[data-theme="dark"] .clock.run{background:#2563eb;border-color:#2563eb;color:#fff}
html[data-theme="dark"] .btn-p:hover{background:#1d4ed8}
html[data-theme="dark"] .stats-bar,html[data-theme="dark"] .toast{background:#1e293b}
/* 2026-12-05 GM lens: rules a move applied (green) next to rules broken (purple) */
.coach-pop.rule-kept{border-color:#16a34a;background:#f0fdf4}
html[data-theme="dark"] .coach-pop.rule-kept{background:#0f2a1a;border-color:#22c55e}
html[data-theme="dark"] .cls-good{color:#cbd5e1}html[data-theme="dark"] .cls-best{color:#4ade80}html[data-theme="dark"] .cls-inaccuracy{color:#fbbf24}html[data-theme="dark"] .cls-mistake{color:#fb923c}html[data-theme="dark"] .cls-blunder{color:#f87171}
/* 2026-12-05: the GM lens text is never cut: it wraps fully and the side column grows */
.bc-lens .coach-pop p{white-space:normal;overflow:visible}
.bc-lens .coach-pop .tiny{font-size:12px;line-height:1.5}
/* 2026-12-06 owner ("The clocks are not visible in dark mode"): these kept a hard-coded light background while dark mode turned
   the text light (light on light). Each now has a dark background with readable text. */
html[data-theme="dark"] .clock{background:#262c38;color:#e5e7eb;border:1px solid #343b49}
html[data-theme="dark"] .clock.low{background:#dc2626;color:#fff;border-color:#dc2626}
html[data-theme="dark"] .note.bad{background:#2a1215}
html[data-theme="dark"] .note.ok{background:#0f2a1a}
html[data-theme="dark"] .bw{background:#2a2110;color:#fbbf24}
html[data-theme="dark"] .br{background:#2a1215;color:#f87171}
html[data-theme="dark"] .bar{background:#262c38}
html[data-theme="dark"] .emoji-pick button:hover{background:#262c38}

/* 2026-12-06 owner: "This is the standard chess board size. Make sure all chess boards are the same size with this" (the Watch board).
   CULPRIT: every page sized its board itself (460, 500, 520, 540, 560 px, and Play used the screen height). Now ONE size for every
   board: 560 px like Watch; on screens too short for that, every board shrinks the same way so they always match. Phones: full width. */
:root{--board:clamp(300px, calc(100vh - 250px), 560px)}
.play-grid,.play-grid.pg-eval{grid-template-columns:28px var(--board) minmax(260px,1fr)}
.play-grid.pg-board{grid-template-columns:var(--board) minmax(260px,1fr)}
.play-grid .board-wrap{width:var(--board);max-width:100%}
@media (max-width:900px){
  .play-grid,.play-grid.pg-eval{grid-template-columns:22px minmax(0,1fr)}
  .play-grid.pg-board{grid-template-columns:minmax(0,1fr)}
  .play-grid .board-wrap{width:100%}
}
/* 2026-12-06 owner: help chat behind a knight button (bottom right) */
.hc-fab{position:fixed;right:18px;bottom:18px;z-index:60;width:58px;height:58px;border-radius:50%;border:2px solid #2563eb;background:#0f172a;
  display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.3)}
.hc-fab:hover{transform:scale(1.05)}
.hc-panel{position:fixed;right:18px;bottom:88px;z-index:61;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100vh - 120px));
  background:var(--white);border:1px solid var(--border);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,.3);display:flex;flex-direction:column;overflow:hidden}
.hc-panel.hidden{display:none}
.hc-head{display:flex;align-items:center;gap:8px;padding:10px 12px;background:#0f172a;color:#fff}
.hc-head b{flex:1}
.hc-x{background:none;border:none;color:#fff;font-size:16px;cursor:pointer;padding:2px 6px}
.hc-body{flex:1;display:flex;flex-direction:column;min-height:0;padding:10px}
.hc-log{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding-bottom:6px}
.hc-msg{max-width:88%;padding:8px 10px;border-radius:10px;font-size:13px;line-height:1.5;white-space:pre-wrap;word-wrap:break-word}
.hc-bot{align-self:flex-start;background:#f1f5f9;color:var(--text)}
.hc-me{align-self:flex-end;background:#2563eb;color:#fff}
.hc-wait{opacity:.6}
.hc-team{margin-top:6px}
.hc-actions{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0}
.hc-input{display:flex;gap:6px}
.hc-input .inp{flex:1;margin:0}
.hc-form textarea,.hc-form input{margin-top:6px}
.hc-foot{font-size:10.5px;color:var(--text3);padding:6px 12px 8px;margin:0;border-top:1px solid var(--border)}
html[data-theme="dark"] .hc-bot{background:#1d222c}
@media (max-width:700px){ .hc-fab{right:12px;bottom:12px;width:50px;height:50px} .hc-panel{right:12px;bottom:72px} }
