/* FuckingGO! - dark board-room chrome, one hot accent, nothing decorative that
   does not carry information. */
:root {
  --bg: #1c1b19;
  --bg-deep: #141312;
  --panel: #26241f;
  --panel-2: #2f2c27;
  --panel-3: #3a3631;
  --line: #3a3631;
  /* Control outlines need 3:1 against their fill; dividers do not. */
  --line-control: #8a857e;
  --text: #f1efec;
  --muted: #a8a39c;
  --muted-2: #a09a92;
  --hot: #ff3b5c;
  --hot-hi: #ff5f79;
  --hot-lo: #b81f3c;
  --hot-wash: rgba(255, 59, 92, .12);
  --gold: #e2b04a;
  --loss: #f0817d;
  --win: #9ccf63;
  --draw: #a5a099;
  --info: #6ea8dd;
  /* Two radii only: controls and surfaces. */
  --radius: 10px;
  --radius-control: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
  --font: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* Visible only to assistive technology. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* One focus treatment everywhere, including rows that contain a link. */
:where(a, button, input, [tabindex], canvas):focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 2px;
}
tr.clickable:has(a:focus-visible) {
  outline: 2px solid var(--hot);
  outline-offset: -2px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
button { font-family: inherit; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  background: var(--bg-deep);
  border-bottom: 1px solid #1f1e1c;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { color: inherit; }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; flex: none; }
/* Logotype: the adjective is set small and tracked, GO carries the size and the
   colour, and the exclamation is a cut rather than a glyph. */
/* One locked-up block, not a row of spans: the tracked word is set to the exact
   ink width of GO plus its exclamation, so both rows are flush. */
.brand-text {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 3px;
  row-gap: 1px;
  align-items: end;
  line-height: 1;
  white-space: nowrap;
}
.brand-text b {
  grid-column: 1 / 3;
  font-size: 9px;
  font-weight: 700;
  /* Tracked to the exact ink width of GO plus its exclamation, so the block is
     flush on both edges. */
  letter-spacing: .31em;
  margin-right: -.31em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-text em {
  grid-column: 1;
  font-style: normal;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: .74;
  color: var(--hot);
}
/* The exclamation is drawn: stem over dot, skewed with the word. */
.brand-text i {
  grid-column: 2;
  align-self: end;
  width: 6px;
  height: 22px;
  transform: skewX(-11deg);
  background:
    linear-gradient(var(--hot), var(--hot)) 0 0 / 100% 70% no-repeat,
    linear-gradient(var(--hot), var(--hot)) 0 100% / 100% 20% no-repeat;
}
.brand:hover .brand-text b { color: var(--text); }

.topnav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.topnav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.topnav a svg { width: 18px; height: 18px; }
.topnav a:hover { background: var(--panel-2); color: var(--text); }
/* Hover and "you are here" must not look the same. */
.topnav a.active {
  color: var(--text);
  background: var(--hot-wash);
  box-shadow: inset 0 -2px 0 var(--hot);
}
.topnav a.active:hover { background: rgba(255, 59, 92, .18); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.userchip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 8px;
}
.userchip:hover { background: #322f2c; }
.userchip .meta { display: flex; flex-direction: column; line-height: 1.15; }
.userchip .meta strong { font-size: 14px; }
.userchip .meta span { font-size: 12px; color: var(--muted); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(160deg, #4b4744, #35322f);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: #ded9d2;
  border: 1px solid #4a4744;
  flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 5px; }
.avatar.lg { width: 76px; height: 76px; font-size: 32px; border-radius: 10px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  padding: 11px 18px;
  min-height: 42px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--panel-3);
  color: var(--text);
  transition: filter .12s ease, transform .06s ease;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.btn-primary {
  background: var(--hot);
  color: #2a0009;
  box-shadow: 0 3px 0 var(--hot-lo);
}
.btn-primary:hover { background: var(--hot-hi); }
.btn-primary:active { box-shadow: 0 1px 0 var(--hot-lo); }

/* A transparent button's border is the whole control, so it needs the 3:1
   control contrast, not the divider colour. */
.btn-ghost { background: transparent; border: 1px solid var(--line-control); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); border-color: #b3ada5; filter: none; }
.btn-danger { background: transparent; border: 1px solid #a86460; color: #e8a7a4; }
.btn-danger:hover { background: #4a2b2a; color: #f6dedc; filter: none; }
.btn-lg { padding: 15px 26px; font-size: 17px; min-height: 52px; }
.btn-sm { padding: 7px 12px; font-size: 13px; min-height: 34px; }
.btn-block { display: flex; width: 100%; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-control);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: var(--radius-control);
  padding: 9px 14px;
  min-height: 42px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: #b3ada5; }
.chip.selected {
  background: var(--hot-wash);
  border-color: var(--hot);
  color: #ff8b9d;
}

/* Tab bar: ladders on the leaderboard, board sizes on a profile. */
.tabbar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  padding: 13px 15px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.tabbar button:hover { color: var(--text); }
.tabbar button.active { color: var(--text); border-bottom-color: var(--hot); }
.tabbar button:focus-visible { outline: 2px solid var(--hot); outline-offset: -2px; }

/* ---------------------------------------------------------------- layout */
.view { flex: 1 0 auto; width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 18px 40px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}
/* Tables are allowed to scroll inside their panel rather than escape it. */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.panel-pad { padding: 18px; }

.panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: .2px; }
.panel-head .sub { color: var(--muted); font-size: 13px; font-weight: 600; }

.section-title {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--muted-2);
  font-weight: 700;
}

/* Every route states what it is, above the panels. */
.pagehead { margin: 0 0 18px; }
.pagehead h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
}
.pagehead p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------------------------------------------------------------- home */
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 44px;
  align-items: center;
  padding: 40px 0 26px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: -1.6px;
  font-weight: 800;
}
.hero h1 .hot { color: var(--hot); }
.hero p.lead { margin: 0 0 26px; font-size: 18px; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-board { display: grid; place-items: center; }
.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 24px; }
.hero-stats span { color: var(--muted); font-size: 13px; }

.nickform { display: flex; gap: 10px; margin: 0 0 18px; max-width: 420px; }
.nickform input {
  flex: 1;
  min-width: 0;
  background: #191816;
  border: 1px solid var(--line-control);
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
}
.nickform input:focus { outline: 2px solid rgba(255, 59, 92, .55); border-color: var(--hot); }
.nickform input::placeholder { color: #9b968e; }
.form-hint { color: var(--muted-2); font-size: 13px; margin: -8px 0 20px; }
.form-error { color: #f0938f; font-size: 13px; margin: -8px 0 18px; }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.feature { padding: 20px; }
.feature h3 { margin: 12px 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.feature .ico {
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(241,239,236,.06); color: #cfcac2;
  display: grid; place-items: center;
}
.feature .ico svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- tables */
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.clickable { cursor: pointer; }
/* Hover has to be felt, and the accent earns its keep marking the row. */
table.tbl tbody tr.clickable:hover {
  background: #34302b;
  box-shadow: inset 3px 0 0 var(--hot);
}
table.tbl th.num, table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td a { color: inherit; }
table.tbl td a:hover { color: #fff; text-decoration: underline; }
/* Specificity: table.tbl td would otherwise win and give an empty state the
   height of a data row. */
.empty-row, table.tbl td.empty-row {
  color: var(--muted);
  padding: 32px 14px;
  text-align: center;
  font-size: 14px;
}
.empty-row .btn { margin-top: 12px; }

.player-cell { display: flex; align-items: center; gap: 9px; }
.player-cell b { font-weight: 700; }
.rankbadge {
  font-size: 11px;
  font-weight: 800;
  color: #dcd6cb;
  background: var(--panel-3);
  border-radius: 4px;
  padding: 2px 5px;
  letter-spacing: .3px;
}
/* Kyu counts down, dan counts up: the scale inverts, and so does the badge. */
.rankbadge.dan { background: var(--hot); color: #2a0009; }
.rating-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.delta { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.delta.up { color: var(--win); }
.delta.down { color: var(--loss); }

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  border-radius: 4px;
  padding: 3px 7px;
  text-transform: uppercase;
}
.pill.win { background: rgba(156,207,99,.16); color: var(--win); }
.pill.loss { background: rgba(240,129,125,.15); color: #f2918e; }
.pill.draw { background: var(--panel-3); color: var(--draw); }
.pill.live { background: var(--hot-wash); color: #ff8b9d; }
.pill.quiet { background: var(--panel-3); color: var(--muted); }

/* ---------------------------------------------------------------- lobby */
.lobby-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
/* Grid items default to min-content width, which lets a long time-control
   label push the whole column wider than the phone. */
.lobby-grid > *, .game-layout > *, .stack > * { min-width: 0; }
/* Two columns keeps the form roughly the height of the tables beside it. */
.tc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tc-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line-control);
  background: var(--panel-2);
  color: var(--text);
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.tc-option:hover { border-color: #b3ada5; }
.tc-option.selected { border-color: var(--hot); background: var(--hot-wash); }
.tc-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-option small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; flex: none; padding-left: 10px; }
.field { margin-bottom: 18px; }

.waiting-note {
  display: flex; align-items: center; gap: 10px;
  background: rgba(110,168,221,.1);
  border: 1px solid rgba(110,168,221,.3);
  color: #b7d4ee;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #cfe4f6;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ computer */
.computer-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.computer-grid > * { min-width: 0; }
.computer-time-list { grid-template-columns: 1fr; }
.computer-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.computer-level {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 154px;
  padding: 12px;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-control);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.computer-level:hover { border-color: #b3ada5; }
.computer-level.selected {
  border-color: var(--hot);
  background: var(--hot-wash);
}
.computer-level .level-kicker {
  color: #ff8b9d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.computer-level b { font-size: 15px; line-height: 1.15; }
.computer-level span:not(.level-kicker) { color: var(--muted); font-size: 13px; line-height: 1.3; }
.computer-level small { margin-top: auto; color: var(--muted-2); font-weight: 700; }

/* ---------------------------------------------------------------- game */
.game-layout { display: grid; grid-template-columns: minmax(320px, 1fr) 330px; gap: 22px; align-items: start; }
/* The whole board must fit the viewport without scrolling: a clipped bottom
   edge is unusable while a clock runs. Per-size caps stop a 9x9 from being
   blown up to 19x19 proportions. */
.board-holder {
  position: relative;
  display: grid;
  place-items: start center;
  width: min(100%, calc(100vh - 165px));
  margin: 0 auto;
}
.board-holder[data-size="19"] { max-width: 760px; }
.board-holder[data-size="13"] { max-width: 600px; }
.board-holder[data-size="9"] { max-width: 470px; }
.board-canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-control);
  box-shadow: var(--shadow);
  touch-action: manipulation;
}

/* One padding band down the whole game sidebar. */
.seat {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.seat:last-of-type { border-bottom: 0; }
.seat .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.seat .who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .who span { font-size: 12px; color: var(--muted); }
.seat .stone-dot {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1px solid #56524d;
}
.seat .stone-dot.black { background: radial-gradient(circle at 34% 30%, #4a4a4a, #0c0c0c 68%); }
.seat .stone-dot.white { background: radial-gradient(circle at 34% 30%, #fff, #cec9bf 72%); }
.seat.turn { background: rgba(255,255,255,.05); box-shadow: inset 3px 0 0 var(--hot); }
/* Whose turn it is must not rely on a background tint alone. */
.turnflag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #ff8b9d;
  background: var(--hot-wash);
  border-radius: 4px;
  padding: 3px 7px;
  margin-left: 8px;
}
.seat .clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 21px;
  background: #211f1d;
  border-radius: 6px;
  padding: 6px 12px;
  min-width: 92px;
  text-align: center;
  color: #d8d4ce;
}
.seat.turn .clock { background: #f0ece4; color: #1d1c1a; }
.seat .clock.low { color: #f08d89; }
.seat.turn .clock.low { background: #f3d6d4; color: #8a1f1c; }
.seat .caps { margin-left: auto; font-size: 12px; color: var(--muted); }

.movelist {
  max-height: 250px;
  overflow-y: auto;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 30px repeat(2, minmax(0, 66px));
  justify-content: start;
  gap: 2px 8px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.movelist .n { color: var(--muted-2); }
.movelist .mv {
  padding: 2px 6px;
  border-radius: 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
}
.movelist button.mv { cursor: pointer; }
.movelist button.mv:hover { background: var(--panel-3); }
.movelist .mv.current { background: var(--panel-3); color: #fff; font-weight: 700; }
.movelist-empty { padding: 18px; color: var(--muted); font-size: 13px; text-align: center; }

.game-actions { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.game-actions .btn { flex: 1; min-width: 96px; }

.scoring-note {
  padding: 12px 14px;
  background: rgba(226,176,74,.1);
  border-top: 1px solid rgba(226,176,74,.3);
  color: #f0d9a8;
  font-size: 13px;
}

/* The result is the only thing anyone screenshots, so the score is the object
   on the page and the sentence around it is the caption. */
.result-banner {
  padding: 22px 14px 18px;
  background: var(--bg-deep);
  border-bottom: 3px solid var(--hot);
}
.result-banner .headline {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-banner .score {
  display: block;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -3px;
  line-height: .92;
  margin: 6px 0 2px;
  color: var(--hot);
  font-variant-numeric: tabular-nums;
}
.result-banner .detail { color: var(--muted); font-size: 13px; }
.result-banner .deltas {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.viewer-controls { display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); }
.viewer-controls button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line-control);
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 8px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.viewer-controls button svg { width: 18px; height: 18px; }
.viewer-controls button:hover { background: var(--panel-3); }

.watchers { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- profile */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 22px; flex-wrap: wrap; }
.profile-head .ident { display: flex; flex-direction: column; gap: 4px; }
.profile-head h1 { margin: 0; font-size: 28px; }
.profile-head .subline { color: var(--muted); font-size: 13px; }
.profile-metrics { margin-left: auto; display: flex; gap: 26px; flex-wrap: wrap; }
.metric { display: flex; flex-direction: column; }
.metric b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Not uppercased: it would render a kyu rank as "13K", which is not a rank. */
.metric span { color: var(--muted); font-size: 12px; letter-spacing: .3px; }
/* One number leads; the other ladders are supporting detail. */
.metric.lead b { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.05; }
.metric.lead span { color: var(--muted); }

.record-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #3a3734; margin-top: 8px; width: 190px; }
.record-bar i { display: block; height: 100%; }
.record-bar i.w { background: var(--win); }
.record-bar i.l { background: var(--loss); }
.record-bar i.d { background: var(--draw); }

.chart-holder { padding: 8px 14px 14px; position: relative; }
.chart-holder svg { width: 100%; height: 150px; display: block; }
.chart-holder .axis {
  position: absolute;
  left: 20px;
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.chart-holder .axis.hi { top: 10px; }
.chart-holder .axis.lo { bottom: 18px; }

/* ---------------------------------------------------------------- misc */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
  background: #201f1d;
  border: 1px solid var(--line);
  border-left: 3px solid var(--hot);
  padding: 11px 16px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: rise .18s ease;
}
.toast.bad { border-left-color: var(--loss); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.sitefoot {
  border-top: 1px solid #232220;
  padding: 16px 18px;
  color: var(--muted-2);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.loading { padding: 60px; text-align: center; color: var(--muted); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; z-index: 80; padding: 20px;
}
.modal { max-width: 400px; width: 100%; }
.modal h2 { margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal .row { display: flex; gap: 10px; }
.recovery-code {
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-control);
  background: #191816;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 26px; }
  .hero h1 { font-size: 36px; letter-spacing: -1px; }
  .hero-board { order: -1; }
  .game-layout { grid-template-columns: 1fr; }
  .board-holder { width: 100%; }
  .lobby-grid { grid-template-columns: 1fr; }
  .computer-grid { grid-template-columns: 1fr; }
  .computer-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-row { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar-inner { gap: 10px; padding: 0 12px; }
  .topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 8px 10px; }
  .topbar-right .btn { padding-left: 10px; padding-right: 10px; }
  .brand-text b { display: none; }
  .wrap { padding: 16px 12px 30px; }
  .profile-metrics { margin-left: 0; gap: 18px; }
  .pagehead h1 { font-size: 22px; }
  .tc-list { grid-template-columns: 1fr; }
  .computer-levels { grid-template-columns: 1fr; }
  .computer-level { min-height: 0; }
  /* Secondary columns are dropped rather than pushed off the screen. */
  table.tbl th.optional, table.tbl td.optional { display: none; }
  .sitefoot { flex-direction: column; gap: 4px; }
}

/* Motion is toned down for reduce, not removed: a still spinner reads as a
   hung page. */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: breathe 2s ease-in-out infinite alternate;
    border-top-color: #cfe4f6;
  }
  @keyframes breathe { from { opacity: .35; } to { opacity: 1; } }
  .toast { animation-duration: .01ms; }
  .btn { transition: none; }
}
