/* ═══════════════════════════════════════════════════════════════════
   VexChess design system
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Arioron Office tokens — same values as docs/cells/forms.office.arioron.com */
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); --dur-fast: .18s; --dur-mid: .28s;

  --bg: #08080a; --bg-raise: #08080a; --panel: #15161b; --panel-2: #1a1a1e; --panel-3: #232329; --hover: rgba(241, 241, 244, .06);
  --line: rgba(241, 241, 244, .09); --line-2: rgba(241, 241, 244, .16);
  --text: #f1f1f4; --text-2: rgba(241, 241, 244, .78); --muted: rgba(241, 241, 244, .64); --faint: rgba(241, 241, 244, .4);
  --accent: #f1f1f4; --accent-2: #f1f1f4; --accent-ink: #131314; --accent-soft: rgba(241, 241, 244, .08); --accent-line: rgba(241, 241, 244, .26);
  --good: #4cc38a; --good-soft: rgba(76, 195, 138, .12); --bad: #f0705f; --bad-soft: rgba(240, 112, 95, .12);
  --warn: #e3b341; --warn-soft: rgba(227, 179, 65, .12); --info: #7da2ff; --info-soft: rgba(125, 162, 255, .12);
  --gold: #e3b341; --silver: #c9cbd1; --bronze: #c89a72;
  --mesh-rgb: 218, 221, 216; --mesh-alpha: .07; --veil: rgba(8, 8, 10, .72);
  --shadow-1: 0 2px 8px -2px rgba(0, 0, 0, .6); --shadow-2: 0 18px 40px -24px rgba(0, 0, 0, .75); --shadow-3: 0 48px 90px -50px rgba(0, 0, 0, .9);
  --r-sm: 8px; --r: 12px; --r-md: 16px; --r-lg: 28px; --r-xl: 40px; --r-full: 999px;
  --side-w: 248px; --top-h: 64px;
  --board-max: 760px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fafaff; --bg-raise: #f2f2f5; --panel: #ffffff; --panel-2: #f4f4f7; --panel-3: #ecebe4; --hover: rgba(28, 28, 28, .045);
  --line: rgba(28, 28, 28, .07); --line-2: rgba(28, 28, 28, .14);
  --text: #1c1c1c; --text-2: rgba(28, 28, 28, .78); --muted: rgba(28, 28, 28, .6); --faint: rgba(28, 28, 28, .38);
  --accent: #1c1c1c; --accent-2: #1c1c1c; --accent-ink: #fafaff; --accent-soft: rgba(28, 28, 28, .06); --accent-line: rgba(28, 28, 28, .24);
  --good: #18794e; --good-soft: rgba(24, 121, 78, .09); --bad: #c2362b; --bad-soft: rgba(194, 54, 43, .09);
  --warn: #8a6100; --warn-soft: rgba(176, 125, 0, .11); --info: #2f5fd0; --info-soft: rgba(47, 95, 208, .09);
  --gold: #b07d00; --silver: #8d9099; --bronze: #a26a3c;
  --mesh-rgb: 28, 28, 28; --mesh-alpha: .055; --veil: rgba(250, 250, 255, .72);
  --shadow-1: 0 2px 8px -2px rgba(28, 28, 28, .1); --shadow-2: 0 18px 40px -24px rgba(28, 28, 28, .28); --shadow-3: 0 48px 90px -50px rgba(28, 28, 28, .42);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; } a.link:hover, .prose a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.18; letter-spacing: -.02em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); letter-spacing: -.028em; line-height: 1.08; } h2 { font-size: 1.3rem; } h3 { font-size: 1.02rem; } h4 { font-size: .9rem; }
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--text); color: var(--bg); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .xs { font-size: .75rem; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn-t { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; } *::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ── app shell ─────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side-nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 0 12px 16px; background: var(--bg-raise); border-right: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 10px; margin: 0 -12px 12px; padding-left: 22px; border-bottom: 1px solid var(--line); color: var(--text) !important; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; display: grid; place-items: center; color: var(--text); flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand small { display: block; font-size: .66rem; color: var(--muted); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-top: -2px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--muted) !important; font-size: 14.5px; font-weight: 400; position: relative; text-decoration: none; transition: background var(--dur-fast), color var(--dur-fast); }
.nav-item:hover { background: var(--hover); color: var(--text) !important; text-decoration: none; }
.nav-item.active { background: var(--text); color: var(--bg) !important; font-weight: 500; }
.nav-item.active:hover { background: var(--text); color: var(--bg) !important; opacity: .92; }
.nav-item .ico { width: 19px; height: 19px; color: inherit; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-play { margin: 2px 0 12px; justify-content: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.online-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .8rem; color: var(--muted); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 25; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--veil); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid var(--line); }
.topbar .brand { display: none; padding: 0; }
.search-btn { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); height: 42px; padding: 0 14px; background: var(--hover); border: 1px solid transparent; border-radius: 99px; color: var(--faint); cursor: pointer; text-align: left; transition: background var(--dur-fast), border-color var(--dur-fast); }
.search-btn:hover { background: var(--panel); border-color: var(--line-2); color: var(--muted); }
.search-btn kbd { margin-left: auto; }
.search-btn { min-width: 0; }
.search-btn > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 500 11px var(--mono); padding: 2px 6px; border-radius: 6px; background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 28px 80px; outline: none; flex: 1; }
main.wide { max-width: 1560px; padding-top: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.eyebrow, .meta { font-family: var(--mono); font-size: .75rem; font-weight: 400; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.bottom-nav { display: none; }

/* user menu */
.user-chip { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px 0 4px; border-radius: 999px; background: transparent; border: 1px solid var(--line-2); cursor: pointer; color: var(--text); font-weight: 500; }
.user-chip:hover { border-color: var(--line-2); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2), var(--shadow-1); padding: 6px; z-index: 60; animation: pop var(--dur-fast) var(--ease-out); }
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 9px; border: 0; background: none; color: var(--text) !important; cursor: pointer; text-align: left; font-size: 14px; font-weight: 400; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--hover); color: var(--text) !important; text-decoration: none; }
.menu .ico { color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ── primitives ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 18px; font-size: .9375rem; font-weight: 500; cursor: pointer; background: transparent; color: var(--text) !important; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), opacity var(--dur-fast), transform var(--dur-fast); white-space: nowrap; line-height: 1; user-select: none; text-decoration: none; }
.btn:hover { background: var(--hover); border-color: var(--faint); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--text); border-color: transparent; color: var(--bg) !important; }
.btn.primary:hover { background: var(--text); opacity: .88; }
.btn.good { background: var(--good); border-color: transparent; color: var(--bg) !important; }
.btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad) !important; }
.btn.danger:hover { background: var(--bad); color: #fff !important; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2) !important; }
.btn.ghost:hover { background: var(--hover); color: var(--text) !important; }
.btn.outline { background: transparent; }
.btn.big { height: 50px; padding: 0 24px; font-size: 1rem; }
.btn.xl { height: 56px; padding: 0 28px; font-size: 1.05rem; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13.5px; }
.btn.icon { width: 40px; padding: 0; color: var(--muted) !important; border-color: transparent; }
.btn.icon:hover { color: var(--text) !important; background: var(--hover); }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-vexid { background: #f1f1f4; color: #08080a !important; border-color: transparent; font-weight: 500; }
.btn-vexid:hover { background: #fff; }
:root[data-theme="light"] .btn-vexid { background: #08080a; color: #f1f1f4 !important; }
:root[data-theme="light"] .btn-vexid:hover { background: #24222e; }
.vexid-mark { width: 22px; height: 22px; border-radius: 6px; background: #08080a; display: grid; place-items: center; }
:root[data-theme="light"] .vexid-mark { background: #f1f1f4; }
.vexid-mark svg { width: 14px; height: 14px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 42px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 14px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-line); }
.btn:focus-visible, a:focus-visible, button:focus-visible, .board:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { min-height: 110px; resize: vertical; font-family: var(--mono); font-size: .85rem; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a88a3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
label.f { display: block; margin-bottom: 14px; } label.f > span { display: block; font-weight: 600; font-size: .8rem; color: var(--text-2); margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; } label.check input { width: auto; accent-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .row > .grow { min-width: 120px; }
.row.tight { gap: 6px; } .row.between { justify-content: space-between; } .row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack.lg { gap: 18px; } .stack.sm { gap: 6px; }

/* switch */
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--panel-3); border-radius: 99px; transition: background .2s; border: 1px solid var(--line-2); }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-1); }
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; background: var(--hover); border: 1px solid var(--line); border-radius: 99px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 99px; cursor: pointer; font-weight: 500; color: var(--muted); font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg.block { display: flex; } .seg.block button { flex: 1; justify-content: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-1); }
.card + .card { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head .ico { color: var(--muted); }
.card-head h2, .card-head h3 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.err { color: var(--bad); margin: 8px 0; min-height: 1.2em; font-size: .9rem; } .okmsg { color: var(--good); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: var(--hover); color: var(--muted); margin-right: 4px; border: 0; white-space: nowrap; }
.tag.live { background: var(--good-soft); color: var(--good); border-color: transparent; } .tag.sched { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.done { color: var(--muted); } .tag.lock { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.accent { background: var(--text); color: var(--bg); }
.tag.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ico { width: 36px; height: 36px; color: var(--faint); margin-bottom: 8px; }

/* avatar */
.avatar { --s: 36px; width: var(--s); height: var(--s); border-radius: 30%; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: calc(var(--s) * .42); overflow: hidden; position: relative; background: var(--panel-3); letter-spacing: -.02em; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.bot { border-radius: 30%; }
.avatar.sm { --s: 28px; } .avatar.xs { --s: 22px; } .avatar.lg { --s: 56px; } .avatar.xl { --s: 96px; border-radius: 28px; }
.avatar .on-dot { position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; border-radius: 50%; background: var(--good); border: 2px solid var(--panel); }

/* tables */
table { width: 100%; border-collapse: collapse; } th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
tbody tr { transition: background .12s; } tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
tr.me td { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* modal, drawer, toast */
.modal-back { position: fixed; inset: 0; background: rgba(5, 4, 12, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px; max-width: 440px; width: 100%; box-shadow: var(--shadow-3); animation: rise .22s cubic-bezier(.2, .9, .3, 1.2); position: relative; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { max-width: 640px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-x { position: absolute; top: 14px; right: 14px; }
.drawer-back { position: fixed; inset: 0; background: rgba(5, 4, 12, .5); z-index: 80; animation: fade .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 81; display: flex; flex-direction: column; box-shadow: var(--shadow-3); animation: slide .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-body { padding: 18px 20px 40px; overflow-y: auto; flex: 1; }
.set-group { margin-bottom: 24px; }
.set-group > h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.set-row .lbl { font-weight: 550; } .set-row .lbl small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-opt { border: 2px solid transparent; border-radius: 10px; padding: 3px; cursor: pointer; background: none; display: flex; flex-direction: column; gap: 5px; align-items: center; font-size: .72rem; color: var(--muted); font-weight: 600; }
.theme-opt.on { border-color: var(--accent); color: var(--text); }
.theme-swatch { width: 100%; aspect-ratio: 1; border-radius: 7px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.piece-opt { width: 100%; aspect-ratio: 1; border-radius: 7px; background: var(--panel-2); display: grid; grid-template-columns: 1fr 1fr; place-items: center; padding: 4px; }
.piece-opt img, .piece-opt span { width: 100%; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 120; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-3); max-width: 360px; transition: opacity .3s, transform .3s; animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2); font-size: .92rem; }
.toast .ico { margin-top: 1px; color: var(--info); }
.toast.warn .ico { color: var(--warn); } .toast.error .ico { color: var(--bad); } .toast.ok .ico { color: var(--good); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
.conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: var(--warn); color: #1d1300; padding: 6px 16px; border-radius: 99px; font-weight: 700; font-size: .85rem; z-index: 130; box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 8px; }
.banner { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--warn-soft); border-color: transparent; }

/* command palette */
.modal.cmdk { max-width: 600px; padding: 0; overflow: hidden; align-self: flex-start; margin-top: 12vh; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in input { border: 0; background: none; padding: 4px 0; font-size: 1.05rem; box-shadow: none !important; }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.cmdk-sec { font-size: .7rem; font-weight: 700; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; padding: 10px 12px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--text-2); }
.cmdk-item.on { background: var(--accent-soft); color: var(--text); }
.cmdk-item .ico { color: var(--muted); }
.cmdk-item kbd { margin-left: auto; }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══ board ═════════════════════════════════════════════════════════ */
.board { --light: #ecebe4; --dark: #9c9e95; --hl: rgba(227, 179, 65, .48); --hl-dark: rgba(227, 179, 65, .55); --sel: rgba(28, 28, 28, .32); --dot: rgba(28, 28, 28, .28); --pm: rgba(125, 162, 255, .5);
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; box-shadow: var(--shadow-3); container-type: inline-size; -webkit-tap-highlight-color: transparent; }
.board[data-theme="walnut"] { --light: #f0d9b5; --dark: #b58863; --hl: rgba(255, 238, 90, .5); --sel: rgba(20, 110, 60, .5); --dot: rgba(40, 20, 0, .25); }
.board[data-theme="emerald"] { --light: #eeeed2; --dark: #769656; --hl: rgba(255, 255, 51, .5); --sel: rgba(20, 85, 30, .5); --dot: rgba(10, 30, 0, .25); }
.board[data-theme="ocean"] { --light: #dee6ee; --dark: #6f8faf; --hl: rgba(155, 220, 255, .6); --sel: rgba(30, 80, 160, .5); }
.board[data-theme="graphite"] { --light: #d9d9de; --dark: #7d7d88; --hl: rgba(255, 220, 110, .5); --sel: rgba(60, 60, 80, .5); }
.board[data-theme="rose"] { --light: #f4e3e8; --dark: #c07f93; --hl: rgba(255, 230, 120, .55); --sel: rgba(140, 30, 70, .45); }
.board[data-theme="midnight"] { --light: #9aa3bd; --dark: #4b5576; --hl: rgba(125, 162, 255, .55); --sel: rgba(255, 255, 255, .3); --dot: rgba(0, 0, 0, .3); }
.board[data-theme="sand"] { --light: #efe6d2; --dark: #c9a66b; --hl: rgba(255, 245, 120, .55); --sel: rgba(110, 70, 0, .4); }
.board[data-theme="mint"] { --light: #e9f4ec; --dark: #6fae8e; --hl: rgba(255, 240, 100, .55); --sel: rgba(0, 80, 60, .45); }
.board .sqs { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.sq { position: relative; }
.sq.l { background: var(--light); } .sq.d { background: var(--dark); }
.sq.last::before, .sq.sel::before, .sq.hint::before, .sq.pm::before, .sq.over::before { content: ""; position: absolute; inset: 0; }
.sq.last::before { background: var(--hl); }
.sq.sel::before { background: var(--sel); }
.sq.pm::before { background: var(--pm); }
.sq.hint::before { background: rgba(92, 200, 255, .55); animation: hintPulse 1.2s ease-in-out infinite alternate; }
@keyframes hintPulse { from { opacity: .45; } }
.sq.over::before { box-shadow: inset 0 0 0 calc(0.5cqi) rgba(255, 255, 255, .75); }
.sq.check::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 40, 60, 1) 0%, rgba(255, 40, 60, .7) 30%, rgba(255, 40, 60, 0) 72%); }
.sq.mk-r::after { content: ""; position: absolute; inset: 0; background: rgba(235, 60, 70, .65); }
.sq.mk-g::after { content: ""; position: absolute; inset: 0; background: rgba(40, 190, 110, .6); }
.sq.mk-b::after { content: ""; position: absolute; inset: 0; background: rgba(60, 140, 240, .6); }
.sq.mk-y::after { content: ""; position: absolute; inset: 0; background: rgba(250, 190, 40, .65); }
.sq .dot { position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; margin: -15% 0 0 -15%; border-radius: 50%; background: var(--dot); z-index: 4; pointer-events: none; }
.sq .dot.cap { width: 100%; height: 100%; margin: 0; left: 0; top: 0; background: radial-gradient(transparent 0%, transparent 79%, var(--dot) 80%); }
.board.no-dots .sq .dot { display: none; }
.coord { position: absolute; font: 700 max(9px, 2.1cqi)/1 var(--font); z-index: 3; pointer-events: none; opacity: .9; }
.sq.l .coord { color: var(--dark); } .sq.d .coord { color: var(--light); }
.coord.rank { top: 4%; left: 5%; } .coord.file { bottom: 4%; right: 6%; }
.board.no-coords .coord { display: none; }
.board .pcs { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.pc { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; background-size: 100% 100%; background-repeat: no-repeat; will-change: transform; pointer-events: none; }
.pc.anim { transition: transform var(--anim, 180ms) cubic-bezier(.22, .8, .32, 1); }
.pc.fading { transition: opacity var(--anim, 180ms) ease-out; opacity: 0; }
.pc.dragging { opacity: .3; }
.pc.glyph { display: flex; align-items: center; justify-content: center; font-size: 9.6cqi; line-height: 1; font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", "DejaVu Sans", sans-serif; }
.pc.glyph.w { color: #fff; -webkit-text-stroke: .18cqi #222; text-shadow: 0 .2cqi .4cqi rgba(0, 0, 0, .45); }
.pc.glyph.b { color: #141414; text-shadow: 0 .2cqi .3cqi rgba(255, 255, 255, .2); }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; background-size: 100% 100%; transform: translate(-50%, -50%) scale(1.14); filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); left: 0; top: 0; }
.drag-ghost.glyph { display: flex; align-items: center; justify-content: center; font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", "DejaVu Sans", sans-serif; line-height: 1; }
.board svg.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 7; }
.board .ann { position: absolute; z-index: 8; width: 5.2%; aspect-ratio: 1; transform: translate(-60%, 40%); border-radius: 50%; display: grid; place-items: center; font: 800 2.4cqi/1 var(--font); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); border: .3cqi solid rgba(255, 255, 255, .95); pointer-events: none; animation: annPop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes annPop { from { transform: translate(-60%, 40%) scale(0); } }
.promo-back { position: absolute; inset: 0; background: rgba(8, 6, 20, .55); z-index: 20; backdrop-filter: blur(2px); }
.promo { position: absolute; z-index: 21; width: 12.5%; background: var(--panel); display: flex; flex-direction: column; box-shadow: var(--shadow-3); border-radius: 10px; overflow: hidden; }
.promo-opt { aspect-ratio: 1; border: 0; background: var(--panel); cursor: pointer; background-size: 86%; background-position: center; background-repeat: no-repeat; transition: background-color .12s; font-size: 9cqi; }
.promo-opt:hover { background-color: var(--accent-soft); }
.board-frame { position: relative; }
.board-resize { position: absolute; right: -14px; bottom: -14px; width: 22px; height: 22px; cursor: nwse-resize; z-index: 10; opacity: .4; color: var(--muted); display: grid; place-items: center; }
.board-resize:hover { opacity: 1; }
.board.over-glow { box-shadow: var(--shadow-3), 0 0 0 3px var(--accent-line); }

/* ═══ game layout ═══════════════════════════════════════════════════ */
.play-layout { --bw: min(calc(100vh - var(--top-h) - 196px), var(--board-max)); display: grid; grid-template-columns: auto minmax(0, var(--bw)) minmax(320px, 400px); gap: 22px; justify-content: center; align-items: start; }
.play-layout.no-eval { grid-template-columns: minmax(0, var(--bw)) minmax(320px, 400px); }
.boardcol { width: 100%; min-width: 0; }
.evalcol { width: 26px; display: flex; flex-direction: column; padding: 64px 0; align-self: stretch; }
.pbar { display: flex; align-items: center; gap: 12px; padding: 10px 2px; min-height: 64px; }
.pbar .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pbar .name { font-weight: 650; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .name a { color: var(--text) !important; }
.pbar .rt { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.pbar .delta { font-weight: 700; font-size: .85rem; }
.captured { display: flex; align-items: center; height: 18px; }
.captured .cp { width: 17px; height: 17px; margin-right: -6px; background-size: contain; background-repeat: no-repeat; }
.captured .cp.gl { font-size: 15px; line-height: 17px; width: auto; margin-right: -1px; color: var(--muted); }
.captured .gap { width: 10px; }
.captured .adv { margin-left: 10px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.clock { font: 600 1.75rem/1 var(--mono); font-variant-numeric: tabular-nums; padding: 9px 14px; border-radius: 10px; background: var(--panel-2); color: var(--muted); min-width: 126px; text-align: right; border: 1px solid var(--line); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: flex-end; gap: 8px; letter-spacing: -.02em; transition: background .2s, color .2s; }
.clock .ico { width: 16px; height: 16px; opacity: 0; transition: opacity .2s; }
.clock.active { background: var(--text); color: var(--bg); border-color: transparent; }
.clock.active .ico { opacity: .6; animation: spinTick 1s steps(8) infinite; }
@keyframes spinTick { to { transform: rotate(360deg); } }
.clock.low { background: var(--bad); color: #fff; }
.clock.low.active { animation: lowFlash 1s infinite; }
@keyframes lowFlash { 50% { background: #c4253d; } }
.clock .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .1s linear; }
.clock.active .bar { background: var(--accent); }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.side-panel .sp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.side-panel .sp-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.side-panel .sp-body { padding: 14px 16px; }
.opening { font-size: .82rem; color: var(--muted); padding: 8px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; min-height: 37px; }
.opening b { color: var(--text-2); font-weight: 600; }
.opening .eco { font: 600 .7rem var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--panel-2); color: var(--muted); }
.moves { height: 260px; overflow-y: auto; font-variant-numeric: tabular-nums; scrollbar-width: thin; }
.moves .mrow { display: grid; grid-template-columns: 46px 1fr 1fr; font-size: .92rem; }
.moves .mrow:nth-child(odd) { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
.moves .mn { color: var(--faint); padding: 6px 10px; font-family: var(--mono); font-size: .8rem; display: flex; align-items: center; }
.moves .mv { padding: 5px 9px; cursor: pointer; border-radius: 6px; font-weight: 600; margin: 1px 2px; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.moves .mv:hover { background: var(--hover); color: var(--text); }
.moves .mv.cur { background: var(--accent); color: var(--accent-ink); }
.moves .mv .fig { font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", "DejaVu Sans", sans-serif; font-size: 1.05em; margin-right: -3px; }
.moves .mv .cls { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; margin-left: auto; flex: none; }
.moves .mv .t { margin-left: auto; font: 500 .7rem var(--mono); color: var(--faint); }
.moves .mv.cur .t { color: inherit; opacity: .7; }
.moves .empty-moves { padding: 26px 16px; text-align: center; color: var(--faint); font-size: .88rem; }
.navbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px; border-top: 1px solid var(--line); }
.navbar .btn { padding: 8px; }
.status { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-weight: 600; display: flex; align-items: center; gap: 10px; font-size: .94rem; }
.status.over { background: var(--accent-soft); color: var(--text); } .status.warn { background: var(--warn-soft); color: var(--warn); } .status.good { background: var(--good-soft); color: var(--good); } .status.bad { background: var(--bad-soft); color: var(--bad); }
.ctrls { display: flex; flex-wrap: wrap; gap: 8px; }
.ctrls .btn { flex: 1 1 auto; }
.ctl-strip { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ctl-strip .btn { flex: 1 1 auto; }
.chat { display: flex; flex-direction: column; height: 230px; }
.chat .msgs { flex: 1; overflow-y: auto; font-size: .88rem; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.chat .msg b { color: var(--accent-2); font-weight: 650; margin-right: 6px; }
.chat .msg.sys { color: var(--muted); font-style: italic; font-size: .82rem; }
.chat .quick { display: flex; gap: 6px; padding: 0 10px 8px; overflow-x: auto; scrollbar-width: none; }
.chat .quick button { flex: none; border: 1px solid var(--line); background: var(--panel-2); border-radius: 99px; padding: 4px 10px; font-size: .78rem; cursor: pointer; color: var(--text-2); }
.chat .quick button:hover { border-color: var(--accent-line); color: var(--text); }
.chat .chat-in { padding: 0 10px 10px; }
.evalbar { width: 100%; flex: 1; background: #403d4f; border-radius: 6px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.evalbar .w { position: absolute; left: 0; right: 0; bottom: 0; background: #f4f3f9; transition: height .45s cubic-bezier(.3, .8, .3, 1); }
.evalbar.flip .w { bottom: auto; top: 0; }
.evalbar span { position: absolute; left: 0; right: 0; text-align: center; font: 700 9px var(--mono); z-index: 2; }
.evalbar span.top { top: 5px; color: #f4f3f9; } .evalbar span.bot { bottom: 5px; color: #403d4f; }
.drawoffer { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--info-soft); border-radius: 12px; font-weight: 600; flex-wrap: wrap; }
.drawoffer .grow { min-width: 140px; }

/* game over */
.modal.go-modal { text-align: center; padding: 0; overflow: hidden; max-width: 420px; }
.go-top { padding: 30px 26px 22px; background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 70%); }
.go-top.won { background: radial-gradient(120% 90% at 50% 0%, var(--good-soft), transparent 70%); }
.go-top.lost { background: radial-gradient(120% 90% at 50% 0%, var(--bad-soft), transparent 70%); }
.go-title { font-family: var(--serif); font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.go-players { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 22px 0 6px; }
.go-player { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: .88rem; max-width: 120px; }
.go-player.win .avatar { box-shadow: 0 0 0 3px var(--good); }
.go-score { font: 700 1.3rem var(--mono); color: var(--muted); }
.go-delta { display: inline-flex; align-items: center; gap: 6px; font: 700 1.05rem var(--mono); padding: 6px 12px; border-radius: 99px; margin-top: 10px; }
.go-delta.up { background: var(--good-soft); color: var(--good); } .go-delta.down { background: var(--bad-soft); color: var(--bad); }
.go-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 18px 22px 22px; border-top: 1px solid var(--line); }
.go-actions .full { grid-column: 1 / -1; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* ═══ home ══════════════════════════════════════════════════════════ */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.hero-card { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 34px; background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 28px; align-items: center; }
.hero-card h1 { font-weight: 600; font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.02; letter-spacing: -.035em; margin-bottom: 16px; max-width: 13ch; }
.hero-card h1 em, h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: inherit; }
.hero-card p { color: var(--text-2); font-size: 1.05rem; max-width: 46ch; }
.hero-board { width: 100%; max-width: 300px; justify-self: end; transform: perspective(900px) rotateY(-10deg) rotateX(6deg); transition: transform .6s; }
.hero-board:hover { transform: none; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { font: 700 1.4rem var(--mono); } .hero-stats small { display: block; font: 600 .7rem var(--font); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.qp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qp { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px 12px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text); }
.qp:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.qp:active { transform: scale(.98); }
.qp b { font: 700 1.3rem var(--mono); letter-spacing: -.03em; }
.qp small { color: var(--muted); font-size: .72rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.qp small .ico { width: 13px; height: 13px; }
.qp.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.seeking { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--accent-line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); color: var(--text) !important; transition: border-color .15s, transform .15s; min-height: 140px; }
.tile:hover { border-color: var(--accent-line); text-decoration: none; transform: translateY(-2px); }
.tile .tile-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px; }
.tile .tile-ico .ico { width: 22px; height: 22px; }
.tile b { font-size: 1.02rem; } .tile span { color: var(--muted); font-size: .86rem; }
.tile .tile-art { position: absolute; right: -12px; bottom: -12px; width: 96px; opacity: .14; transition: opacity .2s, transform .3s; }
.tile:hover .tile-art { opacity: .28; transform: rotate(-8deg) scale(1.05); }
.tile > :not(.tile-art) { position: relative; z-index: 1; } /* text stays above the watermark piece */
.tile span { padding-right: 56px; } /* and clear of it */
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tv { display: flex; flex-direction: column; gap: 8px; color: var(--text) !important; padding: 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); transition: border-color .15s; }
.tv:hover { border-color: var(--accent-line); text-decoration: none; }
.tv .board { box-shadow: none; border-radius: 6px; }
.tv .tvp { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; gap: 6px; }
.tv .tvp span:last-child { color: var(--muted); font-family: var(--mono); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); color: var(--text) !important; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { text-decoration: none; background: var(--hover); border-radius: 10px; }
.rating-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rcard { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.rcard .lbl { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rcard .lbl .ico { width: 14px; height: 14px; }
.rcard .val { font: 700 1.45rem var(--mono); letter-spacing: -.03em; }
.rcard svg { width: 100%; height: 26px; margin-top: 4px; }

/* ═══ practice / bots ═══════════════════════════════════════════════ */
.bot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .1s; }
.bot:hover { border-color: var(--line-2); transform: translateY(-1px); }
.bot.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.bot b { font-size: .9rem; } .bot small { color: var(--muted); font: 600 .74rem var(--mono); }
.bot-hero { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; background: var(--panel-2); margin-bottom: 16px; }
.bot-hero .quote { color: var(--text-2); font-style: italic; font-size: .92rem; }
.bubble { position: relative; background: var(--panel-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 12px; font-size: .86rem; color: var(--text-2); animation: rise .3s; max-width: 260px; }

/* ═══ review ════════════════════════════════════════════════════════ */
.review-sum { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.acc { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.acc .num { font: 700 1.8rem var(--mono); padding: 6px 14px; border-radius: 12px; background: var(--panel-2); min-width: 92px; }
.acc .num.w { background: #f4f3f9; color: #16141f; } .acc .num.b { background: #2a2836; color: #f4f3f9; }
.cls-table { width: 100%; margin-top: 12px; font-size: .88rem; }
.cls-table td { padding: 6px 8px; border: 0; }
.cls-table td:first-child, .cls-table td:last-child { font: 700 .95rem var(--mono); text-align: center; width: 48px; }
.cls-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cls-ico { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font: 800 9.5px/1 var(--font); color: #fff; flex: none; }
.c-brilliant { background: #1bb5b5; } .c-great { background: #5b8bd9; } .c-best { background: #6fb33c; } .c-excellent { background: #8cbf52; } .c-good { background: #8aa37a; }
.c-book { background: #a88865; } .c-inaccuracy { background: #e6b422; } .c-mistake { background: #e8833a; } .c-blunder { background: #e0384d; } .c-miss { background: #e06372; } .c-forced { background: #8a8aa0; }
.t-brilliant { color: #1bb5b5; } .t-great { color: #5b8bd9; } .t-best { color: #6fb33c; } .t-excellent { color: #8cbf52; } .t-good { color: #8aa37a; } .t-book { color: #a88865; }
.t-inaccuracy { color: #e6b422; } .t-mistake { color: #e8833a; } .t-blunder { color: #e0384d; } .t-miss { color: #e06372; } .t-forced { color: var(--muted); }
.graph { width: 100%; height: 96px; display: block; cursor: pointer; border-radius: 10px; overflow: hidden; background: #2a2836; }
.coach { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 78px; }
.coach .txt { font-size: .92rem; } .coach .txt b { font-weight: 700; }
.progress { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--text); border-radius: 99px; transition: width var(--dur-mid) var(--ease); }
.lines .line { display: flex; gap: 10px; padding: 8px 16px; cursor: pointer; font-size: .86rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.lines .line:hover { background: var(--hover); }
.lines .line .sc { font: 700 .82rem var(--mono); min-width: 54px; padding: 2px 6px; border-radius: 5px; text-align: center; background: var(--panel-3); }
.lines .line .sc.w { background: #f4f3f9; color: #16141f; } .lines .line .sc.b { background: #2a2836; color: #f4f3f9; }
.lines .line .pv { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .8rem; }

/* ═══ puzzles ═══════════════════════════════════════════════════════ */
.pz-rating { display: flex; align-items: baseline; gap: 10px; }
.pz-rating b { font: 700 2rem var(--mono); }
.rush-score { font: 700 3rem/1 var(--mono); text-align: center; }
.rush-strip { display: flex; flex-wrap: wrap; gap: 5px; }
.rush-strip span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 .75rem var(--mono); }
.rush-strip .ok { background: var(--good-soft); color: var(--good); } .rush-strip .no { background: var(--bad-soft); color: var(--bad); }
.timer-big { font: 700 2.4rem/1 var(--mono); text-align: center; }
.lives { display: flex; justify-content: center; gap: 8px; }
.lives span { width: 14px; height: 14px; border-radius: 50%; background: var(--bad); }
.lives span.gone { background: var(--panel-3); }

/* ═══ profile ═══════════════════════════════════════════════════════ */
.prof-head { display: flex; gap: 22px; align-items: center; padding: 26px; border-radius: var(--r-lg); background: radial-gradient(90% 140% at 0% 0%, var(--accent-soft), transparent 60%), var(--panel); border: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.prof-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wdl { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--panel-3); margin: 8px 0; }
.wdl .w { background: var(--good); } .wdl .d { background: var(--muted); } .wdl .l { background: var(--bad); }
.chart { width: 100%; height: 220px; display: block; }
.chart text { fill: var(--muted); font: 500 10px var(--mono); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.res-chip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font: 800 .75rem var(--mono); }
.res-chip.W { background: var(--good-soft); color: var(--good); } .res-chip.L { background: var(--bad-soft); color: var(--bad); } .res-chip.D { background: var(--panel-3); color: var(--muted); }

/* ═══ leaderboard ═══════════════════════════════════════════════════ */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; margin-bottom: 18px; }
.pod { text-align: center; padding: 22px 12px 18px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text) !important; position: relative; }
.pod:hover { text-decoration: none; border-color: var(--line-2); }
.pod .rank { position: absolute; top: 12px; left: 14px; font: 800 1.1rem var(--mono); }
.pod.p1 { padding-top: 34px; background: linear-gradient(180deg, rgba(245, 196, 81, .14), transparent 70%), var(--panel); border-color: rgba(245, 196, 81, .4); }
.pod.p1 .rank { color: var(--gold); } .pod.p2 .rank { color: var(--silver); } .pod.p3 .rank { color: var(--bronze); }
.pod b { font-size: 1.05rem; } .pod .val { font: 700 1.4rem var(--mono); }

/* ═══ auth ══════════════════════════════════════════════════════════ */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--top-h) - 108px); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--panel); max-width: 1040px; margin: 0 auto; }
.auth-art { position: relative; padding: 40px; display: flex; flex-direction: column; justify-content: flex-end; background: #08080a; color: #f1f1f4; isolation: isolate; overflow: hidden; }
.auth-art h2 { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; line-height: 1.05; position: relative; z-index: 1; }
.auth-art p { color: rgba(241, 241, 244, .64); position: relative; z-index: 1; }
.auth-art .art-board { position: absolute; top: 40px; left: 50%; width: 76%; transform: translateX(-50%) perspective(900px) rotateX(28deg) rotateZ(-8deg); opacity: .95; }
.auth-form { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 1.7rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vexid-perks { display: grid; gap: 8px; margin-top: 14px; font-size: .84rem; color: var(--muted); }
.vexid-perks div { display: flex; gap: 8px; align-items: center; }
.vexid-perks .ico { color: var(--good); width: 16px; height: 16px; }

/* callback page */
.cb-page { display: grid; place-items: center; min-height: 100vh; }
.cb-card { text-align: center; padding: 30px; color: var(--muted); }
.cb-spin { width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.cb-card[data-ok="0"] .cb-spin { display: none; }

/* ═══ tournaments (shared classes) ═══════════════════════════════════ */
.tcard { display: flex; gap: 16px; align-items: center; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; color: var(--text) !important; transition: border-color .15s, transform .15s; }
.tcard:hover { border-color: var(--accent-line); text-decoration: none; transform: translateY(-1px); }
.tcard > .ico { width: 50px; height: 50px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; flex: none; }
.tcard > .ico .ico { width: 24px; height: 24px; }
.stat { font: 700 1.7rem var(--mono); letter-spacing: -.03em; } .stat small { display: block; font: 600 .7rem var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.seek { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); } .seek:last-child { border: 0; }
.tcgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.tcbtn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; cursor: pointer; font-weight: 700; font-size: 1rem; }
.tcbtn small { display: block; color: var(--muted); font-weight: 500; font-size: .74rem; }
.tcbtn:hover { border-color: var(--accent-line); } .tcbtn.on { border-color: var(--accent); background: var(--accent-soft); }
.pgnbox { width: 100%; height: 90px; }
.slider { width: 100%; accent-color: var(--accent); }
.levelrow { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.bracket { display: flex; gap: 24px; overflow-x: auto; padding-bottom: 8px; }
.livegame { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }

/* ═══ responsive ════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
  .hero-card { grid-template-columns: minmax(0, 1fr) 220px; padding: 28px; }
  .hero-board { max-width: 220px; }
}
@media (max-width: 1200px) {
  .play-layout { --bw: min(calc(100vh - var(--top-h) - 196px), 640px); grid-template-columns: auto minmax(0, var(--bw)) 320px; gap: 16px; }
  .play-layout.no-eval { grid-template-columns: minmax(0, var(--bw)) 320px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 1080px) {
  :root { --side-w: 76px; }
  .side-nav { padding: 16px 10px; align-items: center; }
  :root .side-nav .brand img.brand-logo { display: none !important; }
  .side-nav .brand .brand-compact.logo-light { display: block; }
  :root[data-theme="dark"] .side-nav .brand .brand-compact.logo-dark { display: block !important; }
  .side-nav .brand span, .side-nav .nav-item span, .side-nav .online-pill span, .side-nav .nav-play span { display: none; }
  .side-nav .brand { padding: 6px 0 18px; }
  .nav-item { justify-content: center; padding: 11px; }
  .nav-item.active::before { left: -10px; }
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side-nav { display: none; }
  .topbar { padding: 0 14px; }
  .topbar .brand { display: flex; }
  :root .topbar .brand img.brand-logo, .topbar .brand .brand-sep { display: none !important; }
  .topbar .brand { gap: 8px; }
  .topbar .brand .brand-compact.logo-light { display: block; }
  :root[data-theme="dark"] .topbar .brand .brand-compact.logo-dark { display: block !important; }
  .search-btn { width: auto; flex: 1; }
  .search-btn kbd { display: none; }
  main { padding: 16px 14px 96px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--bg-raise) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: .68rem; font-weight: 600; color: var(--muted) !important; border-radius: 10px; }
  .bottom-nav a .ico { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--accent-2) !important; }
  .bottom-nav a:hover { text-decoration: none; }
  .play-layout, .play-layout.no-eval { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .evalcol { display: none; }
  .boardcol { max-width: min(100%, max(280px, calc(100vh - 268px))); margin: 0 auto; }
  @supports (height: 100dvh) { .boardcol { max-width: min(100%, max(280px, calc(100dvh - 268px))); } }
  .moves { height: 160px; }
  .pbar { min-height: 52px; padding: 6px 0; }
  .clock { font-size: 1.35rem; min-width: 100px; padding: 7px 10px; }
  .home-grid, .hero-card, .grid2, .grid3, .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .home-grid > .play-first { order: -1; }
  .grid2.keep { grid-template-columns: 1fr 1fr; }
  .hero-card { padding: 24px; } .hero-board { display: none; }
  .auth-art { display: none; } .auth-form { padding: 28px 22px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .ratings { grid-template-columns: repeat(2, 1fr); }
  .tcard { flex-wrap: wrap; } .tcard .grow { flex-basis: 60%; }
  .modal { padding: 22px; }
  .bot-grid { grid-template-columns: repeat(4, 1fr); }
  .board-resize { display: none; }
  #toasts { left: 14px; right: 14px; bottom: 80px; } .toast { max-width: none; }
  .page-head h1 { font-size: 1.5rem; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .bot-grid { grid-template-columns: repeat(2, 1fr); }
  .podium { grid-template-columns: 1fr; } .pod.p1 { order: -1; }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .top-actions .btn span { display: none; }
  /* like the Office apps on phones: compact mark, icon search, theme and sound live in Settings */
  .topbar { padding: 0 12px; gap: 8px; }
  .top-actions { gap: 4px; }
  .hide-xs { display: none !important; }
  .search-btn { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; margin-left: auto; }
  .search-btn > span, .search-btn kbd { display: none; }
  .topbar .brand-product { font-size: 19px; }
}
@media (max-width: 560px) {
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.vexid-mark { color: #f1f1f4; } :root[data-theme="light"] .vexid-mark { color: #08080a; }
.btn-vexid .vexid-mark { background: #08080a; color: #f1f1f4; } :root[data-theme="light"] .btn-vexid .vexid-mark { background: #f1f1f4; color: #08080a; }
.daily-board { display: block; border-radius: 12px; overflow: hidden; }
.qp-grid.daily .qp { padding: 10px 8px 9px; }
.qp-grid.daily .qp b { font-size: 1.02rem; }
.dg-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--text) !important; }
.dg-row:hover { background: var(--panel-2); text-decoration: none; }
.dg-row .dg-mini { width: 56px; flex: none; border-radius: 6px; overflow: hidden; }
.dg-row .turn { font-weight: 700; color: var(--accent-2); }
.nav-item { position: relative; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font: 700 .7rem/20px var(--mono); text-align: center; }
@media (max-width: 1080px) { .nav-badge { position: absolute; top: 4px; right: 8px; margin: 0; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; } }
.xp-head { display: flex; align-items: center; gap: 8px; }
.xp-head .eco { font: 700 .72rem var(--mono); color: var(--accent-2); background: var(--accent-soft); padding: 2px 6px; border-radius: 6px; }
.xp-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.xp-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 76px minmax(90px, 1.1fr) 52px; gap: 10px; align-items: center; padding: 9px 12px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.xp-row:first-child { border-top: 0; }
.xp-row:hover:not(.xp-h) { background: var(--panel-2); }
.xp-h { cursor: default; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); background: var(--panel-2); }
.xp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xwdl { display: flex; height: 18px; border-radius: 6px; overflow: hidden; font: 700 .62rem/18px var(--mono); }
.xwdl i { font-style: normal; text-align: center; overflow: hidden; }
.xwdl .w { background: #f2f0f8; color: #222; } .xwdl .d { background: #8a879a; color: #fff; } .xwdl .b { background: #24222e; color: #ddd; }
@media (max-width: 560px) { .xp-row { grid-template-columns: 54px minmax(0, 1fr) 64px 46px; } .xp-row > :nth-child(2) { display: none; } }

/* ── Lessons ── */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lesson-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text) !important; transition: border-color .15s, transform .15s; }
.lesson-card:hover { border-color: var(--accent-line); text-decoration: none; transform: translateY(-1px); }
.lesson-card h3 { margin: 4px 0 0; font-size: 1.12rem; }
.lesson-card p { margin: 0; flex: 1; }
.ico-tile { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; }
.ico-tile .ico { width: 22px; height: 22px; }
.accent-text { color: var(--accent-2); }
.tag.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.lesson-text { font-size: 1.02rem; line-height: 1.55; margin: 0 0 12px; color: var(--text-2); }
.lesson-done { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); line-height: 1.5; font-size: .94rem; }
.lesson-done .ico { flex: none; margin-top: 2px; color: var(--accent-2); }
.lesson-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.lesson-step:hover { background: var(--panel-2); }
.lesson-step.active { background: var(--accent-soft); color: var(--text); font-weight: 650; }
.lesson-step .n { width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; background: var(--panel-3); font-size: .78rem; font-weight: 700; flex: none; }
.lesson-step .n.ok { background: var(--good-soft); color: var(--good); }
.lesson-step .n .ico { width: 14px; height: 14px; }

/* ── Fair play queue ── */
.fp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); }
.fp-stats b { font-size: 1.1rem; }
.fp-games { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fp-game { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--text) !important; }
.fp-game.flagged { border-color: var(--bad); background: var(--bad-soft); }

/* ═══ Arioron Office alignment ══════════════════════════════════════
   Patterns shared with Vex Docs / Cells / Forms: the faint grid mesh behind the page, the wordmark │ product lockup,
   and quiet monochrome surfaces. */
body { background: var(--bg); }
.main-col { position: relative; isolation: isolate; }
.main-col::before { content: ""; position: absolute; inset: 0 0 auto; height: 720px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(var(--mesh-rgb), var(--mesh-alpha)) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--mesh-rgb), var(--mesh-alpha)) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(80% 70% at 50% 20%, #000 30%, transparent 85%); mask-image: radial-gradient(80% 70% at 50% 20%, #000 30%, transparent 85%); }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(218, 221, 216, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(218, 221, 216, .08) 1px, transparent 1px); background-size: 56px 56px; }
.brand-logo { display: block; width: auto; height: 16px; object-fit: contain; }
.brand-compact { display: none; width: 26px; height: 26px; border-radius: 6px; object-fit: contain; }
.brand-product-icon { display: block; flex: none; width: 22px; height: 22px; object-fit: contain; }
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .brand-logo.logo-dark { display: block !important; }
.brand-sep { width: 1px; height: 18px; background: var(--line-2); flex: none; }
.brand-product-wrap { display: inline-flex; align-items: center; gap: 8px; }
.brand-product { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.topbar .brand { height: auto; margin: 0; padding: 0; border: 0; }
.hero-card { border-color: var(--line); box-shadow: var(--shadow-1); }
.tile-ico { background: var(--hover) !important; color: var(--text) !important; }
.dot-live { box-shadow: none; animation: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ── Board editor ── */
.ed-layout { display: grid; grid-template-columns: minmax(0, min(calc(100vh - var(--top-h) - 260px), 640px)) minmax(300px, 380px); gap: 22px; justify-content: center; align-items: start; }
.ed-board { cursor: crosshair; }
.ed-board .sq { display: flex; align-items: center; justify-content: center; }
.ed-pc { width: 100%; height: 100%; pointer-events: none; }
.ed-pc.glyph { display: flex; align-items: center; justify-content: center; font-size: 9.6cqi; line-height: 1; font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", "DejaVu Sans", sans-serif; }
.ed-pc.glyph.w { color: #fff; -webkit-text-stroke: .18cqi #222; } .ed-pc.glyph.b { color: #141414; }
.ed-coord { position: absolute; font: 600 2.2cqi/1 var(--font-mono, monospace); opacity: .7; pointer-events: none; }
.ed-coord.rank { left: 3%; top: 4%; } .ed-coord.file { right: 4%; bottom: 3%; }
.sq.l .ed-coord { color: var(--dark); } .sq.d .ed-coord { color: var(--light); }
.ed-tools { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.ed-tool { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 3px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--text); cursor: pointer; container-type: inline-size; }
.ed-tool:hover { background: var(--bg-hover, var(--accent-soft)); }
.ed-tool.on { border-color: var(--text); background: var(--accent-soft); }
.ed-tool .ed-pc.glyph { font-size: 80cqi; }
.ed-tool svg { width: 46%; height: 46%; }
.ed-castle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.ed-check { gap: 8px; font-size: .9rem; cursor: pointer; } .ed-check input { accent-color: var(--text); } .ed-check.muted { cursor: default; }
.ed-err { color: var(--danger); background: var(--danger-soft); border-radius: var(--r-sm); padding: 8px 12px; font-size: .88rem; }
.ed-ok { color: var(--success); background: var(--success-soft); border-radius: var(--r-sm); padding: 8px 12px; font-size: .88rem; }
@media (max-width: 900px) {
  .ed-layout { grid-template-columns: minmax(0, 1fr); }
  .ed-tools { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
