/* =====================================================================================================
   Hearth Chess - design system
   Tokens first (dark by default, light via html[data-theme=light]), then base, components, then views.
   ===================================================================================================== */
:root {
  --bg: #14100d; --bg-2: #19130f; --surface: #1f1814; --surface-2: #271e18; --surface-3: #31261e;
  --line: #352a22; --line-2: #483a2e; --text: #f3ebe2; --text-2: #c9bcad; --muted: #9a8a78;
  --accent: #f0a24a; --accent-2: #ffbf73; --accent-ink: #2b1604; --accent-soft: rgba(240, 162, 74, .15);
  --ember: #e8663a;
  --gold: #e9c46a; --good: #5bc98a; --warn: #f0b341; --bad: #f0645a; --good-soft: rgba(91, 201, 138, .14); --bad-soft: rgba(240, 100, 90, .14); --warn-soft: rgba(240, 179, 65, .14);
  --r: 14px; --r-sm: 10px; --r-xs: 7px;
  --shadow: 0 1px 0 rgba(255, 235, 210, .035) inset, 0 10px 30px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --font: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --light: #eadbc6; --dark: #a0663f;
  /* firelight: a warm glow rising from the lower left, a fainter one at the top right */
  --hero: radial-gradient(900px 520px at 10% 110%, rgba(232, 102, 58, .17), transparent 62%), radial-gradient(1000px 420px at 94% -14%, rgba(240, 162, 74, .09), transparent 55%);
  color-scheme: dark;
}
html[data-theme=light] {
  --bg: #f4eee6; --bg-2: #ece4d8; --surface: #fffaf3; --surface-2: #f6efe5; --surface-3: #ebe1d3;
  --line: #e4d9ca; --line-2: #d3c4b0; --text: #2a1f17; --text-2: #54443a; --muted: #86766a;
  --accent: #b85a14; --accent-2: #9c4710; --accent-ink: #fff; --accent-soft: rgba(184, 90, 20, .1);
  --ember: #c4411b;
  --gold: #a67a14; --good: #1f9a63; --warn: #b87c08; --bad: #d4452f; --good-soft: rgba(31, 154, 99, .12); --bad-soft: rgba(212, 69, 47, .1); --warn-soft: rgba(184, 124, 8, .12);
  --shadow: 0 1px 2px rgba(60, 35, 15, .07), 0 8px 24px rgba(60, 35, 15, .09); --shadow-sm: 0 1px 2px rgba(60, 35, 15, .09);
  --hero: radial-gradient(1100px 480px at 8% 112%, rgba(196, 65, 27, .09), transparent 60%);
  color-scheme: light;
}
body[data-board="green"]    { --light: #eeeed2; --dark: #769656; }
body[data-board="brown"]    { --light: #f0d9b5; --dark: #b58863; }
body[data-board="blue"]     { --light: #dee3e6; --dark: #8ca2ad; }
body[data-board="gray"]     { --light: #e4e4e4; --dark: #9b9b9b; }
body[data-board="purple"]   { --light: #e8dff5; --dark: #9f7fc4; }
body[data-board="midnight"] { --light: #b9c4dc; --dark: #4f6290; }
body[data-board="ember"]    { --light: #eadbc6; --dark: #a0663f; }
body[data-board="coral"]    { --light: #f7e6d8; --dark: #d98a74; }
body[data-board="ice"]      { --light: #eef4f8; --dark: #8fb4cf; }

/* ------------------------------------------------------------------------------------ base */
* { 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; }
body { min-height: 100vh; background-image: var(--hero); background-repeat: no-repeat; background-attachment: fixed; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .xs { font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.hidden { display: none !important; }
.ic { flex: none; vertical-align: -3px; }
.err { color: var(--bad); min-height: 1.3em; font-size: 14px; }
code, pre.code { font-family: var(--mono); font-size: 13px; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; overflow-x: auto; user-select: all; margin: 8px 0; }

/* ------------------------------------------------------------------------------------ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  border-radius: var(--r-sm); padding: 9px 15px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-3); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 18px -6px var(--accent), 0 1px 0 rgba(255, 255, 255, .25) inset; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: transparent; }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238590a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.500l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--surface-3); outline-offset: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .2s, border-color .2s; flex: none; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 7px 13px; border-radius: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-2); }
html[data-theme=dark] .seg button.on { background: var(--surface-3); }
html[data-theme=dark] .seg.accent button.on, .seg.accent button.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* ------------------------------------------------------------------------------------ surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .stack > .card { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h3 { display: flex; align-items: center; gap: 8px; }
.card-h .ic { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.autogrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.badge.win { background: var(--good-soft); color: var(--good); } .badge.loss { background: var(--bad-soft); color: var(--bad); }
.badge.draw { background: var(--surface-3); color: var(--muted); } .badge.admin { background: var(--accent-soft); color: var(--accent); } .badge.gold { background: rgba(232, 185, 74, .16); color: var(--gold); }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty .ic { color: var(--line-2); margin-bottom: 8px; } .empty h3 { color: var(--text); margin-bottom: 4px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 28px 8px; justify-content: center; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.av { --s: 32px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: calc(var(--s) * .42); color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 220) 70% 58%), hsl(calc(var(--h, 220) + 40) 70% 42%)); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-2); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tbody tr:last-child td, table tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; } tr.link:hover td { background: var(--surface-2); }
.tscroll { overflow-x: auto; } .tscroll table { min-width: 460px; }
.num { text-align: right; font-variant-numeric: tabular-nums; } th.num { text-align: right; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.tile .v { font-size: 25px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; } .tile .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.overlay { position: fixed; inset: 0; background: rgba(10, 6, 3, .66); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; animation: fade .15s; }
.dialog { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; max-width: 440px; width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
.dialog h3 { font-size: 18px; margin-bottom: 10px; } .dlg-body { color: var(--text-2); } .dlg-body p { margin-bottom: 6px; }
.dlg-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: scale(.94) translateY(6px); } }
#toasts { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 120; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
@media (min-width: 761px) { #toasts { bottom: 24px; } }
.toast { background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.in { opacity: 1; transform: none; } .toast.bad { border-color: var(--bad); }

/* ------------------------------------------------------------------------------------ auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden; background: linear-gradient(160deg, #141b2e, #14100d 70%); }
html[data-theme=light] .auth-hero { background: linear-gradient(160deg, #e3eaff, #f4eee6 70%); }
.auth-hero h1 { font-size: 44px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; max-width: 520px; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero .lead { color: var(--text-2); font-size: 17px; max-width: 480px; }
.auth-points { display: grid; gap: 12px; max-width: 480px; margin-top: 4px; }
.auth-points div { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; }
.auth-points .ic { color: var(--accent); margin-top: 2px; }
.auth-bgboard { position: absolute; right: -90px; bottom: -90px; width: 380px; opacity: .17; transform: rotate(-8deg); pointer-events: none; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-card form { display: grid; gap: 14px; margin-top: 20px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { padding: 36px 24px 28px; } .auth-hero h1 { font-size: 32px; } .auth-points, .auth-bgboard { display: none; } }

/* ------------------------------------------------------------------------------------ shell */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; display: inline-flex; flex: none; }
.logo-mark img { width: 34px; height: 34px; border-radius: 9px; }
header.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; }
.tab { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text-2); padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; position: relative; transition: background .15s, color .15s; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); }
.tab.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -11px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .ic { opacity: .9; } .tab.active .ic { color: var(--accent); }
.acct { display: flex; align-items: center; gap: 8px; flex: none; }
.who { display: inline-flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; cursor: pointer; font-weight: 600; font-size: 14px; transition: border-color .15s; }
.who:hover, .who.active { border-color: var(--accent); }
.who .wr { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.who .av { box-shadow: none; }
main.page { max-width: 1240px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.sect { margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.sect h2 { font-size: 17px; }
.bottomnav { display: none; }
@media (max-width: 760px) {
  .top-in { padding: 8px 12px; gap: 8px; }
  .tabs { display: none; }
  .who .wn, .who .wr, .acct .logout-t { display: none; } .who { padding: 3px; }
  .acct { margin-left: auto; }
  main.page { padding: 16px 12px 96px; }
  .bottomnav { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav button { background: none; border: 0; color: var(--muted); display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; padding: 4px 0; cursor: pointer; }
  .bottomnav button.active { color: var(--accent); }
  h1 { font-size: 23px; }
}

/* ------------------------------------------------------------------------------------ board */
.board { container-type: inline-size; width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 10px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; position: relative;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 18px 40px -12px rgba(0, 0, 0, .55); }
.board.small { border-radius: 6px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.board.draggable { touch-action: none; -webkit-touch-callout: none; }
.board-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.coach-arrow { stroke: rgba(63, 207, 142, .9); fill: rgba(63, 207, 142, .9); stroke-width: .15; stroke-linecap: round; }
.coach-arrow.warning { stroke: rgba(242, 181, 58, .95); fill: rgba(242, 181, 58, .95); }
.sq { position: relative; display: flex; align-items: center; justify-content: center; }
.sq.light { background-color: var(--light); } .sq.dark { background-color: var(--dark); }
.sq.last { background-image: linear-gradient(rgba(255, 214, 0, .4), rgba(255, 214, 0, .4)); }
.sq.sel { background-image: linear-gradient(rgba(240, 162, 74, .55), rgba(240, 162, 74, .55)); }
.sq.hint { background-image: linear-gradient(rgba(60, 200, 130, .6), rgba(60, 200, 130, .6)); }
.sq.check { background-image: radial-gradient(circle at center, rgba(255, 60, 60, .95) 0%, rgba(235, 50, 50, .75) 38%, rgba(235, 50, 50, 0) 78%); }
.sq.tgt::after { content: ""; width: 30%; height: 30%; border-radius: 50%; background: rgba(0, 0, 0, .22); position: absolute; }
.sq.cap { box-shadow: inset 0 0 0 .9cqw rgba(0, 0, 0, .3); }
.sq.over { box-shadow: inset 0 0 0 .8cqw rgba(255, 255, 255, .9); }
.sq.grab { cursor: grab; }
.pc { width: 100%; height: 100%; pointer-events: none; background-repeat: no-repeat; background-position: center; background-size: 92%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.pc.dragging { opacity: .22; }
.sq.last .pc:not(.dragging) { animation: land .16s ease-out; }
@keyframes land { from { transform: scale(.88); } }
.pc.wK { background-image: var(--p-wK); } .pc.wQ { background-image: var(--p-wQ); } .pc.wR { background-image: var(--p-wR); } .pc.wB { background-image: var(--p-wB); } .pc.wN { background-image: var(--p-wN); } .pc.wP { background-image: var(--p-wP); }
.pc.bK { background-image: var(--p-bK); } .pc.bQ { background-image: var(--p-bQ); } .pc.bR { background-image: var(--p-bR); } .pc.bB { background-image: var(--p-bB); } .pc.bN { background-image: var(--p-bN); } .pc.bP { background-image: var(--p-bP); }
.pc.glyph { background: none !important; filter: none; font-size: 10.6cqw; line-height: 1; display: flex; align-items: center; justify-content: center; font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", sans-serif; }
.pc.glyph.w { color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 1px #000; }
.pc.glyph.b { color: #151515; text-shadow: 0 0 1px rgba(255, 255, 255, .35); }
.co { position: absolute; font-size: max(9px, 1.9cqw); font-weight: 700; opacity: .8; pointer-events: none; }
.co.rk { top: 2px; left: 4px; } .co.fl { bottom: 1px; right: 4px; }
.sq.light .co { color: var(--dark); } .sq.dark .co { color: var(--light); }
body.dragging-piece, body.dragging-piece * { cursor: grabbing !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; display: flex; align-items: center; justify-content: center; will-change: transform; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .4)); }
.drag-ghost .pc { filter: none; }

/* ------------------------------------------------------------------------------------ play */
.play-layout { display: grid; grid-template-columns: minmax(0, 640px) minmax(300px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .play-layout { grid-template-columns: 1fr; gap: 14px; } }
.board-col { display: grid; gap: 10px; }
.strip { display: flex; align-items: center; gap: 10px; padding: 2px 2px; min-height: 44px; }
.strip .nm { font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; } .strip .nm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .rt { color: var(--muted); font-weight: 600; font-size: 13px; }
.strip .engine-av { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.clock { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 750; font-size: 20px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px 12px; min-width: 84px; text-align: center; letter-spacing: .02em; }
.clock.active { background: var(--text); color: var(--bg); border-color: var(--text); } .clock.low { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.boardwrap { display: flex; gap: 8px; align-items: stretch; }
.boardwrap > .board, .boardwrap > .boardhost { flex: 1; min-width: 0; }
.evalbar { width: 18px; background: #2a2f3a; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column-reverse; flex: none; position: relative; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.evalbar.flip { flex-direction: column; } .evalbar .fill { background: #f4f4f4; height: 50%; transition: height .35s ease; }
.evalbar .lab { position: absolute; left: 0; right: 0; font-size: 9.5px; font-weight: 800; text-align: center; color: #111; bottom: 3px; mix-blend-mode: normal; }
.evalbar.flip .lab { bottom: auto; top: 3px; }
.evalbar.hidden { display: none; }
.side-col { display: grid; gap: 14px; }
.statusbar { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.you { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); } .status-dot.think { background: var(--warn); animation: pulse 1s infinite; } .status-dot.over { background: var(--bad); }
.controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.controls .btn { flex-direction: column; gap: 4px; padding: 10px 6px; font-size: 12.5px; }
.controls .btn .ic { width: 20px; height: 20px; }
.moves { max-height: 230px; overflow-y: auto; display: grid; grid-template-columns: 36px 1fr 1fr; gap: 1px 6px; font-variant-numeric: tabular-nums; align-content: start; font-size: 14.5px; }
.moves .n { color: var(--muted); padding: 2px 0; text-align: right; padding-right: 4px; } .moves span.mv { padding: 2px 8px; border-radius: 6px; cursor: default; font-weight: 600; }
.moves span.mv.cur { background: var(--accent); color: var(--accent-ink); }
.feed { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; scroll-behavior: smooth; }
.feed .msg { border-left: 3px solid var(--line-2); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: 8px 12px; font-size: 14px; color: var(--text-2); animation: fade .25s; }
.feed .msg b { color: var(--text); } .feed .msg .pl { float: right; color: var(--muted); font-size: 11.5px; font-weight: 700; margin-left: 8px; }
.feed .msg.good { border-left-color: var(--good); } .feed .msg.warn { border-left-color: var(--warn); } .feed .msg.bad { border-left-color: var(--bad); } .feed .msg.info { border-left-color: var(--accent); }
.feed .none { color: var(--muted); font-size: 13.5px; padding: 6px 2px; }
.coachmsg { padding: 11px 13px; border-radius: 10px; background: var(--warn-soft); border-left: 3px solid var(--warn); font-size: 14px; color: var(--text); }
.coachmsg:empty { display: none; } .coachmsg.good { background: var(--good-soft); border-color: var(--good); } .coachmsg.bad { background: var(--bad-soft); border-color: var(--bad); }
.cls-best, .cls-excellent { color: var(--good); } .cls-good { color: #8fcf5a; } .cls-inaccuracy { color: var(--warn); } .cls-mistake { color: #f08a3c; } .cls-blunder { color: var(--bad); }
.toggles { display: flex; gap: 6px; }

/* lobby */
.lobby { display: grid; grid-template-columns: minmax(0, 520px) minmax(320px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } .lobby .preview { display: none; } }
.lobby .preview { display: grid; gap: 12px; }
.opt { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.opt:first-of-type { padding-top: 0; } .opt:last-of-type { border-bottom: 0; padding-bottom: 0; }
.opt > .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opt > .lbl b { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.colorpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.colorpick button { background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 12px 6px 10px; cursor: pointer; display: grid; justify-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--text); transition: border-color .15s, background .15s, transform .1s; }
.colorpick button:hover { border-color: var(--line-2); transform: translateY(-1px); }
.colorpick button.on { border-color: var(--accent); background: var(--accent-soft); }
.colorpick .pcs { width: 44px; height: 44px; } .colorpick .pcs .pc { width: 100%; height: 100%; display: block; }
.colorpick .rnd { display: flex; width: 44px; height: 44px; position: relative; } .colorpick .rnd .pc { position: absolute; width: 30px; height: 30px; } .colorpick .rnd .pc:first-child { left: 0; top: 0; } .colorpick .rnd .pc:last-child { right: 0; bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--accent); color: var(--text); } .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip small { opacity: .7; font-weight: 600; margin-left: 4px; }
.modegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modegrid button { text-align: left; background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); display: grid; gap: 3px; transition: border-color .15s, background .15s; }
.modegrid button b { display: flex; align-items: center; gap: 7px; font-size: 14.5px; } .modegrid button span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.modegrid button:hover { border-color: var(--line-2); } .modegrid button.on { border-color: var(--accent); background: var(--accent-soft); } .modegrid button.on b .ic { color: var(--accent); }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.switchrow small { display: block; color: var(--muted); font-size: 12.5px; }
.startrow { margin-top: 20px; display: grid; gap: 8px; }
.resume-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, var(--accent-soft), transparent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* ------------------------------------------------------------------------------------ games list + review */
.glist { display: grid; gap: 8px; }
.gitem { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; cursor: pointer; transition: border-color .15s, transform .1s, background .15s; }
.gitem:hover { border-color: var(--accent); background: var(--surface-2); }
.gitem .dot { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.gitem .dot.win { background: var(--good-soft); color: var(--good); } .gitem .dot.loss { background: var(--bad-soft); color: var(--bad); } .gitem .dot.draw { background: var(--surface-3); color: var(--muted); }
.gitem .acc { text-align: right; min-width: 64px; } .gitem .acc b { font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .gitem { grid-template-columns: auto 1fr auto; } .gitem .chev { display: none; } }
.review-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.navbtns { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
svg.graph { width: 100%; height: 84px; display: block; background: var(--surface-2); border-radius: 10px; cursor: pointer; }
.rtag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); font-weight: 600; }

/* ------------------------------------------------------------------------------------ profile / insights */
.prof-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.av.big { --s: 68px; }
.ratebox { text-align: right; } .ratebox .v { font-size: 38px; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .ratebox .l { color: var(--muted); font-size: 12.5px; }
.form { margin-top: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.pill { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pill.W { background: var(--good-soft); color: var(--good); } .pill.L { background: var(--bad-soft); color: var(--bad); } .pill.D { background: var(--surface-3); color: var(--muted); }
.barcell { width: 130px; min-width: 90px; }
.wdl { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-3); } .wdl i { display: block; height: 100%; }
.wdl .w { background: var(--good); } .wdl .d { background: #7b8494; } .wdl .l { background: var(--bad); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); } .kv:last-child { border-bottom: 0; }
.qbar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--surface-3); } .qbar i { display: block; height: 100%; }
.qbar .best { background: var(--good); } .qbar .excellent { background: #66c28d; } .qbar .good { background: #9ccc65; } .qbar .inaccuracy { background: var(--warn); } .qbar .mistake { background: #f08a3c; } .qbar .blunder { background: var(--bad); }
.qleg { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.dot-line { stroke-width: 7; stroke-linecap: round; vector-effect: non-scaling-stroke; } .dot-line.win { stroke: var(--good); } .dot-line.loss { stroke: var(--bad); } .dot-line.draw { stroke: #9aa3b2; }
.lesson { border-left: 3px solid var(--line-2); } .lesson.high { border-left-color: var(--bad); } .lesson.med { border-left-color: var(--warn); } .lesson.low { border-left-color: var(--accent); } .lesson.good { border-left-color: var(--good); }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 14px; align-items: center; }
.compare .lbl { color: var(--muted); font-size: 12.5px; text-align: center; } .compare .a { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; } .compare .b { font-weight: 700; font-variant-numeric: tabular-nums; }
.compare .win { color: var(--good); }

/* ------------------------------------------------------------------------------------ train */
.hero-card { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.streak { display: flex; align-items: center; gap: 12px; }
.streak .flame { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(145deg, #ffb347, #ff6a3d); display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 20px -8px #ff6a3d; }
.streak.cold .flame { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.streak .big { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.plan { display: grid; gap: 10px; }
.plan-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.plan-item:hover { border-color: var(--accent); background: var(--surface-2); }
.plan-item .ck { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: transparent; flex: none; }
.plan-item.done .ck { background: var(--good); border-color: var(--good); color: #fff; }
.plan-item.done .ttl { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.plan-item .ttl { font-weight: 700; } .plan-item .dtl { color: var(--muted); font-size: 13.5px; }
.prog { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 8px; max-width: 240px; } .prog i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
.plan-item.done .prog i { background: var(--good); }
.cardlink { display: block; color: inherit; } .cardlink:hover { text-decoration: none; }
.drills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.drill { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: grid; gap: 10px; transition: border-color .15s, transform .1s, box-shadow .15s; }
.drill:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.drill .mini { width: 100%; max-width: 200px; margin: 0 auto; pointer-events: none; }
.drill h4 { font-size: 15px; } .drill .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); align-items: center; }
.lvl { display: inline-flex; gap: 3px; } .lvl i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); } .lvl i.on { background: var(--gold); }
.solved-tag { color: var(--good); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.drill-play { display: grid; grid-template-columns: minmax(0, 560px) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .drill-play { grid-template-columns: 1fr; } }
.tip-list { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; } .tip-list li { margin: 4px 0; }
.result-banner { padding: 14px 16px; border-radius: 12px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.result-banner.good { background: var(--good-soft); color: var(--good); } .result-banner.bad { background: var(--bad-soft); color: var(--bad); }

/* ------------------------------------------------------------------------------------ community */
.rank-row { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.rank-row:hover { background: var(--surface-2); } .rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: var(--accent-soft); }
.rank-row .pos { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--surface-3); font-variant-numeric: tabular-nums; font-size: 14px; }
.rank-row .pos.p1 { background: linear-gradient(145deg, #ffd66b, #d99a1c); color: #3a2800; } .rank-row .pos.p2 { background: linear-gradient(145deg, #e6ebf3, #a9b4c6); color: #1d2433; } .rank-row .pos.p3 { background: linear-gradient(145deg, #e6a876, #b06a36); color: #2e1706; }
.rank-row .who2 { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 650; } .rank-row .who2 span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .val { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; } .rank-row .sub { color: var(--muted); font-size: 12.5px; text-align: right; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); } .person:last-child { border-bottom: 0; }
.person .info { flex: 1; min-width: 0; cursor: pointer; } .person .info b { display: block; }
.searchbox { position: relative; } .searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); } .searchbox input { padding-left: 38px; }
.dotlive { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 6px; }

/* ------------------------------------------------------------------------------------ settings */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.snav { position: sticky; top: 84px; display: grid; gap: 2px; }
.snav button { background: none; border: 0; text-align: left; color: var(--text-2); padding: 10px 12px; border-radius: 10px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.snav button:hover { background: var(--surface-2); } .snav button.on { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 860px) { .settings-layout { grid-template-columns: 1fr; gap: 14px; } .snav { position: static; display: flex; overflow-x: auto; gap: 4px; } .snav button { white-space: nowrap; } }
.setting { display: grid; grid-template-columns: 1fr minmax(150px, 240px); gap: 6px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; padding-bottom: 0; } .setting:first-child { padding-top: 0; }
.setting label.nm { font-weight: 600; font-size: 14.5px; } .setting label.nm b { color: var(--accent); margin-left: 6px; font-variant-numeric: tabular-nums; }
.setting .help { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin-top: -2px; }
.setting .ctl { display: flex; justify-content: flex-end; }
.pgallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcard { background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 8px 8px; cursor: pointer; display: grid; gap: 4px; justify-items: center; color: var(--text); font-weight: 650; font-size: 13px; transition: border-color .15s, transform .1s; }
.pcard:hover { border-color: var(--line-2); transform: translateY(-1px); } .pcard.on { border-color: var(--accent); background: var(--accent-soft); }
.pcard .strip5 { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; border-radius: 8px; overflow: hidden; }
.pcard .strip5 > div { aspect-ratio: 1; display: flex; } .pcard .strip5 > div:nth-child(odd) { background: var(--light); } .pcard .strip5 > div:nth-child(even) { background: var(--dark); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.swatch { background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; display: grid; gap: 6px; justify-items: center; color: var(--text); font-size: 12.5px; font-weight: 650; }
.swatch .b2 { width: 100%; aspect-ratio: 2; display: grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden; } .swatch.on { border-color: var(--accent); background: var(--accent-soft); }
.settings-preview { position: sticky; top: 84px; }
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .sp-layout { grid-template-columns: 1fr; } .settings-preview { position: static; max-width: 340px; } }

/* ------------------------------------------------------------------------------------ admin */
.logview { background: #0a0d13; color: #cfd6e4; border: 1px solid var(--line); border-radius: 12px; padding: 8px 0; font-family: var(--mono); font-size: 12.3px; max-height: 560px; overflow: auto; line-height: 1.55; }
html[data-theme=light] .logview { background: #11151d; }
.logview .ln { padding: 1px 14px; white-space: pre-wrap; word-break: break-word; border-left: 3px solid transparent; }
.logview .ln:hover { background: rgba(255, 255, 255, .04); }
.logview .ln.warn { border-left-color: var(--warn); background: rgba(242, 181, 58, .07); } .logview .ln.error { border-left-color: var(--bad); background: rgba(242, 100, 94, .1); } .logview .ln.debug { color: #8c7c6a; }
.logview .ts { color: #8c7c6a; } .logview .lv { font-weight: 700; } .logview .lv.INFO { color: #f0a24a; } .logview .lv.WARN { color: var(--warn); } .logview .lv.ERROR { color: var(--bad); } .logview .lv.DEBUG { color: #8c7c6a; } .logview .ct { color: #3fcf8e; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ok-dot { color: var(--good); } .bad-dot { color: var(--bad); }

.chev { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

.eco { display: inline-block; font: 700 11px/1 var(--mono, ui-monospace, monospace); letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; margin-right: 4px; }

.vbanner { position: sticky; top: 0; z-index: 200; background: #7a1f1f; color: #fff; padding: 10px 16px; font-size: 13.5px; line-height: 1.45; text-align: center; }
.vbanner code { background: rgba(255,255,255,.18); padding: 1px 6px; border-radius: 5px; }

.rchart { width: 100%; height: auto; display: block; }
.rchart .cg { stroke: var(--line); stroke-width: 1; } .rchart .ca { fill: var(--text-3, #9a8a78); font-size: 11.5px; }
.rchart .cref { stroke: var(--text-3, #9a8a78); stroke-width: 1; stroke-dasharray: 5 5; opacity: .8; }
.rchart .carea { fill: var(--accent-soft); } .rchart .cline { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.rchart .cd { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; } .rchart .cd.win { fill: #3ecf8e; stroke: #3ecf8e; } .rchart .cd.loss { fill: #f2645e; stroke: #f2645e; } .rchart .cd.draw { fill: #9a8a78; stroke: #9a8a78; }
.rchart .cnow { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.rchart .ct2 { fill: var(--text-2); font-size: 11.5px; font-weight: 600; } .rchart .ct2.now { fill: var(--text); font-size: 13px; font-weight: 700; }

.cnotes { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; } .cnotes .msg.now { outline: 2px solid var(--accent); }

.oline { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; } .oline:last-child { border-bottom: 0; } .oline:hover { background: var(--surface-2); }

.wbars { display: flex; align-items: flex-end; gap: 6px; height: 110px; } .wbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; } .wbar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; } .wbar span { font-size: 10.5px; color: var(--text-3, #9a8a78); }

.askrow { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.board-annot { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.board { position: relative; }
.mark-ring { fill: none; stroke-width: .075; opacity: .85; }
.mark-arrow line { stroke-width: .17; stroke-linecap: round; opacity: .82; } .mark-arrow.live { opacity: .6; }
.mark-ring.green, .mark-arrow.green { stroke: #15a34a; } .mark-arrow.green polygon { fill: #15a34a; }
.mark-ring.red, .mark-arrow.red { stroke: #e0382f; } .mark-arrow.red polygon { fill: #e0382f; }
.mark-ring.blue, .mark-arrow.blue { stroke: #e8663a; } .mark-arrow.blue polygon { fill: #e8663a; }
.mark-ring.yellow, .mark-arrow.yellow { stroke: #e8b923; } .mark-arrow.yellow polygon { fill: #e8b923; }
.mark-arrow polygon { stroke: none !important; }
.evalbar { width: 24px; } .evalbar .lab { font-size: 9px; letter-spacing: -.3px; }

.recipe { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); } .recipe b { color: var(--text); }
.pgroup { margin-top: 10px; } .pgroup-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 4px; }
.prow { border-top: 1px solid var(--line); padding: 8px 0; } .prow-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .pmove { min-width: 48px; font-size: 15px; }
.prow-board { max-width: 220px; margin: 8px 0 2px 36px; } .prow-board .mini { width: 100%; }

/* ---- Tactics Gym ---- */
.mflow{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.mflow>div{flex:1 1 150px;display:flex;flex-direction:column;gap:2px}
.mflow b{font-size:1.05rem}.mflow span{color:var(--muted);font-size:.85rem}
.mflow i{color:var(--muted);display:flex}
.lessons{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px}
.lesson{display:flex;gap:12px;align-items:flex-start;text-align:left;padding:12px 14px;border:1px solid var(--line);background:var(--surface);border-radius:12px;color:inherit;font:inherit;cursor:pointer}
.lesson:hover{border-color:var(--accent)}
.lesson .n{flex:none;width:26px;height:26px;border-radius:50%;background:var(--accent-soft,rgba(120,120,120,.15));display:grid;place-items:center;font-weight:700;font-size:.85rem}
.lesson b{display:block}.lesson small{display:block;color:var(--muted);margin-top:2px;line-height:1.35}
.lesson .tag{margin-left:auto;flex:none;display:inline-flex;gap:4px;align-items:center;font-size:.75rem;color:var(--muted)}
.lesson-body p{margin:0 0 10px;line-height:1.55}
.remember{display:flex;gap:8px;align-items:flex-start;padding:10px 12px;border-radius:10px;background:var(--accent-soft,rgba(120,120,120,.12));font-weight:600}
.scanlist{margin:10px 0 0;padding-left:18px;line-height:1.45;font-size:.92rem}
.scanlist li{margin:4px 0}
.lnav{margin-top:6px;gap:8px;flex-wrap:wrap}
.ptag{display:inline-block;padding:1px 8px;border-radius:999px;background:var(--accent-soft,rgba(120,120,120,.15));font-weight:600;font-size:.82rem}
@media (max-width:560px){.mflow i{display:none}.mflow>div{flex-basis:100%}}
.qrow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:8px 0;border-top:1px solid var(--line)}
.qrow:first-of-type{border-top:0}
.qtext{flex:1 1 240px;font-size:.95rem}
.qseg{flex:0 1 auto;flex-wrap:wrap}
.view-inner { display: contents; }
.gdots{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.gdot{width:30px;height:30px;border-radius:8px;border:1px solid var(--line-2);background:var(--surface-2);color:var(--text-2);font-weight:700;font-size:.82rem;display:grid;place-items:center;cursor:pointer;padding:0}
.gdot:hover{border-color:var(--accent)}
.gdot.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.gdot.ok{border-color:var(--good);color:var(--good)} .gdot.on.ok{color:var(--accent-ink)}
.gdot.miss{border-color:var(--bad)}
.gym-sum{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.lesson.complete{border-color:var(--good)}
.lesson .tag.all{color:var(--good);font-weight:700}

/* ------------------------------------------------------------------------------------ welcome (first visit) */
.welcome { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; background: var(--hero), var(--bg); }
.w-card { width: 100%; max-width: 580px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px 26px; box-shadow: var(--shadow); }
.w-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; } .w-top .grow { flex: 1; }
.w-dots { display: flex; gap: 6px; margin: 0 0 20px; } .w-dots i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); } .w-dots i.d { background: var(--accent); } .w-dots i.n { background: var(--accent-2); opacity: .7; }
.w-h { font-size: 28px; line-height: 1.2; margin: 6px 0 14px; letter-spacing: -.01em; }
.w-say { font-size: 16.5px; line-height: 1.6; color: var(--text-2); margin: 0 0 12px; max-width: 62ch; } .w-say.big { font-size: 22px; line-height: 1.35; color: var(--text); font-weight: 600; margin-bottom: 10px; }
.w-hint { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; max-width: 60ch; }
.w-opts { display: grid; gap: 9px; margin: 16px 0 6px; }
.w-opt { text-align: left; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.w-opt:hover, .w-opt:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; } .w-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.w-list { margin: 8px 0 14px; padding-left: 20px; color: var(--text-2); line-height: 1.6; } .w-list li { margin: 4px 0; }
.w-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; } .w-nav:empty { display: none; }
.btn.lg { padding: 12px 22px; font-size: 16px; }
@media (max-width: 520px) { .w-card { padding: 18px 16px 22px; } .w-h { font-size: 24px; } .w-say.big { font-size: 20px; } }

/* ------------------------------------------------------------------------------------ XP pop-ups, level chip, skills, coach analysis */
.toast.xp { border-color: var(--gold); color: var(--gold); font-weight: 700; background: var(--surface-2); }
.toast.xp.level { background: var(--gold); color: #241a00; border-color: var(--gold); }
.wx { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(232, 185, 74, .16); color: var(--gold); font-size: 11.5px; font-weight: 800; }
.skillrows { display: grid; gap: 12px; margin: 4px 0 0; }
.skillrow { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2fr auto; gap: 6px 12px; align-items: center; }
.skillrow .sn { font-weight: 600; font-size: 14px; } .skillrow .sn small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.sbar { height: 9px; border-radius: 9px; background: var(--surface-3); overflow: hidden; } .sbar i { display: block; height: 100%; border-radius: 9px; background: var(--accent); }
.sbar.good i { background: var(--good); } .sbar.mid i { background: var(--warn); } .sbar.low i { background: var(--bad); }
.strend { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.strend.improving { background: var(--good-soft); color: var(--good); } .strend.needs { background: var(--warn-soft); color: var(--warn); } .strend.stable { background: var(--accent-soft); color: var(--accent-2); }
.sscore { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 28px; text-align: right; }
@media (max-width: 560px) { .skillrow { grid-template-columns: 1fr auto; } .skillrow .sbar { grid-column: 1 / -1; order: 3; } }
.report { margin-bottom: 16px; } .report h2 { font-size: 15px; margin: 18px 0 8px; } .report .rhead { font-size: 21px; line-height: 1.3; margin: 0 0 4px; }
.report p { margin: 0 0 10px; color: var(--text-2); line-height: 1.65; max-width: 75ch; } .report ul { margin: 0 0 10px; padding-left: 20px; color: var(--text-2); line-height: 1.65; max-width: 75ch; } .report li { margin: 6px 0; }
.report b { color: var(--text); }
.ractions { display: grid; gap: 10px; margin: 8px 0; } .raction { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text-2); line-height: 1.6; max-width: 75ch; } .raction .btn { margin-top: 8px; }
.rask { background: var(--accent-soft); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; margin: 10px 0; max-width: 75ch; } .rask b { display: block; margin-bottom: 8px; color: var(--text); font-weight: 600; }
.rask .row { flex-wrap: wrap; gap: 8px; } .rask .thanks { color: var(--good); font-weight: 600; }
.xpline { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; } .xpline span { font-size: 12.5px; font-weight: 700; color: var(--gold); background: rgba(232, 185, 74, .12); border-radius: 999px; padding: 3px 10px; }
.xpbar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; max-width: 260px; } .xpbar i { display: block; height: 100%; background: var(--gold); }
.endsum { margin-top: 14px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.endsum h3 { margin: 0 0 8px; font-size: 15px; }

/* install-as-app banner (phones only) */
#installbar { position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 110; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
#installbar .im { flex: 1 1 200px; } #installbar b { color: var(--text); }

/* v12: learner model */
.patbox{margin:10px 0 0;padding:10px 12px;border-radius:10px;background:var(--surface-2,rgba(127,127,127,.1));border-left:3px solid var(--accent,#6aa5ff)}
.patbox .small{margin-top:3px}
.patcard{padding:12px 0;border-top:1px solid var(--line,rgba(127,127,127,.2))}
.patcard:first-child{border-top:0}
.patcard .row{gap:8px;flex-wrap:wrap;align-items:center}
.patcard .tag{font-size:12px;padding:2px 8px;border-radius:99px;background:rgba(127,127,127,.18)}
.patcard .tag.rec{background:rgba(230,150,60,.22)}
.patcard .tag.imp{background:rgba(80,190,120,.22)}
.hookbox{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}
.hookbox input{flex:1 1 220px;min-width:0}
.rhook{margin:14px 0 4px;padding:12px 14px;border-radius:12px;background:var(--surface-2,rgba(127,127,127,.1))}

/* v13: opening book and folded sections */
details.fold{border:1px solid var(--line);border-radius:12px;background:var(--surface);margin:8px 0}
details.fold>summary{padding:13px 16px;cursor:pointer;font-weight:600;list-style:none;display:flex;justify-content:space-between;align-items:center}
details.fold>summary::-webkit-details-marker,details.bk>summary::-webkit-details-marker,details.patcard>summary::-webkit-details-marker,details.bkmore>summary::-webkit-details-marker{display:none}
details.fold>summary::after,details.bk>summary::after,details.patcard>summary::after{content:"›";transition:transform .15s;color:var(--muted);font-size:20px;margin-left:10px}
details[open].fold>summary::after,details[open].bk>summary::after,details[open].patcard>summary::after{transform:rotate(90deg)}
details.fold .foldbody{padding:0 12px 12px}
details.fold .foldbody .card{box-shadow:none;border:0;padding:4px}
details.bk,details.patcard{border-top:1px solid var(--line);padding:2px 0}
details.bk:first-of-type,details.patcard:first-of-type{border-top:0}
details.bk>summary,details.patcard>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 0}
details.bk .bkn{font-weight:600;flex:1 1 150px;min-width:0}
details.bk .bkm{margin-left:auto}
.bkb,.patcard .tag{font-size:12px;padding:2px 9px;border-radius:99px;background:rgba(127,127,127,.18);white-space:nowrap}
.bkb.good{background:rgba(80,190,120,.22)}.bkb.bad{background:rgba(230,90,80,.24)}.bkb.warn{background:rgba(230,150,60,.24)}
details.patcard>summary b{flex:1 1 150px}
.bkbody{padding:0 0 14px}
.bkbody p{margin:0 0 10px}
.bkfacts{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:8px 0}
.bkfacts>div{padding:8px 10px;border-radius:10px;background:var(--surface-2)}
details.bkmore>summary{cursor:pointer;padding:10px 0;list-style:none}
.bkpane.hidden{display:none}
.book .seg{margin-bottom:6px}

/* v15: backups */
.bkrow{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line)}
.tfield{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px 0;border-bottom:1px solid var(--line)}
.tfield input{width:110px;flex:none}
@media(max-width:560px){.tfield{flex-direction:column;align-items:stretch;gap:6px}.tfield input{width:100%}}
.mstep{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.mstep span{font-size:12.5px;padding:4px 10px;border-radius:999px;border:1px solid var(--line);color:var(--muted)}
.mstep span.done{color:var(--text);border-color:var(--accent);background:var(--surface-2)}
.tag.ok{background:var(--accent);color:var(--accent-ink)}
.srcline{margin:0 0 10px;padding:9px 12px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line);font-size:13.5px;line-height:1.5}
.srcline b{font-weight:650}
.readrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0 0}

.phasebar{display:flex;margin-top:4px;font-size:11.5px;color:var(--muted);gap:2px}
.phasebar span{text-align:center;border-top:2px solid var(--line);padding-top:3px;overflow:hidden;white-space:nowrap;text-overflow:clip;min-width:0}
.rask .does{margin:4px 0 8px;font-size:13px;color:var(--muted);line-height:1.45}
.rask .does b{font-weight:600;color:var(--text-2)}
.titles{margin:0;padding:0;list-style:none}
.titles li{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid var(--line);font-size:14px}
.titles li.now{font-weight:650;color:var(--text)}
.titles li.past{color:var(--muted)}

/* ---- v18: celebrations, thumbs on the coach's remarks, goals */
#cele { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; z-index: 310; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.cele-card { pointer-events: auto; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, #2a1d12, #1b130d); border: 1px solid var(--accent); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7), 0 0 28px -6px var(--accent); color: #f3e9dc; opacity: 0; transform: translateY(-14px) scale(.96); transition: opacity .25s, transform .3s cubic-bezier(.2, 1.3, .4, 1); }
.cele-card.in { opacity: 1; transform: none; }
.cele-card b { display: block; font-size: 17px; letter-spacing: -.01em; color: var(--accent-2); }
.cele-card span { font-size: 14px; color: #e5d6c3; } .cele-card em { font-style: normal; color: var(--accent-2); font-weight: 700; }
.cele-flame { width: 34px; height: 34px; flex: none; background: url(/logo-mark.svg) center / contain no-repeat; border-radius: 9px; }
.fb { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: middle; opacity: .45; transition: opacity .15s; }
.msg:hover .fb, .fb.voted, .fb:focus-within { opacity: 1; }
.fb button { background: none; border: 0; padding: 2px 4px; line-height: 1; cursor: pointer; color: var(--muted); border-radius: 6px; font-size: 13px; }
.fb button:hover { color: var(--text); background: var(--surface-3); } .fb button.on { color: var(--accent-2); }
.goalcard { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.goalcard.done { border-color: var(--good); }
.goalcard .gt { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.gbar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .gbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .5s; }
.goalcard.done .gbar i { background: var(--good); }
.gpick { display: grid; gap: 8px; } .gpick .btn { justify-content: flex-start; text-align: left; white-space: normal; }
.grid2 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; } @media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
/* the tab row gets crowded when you are an admin with a long name: drop the tab icons first, then the name */
@media (min-width: 761px) and (max-width: 1360px) { .tab .ic { display: none; } .tab { padding: 9px 11px; } .tab.active::after { left: 11px; right: 11px; } }
@media (min-width: 761px) and (max-width: 1060px) { .who .wr, .acct .logout-t { display: none; } }

/* ---- v19: remark labels, quiz result, help */
.rtype { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); margin-right: 7px; vertical-align: 1px; white-space: nowrap; }
.qzres { margin-top: 6px; padding: 8px 10px; border-radius: 10px; font-size: 14px; background: var(--surface-3); border-left: 3px solid var(--line-2); }
.qzres.right { border-left-color: var(--good); } .qzres.close { border-left-color: var(--warn); } .qzres.wrong { border-left-color: var(--bad); }
.rtrow { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.rtrow:first-of-type { border-top: 0; } .rtrow .nm { font-weight: 600; } .rtrow .hp { color: var(--muted); font-size: 13px; }
.reportbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); cursor: pointer; width: 100%; color: var(--text); font: inherit; text-align: left; }
.reportbar:hover { border-color: var(--accent); } .reportbar b { display: block; } .reportbar .sub { color: var(--muted); font-size: 13px; }
.helpwrap { max-width: 820px; } .helpq { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; margin-bottom: 14px; }
.helpwrap details.fold { margin-bottom: 10px; } .helpwrap .foldbody p { margin: 0 0 10px; line-height: 1.55; } .helpwrap .foldbody ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.55; }
.helpwrap h3 { margin: 22px 0 8px; font-size: 16px; }

/* forum */
.fsec { display: grid; grid-template-columns: auto 1fr auto 150px; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.fsec:last-child { border-bottom: 0; } .fsec:hover, .fsec:focus-visible { background: var(--surface-2); outline: none; }
.fsec.ft { grid-template-columns: 1fr auto 90px; }
.fsec .fi { color: var(--accent); display: flex; } .fsec .fm { min-width: 0; } .fsec .fm b { display: block; overflow-wrap: anywhere; } .fsec .fm .small { display: block; }
.fsec .fc { text-align: center; } .fsec .fc b { display: block; } .fsec .fl { text-align: right; }
.fh { margin: 4px 0 12px; overflow-wrap: anywhere; }
.fpost { padding: 14px 16px; border-bottom: 1px solid var(--line); } .fpost:last-child { border-bottom: 0; } .fpost.first { background: var(--surface-2); }
.fhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fbody { line-height: 1.55; overflow-wrap: anywhere; } .factions { display: flex; gap: 6px; margin-top: 8px; }
.flink { color: inherit; text-decoration: none; } .flink:hover { text-decoration: underline; }
@media (max-width: 640px) { .fsec { grid-template-columns: auto 1fr auto; } .fsec .fl { display: none; } .fsec.ft { grid-template-columns: 1fr auto; } }

/* step back and forth through a finished puzzle */
.replay { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .replay .rlabel { flex-basis: 100%; margin-top: 2px; } .replay .btn[disabled] { opacity: .45; }

/* voice preparation bar */
.voiceload { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line, #e6dccb); border-radius: 10px; background: var(--card-2, rgba(0,0,0,.03)); font-size: 13px; }
.voiceload .vl-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.voiceload .vl-bar { height: 6px; border-radius: 3px; background: rgba(0,0,0,.08); overflow: hidden; }
.voiceload .vl-bar i { display: block; height: 100%; background: var(--accent, #b85c1a); transition: width .6s ease; }
.voiceload .vl-note { margin-top: 6px; color: var(--muted, #7a6d5c); font-size: 12px; }

/* ---- v46: admin moderation card (admin.js) */
.modcard [hidden] { display: none !important; }
.modstat { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.modstat .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.modstat.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); } .modstat.warn .dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.modstat.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); } .modstat.bad .dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.modstat b { display: block; }
.modmsg { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--line-2); background: var(--surface); border-radius: 0 8px 8px 0; }
.modmsg p { margin: 2px 0 0; color: var(--text); line-height: 1.5; }
.modtabs { margin: 16px 0 14px; }
.modpane { display: grid; gap: 12px; }
.modpane textarea { resize: vertical; min-height: 72px; font: inherit; font-weight: 400; }
.modpane .field small { justify-self: end; font-weight: 500; }
.modpane > .btn { justify-self: start; }
.modend { color: var(--text-2); min-height: 1.4em; }
.modlist { margin: 0; padding-left: 18px; color: var(--text-2); line-height: 1.6; } .modlist li { margin: 2px 0; }
.modhist { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; } .modhist summary { cursor: pointer; }
.modhist .kv { gap: 12px; align-items: flex-start; } .modhist .kv > span:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .modhist .kv { flex-direction: column; gap: 2px; } .modhist .kv > span:last-child { text-align: left; } .modpane > .btn { justify-self: stretch; } }

/* ---- v46: the screen a banned member sees at log-in (landing.js) */
.locked { text-align: center; }
.locked-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--bad-soft); color: var(--bad); }
.locked h1 { margin: 0 0 10px; } /* keeps the serif heading of the other log-in screens */
.locked .auth-alt { justify-content: center; text-align: center; }
.locked-msg { text-align: left; margin: 18px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.locked-msg p { margin: 4px 0 0; line-height: 1.55; color: var(--text); }

/* ---- v46: the game report opens on a summary; the full analysis folds (skillui.js) */
.reportbar.open .chev { transform: rotate(90deg); } .reportbar .chev { transition: transform .15s; color: var(--muted); }
.report .rhead { margin-bottom: 14px; }
.rstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.rstat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 1px; }
.rstat b { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.rstat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rstat small { font-size: 11.5px; color: var(--text-2); }
.rstat.bad b { color: var(--bad); } .rstat.warn b { color: var(--warn); } .rstat.soft b { color: var(--accent-2); } .rstat.ok b { color: var(--muted); }
.rtakes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }
.rtake { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.rtake-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.rtake.good .rtake-h { color: var(--good); } .rtake.bad .rtake-h { color: var(--bad); } .rtake.next .rtake-h { color: var(--accent); }
.rtake.next { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.report .rtake p { margin: 0; font-size: 14px; line-height: 1.55; }
.rtake .btn { align-self: flex-start; margin-top: auto; }
.rask-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 6px; }
.rask-h .muted { font-weight: 600; text-transform: none; letter-spacing: 0; }
.rask[hidden] { display: none; }
.rfull { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.rfull-h { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.rsec { border-bottom: 1px solid var(--line); } .rsec:last-child { border-bottom: 0; }
.rsec summary { display: flex; align-items: baseline; gap: 10px; padding: 11px 2px; cursor: pointer; list-style: none; font-weight: 600; }
.rsec summary::-webkit-details-marker { display: none; }
.rsec summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; position: relative; top: -2px; }
.rsec[open] summary::before { transform: rotate(45deg); }
.rsec summary small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12.5px; text-align: right; }
.rsec summary:hover span { color: var(--accent-2); }
.rsec-b { padding: 0 2px 12px 17px; }
.rfoot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-2); display: grid; gap: 8px; }
@media (max-width: 720px) { .rtakes { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .rstats { grid-template-columns: repeat(2, 1fr); } .rsec-b { padding-left: 4px; } }

/* ---- v47: Admin security, sign-in log and messages (securityui.js) */
.adm-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.adm-jump a { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.adm-jump a:hover { border-color: var(--accent); color: var(--text); }
.adm-jump .badge { padding: 1px 7px; font-size: 11px; }
.sect { scroll-margin-top: 80px; }
.chks { display: grid; gap: 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.chk .ic { flex: none; margin-top: 2px; } .chk b { display: block; margin-bottom: 2px; } .chk .small { color: var(--text-2); line-height: 1.5; }
.chk.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); } .chk.bad .ic { color: var(--bad); }
.chk.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); } .chk.warn .ic { color: var(--warn); }
.chk.ok .ic { color: var(--good); } .chk.info .ic { color: var(--muted); }
.subh { font-size: 15px; margin: 20px 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.subh.small { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.mono { font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sev { font-weight: 700; font-size: 13px; } .sev.ok { color: var(--good); } .sev.bad { color: var(--bad); } .sev.warn { color: var(--warn); }
table.signins td { vertical-align: top; }
.msgs { display: grid; gap: 10px; }
.msg-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.msg-item.done { opacity: .75; }
.msg-item summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.msg-item summary::-webkit-details-marker { display: none; }
.msg-body { margin: 12px 0 10px; line-height: 1.6; color: var(--text); white-space: normal; overflow-wrap: anywhere; }
.msg-meta { line-height: 1.6; overflow-wrap: anywhere; }
.rtrow .qseg { flex-shrink: 0; }
@media (max-width: 560px) { .rtrow:has(.qseg) { flex-wrap: wrap; } .rtrow:has(.qseg) .qseg { width: 100%; } }

/* Admin on phones: the bottom bar holds the six main tabs, so admins get a shield button in the top bar instead */
.admin-top { display: none; }
@media (max-width: 760px) { .admin-top { display: inline-flex; padding: 7px; } .admin-top.active { color: var(--accent); } }
