:root { --bg: #0a0a0b; --panel: #171719; --line: #2c2c31; --text: #f5f5f7; --muted: #9a9aa3; --accent: #3b7bff; --bad: #ff8a80; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 72rem; margin: 0 auto; padding: 1rem 1rem calc(3rem + env(safe-area-inset-bottom)); }
h1 { font-size: clamp(2rem, 7vw, 3.5rem); line-height: 1.1; margin: .5rem 0; }
h2 { font-size: 1.3rem; margin: 0; }
h3 { margin: 1.5rem 0 .5rem; }
a { color: inherit; }
ol, ul { padding-left: 1.3rem; }
li { margin: .35rem 0; }
.muted, small { color: var(--muted); }
small { display: block; font-size: .8rem; }
.lede { font-size: 1.25rem; }
.error { color: var(--bad); font-weight: 600; }
.stack { display: grid; gap: .75rem; margin: 1rem 0; }
.row { display: flex; gap: .5rem; align-items: center; }
.row > input { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; }

input, button, .btn { font: inherit; border-radius: .8rem; min-height: 3rem; }
input { background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 0 .9rem; width: 100%; }
input[type=range] { padding: 0; accent-color: var(--accent); }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 .9rem; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border: 0; font-weight: 700; padding: .6rem 1.2rem; text-decoration: none; text-align: center; width: 100%; }
.btn.alt { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn.small { width: auto; }
.ghost { background: transparent; min-height: 2.5rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button { min-height: 2.4rem; border-radius: 2rem; font-size: .9rem; }
.chips .on { background: var(--accent); color: #fff; border-color: var(--accent); }
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button { width: 3rem; font-size: 1.4rem; }
.stepper output { min-width: 3rem; text-align: center; font-weight: 700; }
.toggle { display: flex; gap: .75rem; align-items: flex-start; }
.toggle input { width: 1.5rem; min-height: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: .75rem; }
.tile { aspect-ratio: 1; display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1rem; border-radius: 1.25rem; text-decoration: none; color: #fff; }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; margin-bottom: auto; font-size: .8rem; }
.tile-top span { text-align: right; }
.tile-top b { background: rgb(0 0 0 / .3); border-radius: 2rem; padding: .15rem .6rem; white-space: nowrap; }
.tile h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); font-weight: 800; line-height: 1.1; }
.pill { background: #fff; color: #111; font-weight: 700; font-size: .8rem; border-radius: .4rem; padding: .2rem .6rem; }
.pill.outline { background: rgb(255 255 255 / .15); color: #fff; border: 1px solid rgb(255 255 255 / .5); }
.tile.dim { opacity: .3; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.top > a { font-weight: 800; font-size: 1.3rem; text-decoration: none; white-space: nowrap; }
.top form { max-width: 16rem; }
.filters { display: grid; gap: .9rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.wrap { flex-wrap: wrap; }
.divider { width: 1px; align-self: stretch; background: var(--line); }
.summary { margin: 1.25rem 0 1rem; }

.bar { display: flex; justify-content: space-between; align-items: center; min-height: 3rem; }
.bar a { text-decoration: none; color: var(--muted); padding: .75rem 0; }
.code { font-family: ui-monospace, monospace; letter-spacing: .2em; color: var(--accent); }
.code.big { font-size: 2.5rem; margin: 0; }
.invite { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.invite img { background: #fff; border-radius: .5rem; }
.invite .muted { word-break: break-all; margin: 0 0 .5rem; }
summary { cursor: pointer; font-weight: 700; min-height: 2rem; }
.people { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.people li { display: flex; align-items: center; gap: .4rem; background: var(--panel); border-radius: 2rem; padding: .2rem .8rem; margin: 0; }
.people .out { text-decoration: line-through; opacity: .5; }
i { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; flex: none; }

/* Table screen: big shared type that scales from a phone on the table up to a TV. */
.table { text-align: center; display: grid; gap: 1rem; margin: 1rem 0; font-size: clamp(1.1rem, 2.6vw, 2rem); }
.table .huge { font-size: clamp(2.5rem, 11vw, 8rem); font-weight: 800; line-height: 1.05; margin: 0; overflow-wrap: anywhere; }
.table .timer { font-variant-numeric: tabular-nums; font-size: clamp(2rem, 8vw, 5rem); font-weight: 700; color: var(--accent); margin: 0; }
.table .timer.low { color: var(--bad); }
.grid16 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; font-size: clamp(.75rem, 2vw, 1.3rem); }
.grid16 span { background: var(--panel); border-radius: .5rem; padding: .6rem .2rem; overflow-wrap: anywhere; }
.words { list-style: none; padding: 0; font-size: clamp(1.5rem, 5vw, 3.5rem); font-weight: 700; }

/* Pass-reveal: every card has the same size and colour, so a glance from across the room tells nothing. */
.pass { min-height: 80vh; display: grid; gap: 1rem; align-content: center; text-align: center; }
.pass p { margin: 0; }
.hold { width: 100%; height: 16rem; display: grid; align-content: center; gap: .5rem; border: 2px dashed var(--line); background: var(--panel); color: var(--text); border-radius: 1.5rem; padding: 1rem; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hold b { font-size: clamp(1.6rem, 7vw, 2.6rem); overflow-wrap: anywhere; }
.hold span { color: var(--muted); }
.hold.open { border-style: solid; }

.scores { list-style: none; padding: 0; text-align: left; font-size: 1.1rem; }
.scores li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }
.scores span { flex: 1; }
.scores b { min-width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.scores .lead span { color: var(--accent); font-weight: 700; }
.scores button { min-height: 2.5rem; min-width: 2.75rem; padding: 0 .4rem; }
.win { color: var(--accent); }
.dial { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.keys button { min-height: 4rem; font-size: 1.6rem; font-weight: 700; }

@media (prefers-reduced-motion: no-preference) { .tile { transition: transform .15s; } .tile:hover { transform: translateY(-2px); } }
