/* Wiki Bingo. Colours and type follow Wikipedia's Vector skin and its night mode. */
:root {
  --bg: #fff; --bg2: #f8f9fa; --bg3: #eaecf0; --ink: #202122; --ink2: #54595d; --ink3: #72777d;
  --line: #a2a9b1; --line2: #c8ccd1; --line3: #eaecf0; --link: #36c; --on-link: #fff;
  --red: #bf3c2c; --red-bg: #ffe9e5; --yellow: #886425; --yellow-bg: #fdf2d5; --green: #177860; --green-bg: #dff2eb;
  --serif: 'Linux Libertine', Georgia, Times, 'Source Serif Pro', serif;
  --sans: sans-serif;
  --img-invert: none; --on-inline: inherit; --link-on-inline: var(--link);
  --bar-h: 62px; --foot-h: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  /* Wikipedia's own tokens, used by the styles inside articles */
  --color-base: var(--ink); --color-emphasized: var(--ink); --color-subtle: var(--ink2);
  --color-progressive: var(--link); --background-color-base: var(--bg);
  --background-color-neutral: var(--bg3); --background-color-neutral-subtle: var(--bg2);
  --background-color-interactive: var(--bg3); --background-color-interactive-subtle: var(--bg2);
  --border-color-base: var(--line); --border-color-subtle: var(--line2); --border-color-muted: var(--line3);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #101418; --bg2: #202122; --bg3: #27292d; --ink: #eaecf0; --ink2: #a2a9b1; --ink3: #8d9299;
  --line: #72777d; --line2: #54595d; --line3: #303338; --link: #88a3e8; --on-link: #101418;
  --red: #fd7865; --red-bg: #3c2525; --yellow: #d9b566; --yellow-bg: #362c15; --green: #5dc9a5; --green-bg: #17302a;
  --img-invert: invert(1) hue-rotate(180deg); --on-inline: #202122; --link-on-inline: #2a4b8d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h2 { font-size: 22px; line-height: 1.3; border-bottom: 1px solid var(--line); margin: 0 0 10px; padding-bottom: 2px; }
.muted { color: var(--ink2); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* buttons */
.btn { appearance: none; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); border-radius: 2px; padding: 5px 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; text-decoration: none; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:active { background: var(--bg3); }
.btn.primary { background: var(--link); border-color: var(--link); color: var(--on-link); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--red); }
.btn.big { min-height: 44px; font-size: 16px; width: 100%; }
.btn.sm { min-height: 28px; padding: 2px 8px; font-size: 13px; font-weight: 400; }
.btn:disabled { color: var(--ink3); background: var(--bg3); border-color: var(--line2); cursor: default; }
.linkbtn { appearance: none; border: 0; background: none; color: var(--link); cursor: pointer; padding: 2px 4px; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px 14px; border-bottom: 1px solid var(--line2); }
.tabs button { appearance: none; border: 0; border-bottom: 2px solid transparent; background: none; padding: 4px 1px; cursor: pointer; color: var(--link); margin-bottom: -1px; }
.tabs button:hover { text-decoration: underline; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
input[type=text], input[type=search], input:not([type]), textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 2px; padding: 6px 8px; outline: none; color: var(--ink); }
input:focus, textarea:focus { border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
label { display: block; font-weight: 700; font-size: 13px; }
label > input, label > textarea { margin-top: 3px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; font-size: 14px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--link); }
.spin { width: 12px; height: 12px; border: 2px solid var(--line); border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -1px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.box { border: 1px solid var(--line2); background: var(--bg2); padding: 10px 12px; }
.note { border: 1px solid var(--yellow); background: var(--yellow-bg); color: var(--ink); padding: 6px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* light and dark switch */
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: var(--ink2); cursor: pointer; white-space: nowrap; position: relative; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch i { width: 34px; height: 18px; border: 1px solid var(--line); background: var(--bg3); position: relative; flex: none; border-radius: 9px; }
.switch i::after { content: ""; position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 50%; transition: transform .12s; }
.switch input:checked + i { background: var(--link); border-color: var(--link); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--link); outline-offset: 1px; }

/* wordmark */
.brand { display: inline-block; color: var(--ink); line-height: 1; }
.brand:hover { text-decoration: none; }
.brand b { display: block; font: 400 21px/1 var(--serif); letter-spacing: .02em; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 40; min-height: calc(var(--bar-h) + var(--safe-t)); padding: var(--safe-t) 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; background: var(--bg); border-bottom: 1px solid var(--line3); }
.bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.bar-title { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-dot { width: 8px; height: 8px; background: var(--green); flex: none; border-radius: 50%; }
.conn-dot.off { background: var(--red); }
.clock { font: 700 44px/1 var(--sans); font-variant-numeric: tabular-nums; padding: 5px 16px; text-align: center; min-width: 124px; letter-spacing: .01em; }
.clock.up { color: var(--ink2); font-size: 26px; font-weight: 400; }
.clock.low { background: var(--red-bg); color: var(--red); }
.clock.crit { background: var(--red); color: #fff; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: .6; } }
.clock-bar { height: 7px; background: var(--bg3); position: sticky; top: calc(var(--bar-h) + var(--safe-t)); z-index: 39; }
.clock-bar i { display: block; height: 100%; background: var(--ink); transition: width .25s linear; }
.clock-bar i.low { background: var(--red); }
.final { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none; font: 700 min(46vw, 320px)/1 var(--sans); color: var(--red); opacity: .28; font-variant-numeric: tabular-nums; }
.mini { appearance: none; border: 1px solid var(--line2); background: var(--bg); padding: 4px; cursor: pointer; display: none; flex: none; }
.mini-g { display: grid; gap: 1px; }
.mini i { display: block; background: var(--line3); aspect-ratio: 1; }
.mini i.here { outline: 1px solid var(--ink); }

/* home */
.bd-row { display: flex; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line3); flex-wrap: wrap; }
.bd-row .grow { min-width: 200px; }
.page { max-width: 960px; margin: 0 auto; padding: 16px; }
.welcome { text-align: center; padding: 16px; margin-bottom: 14px; }
.welcome h1 { font-size: 30px; margin: 0 0 4px; }
.welcome p { margin: 0; color: var(--ink2); }
.mp { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.mp-box { border: 1px solid var(--line2); }
.mp-box > h2 { font: 700 15px var(--sans); background: var(--bg3); margin: 0; padding: 4px 10px; border-bottom: 1px solid var(--line2); }
.mp-box > .in { padding: 10px; display: grid; gap: 10px; align-content: start; }
.mp-box ol { margin: 0; padding-left: 22px; }
.mp-box li { margin-bottom: 3px; }
.recent { margin: 12px 0; font-size: 13px; }
.center-page { max-width: 420px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 12px; }
.center-page h1 { font-size: 26px; margin: 0; border-bottom: 1px solid var(--line); }
.code-big { font: 700 34px/1 var(--sans); letter-spacing: 5px; }

/* board */
.board { --n: 4; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cell { appearance: none; position: relative; aspect-ratio: 1; border: 0; background: var(--bg); padding: 4px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; text-align: center; overflow: hidden; cursor: pointer; color: var(--link); min-width: 0; }
.cell:hover { background: var(--bg2); }
.cell .t { font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.board.n2 .cell .t { font-size: 17px; } .board.n3 .cell .t { font-size: 15px; } .board.n5 .cell .t { font-size: 12px; } .board.n6 .cell .t { font-size: 11px; -webkit-line-clamp: 3; }
.cell .who { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell img { width: 44px; height: 44px; object-fit: cover; flex: none; }
.board.n5 .cell img, .board.n6 .cell img { display: none; }
.cell.claimed, .cell.claimed:hover { background: var(--pc); color: #fff; }
.cell.mine::after { content: ""; position: absolute; inset: 2px; border: 2px solid #fff; pointer-events: none; }
.cell.here { box-shadow: inset 0 0 0 2px var(--ink); }
.cell.win { box-shadow: inset 0 0 0 4px var(--ink); }
.cell.empty { color: var(--ink2); background: var(--bg2); }
.cell.hidden { background: var(--bg3); cursor: default; }
.cell .x { position: absolute; top: 0; right: 0; width: 22px; height: 22px; background: var(--bg3); color: var(--ink); font-size: 14px; line-height: 22px; cursor: pointer; }
.cell .chk { font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell .chk.easy { color: var(--green); } .cell .chk.medium { color: var(--yellow); } .cell .chk.hard, .cell .chk.nf { color: var(--red); }

/* players */
.plist { display: grid; }
.prow { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line3); min-width: 0; }
.prow.click { cursor: pointer; }
.prow.click:hover .nm { text-decoration: underline; }
.prow.on .nm { font-weight: 700; }
.sw { width: 12px; height: 12px; flex: none; display: inline-block; }
.sw.off { opacity: .3; }
.prow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pg { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .sc { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; }
.prow .sc small { display: block; font-size: 11px; color: var(--ink2); font-weight: 400; }
.prow .kick { border: 0; background: none; color: var(--ink2); cursor: pointer; font-size: 16px; padding: 0 4px; }
.tag { font-size: 11px; color: var(--ink2); flex: none; }
.tag.stuck { color: var(--red); font-weight: 700; }

/* lobby */
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; max-width: 1140px; margin: 0 auto; padding: 16px 16px calc(40px + var(--safe-b)); align-items: start; }
.lobby-main, .lobby-side { display: grid; gap: 22px; min-width: 0; }
.lobby-side { position: sticky; top: calc(var(--bar-h) + var(--safe-t) + 12px); }
.picker { position: relative; }
.pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 1px); background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 2px rgba(0, 0, 0, .2); max-height: 340px; overflow-y: auto; }
.modal .pick-list, .browse-bar .pick-list { max-height: min(56vh, 460px); }
.modal .pick-list { position: static; border-top: 0; box-shadow: none; max-height: none; }
.pick-item { display: flex; gap: 8px; align-items: center; padding: 5px 8px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; color: var(--ink); }
.pick-item.act, .pick-item:hover { background: var(--bg3); }
.pick-item img, .pick-item .noimg { width: 36px; height: 36px; object-fit: cover; flex: none; background: var(--bg3); }
.pick-item .pt { font-weight: 700; }
.pick-item .pd { font-size: 12px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.page-card { display: flex; gap: 10px; align-items: center; padding: 8px; margin-top: 8px; border: 1px solid var(--line2); background: var(--bg2); }
.page-card img { width: 50px; height: 50px; object-fit: cover; flex: none; }
.page-card .pt { font: 400 18px var(--serif); }
.opts { display: grid; gap: 12px; }
.opt-row > .lbl { font-weight: 700; display: block; margin-bottom: 2px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.scan { font-size: 13px; color: var(--ink2); margin: 8px 0; display: flex; gap: 8px; align-items: center; }
.prog { height: 4px; background: var(--bg3); flex: 1; max-width: 200px; }
.prog i { display: block; height: 100%; background: var(--ink2); transition: width .3s; }
.summary { margin-top: 8px; font-size: 13px; color: var(--ink2); }
.infobox-side { border: 1px solid var(--line2); background: var(--bg2); padding: 8px 10px; text-align: center; }
.infobox-side .ttl { font-weight: 700; background: var(--bg3); margin: -8px -10px 8px; padding: 3px; }
.infobox-side .link { font-size: 12px; color: var(--ink2); word-break: break-all; margin: 6px 0; }
.qr { margin: 8px auto 4px; width: 148px; height: 148px; background: #fff; padding: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.swatch { width: 28px; height: 28px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.swatch:disabled { opacity: .2; cursor: default; }
.why { font-size: 13px; color: var(--ink2); text-align: center; margin-top: 4px; }

/* playing */
.play { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 28px; padding: 16px 20px calc(var(--foot-h) + 24px + var(--safe-b)); align-items: start; }
.play.wallmode { grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; padding: 10px 14px; }
.play.wallmode .toc { display: none; }
.stage { min-width: 0; }
.toc, .side { position: sticky; top: calc(var(--bar-h) + var(--safe-t) + 18px); max-height: calc(100dvh - var(--bar-h) - var(--safe-t) - var(--foot-h) - 40px); overflow: auto; overscroll-behavior: contain; }
.toc { font-size: 13px; }
.toc-h { font-weight: 700; padding-bottom: 4px; border-bottom: 1px solid var(--line3); margin-bottom: 4px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; padding: 2px 0; cursor: pointer; line-height: 1.3; }
.toc a.on { color: var(--ink); font-weight: 700; }
.toc a.ban { color: var(--ink3); }
.side { display: grid; gap: 16px; align-content: start; }
.side h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line3); padding-bottom: 3px; }
.side h3 span { font-weight: 400; font-size: 12px; color: var(--ink2); }
.sheet-handle, .scrim { display: none; }
#article { min-height: 60vh; position: relative; }
.mine.loading { opacity: .55; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; min-height: calc(var(--foot-h) + var(--safe-b)); padding: 4px 16px calc(4px + var(--safe-b)); display: flex; align-items: center; gap: 12px; background: var(--bg); border-top: 1px solid var(--line2); }
.crumbs { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 13px; color: var(--ink2); }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs b { color: var(--ink); }
.crumbs .sep { margin: 0 5px; color: var(--ink3); }
.crumbs .got { color: var(--pc); font-weight: 700; }
.clicks { font-size: 13px; white-space: nowrap; color: var(--ink2); }
.back-btn.stuck { border-color: var(--red); color: var(--red); }
.toc-btn { display: none; }

/* watching */
.wall-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wall-head h2 { flex: 1; margin: 0; min-width: 0; font-size: 20px; }
.wall-body { min-height: 0; }
#wall-grid { --cols: 1; --rows: 1; display: flex; flex-wrap: wrap; gap: 8px; height: 100%; min-height: 0; align-content: stretch; }
#wall-grid .screen { flex: 1 1 calc((100% - (var(--cols) - 1) * 8px) / var(--cols) - .5px); height: calc((100% - (var(--rows) - 1) * 8px) / var(--rows)); }
.wall.focus .wall-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 8px; }
.wall.focus #wall-grid { flex-direction: column; flex-wrap: nowrap; overflow-y: auto; }
.wall.focus #wall-grid .screen { flex: 0 0 auto; height: auto; }
.wall.focus #wall-grid .screen-box { flex: none; aspect-ratio: 16 / 10; }
.wall.focus #wall-grid .screen-path { display: none; }
#wall-main { min-height: 0; height: 100%; }
#wall-main:empty { display: none; }
#wall-main .screen { height: 100%; cursor: default; }
.screen { display: flex; flex-direction: column; border: 1px solid var(--line2); background: var(--bg); cursor: pointer; min-width: 0; min-height: 0; }
.screen:hover { border-color: var(--line); }
.screen-bar { display: flex; gap: 8px; align-items: baseline; padding: 3px 8px; font-size: 13px; background: var(--bg2); border-left: 6px solid var(--pc); min-width: 0; flex: none; }
.screen-bar .pg { font-family: var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.screen-bar .st { color: var(--ink2); white-space: nowrap; font-size: 12px; }
.screen-path { display: flex; justify-content: flex-end; flex: none; white-space: nowrap; overflow: hidden; padding: 2px 8px; font-size: 12px; color: var(--ink2); background: var(--bg2); border-bottom: 1px solid var(--line3); border-left: 6px solid var(--pc); }
#wall-main .screen-path { justify-content: flex-start; white-space: normal; max-height: 6em; overflow-y: auto; }
.screen-path b { color: var(--ink); }
.screen-path .got { color: var(--pc); font-weight: 700; }
.screen-path .sep { margin: 0 4px; color: var(--ink3); }
.screen-box { position: relative; overflow: hidden; flex: 1; min-height: 0; background: var(--bg); }
.screen-page { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: none; transition: transform .14s linear; }
.cursor { position: absolute; top: 0; left: 0; width: 18px; height: 24px; pointer-events: none; z-index: 3; transition: transform .1s linear; }
.cursor svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }

/* browse overlay */
.browse { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.browse-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: calc(8px + var(--safe-t)) 16px 8px; background: var(--bg); border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.browse-bar .picker { flex: 1; min-width: 200px; max-width: 520px; }
.browse-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.browse-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 16px 20px 60px; max-width: 1240px; margin: 0 auto; align-items: start; }
.browse-body .toc { top: 70px; }
.land li { list-style: none; border-bottom: 1px solid var(--line3); }
.land ul { margin: 0; padding: 0; }
.land button { appearance: none; border: 0; background: none; display: flex; gap: 10px; width: 100%; text-align: left; align-items: center; padding: 6px 0; cursor: pointer; color: var(--ink); }
.land img, .land .noimg { width: 44px; height: 44px; object-fit: cover; background: var(--bg3); flex: none; }
.land b { color: var(--link); font-weight: 400; }

/* dialogs */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.modal.tall { height: min(640px, calc(100dvh - 32px)); }
.modal h2 { margin: 0; font-size: 20px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.modal .close { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--ink2); flex: none; }
.modal .path { font-size: 13px; color: var(--ink2); }
.modal .path b { color: var(--ink); font-weight: 400; }
.modal textarea { min-height: 180px; }

/* page previews and definitions */
.pop-card { position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 16px); background: var(--bg); box-shadow: 0 2px 12px rgba(0, 0, 0, .35); border: 1px solid var(--line2); font-size: 14px; line-height: 1.5; }
.pop-card img { display: block; width: 100%; max-height: 190px; object-fit: cover; }
.pop-card .tx { padding: 8px 12px 10px; }
.pop-card .tt { font: 400 18px/1.25 var(--serif); margin-bottom: 2px; }
.pop-card .ds { font-size: 12px; color: var(--ink2); margin-bottom: 4px; }
.pop-card p { margin: 0; }
.pop-card .by { margin-top: 6px; font-size: 13px; font-weight: 700; }
.pop-card.preview { pointer-events: none; }

/* toasts, countdown */
#toasts { position: fixed; top: calc(var(--bar-h) + var(--safe-t) + 14px); right: 14px; z-index: 95; display: grid; gap: 6px; width: min(calc(100vw - 28px), 320px); pointer-events: none; }
.toast { background: var(--bg); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 2px 2px rgba(0, 0, 0, .25); padding: 6px 10px; display: flex; gap: 8px; align-items: center; }
.toast.err { border-color: var(--red); color: var(--red); }
.toast.out { opacity: 0; transition: opacity .3s; }
.countdown { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; background: var(--bg); color: var(--ink); text-align: center; }
.countdown .n { font: 400 min(36vw, 180px)/1 var(--serif); }
.countdown small { display: block; font-size: 15px; color: var(--ink2); margin-top: 8px; }

/* hints */
.hint-list { display: grid; font-size: 13px; }
.hint-list button { appearance: none; border: 0; border-bottom: 1px solid var(--line3); text-align: left; background: none; padding: 3px 0; cursor: pointer; display: flex; gap: 6px; align-items: baseline; color: var(--ink); }
.hint-list .d { font-weight: 700; min-width: 18px; text-align: center; }
.hint-list .d1 { background: #e8432a; color: #fff; } .hint-list .d2 { background: #ffa033; color: #202122; } .hint-list .d3 { background: #ffe14d; color: #202122; }

/* results */
.results { max-width: 980px; margin: 0 auto; padding: 16px 16px calc(40px + var(--safe-b)); display: grid; gap: 20px; }
.results h1 { margin: 0; font-size: 30px; border-bottom: 1px solid var(--line); }
.res-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
#final-board { max-width: 400px; }
.stand { width: 100%; border-collapse: collapse; background: var(--bg2); }
.stand td, .stand th { padding: 3px 8px; border: 1px solid var(--line); text-align: left; }
.stand th { background: var(--bg3); }
.stand td.n { text-align: right; font-variant-numeric: tabular-nums; }
.route { margin: 6px 0; }
.route summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
.route ol { margin: 6px 0 0; padding-left: 26px; font-size: 14px; }
.route li .tm { color: var(--ink2); font-size: 12px; margin-left: 6px; }
.route li.claim { font-weight: 700; }
.route li.back { color: var(--yellow); }
.sqlist { width: 100%; border-collapse: collapse; font-size: 13px; }
.sqlist td, .sqlist th { padding: 3px 8px; border: 1px solid var(--line2); text-align: left; vertical-align: top; }
.sqlist th { background: var(--bg3); }

@media (max-width: 1180px) {
  .play { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
  .play > .toc { display: none; }
  .toc-btn { display: inline-flex; }
}
@media (max-width: 900px) {
  :root { --bar-h: 52px; }
  .bar { grid-template-columns: auto 1fr auto; padding-left: 10px; padding-right: 10px; gap: 8px; }
  .bar-title { display: none; }
  .switch span { font-size: 0; }
  .switch span::after { content: 'Dark'; font-size: 12px; }
  .brand b { font-size: 16px; }
  .clock { font-size: 36px; min-width: 0; padding: 3px 10px; }
  .clock.up { font-size: 22px; }
  .mini { display: block; }
  .lobby { grid-template-columns: 1fr; }
  .lobby-side { position: static; order: -1; }
  .play { grid-template-columns: 1fr; padding: 10px 14px calc(var(--foot-h) + 12px + var(--safe-b)); }
  .play.wallmode { grid-template-columns: 1fr; padding: 8px 8px calc(8px + var(--safe-b)); }
  .side { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 60; max-height: 84dvh; background: var(--bg); border-top: 1px solid var(--line); padding: 0 14px calc(14px + var(--foot-h) + var(--safe-b)); transform: translateY(105%); transition: transform .22s ease-out; }
  .side.open { transform: none; }
  .sheet-handle { display: block; position: sticky; top: 0; z-index: 2; margin: 0 -14px; padding: 8px 0; background: var(--bg); cursor: pointer; border: 0; width: calc(100% + 28px); color: var(--ink2); font-size: 12px; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .4); display: block; }
  .res-grid { grid-template-columns: 1fr; }
  .browse-body { grid-template-columns: 1fr; padding: 10px 14px 60px; }
  .browse-body .toc { display: none; }
  .browse-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
  .wall.focus .wall-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 150px; }
  .wall.focus #wall-grid { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .wall.focus #wall-grid .screen { flex: 0 0 200px; height: 100%; }
  .wall.focus #wall-grid .screen-box { flex: 1; aspect-ratio: auto; }
  .modal-bg { padding: 0; place-items: stretch; }
  .modal, .modal.tall { max-width: none; height: 100dvh; max-height: none; border: 0; padding-top: calc(14px + var(--safe-t)); padding-bottom: calc(14px + var(--safe-b)); }
  .modal:not(.tall) { height: auto; align-self: end; }
}
