/* pool — phone first; the table is the screen.
 *
 * Minesweeper's house look (one glass recipe, gold means YOU, light is the
 * base and dark a token swap in two guarded blocks), on a ground tinted like
 * a pool hall's baize. The table itself is drawn on a canvas (render.js) and
 * keeps its own colours in both themes, as a real table would.
 *
 * THE SHELL (IOS.md §15, gems' and bubbles' shape): the home and the menu are
 * in-flow content and the document is their one scroller; the table LOCKS the
 * page (html.locked) while it shows and the menu is closed. Insets go on
 * padding, always with a 0px fallback.
 */

:root {
  --bg:       #e3e8e2;
  --panel:    #ffffff;
  --glass:    rgba(255, 255, 255, .80);
  --glass-2:  rgba(255, 255, 255, .55);
  --line:     rgba(60, 60, 67, .16);
  --line-2:   rgba(60, 60, 67, .08);
  --ink:      #000000;
  --ink-2:    #3c3c43;
  --dim:      #85898a;
  --dim-2:    #b0b4b2;
  --pill:     #eceeec;
  --good:     #1a9e4b;
  --warn:     #b8730a;
  --bad:      #e5322b;
  --link:     #007aff;
  --heart:    #e0596e;
  --gold:     #d9a520;
  --gold-lit: #ffd45c;
  --gold-ink: #1a1200;
  --felt:     #1f7a4a;
  --shadow:   0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --r-card: 18px; --r-mid: 14px; --r-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-num: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --glass-t: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1310; --panel: #1c1c1e; --glass: rgba(28, 30, 29, .86); --glass-2: rgba(44, 46, 45, .75);
    --line: rgba(84, 88, 86, .5); --line-2: rgba(84, 88, 86, .28); --ink: #ffffff; --ink-2: #ebebf5;
    --dim: #8e938f; --dim-2: #636866; --pill: #2a2d2b; --good: #30d158; --warn: #ffd60a; --bad: #ff453a;
    --link: #0a84ff; --gold: #e8c05a; --gold-lit: #ffd77a;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1310; --panel: #1c1c1e; --glass: rgba(28, 30, 29, .86); --glass-2: rgba(44, 46, 45, .75);
  --line: rgba(84, 88, 86, .5); --line-2: rgba(84, 88, 86, .28); --ink: #ffffff; --ink-2: #ebebf5;
  --dim: #8e938f; --dim-2: #636866; --pill: #2a2d2b; --good: #30d158; --warn: #ffd60a; --bad: #ff453a;
  --link: #0a84ff; --gold: #e8c05a; --gold-lit: #ffd77a;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
/* No double-tap zoom anywhere (IOS.md §27): touch-action is not inherited. */
*, *::before, *::after { touch-action: manipulation; }
[hidden] { display: none !important; }
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

html, body {
  margin: 0; min-height: 100%;
  font-family: var(--font); color: var(--ink); background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
input, textarea { -webkit-user-select: text; user-select: text; }

.card, .signin-card, .mode-card, .overlay-card, .banner, .icon, .btn, .board-list, .spin-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: .5px solid var(--line);
  box-shadow: var(--shadow);
}

/* ── the shell ── */
html.locked, html.locked body { height: 100%; min-height: 0; overflow: hidden; overscroll-behavior: none; }
html.locked main { height: 100%; }
.view {
  padding: calc(8px + var(--glass-t) + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin: 0 auto;
}
.view[hidden] { display: none !important; }
body:has(#sheet-menu:not([hidden])) main { visibility: hidden; position: fixed; inset: 0; height: auto; }

.view-head { padding: 12px 4px 18px; }
.view-head.bar { display: flex; align-items: center; gap: 10px; }
.bar-title { flex: 1; min-width: 0; }
.view-head h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.6px; }
.view-sub { margin: 4px 0 0; color: var(--dim); font-size: 15px; }

.card { border-radius: var(--r-card); padding: 16px; margin: 0 0 14px; }
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 650; }
.card.rows { padding: 0 16px; }
.fine { margin: 12px 6px 0; color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.fine.in-card { margin-left: 0; margin-right: 0; }
.fine.version { font-family: var(--font-num); }

.btn {
  font: inherit; font-size: 16px; font-weight: 600; padding: 12px 18px;
  border-radius: var(--r-mid); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { opacity: .7; }
.btn-primary { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.btn-quiet { background: transparent; color: var(--link); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; }
.btn-wide { display: flex; width: 100%; margin-top: 18px; }
.btn-small { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: default; }
.icon {
  font: inherit; font-size: 20px; line-height: 0;
  width: 40px; height: 40px; border-radius: 20px;
  display: grid; place-items: center; color: var(--ink); cursor: pointer; flex: none; padding: 0;
}
.icon:active { opacity: .7; }
.pill {
  display: block; width: 100%; margin: 0 0 12px; font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 10px 14px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--link) 12%, var(--panel)); color: var(--link); cursor: pointer;
}

/* ── the door ── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.signin-card { max-width: 340px; width: 100%; text-align: center; padding: 26px 22px 22px; border-radius: var(--r-card); }
.signin-card h1 { margin: 14px 0 6px; font-size: 30px; letter-spacing: -.03em; }
.signin-card .lede { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.signin-card .btn-wide { margin-top: 0; }
.brand { display: block; width: 88px; height: 88px; margin: 0 auto; border-radius: 22.5%; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.gate-msg {
  margin: 0 0 18px; padding: 11px 13px; border-radius: var(--r-mid);
  background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn);
  font-size: 13px; line-height: 1.45; text-align: left;
}

/* ── home ── */
.mode-cards { display: grid; gap: 12px; }
.mode-card {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left;
  font: inherit; color: inherit; cursor: pointer; padding: 16px; border-radius: var(--r-card);
}
.mode-card:active { background: var(--glass-2); }
.mode-card.daily { box-shadow: var(--shadow), inset 3px 0 0 var(--gold); }
.mode-card.resume { box-shadow: var(--shadow), inset 3px 0 0 var(--felt); }
.mode-body { flex: 1; min-width: 0; }
.mode-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mode-card h3 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.mode-card .tag { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.mode-card .blurb { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.mode-thumb { flex: none; width: 54px; height: 54px; }
.mode-thumb svg { width: 100%; height: 100%; display: block; }
.mode-stats { display: flex; gap: 18px; margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--line-2); }
.mode-stats div { display: flex; flex-direction: column; gap: 1px; }
.mode-stats .v { font-family: var(--font-num); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mode-stats .v.none { color: var(--dim-2); }
.mode-stats .v.you { color: var(--gold); }
.mode-stats .k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .4px; }
.levels { display: flex; gap: 6px; margin-top: 10px; }
.levels button {
  flex: 1; font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 6px;
  border-radius: 10px; border: .5px solid var(--line); background: var(--glass-2); color: var(--ink); cursor: pointer;
}
.levels button.is-on { background: var(--gold); color: var(--gold-ink); border-color: transparent; }

/* ── the table screen ── */
#view-game {
  height: 100%; max-width: none;
  display: flex; flex-direction: column; overflow: hidden;
  /* IOS.md §1: iOS blurs ~20px past the status bar, so the header starts below
     that band too. The glass is added only where there IS a status bar (the min
     is 0 when the inset is 0 — a landscape phone, a desktop), so a sideways table
     loses nothing. */
  padding: calc(6px + env(safe-area-inset-top, 0px) + min(var(--glass-t), env(safe-area-inset-top, 0px) * 100)) calc(10px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(10px + env(safe-area-inset-left, 0px));
}
/* THE ROOM (pool-v8): the table stands in a dim hall under a lamp, as solitaire's
   cards lie on felt and dice roll on wine — the play screen wears its game's own
   ground in both themes, and the header and controls are light on it. */
:root { --room-1: #3a4a42; --room-2: #18211d; --room-ink: #f2f7f3; --room-dim: rgba(242, 247, 243, .62); --room-line: rgba(255, 255, 255, .2); --room-glass: rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --room-1: #24302a; --room-2: #0a0f0c; } }
:root[data-theme="dark"] { --room-1: #24302a; --room-2: #0a0f0c; }
html.locked, html.locked body { background-color: var(--room-2); }
#view-game { background: radial-gradient(ellipse 85% 60% at 50% 45%, var(--room-1), var(--room-2)); color: var(--room-ink); }
#view-game .game-stat-k { color: var(--room-dim); }
#view-game .icon, #view-game .spin-btn, #view-game .power, #view-game .vs-side {
  background: var(--room-glass); color: var(--room-ink); border-color: var(--room-line); box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
#view-game .power-label { color: var(--room-dim); }
#view-game .power.live .power-label { color: var(--room-ink); }
#view-game .fine-aim { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18); }
#view-game .chip { box-shadow: inset -1px -1px 2px rgba(0,0,0,.35), 0 0 0 .5px rgba(255,255,255,.18); }
#view-game .tray .chip.next { box-shadow: 0 0 0 2px var(--gold), inset -1px -1px 2px rgba(0,0,0,.35); }
#view-game .chip[title="8"] { box-shadow: inset -1px -1px 2px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.4); }
.game-head { display: flex; align-items: center; gap: 8px; padding: 4px 0 6px; max-width: 760px; width: 100%; margin: 0 auto; }
.game-status { flex: 1; display: flex; justify-content: center; gap: 26px; }
.game-stat { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.game-stat-v { font-family: var(--font-num); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.game-stat-k { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.vs { flex: 1; display: flex; gap: 8px; min-width: 0; }
.vs-side {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 5px 8px;
  border-radius: 12px; border: .5px solid var(--line-2); background: var(--glass-2);
}
.vs-side.turn { border-color: transparent; box-shadow: inset 0 0 0 2px var(--gold); }
.vs-name { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-balls { display: flex; gap: 2px; min-height: 12px; flex-wrap: wrap; }
.chip { width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative; box-shadow: inset -1px -1px 2px rgba(0,0,0,.35), 0 0 0 .5px var(--line); }
.chip.stripe { background: #f4f1e8 !important; overflow: hidden; }
.chip.stripe::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; bottom: 3px; background: var(--c); }
.chip.gone { opacity: .22; }

.sound-btn .snd-off { display: none; }
.sound-btn[aria-pressed="false"] .snd-on { display: none; }
.sound-btn[aria-pressed="false"] .snd-off { display: inline; }
.sound-btn[aria-pressed="false"] { opacity: .72; }

.stage-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 760px; margin: 0 auto; }
.stage { position: relative; flex: 1; min-height: 0; }
.stage canvas { position: absolute; left: 0; top: 0; touch-action: none; display: block; }
.side { display: flex; flex-direction: column; gap: 8px; flex: none; }

.tray { display: flex; justify-content: center; gap: 4px; min-height: 18px; flex-wrap: wrap; }
.tray .chip { width: 16px; height: 16px; }
.tray .chip.stripe::after { top: 4px; bottom: 4px; }
.tray .chip.next { box-shadow: 0 0 0 2px var(--gold), inset -1px -1px 2px rgba(0,0,0,.35); }
.chip[title="8"] { box-shadow: inset -1px -1px 2px rgba(0,0,0,.35), 0 0 0 1px var(--dim-2); }

.controls { display: flex; gap: 8px; align-items: stretch; height: 52px; }
.spin-btn {
  flex: none; width: 52px; border-radius: 14px; padding: 0; cursor: pointer;
  border: .5px solid var(--line); background: var(--glass); box-shadow: var(--shadow); display: grid; place-items: center;
}
.spin-ball, .spin-big {
  position: relative; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #ffffff 0%, #f1ede2 45%, #c9c3b4 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.spin-ball { width: 32px; height: 32px; }
.spin-dot, .spin-big-dot {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #d22; left: 50%; top: 50%; box-shadow: 0 0 0 1.5px rgba(255,255,255,.8);
}
.fine-aim {
  flex: none; width: 64px; border-radius: 14px; overflow: hidden; position: relative; cursor: ew-resize;
  background: linear-gradient(90deg, #3a2a1c, #6b4a2e 50%, #3a2a1c); box-shadow: var(--shadow), inset 0 0 0 .5px rgba(0,0,0,.3);
  touch-action: none;
}
.fine-ticks {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,235,200,.0) 0 5px, rgba(255,235,200,.35) 5px 6px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
  mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}
.power {
  flex: 1; position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; touch-action: none;
  background: var(--glass); border: .5px solid var(--line); box-shadow: var(--shadow);
}
.power-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, #3fbf6a, #e8c05a 55%, #e5532b);
}
.power-label {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 14px; font-weight: 600; color: var(--dim); letter-spacing: .2px;
}
.power.live .power-label { color: var(--ink); }
.controls.off .power, .controls.off .fine-aim, .controls.off .spin-btn { opacity: .4; pointer-events: none; }

/* Sideways (a phone on its side, or a wide window): the table takes the width,
   the controls stand up on the right. */
#view-game.wide .stage-wrap { flex-direction: row; max-width: none; }
#view-game.wide .side { width: 76px; }
#view-game.wide .tray { display: grid; grid-template-columns: repeat(4, 14px); gap: 3px; justify-content: center; min-height: 0; }
#view-game.wide .tray .chip { width: 14px; height: 14px; }
#view-game.wide .tray .chip.stripe::after { top: 3.5px; bottom: 3.5px; }
#view-game.wide .game-head { padding: 0 0 4px; }
#view-game.wide .game-head .icon { width: 36px; height: 36px; }
#view-game.wide .spin-btn { height: 46px !important; }
#view-game.wide .fine-aim { height: 54px !important; }
#view-game.wide .controls { min-height: 0; }
#view-game.wide .side { min-height: 0; }
#view-game.wide .controls { flex-direction: column; height: auto; flex: 1; width: 76px; }
#view-game.wide .spin-btn { width: 76px; height: 52px; }
#view-game.wide .fine-aim { width: 76px; height: 64px; cursor: ns-resize; background: linear-gradient(180deg, #3a2a1c, #6b4a2e 50%, #3a2a1c); }
#view-game.wide .fine-ticks { background: repeating-linear-gradient(180deg, rgba(255,235,200,0) 0 5px, rgba(255,235,200,.35) 5px 6px);
  -webkit-mask: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
#view-game.wide .power { flex: 1; }
#view-game.wide .power-fill { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 0;
  background: linear-gradient(180deg, #3fbf6a, #e8c05a 55%, #e5532b); }
#view-game.wide .power-label { writing-mode: vertical-rl; }
#view-game.wide .game-head { max-width: none; }

.game-note {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 2;
  margin: 0; padding: 8px 14px; border-radius: 999px; max-width: calc(100% - 24px);
  background: var(--glass); -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  border: .5px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.35; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.game-note.show { opacity: 1; }
.game-note.warn { color: var(--warn); }
.thinking {
  position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; padding: 8px 10px; border-radius: 999px;
  background: rgba(0,0,0,.45);
}
.thinking span { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: think 1s infinite ease-in-out; }
.thinking span:nth-child(2) { animation-delay: .15s; }
.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.spin-pop { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(0,0,0,.28); }
.spin-card { padding: 20px; border-radius: var(--r-card); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.spin-big { width: 200px; height: 200px; touch-action: none; cursor: crosshair; }
.spin-big-dot { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.spin-cross { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.12), rgba(0,0,0,.12)) center/1px 70% no-repeat, linear-gradient(90deg, rgba(0,0,0,.12), rgba(0,0,0,.12)) center/70% 1px no-repeat; }
.spin-big::after { content: ""; position: absolute; inset: 25%; border-radius: 50%; border: 1px dashed rgba(0,0,0,.18); pointer-events: none; }
.spin-btns { display: flex; gap: 10px; }

/* ── the end of a rack ── */
.overlay {
  position: fixed; inset: 0; z-index: 5; display: grid; place-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.overlay-card { width: min(320px, 90%); padding: 24px 20px; text-align: center; border-radius: var(--r-card); }
.overlay-mark { font-size: 46px; line-height: 1; display: flex; justify-content: center; }
.overlay-mark svg { width: 52px; height: 52px; }
.overlay-card h2 { margin: 12px 0 4px; font-size: 24px; letter-spacing: -.4px; }
.overlay-line { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }
.overlay-stats { display: flex; justify-content: center; gap: 22px; margin: 18px 0 0; padding: 14px 0 0; border-top: .5px solid var(--line-2); }
.overlay-stats div { display: flex; flex-direction: column; gap: 2px; }
.overlay-stats dt { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .4px; order: 2; }
.overlay-stats dd { margin: 0; font-family: var(--font-num); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; order: 1; }
.overlay-submit { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--dim); min-height: 17px; }
.overlay-submit.bad { color: var(--warn); }
.overlay-submit.good { color: var(--good); }
.overlay-btns { display: flex; gap: 10px; margin-top: 18px; }
.overlay-btns .btn { flex: 1; padding-left: 10px; padding-right: 10px; }
.look-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 4; }

/* ── the menu ── */
.segmented { display: flex; gap: 3px; padding: 3px; background: var(--glass-2); border-radius: var(--r-sm); border: .5px solid var(--line-2); }
.segmented button {
  flex: 1; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 6px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.segmented button[aria-selected="true"], .segmented button.is-on { background: var(--gold); color: var(--gold-ink); box-shadow: var(--shadow); }
.segmented.seg-sm { flex: none; }
.segmented.seg-sm button { flex: none; font-size: 13px; padding: 6px 11px; }
h3.board-sec { margin: 18px 6px 8px; font-size: 13px; font-weight: 650; color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.board-list { margin-top: 0; padding: 0; overflow: hidden; border-radius: var(--r-card); }
.board-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: .5px solid var(--line-2); }
.board-row:last-child { border-bottom: 0; }
.board-row.you { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.board-rank { width: 26px; flex: none; text-align: right; font-family: var(--font-num); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--dim); }
.board-row.you .board-rank { color: var(--gold); }
.board-who { flex: 1; min-width: 0; }
.board-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-meta { font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.board-score { font-family: var(--font-num); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board-empty { padding: 26px 20px; text-align: center; color: var(--dim); font-size: 14px; }
.board-you { margin: 8px 6px 0; }

.rows > .row, .rows > div > .row { padding: 13px 0; border-bottom: .5px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rows > .row:last-child, .rows > div > .row:last-child { border-bottom: 0; }
.rows > .row.row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.row-head { display: flex; align-items: center; justify-content: space-between; }
.row-k { font-size: 15px; font-weight: 500; }
.row-v { font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; }
.row-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--dim); }
.rows > button.row-tap {
  appearance: none; -webkit-appearance: none; width: 100%; background: none; border: 0;
  border-bottom: 1px solid var(--line-2); font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.rows > button.row-tap:active { background: var(--pill); }
.row-tap .chev { color: var(--dim); font-size: 22px; line-height: 1; margin-top: -2px; }

.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--pill); transition: background .2s ease; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }

.prose p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.howto { padding: 4px 16px 16px; border-top: .5px solid var(--line-2); }
.howto p:first-child { margin-top: 12px; }
.update-note { color: var(--warn) !important; }

.sheet { position: relative; z-index: 30; }
.sheet-body {
  padding: calc(8px + var(--glass-t) + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  max-width: 560px; width: 100%; margin: 0 auto;
}
.sheet-body > .view-head { padding-bottom: 4px; }
h2.sec { margin: 26px 4px 10px; font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.sheet-body section:first-of-type h2.sec { margin-top: 14px; }

#tipjar-card { margin-top: 14px; }
#tipjar .tip-glyph { color: var(--heart); font-size: 18px; line-height: 1; margin-right: 2px; }
#tipjar .row-k { flex: 1; }
:root { --games-gold: #c48a12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --games-gold: #f2b93a; } }
:root[data-theme="dark"] { --games-gold: #f2b93a; }
#games-card { margin-top: 14px; }
#games-row { padding: 12px 0; }
.games-lockup { flex: none; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1; font-family: "SF Pro Rounded", ui-rounded, var(--font); font-weight: 700; }
.games-lockup .gl-mark { font-size: 22px; letter-spacing: -0.01em; color: var(--ink); }
.games-lockup .gl-ca { color: var(--dim); }
.games-lockup .gl-sub { font-size: 10px; letter-spacing: .02em; color: var(--games-gold); margin-top: -1px; margin-right: 1px; }
#games-row .games-more { flex: 1; text-align: right; color: var(--dim); font-weight: 400; }
#account-card { padding: 16px 16px 0; }
#account-card #account-who { margin: 0 0 12px; }
#account-card .rows { margin: 0 -16px; }
#account-card .rows > button.row-tap { padding: 13px 16px; border-bottom: 0; border-top: .5px solid var(--line-2); }
.rows > button.row-tap.danger { color: var(--bad); }
details.technical { padding: 0; overflow: hidden; }
details.technical > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; }
details.technical > summary::-webkit-details-marker { display: none; }
details.technical > summary .chev { color: var(--dim); font-size: 22px; line-height: 1; margin-top: -2px; transition: transform .15s; }
details.technical[open] > summary .chev { transform: rotate(90deg); }
details.technical .kv { margin: 0; padding: 4px 16px 12px; border-top: .5px solid var(--line-2); }
details.technical .kv > div { display: flex; gap: 12px; padding: 8px 0; border-bottom: .5px solid var(--line-2); }
details.technical .kv > div:last-child { border-bottom: 0; }
details.technical .kv dt { flex: 0 0 76px; font-size: 13px; color: var(--dim); }
details.technical .kv dd { margin: 0; flex: 1; min-width: 0; font-size: 12px; font-family: var(--font-mono); color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
details.technical > .row-note { padding: 0 16px 14px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  max-width: min(92vw, 420px); padding: 10px 14px; border-radius: 14px;
  background: var(--glass); -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  border: .5px solid var(--line); box-shadow: var(--shadow); color: var(--ink); font-size: 14px; line-height: 1.4; text-align: center;
}
.banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-mid);
  font-size: 13.5px; line-height: 1.45; z-index: 20;
}
.banner .banner-retry { margin-left: auto; padding: 6px 13px; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; border: 0; border-radius: 999px; background: var(--gold); color: var(--gold-ink); cursor: pointer; }
.banner button { margin-left: auto; flex: none; font: inherit; font-size: 20px; line-height: 1; border: 0; background: transparent; color: inherit; cursor: pointer; }
.banner .banner-retry + button { margin-left: 4px; }
