:root {
  /* One palette: warm paper, the felt of the board, maple tiles.  Bonus squares are Tilefish's
     own: warm terracotta and clay for the word squares, the felt's greens for the letter
     squares.  "You" is the felt's green, Tilefish the copper of a tile's edge. */
  --paper: #f4efe6; --paper-2: #ece5d7; --card: #f8f4ec; --ink: #1f1a14; --ink-2: #544b40; --ink-3: #7f7668;
  --line: #dbd1bf; --felt: #2b4a41; --felt-2: #355a4f; --sq: #e8dfca; --sq-line: #d1c4a8;
  --tw: #bb4a30; --dw: #dc9f80; --tl: #2f6a58; --dl: #a9c8b2;
  --tile: #efd59c; --tile-hi: #f9ebc8; --tile-edge: #c4a063; --tile-ink: #2a2116; --blank-ink: #9a4f16;
  --accent: #2b4a41; --accent-ink: #f6f1e7; --warn: #b0452b; --you: #2f6a58; --bot: #9a5c2c;
  --label-dark: rgba(34,29,23,.6); --focus: #1f6feb;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 22px -16px rgba(40,28,10,.45);
  --rt: clamp(34px, 10.5vw, 46px);
  /* move classes in a game review (the same in both themes: they sit on their own discs) */
  --c-brilliant: #1d8a83; --c-great: #3a6fa2; --c-best: #4a8a3a; --c-excellent: #6c953a; --c-good: #868f6c;
  --c-inaccuracy: #c8921a; --c-mistake: #cf672b; --c-blunder: #b9392a;
  --bw: min(720px, calc(100svh - 300px));
  color-scheme: light;
}
.app.focus { --bw: min(860px, calc(100svh - 230px)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161411; --paper-2: #1f1c17; --card: #1b1915; --ink: #eee7da; --ink-2: #bfb6a7; --ink-3: #8f8677;
    --line: #36312a; --felt: #1f3a33; --felt-2: #284a41; --sq: #2a2620; --sq-line: #3a352d; --tw: #b34a33; --dw: #7d4a40; --tl: #2f6352; --dl: #3e5c4b;
    --accent: #7aa898; --accent-ink: #12100d; --you: #8fbcad; --bot: #d9a874; --label-dark: rgba(255,255,255,.78);
    --focus: #7fb0ff; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 24px -16px rgba(0,0,0,.7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161411; --paper-2: #1f1c17; --card: #1b1915; --ink: #eee7da; --ink-2: #bfb6a7; --ink-3: #8f8677;
  --line: #36312a; --felt: #1f3a33; --felt-2: #284a41; --sq: #2a2620; --sq-line: #3a352d; --tw: #b34a33; --dw: #7d4a40; --tl: #2f6352; --dl: #3e5c4b;
  --accent: #7aa898; --accent-ink: #12100d; --you: #8fbcad; --bot: #d9a874; --label-dark: rgba(255,255,255,.78);
  --focus: #7fb0ff; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 24px -16px rgba(0,0,0,.7); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image: radial-gradient(1100px 520px at 50% -140px, color-mix(in srgb, var(--card) 85%, transparent), transparent 70%);
  background-repeat: no-repeat;
  font: 15px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
kbd { font: 600 11px/1 "IBM Plex Sans", system-ui, sans-serif; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--paper-2); }
.dim { color: var(--ink-3); font-weight: 400; }

.app { max-width: 1180px; margin: 0 auto; padding: env(safe-area-inset-top, 0px) 16px 24px; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 2px 12px; }
.wordmark { margin: 0; font: 650 26px/1 Fraunces, Georgia, serif; letter-spacing: -0.01em; }
.top-actions { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
.link { background: none; border: 0; padding: 2px 0; color: var(--ink-2); text-decoration: none; font-size: 14px; border-bottom: 1px solid transparent; }
.link:hover:not(:disabled) { color: var(--ink); border-bottom-color: var(--ink-3); }
.link:disabled { opacity: .4; cursor: default; }
.link.strong { color: var(--ink); font-weight: 600; }
.link[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.mini { display: none; font: 650 17px/1 Fraunces, Georgia, serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini .mclock { font: 600 13px/1 "IBM Plex Sans", system-ui, sans-serif; color: var(--ink-2); margin-left: 8px; }
.mini .mclock.over { color: var(--warn); }
.mini .y { color: var(--you); } .mini .b { color: var(--bot); } .mini .sep { color: var(--ink-3); margin: 0 6px; }
.banner { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, var(--paper)); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--paper)); font-size: 14px; }

.layout { display: grid; grid-template-columns: minmax(0, calc(var(--bw) + 18px)) 330px; gap: 32px; align-items: start; justify-content: center; }
/* Focus hides the side panel only where its button is shown, so it can always be undone. */
@media (min-width: 901px) {
  .app.focus .layout { grid-template-columns: minmax(0, calc(var(--bw) + 18px)); }
  .app.focus .side { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .mini:not([hidden]) { display: block; }
  #btn-focus { display: none; }
}
@media (max-width: 480px) {
  .top { flex-wrap: wrap; row-gap: 6px; padding-bottom: 10px; }
  .top-actions { order: 3; width: 100%; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
  .wordmark { font-size: 22px; }
}

/* ---------- board ---------- */
.table { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.board-frame {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); grid-template-rows: 14px auto; gap: 4px;
  width: min(100%, var(--bw) + 18px); min-width: min(100%, 300px);
}
.coords-top { grid-column: 2; display: grid; grid-template-columns: repeat(15, 1fr); padding: 0 8px; }
.coords-left { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(15, 1fr); padding: 8px 0; }
.coords-top span, .coords-left span { display: grid; place-items: center; font: 500 10.5px/1 "IBM Plex Sans", system-ui, sans-serif; color: var(--ink-3); }
.board-wrap { grid-column: 2; grid-row: 2; position: relative; padding: 6px; border-radius: 10px;
  background: linear-gradient(160deg, var(--felt-2), var(--felt) 55%); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 34px -20px rgba(20,14,5,.55); }
.board { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 2px; padding: 2px; background: var(--sq-line); border-radius: 4px; aspect-ratio: 1; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sq { position: relative; aspect-ratio: 1; min-width: 0; background: var(--sq); border-radius: 2.5px; display: grid; place-items: center; container-type: inline-size;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(0,0,0,.05); transition: background-color .2s; }
.sq .lbl { font: 600 22cqw/1 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: .02em; color: rgba(255,255,255,.94); }
.sq.tw { background: var(--tw); } .sq.dw { background: var(--dw); } .sq.tl { background: var(--tl); } .sq.dl { background: var(--dl); }
.sq.star .lbl { color: color-mix(in srgb, var(--tw) 70%, #fff); }
.sq.dw .lbl, .sq.dl .lbl { color: var(--label-dark); }
.sq.star .lbl { font-size: 46cqw; }
.sq.cursor { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.sq.cursor::after { content: ""; position: absolute; right: 7%; top: 50%; transform: translateY(-50%); border: 17cqw solid transparent; border-left-color: var(--accent); border-right-width: 0; }
.sq.cursor.down::after { right: auto; left: 50%; top: auto; bottom: 7%; transform: translateX(-50%); border: 17cqw solid transparent; border-top-color: var(--accent); border-bottom-width: 0; }
.sq.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.sq > .tile { width: 92%; height: 92%; }
/* the last move: its squares tinted in the mover's colour around the tiles */
.sq.lastsq { background: color-mix(in srgb, var(--bot) 55%, var(--sq)); }
.sq.lastsq.mine { background: color-mix(in srgb, var(--you) 55%, var(--sq)); }

/* ---------- tiles (one look everywhere: board, rack, drag, picker) ---------- */
.tile {
  position: relative; aspect-ratio: 1; border-radius: 11%; container-type: inline-size;
  background: linear-gradient(165deg, var(--tile-hi) 0%, var(--tile) 72%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -0.09em 0 var(--tile-edge), 0 1px 2px rgba(40,25,5,.3);
  color: var(--tile-ink); display: grid; place-items: center;
}
.tile .ch { font: 800 48cqw/1 Archivo, "Arial Black", system-ui, sans-serif; transform: translate(-4%, -3%); }
.tile .val { position: absolute; right: 9%; bottom: 7%; font: 600 20cqw/1 Archivo, system-ui, sans-serif; }
.tile.blank .ch { color: var(--blank-ink); font-style: italic; }
.tile.blank::after { content: ""; position: absolute; inset: 8%; border-radius: 8%; border: 1px dashed rgba(154,79,22,.45); pointer-events: none; }
.tile.pending { box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -0.09em 0 var(--tile-edge), 0 0 0 2px var(--accent), 0 3px 6px -2px rgba(0,0,0,.35); cursor: grab; transform: translateY(-3%); }
.tile.popin { animation: popin .2s cubic-bezier(.2,.9,.3,1.4) both; }
@keyframes popin { from { transform: scale(.7); opacity: .4; } to { transform: translateY(-3%); opacity: 1; } }
.sq.badword .tile { box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 0 0 2.5px var(--c-blunder); }
.sq.badword .tile .ch { color: color-mix(in srgb, var(--c-blunder) 75%, var(--tile-ink)); }
.tile.last { background: linear-gradient(180deg, #fbeec9, #f0d389); }
.tile.last::before { content: ""; position: absolute; left: 9%; top: 9%; width: 14%; height: 14%; border-radius: 50%; background: var(--bot); }
.tile.last.mine::before { background: var(--you); }
.tile.last:not(.mine) { box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 0 0 2px var(--bot), 0 1px 1.5px rgba(0,0,0,.25); }
.tile.fresh { animation: drop .32s cubic-bezier(.2,.8,.3,1.2) both; }
.sq:nth-child(2n) > .tile.fresh { animation-delay: .03s; } .sq:nth-child(3n) > .tile.fresh { animation-delay: .05s; }
@keyframes drop { from { transform: translateY(-14%) scale(1.08); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- rack ---------- */
.rack {
  display: flex; justify-content: center; gap: calc(var(--rt) * .11); padding: calc(var(--rt) * .16) calc(var(--rt) * .2);
  background: linear-gradient(180deg, var(--felt-2), var(--felt)); border-radius: 11px; user-select: none; -webkit-user-select: none; touch-action: none;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.5);
  min-height: calc(var(--rt) * 1.32);
}
.rack .tile, .rack .slot { width: var(--rt); height: var(--rt); flex: none; }
.rack .slot { border-radius: 10%; background: rgba(255,255,255,.06); }
.rack .tile { cursor: grab; transition: transform .14s cubic-bezier(.2,.7,.3,1), box-shadow .14s; }
@media (hover: hover) { .rack:not(.review) .tile:not(.used):hover { transform: translateY(-6%); } }
.rack .tile.used { visibility: hidden; }
.rack .tile.sel { transform: translateY(-14%); box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 6px 10px -4px rgba(0,0,0,.5); }
.rack .tile.xsel { box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 0 0 3px var(--warn); }
.rack.concealed .tile { visibility: hidden; }
.ghost { position: fixed; pointer-events: none; z-index: 50; transform: translate(-50%, -50%); opacity: .96; box-shadow: 0 8px 18px -6px rgba(0,0,0,.45); transition: width .08s, height .08s; }
.sq.drop { background: color-mix(in srgb, var(--accent) 22%, var(--sq)); }

/* ---------- controls ---------- */
.status { min-height: 22px; font-size: 14px; color: var(--ink-2); text-align: center; max-width: 640px; }
.status b { color: var(--ink); font-weight: 600; }
.status .bad { color: var(--warn); }
.thinking::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.ctl-gap { width: 10px; }
.ctl { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--card), var(--paper-2)); font-weight: 500; font-size: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 1px 2px rgba(40,28,10,.08); transition: border-color .15s, transform .08s, box-shadow .15s, background .15s; }
.ctl:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink-3) 70%, var(--line)); }
.ctl:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.ctl:disabled { opacity: .45; cursor: default; }
.ctl.primary { background: linear-gradient(180deg, var(--felt-2), var(--accent)); border-color: var(--accent); color: var(--accent-ink); min-width: 104px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 4px 10px -6px rgba(20,40,30,.7); }
.ctl.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.ctl.icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ctl.armed { border-color: var(--warn); color: var(--warn); }
.secondary { display: flex; gap: 18px; justify-content: center; min-height: 22px; }
.review-nav { display: flex; gap: 8px; align-items: center; }
.rv-pos { min-width: 9em; text-align: center; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.controls .ctl.icon span { display: none; }
.controls .ctl.icon { padding: 7px 10px; min-width: 40px; }
@media (max-width: 480px) { .ctl { padding: 7px 10px; } .ctl-gap { display: none; } .controls .ctl.icon { padding: 7px 9px; min-width: 38px; } }

/* ---------- side ---------- */
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.player { padding: 9px 12px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; position: relative; }
.player .who { font-size: 13px; color: var(--ink-2); grid-column: 1 / 3; }
.player .pts { font: 650 30px/1.05 Fraunces, Georgia, serif; font-variant-numeric: tabular-nums; position: relative; display: inline-block; }
.player .pts.bump { animation: bump .45s cubic-bezier(.2,.8,.3,1.3); }
.player .pts[data-gain]::after { content: attr(data-gain); position: absolute; left: 100%; top: 0; margin-left: 6px; font: 600 13px/1 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--you); animation: gain 1.6s ease-out both; white-space: nowrap; }
.player.p1 .pts[data-gain]::after { color: var(--bot); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes gain { 0% { opacity: 0; transform: translateY(4px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.player .clock { align-self: end; font: 600 16px/1.2 "IBM Plex Sans", system-ui, sans-serif; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 5px; color: var(--ink-2); }
.player.running .clock { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.player .clock.low { color: var(--warn); }
.player .clock.over { background: var(--warn); color: #fff; }
.player.turn::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--you); }
.player.p1.turn::after { background: var(--bot); }
.config { font-size: 12.5px; color: var(--ink-3); }
.chance-bar { height: 6px; border-radius: 6px; background: var(--bot); overflow: hidden; opacity: .9; }
.chance-fill { height: 100%; background: var(--you); transition: width .5s ease; }
.chance-label { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); list-style: none; }
details > summary.panel-head { cursor: pointer; border-bottom: 0; }
details[open] > summary.panel-head { border-bottom: 1px solid var(--line); }
summary::-webkit-details-marker { display: none; }
.log { margin: 0; padding: 4px 0; list-style: none; max-height: 260px; overflow-y: auto; font-size: 13.5px; }
.log li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; padding: 3px 12px; align-items: baseline; }
.log li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bot); align-self: center; }
.log li.s0::before { background: var(--you); }
.log li.at { background: var(--paper); }
.log li button { all: unset; cursor: pointer; }
.log li button:focus-visible { outline: 2px solid var(--focus); }
.log .sc { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.log .tot { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
.log .empty { display: block; color: var(--ink-3); }
.log .empty::before { display: none; }
.unseen { display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 10px 12px; font: 600 13.5px/1.6 Archivo, system-ui, sans-serif; letter-spacing: .08em; }
.unseen .n { color: var(--ink-3); font-size: 11px; letter-spacing: 0; margin-left: 1px; }
.hint-row { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; width: 100%; padding: 6px 12px; border: 0; background: none; text-align: left; font-size: 13.5px; }
.hint-row:hover { background: var(--paper); }
.hint-row .sub { grid-column: 1 / 4; font-size: 12px; color: var(--ink-3); }
.hint-row .sc, .hint-row .wp { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hint-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px 8px; font-size: 12px; color: var(--ink-3); align-items: baseline; }
.review-body { padding: 8px 12px 10px; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.review-body .verdict { color: var(--ink-2); }
.review-body .alts { margin: 0; padding-left: 18px; color: var(--ink-2); }
.review-body .row { display: flex; gap: 12px; flex-wrap: wrap; }
.exports { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.toast { position: absolute; left: 50%; bottom: 74px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); transform: translate(-50%, 8px); opacity: 0; background: var(--ink); color: var(--paper); padding: 7px 12px; border-radius: 7px; font-size: 13.5px; pointer-events: none; transition: opacity .18s, transform .18s; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--accent); color: var(--accent-ink); }
.foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); line-height: 1.6; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: color-mix(in srgb, var(--paper) 72%, transparent); backdrop-filter: blur(3px); }
#handover { background: var(--paper); }
.card { width: min(100%, 470px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px 24px 20px; box-shadow: 0 24px 60px -28px rgba(30,20,5,.5); margin: auto; animation: rise .22s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card.small { width: min(100%, 380px); padding: 18px; }
.card.wide { width: min(100%, 620px); }
.card.center { text-align: center; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-title { margin: 0 0 6px; font: 650 28px/1.1 Fraunces, Georgia, serif; }
.card-sub { margin: 0 0 16px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; background: var(--paper-2); }
.seg button { border: 0; background: none; padding: 7px 4px; border-radius: 6px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.seg button { transition: background .15s, color .15s; }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.seg button.off:not(.on) { opacity: .45; }
@media (max-width: 480px) { .seg button { font-size: 12.5px; padding: 7px 2px; } }
.hint-text { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.custom-row { margin-top: 8px; font-size: 13.5px; }
input[type="number"], textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-2); }
.custom-row input { width: 6em; margin-left: 6px; }
textarea { font: 13px/1.4 ui-monospace, Consolas, monospace; resize: vertical; }
.advanced { margin: 4px 0 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.advanced > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.analysis-in .row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
/* Setting up a board by hand: the editor takes the place of the rack and controls. */
.app.setting-up #rack, .app.setting-up #controls, .app.setting-up #secondary, .app.setting-up #status, .app.setting-up #review-nav { display: none; }
.app.setting-up .side > :not(.setup) { display: none; }
.setup { margin-top: 12px; display: grid; gap: 10px; font-size: 14px; min-width: 0; max-width: 100%; }
.side > .setup { margin-top: 0; }
.setup-head .dim { display: block; font-size: 13px; }
.setup-keys { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.skey { aspect-ratio: 1; padding: 0; border-radius: 5px; border: 1px solid var(--tile-edge); background: linear-gradient(var(--tile-hi), var(--tile)); color: var(--tile-ink); font: 700 clamp(13px, 3.4vw, 17px)/1 Archivo, system-ui, sans-serif; box-shadow: 0 1px 0 var(--tile-edge); }
.skey.wide { grid-column: span 3; aspect-ratio: auto; padding: 7px 0; font-size: 13px; }
.skey.wide.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.skey:active { transform: translateY(1px); box-shadow: none; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.setup-grid label { display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.setup-grid input { width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.setup-grid input[type=number], .setup-grid input::placeholder { text-transform: none; letter-spacing: 0; }
.setup-check { font-size: 13px; color: var(--ink-2); }
.setup-check.bad { color: var(--warn); }
.backup-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.backup-row .dim { flex: 1 1 220px; }
@media (max-width: 480px) { .backup-row .dim { flex-basis: 100%; } }
.file-link { cursor: pointer; position: relative; }
.file-link input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.setup-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setup-acts .ctl-gap { flex: 1; display: block; }
.ctl.file { display: inline-block; position: relative; overflow: hidden; }
.ctl.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.resume { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); font-size: 14px; }
.summary { font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; min-height: 18px; }
.start { width: 100%; margin-top: 6px; padding: 11px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px; }
.start:disabled { opacity: .6; cursor: default; }
.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.end-actions .start { grid-column: 1 / 3; }
.end-share { display: block; margin: 12px auto 0; }
.loading { margin-top: 14px; }
.loading-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.loading-fill { height: 100%; width: 0; background-color: var(--accent); transition: width .2s; }
/* A sheen runs along the filled part while work is under way, so the bar visibly lives
   even in a stage it cannot measure. */
.loading.busy .loading-fill {
  background-image: linear-gradient(100deg, transparent 0 35%, rgba(255, 255, 255, .45) 50%, transparent 65% 100%);
  background-size: 200% 100%;
  animation: sheen 1.2s linear infinite;
}
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.loading-text { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.letters button { aspect-ratio: 1; border: 0; border-radius: 10%; background: linear-gradient(180deg, var(--tile-hi), var(--tile)); box-shadow: inset 0 -2px 0 var(--tile-edge); font: 800 20px/1 Archivo, system-ui, sans-serif; color: var(--blank-ink); }
.final { font: 650 44px/1 Fraunces, Georgia, serif; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.games-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.games-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.games-list .acts { display: flex; gap: 12px; }
.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.help-list b { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- game review ---------- */
.cls { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; vertical-align: -6px;
  background: var(--c-best); color: #fff; font: 800 11.5px/1 Archivo, system-ui, sans-serif; letter-spacing: -.04em;
  box-shadow: 0 1px 2px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.15); text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.cls svg { width: 64%; height: 64%; fill: currentColor; }
.cls.sm { width: 16px; height: 16px; font-size: 9px; vertical-align: -3px; margin-right: 6px; }
.cls.lg { width: 34px; height: 34px; font-size: 16px; }
.cls.brilliant { background: var(--c-brilliant); } .cls.great { background: var(--c-great); } .cls.best { background: var(--c-best); }
.cls.excellent { background: var(--c-excellent); } .cls.good { background: var(--c-good); } .cls.inaccuracy { background: var(--c-inaccuracy); }
.cls.mistake { background: var(--c-mistake); } .cls.blunder { background: var(--c-blunder); }
.cls-legend .cls { width: 17px; height: 17px; font-size: 9px; vertical-align: -3px; }

/* on the board: the move played, outlined in its class's colour with its badge; the better
   move dashed in green with its coordinate and an arrow for its direction */
.board { position: relative; }
.rv-span { position: absolute; inset: -3px; border-radius: 7px; pointer-events: none; z-index: 3; --c: var(--c-best);
  animation: rv-in .22s ease-out both; }
.rv-span.played { border: 3px solid var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 0 12px -2px var(--c); }
.rv-span.played.ghost { border-style: dashed; box-shadow: none; opacity: .75; }
.rv-span.best { border: 3px dashed var(--c-best); background: color-mix(in srgb, var(--c-best) 13%, transparent); animation-delay: .12s; }
.rv-span.best.preview { border-style: solid; background: color-mix(in srgb, var(--c-best) 9%, transparent); animation-delay: 0s; }
.rv-span.best::after { content: ""; position: absolute; border: calc(var(--sqw, 40px) * .17) solid transparent; }
.rv-span.best.across::after { left: 100%; top: 50%; margin-left: 3px; transform: translateY(-50%); border-left-color: var(--c-best); border-right-width: 0; }
.rv-span.best.down::after { top: 100%; left: 50%; margin-top: 3px; transform: translateX(-50%); border-top-color: var(--c-best); border-bottom-width: 0; }
.rv-tag { position: absolute; padding: 2px 6px; border-radius: 5px; background: var(--c-best); color: #fff; white-space: nowrap;
  font: 700 clamp(9.5px, calc(var(--sqw, 40px) * .27), 12px)/1.15 "IBM Plex Sans", system-ui, sans-serif; box-shadow: 0 2px 6px -2px rgba(0,0,0,.4); }
.rv-tag.above { left: -3px; bottom: 100%; margin-bottom: 4px; }
.rv-tag.below { left: -3px; top: 100%; margin-top: 4px; }
.rv-tag.left { right: 100%; top: -3px; margin-right: 4px; }
.rv-tag.right { left: 100%; top: -3px; margin-left: 4px; }
.rv-badge { position: absolute; right: calc(var(--sqw, 40px) * -.34); top: calc(var(--sqw, 40px) * -.34); animation: pop .34s cubic-bezier(.2,.9,.3,1.35) .08s both; }
.rv-badge .cls { width: calc(var(--sqw, 40px) * .62); height: calc(var(--sqw, 40px) * .62); min-width: 18px; min-height: 18px; font-size: max(9px, calc(var(--sqw, 40px) * .28)); vertical-align: 0; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.tile.suggest { background: linear-gradient(180deg, color-mix(in srgb, var(--c-best) 16%, var(--tile-hi)), color-mix(in srgb, var(--c-best) 24%, var(--tile)));
  box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 0 0 2px var(--c-best); animation: rv-in .2s ease-out both; }
.tile.suggest.faint { opacity: .62; box-shadow: inset 0 -0.09em 0 var(--tile-edge); animation-delay: .12s; }
.coords-top span, .coords-left span { border-radius: 4px; transition: background .15s, color .15s; }
.coords-top span.hl, .coords-left span.hl { color: #fff; font-weight: 700; background: var(--c, var(--c-best)); }
.coords-top span.hl.best, .coords-left span.hl.best { background: var(--c-best); }
.coords-top span.hl.hint, .coords-left span.hl.hint { background: var(--c-great); }
@keyframes rv-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }

/* the rack in review: the tiles the move used, and those kept */
.rack.review .tile { cursor: default; transition: opacity .15s, transform .15s; }
.rack.review .tile.spent { transform: translateY(-10%); box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 0 0 2px var(--accent-ink), 0 5px 9px -4px rgba(0,0,0,.5); }
.rack.review .tile.spent.alt { box-shadow: inset 0 -0.09em 0 var(--tile-edge), 0 0 0 2px var(--c-best), 0 5px 9px -4px rgba(0,0,0,.5); }
.rack.review .tile.kept { opacity: .8; }

/* the winning-chance bar beside the board */
.board-frame { position: relative; }
.evalbar { position: absolute; left: -15px; top: 18px; bottom: 0; width: 10px; border-radius: 6px; overflow: hidden; background: var(--bot); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.evalbar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--you); transition: height .45s cubic-bezier(.3,.7,.3,1); }
.evalbar-label { display: none; }
@media (min-width: 901px) {
  .evalbar { left: -24px; width: 16px; }
  .evalbar-label { display: block; position: absolute; left: 0; right: 0; text-align: center; font: 700 8.5px/1 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: -.04em; color: #fff; }
  .evalbar-label.lo { bottom: 4px; } .evalbar-label.hi { top: 4px; }
}
@media (max-width: 480px) { .evalbar { left: -12px; width: 8px; } }

/* the review panel */
.review-body { gap: 10px; }
.rv-intro { margin: 0; color: var(--ink-2); }
.rv-start { display: flex; gap: 8px; align-items: center; }
.rv-start .seg { flex: 1; }
.rv-start .seg button { padding: 6px 4px; font-size: 12.5px; }
.rv-progress-row { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rv-progress .loading-fill { transition: width .3s ease; background-image: linear-gradient(100deg, transparent 0 35%, rgba(255,255,255,.45) 50%, transparent 65% 100%); background-size: 200% 100%; animation: sheen 1.2s linear infinite; }
.coach { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px; border-radius: 8px; background: var(--paper); border-left: 4px solid var(--c, var(--line)); animation: rv-in .18s ease-out both; }
.coach.pending { color: var(--ink-3); border-left-color: var(--line); }
.coach.brilliant { --c: var(--c-brilliant); } .coach.great { --c: var(--c-great); } .coach.best { --c: var(--c-best); } .coach.excellent { --c: var(--c-excellent); }
.coach.good { --c: var(--c-good); } .coach.inaccuracy { --c: var(--c-inaccuracy); } .coach.mistake { --c: var(--c-mistake); } .coach.blunder { --c: var(--c-blunder); }
.coach-head { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.coach-head b { color: var(--c); }
.coach-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.coach-text, .coach-chance { margin: 0; color: var(--ink-2); }
.coach-text b { color: var(--ink); }
.coach-chance { font-size: 12.5px; color: var(--ink-3); }
.alts2 { list-style: none; margin: 2px -6px 0; padding: 0; }
.alts2 button { display: grid; grid-template-columns: auto 1fr auto 3.2em; gap: 0 8px; align-items: baseline; width: 100%; padding: 4px 6px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: 13.5px; }
.alts2 button:hover, .alts2 li.on button { background: color-mix(in srgb, var(--c-best) 13%, var(--paper-2)); }
.alts2 .cls { align-self: center; margin-right: 0; }
.alts2 .mv { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alts2 li.played .mv { font-weight: 700; }
.alts2 li.extra { border-top: 1px dashed var(--line); margin-top: 3px; padding-top: 3px; }
.alts2 .sc, .alts2 .wp { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.alts2 .sub { grid-column: 2 / 5; font-size: 11.5px; color: var(--ink-3); }
.coach-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coach-acts .ctl { padding: 6px 10px; font-size: 13px; }
.coach-acts .ctl-gap { flex: 1; width: auto; }
.keynav { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.keynav .ctl { padding: 5px 10px; }
.wgraph-wrap { cursor: pointer; border-radius: 6px; overflow: hidden; line-height: 0; box-shadow: inset 0 0 0 1px var(--line); }
.wgraph { display: block; width: 100%; height: auto; }
.wg-b { fill: color-mix(in srgb, var(--bot) 30%, var(--paper)); }
.wg-a { fill: color-mix(in srgb, var(--you) 62%, var(--paper)); }
.wg-line { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; opacity: .55; }
.wg-mid { stroke: var(--ink-3); stroke-dasharray: 3 3; stroke-width: 1; opacity: .7; }
.wg-at { stroke: var(--ink); stroke-width: 1.5; }
.wg-dot { stroke: var(--paper); stroke-width: 1.5; }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acc { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--paper); border-top: 3px solid var(--you); }
.acc.b { border-top-color: var(--bot); }
.acc .who { font-size: 12.5px; color: var(--ink-2); }
.acc-n { font: 650 28px/1.1 Fraunces, Georgia, serif; font-variant-numeric: tabular-nums; }
.acc-sub { font-size: 11.5px; color: var(--ink-3); }
.classes > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); list-style: none; }
.classes > summary::before { content: "▸ "; } .classes[open] > summary::before { content: "▾ "; }
.cls-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13px; }
.cls-table td, .cls-table th { padding: 2px 4px; }
.cls-table th { font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cls-table .cname { white-space: nowrap; }
.cls-table .cnt { width: 2.6em; font-variant-numeric: tabular-nums; font-weight: 600; }
.cls-table .cnt.l { text-align: right; } .cls-table .cnt.r { text-align: left; }
.cls-table .zero { color: var(--ink-3); font-weight: 400; opacity: .6; }
.log li button .cls.sm { margin-right: 5px; }

/* ---------- play: the words a move makes ---------- */
.status { min-height: 26px; }
.wchips { display: inline-flex; flex-wrap: wrap; gap: 5px; justify-content: center; align-items: center; }
.wchip { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink); letter-spacing: .02em; }
.wchip b { font-variant-numeric: tabular-nums; }
.wchip.ok { border-color: color-mix(in srgb, var(--c-best) 45%, var(--line)); }
.wchip.bad { border-color: var(--c-blunder); color: var(--c-blunder); background: color-mix(in srgb, var(--c-blunder) 8%, var(--card)); }
.wchip.bingo { background: color-mix(in srgb, var(--tile) 70%, var(--card)); border-color: var(--tile-edge); }
.wtags { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0; }
.wsum { font-weight: 600; color: var(--ink); margin-left: 2px; }

/* ---------- hints in steps ---------- */
.hint-steps { padding: 8px 12px 2px; display: flex; flex-direction: column; gap: 6px; }
.hint-step { margin: 0; font-size: 13.5px; color: var(--ink-2); padding-left: 12px; border-left: 3px solid var(--c-great); animation: rv-in .2s ease-out both; }
.hint-step.where { border-left-color: var(--c-best); }
.rv-span.hint { border: 3px dashed var(--c-great); background: color-mix(in srgb, var(--c-great) 12%, transparent); animation: rv-in .2s ease-out both, breathe 1.8s ease-in-out .2s infinite; }
.rv-span.hint .rv-tag { background: var(--c-great); }
@keyframes breathe { 50% { background: color-mix(in srgb, var(--c-great) 22%, transparent); } }

/* ---------- the instant rating in Practice ---------- */
.rating { --c: var(--line); border-left: 4px solid var(--c); animation: rv-in .2s ease-out both; }
.rating.brilliant { --c: var(--c-brilliant); } .rating.great { --c: var(--c-great); } .rating.best { --c: var(--c-best); } .rating.excellent { --c: var(--c-excellent); }
.rating.good { --c: var(--c-good); } .rating.inaccuracy { --c: var(--c-inaccuracy); } .rating.mistake { --c: var(--c-mistake); } .rating.blunder { --c: var(--c-blunder); }
.rating-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.rating-text { flex: 1; font-size: 14px; }
.rating-text b { color: var(--c); }
.rating-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.rating-sub b { color: var(--ink); }
.rating-x { font-size: 18px; line-height: 1; padding: 0 2px; align-self: flex-start; }
.rating-acts { padding: 0 12px 10px 56px; }

/* ---------- puzzles ---------- */
.puzzle-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.pz-task { margin: 0; color: var(--ink-2); }
.pz-result { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; background: var(--paper); animation: rv-in .2s ease-out both; }
.pz-result.ok { background: color-mix(in srgb, var(--c-best) 12%, var(--paper)); }
.pz-result.no { background: color-mix(in srgb, var(--c-mistake) 10%, var(--paper)); }
.pz-tries { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.pz-tries span { width: 10px; height: 10px; border-radius: 50%; background: var(--c-best); opacity: .85; }
.pz-tries span.used { background: var(--line); }
.pz-tries em { font-style: normal; margin-left: 4px; }
.pz-past { margin-top: 12px; font-size: 13px; }
.pz-past summary { cursor: pointer; color: var(--ink-2); }
.pz-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.pz-days button { display: grid; justify-items: center; gap: 1px; padding: 4px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pz-days button span { font-size: 11px; line-height: 1; min-height: 11px; color: var(--ink-3); }
.pz-days button.ok span { color: var(--c-best); }
.pz-days button.no span { color: var(--c-mistake); }
.pz-days button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pz-kind { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.pz-kind .seg { flex: 1; }
.pz-note { margin: 6px 0 0; font-size: 12.5px; }
.coach-line { margin: 6px 0 0; font-size: 13px; line-height: 1.55; }
.coach-line .lbl { color: var(--ink-3); margin-right: 2px; }
.ln-move { white-space: nowrap; }
.ln-sep { color: var(--ink-3); margin: 0 2px; }
.hint-line { padding: 0 2px 4px; }
.streak { font-size: 12px; font-weight: 600; color: var(--c-mistake); }
.streak::before { content: "● "; }
.puzzle-cta { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; text-align: left;
  border: 1px solid color-mix(in srgb, var(--c-great) 40%, var(--line)); background: color-mix(in srgb, var(--c-great) 7%, var(--card)); font-size: 14px; transition: border-color .15s; }
.puzzle-cta:hover { border-color: var(--c-great); }
.puzzle-cta > span:nth-child(2) { flex: 1; }
.pz-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(165deg, var(--tile-hi), var(--tile));
  box-shadow: inset 0 -2px 0 var(--tile-edge); font: 800 16px/1 Archivo, system-ui, sans-serif; color: var(--tile-ink); }
.pz-go { font-size: 20px; color: var(--ink-3); }

/* ---------- tile tracker ---------- */
.unseen-notes { padding: 8px 12px 0; font-size: 12.5px; }
.tr-sum { display: flex; gap: 12px; color: var(--ink-2); }
.tr-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tr-notes { margin: 6px 0 0; padding-left: 16px; color: var(--ink-2); }
.tr-notes li::marker { color: var(--c-inaccuracy); }
.infer { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; line-height: 1.5; }
.infer-head { font-weight: 600; margin-bottom: 2px; }
.infer-row { margin-top: 3px; }
.infer-btn { margin-top: 8px; font-size: 13px; }

/* ---------- Games and Stats ---------- */
.tabs { display: flex; gap: 4px; margin: 6px 0 12px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 7px 12px; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.stats-view { display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 480px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); }
.stat-n { font: 650 24px/1.1 Fraunces, Georgia, serif; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12px; color: var(--ink-3); }
.stat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.stat-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.stat-table td { padding: 5px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); font-variant-numeric: tabular-nums; }
.stat-acc-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.stat-acc-head b { font: 650 18px/1 Fraunces, Georgia, serif; color: var(--ink); }
.spark { width: 100%; height: auto; display: block; }
#stats-reset { align-self: flex-start; }
.spark polyline { fill: none; stroke: var(--you); stroke-width: 2; stroke-linejoin: round; }
.spark circle { fill: var(--card); stroke: var(--you); stroke-width: 1.5; }
.stat-line { margin: 0; color: var(--ink-2); }
.stat-line b { color: var(--ink); }

/* ---------- the analysis board ---------- */
.coach.explore { --c: var(--c-great); }
.explore-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-great); color: #fff; font-size: 16px; flex: none; }
.controls.exploring #btn-exchange, .controls.exploring #btn-pass, .controls.exploring #btn-hint { display: none; }

/* ---------- zoom on phones ---------- */
.board-area { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.board-scroll { width: 100%; display: flex; justify-content: center; }
.zoom-btn { display: none; }
@media (max-width: 700px) {
  .zoom-btn { display: grid; place-items: center; position: absolute; right: -6px; top: -10px; z-index: 6; width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--card); color: var(--ink-2); box-shadow: 0 4px 10px -4px rgba(0,0,0,.35); }
  .zoom-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .zoom-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .zoom-btn[aria-pressed="true"] svg path { d: path("M12.6 12.6 17 17M6 8.5h5"); }
  .board-area.zoomed .board-scroll { display: block; overflow: auto; height: min(calc(100vw - 20px), 68svh); border-radius: 10px; overscroll-behavior: contain;
    box-shadow: inset 0 0 0 1px var(--line); scrollbar-width: none; }
  .board-area.zoomed .board-scroll::-webkit-scrollbar { display: none; }
  .board-area.zoomed .board-frame { width: 175%; min-width: 0; max-width: none; margin: 0; }
  .board-area.zoomed .evalbar { display: none; }
}
/* Tournament rules: the WESPA penalty row, and the words offered for a challenge. */
.label.sub { margin-top: 10px; }
button.wchip.pick { cursor: pointer; font: inherit; color: inherit; margin: 0 4px 4px 0; }
button.wchip.pick:hover { border-color: var(--ink-3); }
.own-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.own-row .hint-text { margin-top: 0; }
