:root {
  --paper: #e4e9f4; --ink: #121a3a; --soft: #56608a; --line: #c9d1e6; --card: #fff; --serial: #d7263d;
  --tomato: #f2543d; --sky: #2f6fe4; --orchid: #9a52de; --sun: #f0a80e; --mint: #12997c;
  --game: var(--ink);
  --face: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--face); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 600px; margin: 0 auto; padding: 0 16px; }
.tab { font-variant-numeric: tabular-nums; }

/* ---------- masthead ---------- */
.mast { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 22px 0 10px; }
.mark { font-weight: 800; font-stretch: 75%; font-size: 30px; letter-spacing: -.01em; text-decoration: none; line-height: 1; }
.mark i { font-style: normal; color: var(--serial); }
.mast nav { display: flex; gap: 18px; font-size: 15px; font-weight: 500; }
.mast nav a { text-decoration: none; color: var(--soft); }
.mast nav a:hover, .mast nav a[aria-current] { color: var(--ink); text-decoration: underline; }

/* ---------- home ---------- */
.today { padding: 26px 0 18px; }
.today h1 { margin: 0; font-weight: 800; font-stretch: 75%; font-size: clamp(44px, 13vw, 72px); line-height: .92; letter-spacing: -.02em; }
.today p { margin: 12px 0 0; color: var(--soft); max-width: 34em; }
.no { color: var(--serial); font-weight: 700; font-stretch: 75%; font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.strip { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.ticket { position: relative; display: grid; grid-template-columns: 62px 1fr 104px; min-height: 92px; background: var(--card); border-radius: 12px; text-decoration: none; overflow: hidden; transition: transform .12s ease; }
a.ticket:hover { transform: translateX(4px); }
.ticket::before, .ticket::after { content: ""; position: absolute; right: 104px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transform: translate(50%, -50%); top: 0; }
.ticket::after { top: auto; bottom: 0; transform: translate(50%, 50%); }
.band { background: var(--game); display: grid; place-items: center; }
.band svg { width: 30px; height: 30px; }
.tbody { padding: 14px 14px 14px 16px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.tbody b { font-weight: 800; font-stretch: 75%; font-size: 27px; line-height: 1; letter-spacing: -.005em; }
.tbody span { color: var(--soft); font-size: 15px; line-height: 1.3; margin-top: 5px; }
.stub { border-left: 2px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 8px; }
.stub .go { font-weight: 800; font-stretch: 75%; font-size: 21px; color: var(--game); }
.stub small { display: block; font-size: 12px; color: var(--soft); font-weight: 500; }
.ticket.done .tbody b, .ticket.done .tbody span { opacity: .55; }

.stamp { --s: 64px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; color: var(--game); border: 3px solid currentColor; box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4.5px currentColor; font-weight: 800; font-stretch: 75%; font-size: calc(var(--s) * .44); line-height: 1; font-variant-numeric: tabular-nums; transform: rotate(-9deg); filter: url(#ink); }
.stamp.big { --s: 148px; border-width: 5px; box-shadow: inset 0 0 0 5px var(--card), inset 0 0 0 7.5px currentColor; }
.stamp.thump { animation: thump .38s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes thump { from { transform: rotate(-9deg) scale(2.1); opacity: 0; } 55% { opacity: 1; } to { transform: rotate(-9deg) scale(1); } }

.tally { margin: 18px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: end; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.tally .sum { font-weight: 800; font-stretch: 75%; font-size: 56px; line-height: .9; font-variant-numeric: tabular-nums; }
.tally .sum small { font-size: 24px; color: var(--soft); font-weight: 700; }
.tally .meta { color: var(--soft); font-size: 15px; grid-column: 1 / -1; }
.below { padding: 22px 0 8px; color: var(--soft); font-size: 15px; }
.below h2 { color: var(--ink); font-size: 19px; font-weight: 700; margin: 26px 0 6px; }
.below p { margin: 0 0 10px; max-width: 36em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; transition: transform .08s ease; }
.btn:active { transform: translateY(2px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.game { background: var(--game); border-color: var(--game); }
.btn[disabled] { opacity: .4; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- game page ---------- */
.ghead { padding: 18px 0 14px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.ghead h1 { margin: 0; font-weight: 800; font-stretch: 75%; font-size: 42px; line-height: .95; letter-spacing: -.015em; }
.ghead h1::after { content: ""; display: block; width: 44px; height: 6px; background: var(--game); margin-top: 10px; border-radius: 3px; }
.ghead .no { font-size: 15px; white-space: nowrap; }
.board { background: var(--card); border-radius: 14px; padding: 18px 16px 20px; min-height: 420px; display: flex; flex-direction: column; }
.pips { display: flex; gap: 6px; margin-bottom: 16px; }
.pips i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.pips i.on { background: var(--game); }
.pips i.now { background: var(--ink); }
.ask { font-weight: 700; font-size: 23px; line-height: 1.2; margin: 0 0 4px; }
.ask b { color: var(--game); font-weight: 800; }
.sub { color: var(--soft); font-size: 15px; margin: 0; min-height: 1.5em; }
.stage { flex: 1; display: grid; place-items: center; padding: 14px 0; min-height: 250px; touch-action: none; user-select: none; -webkit-user-select: none; }
.foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.foot .btn { flex: 1; }
.verdict { font-weight: 700; font-size: 17px; }
.verdict b { font-weight: 800; color: var(--game); font-variant-numeric: tabular-nums; }
.rules { padding: 26px 0 0; color: var(--soft); font-size: 16px; }
.rules h2 { color: var(--ink); font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.rules p { margin: 0 0 10px; max-width: 36em; }
.note { margin: 10px 0 0; font-size: 14px; color: var(--soft); }

/* result */
.result { text-align: left; display: grid; gap: 18px; }
.result .top { display: flex; align-items: center; gap: 20px; }
.result h2 { margin: 0; font-weight: 800; font-stretch: 75%; font-size: 34px; line-height: 1; }
.result .top p { margin: 6px 0 0; color: var(--soft); }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.lines li span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.lines small { display: block; color: var(--soft); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 15px; z-index: 9; }

/* ---------- eyeball ---------- */
.bar { position: relative; width: 100%; height: 150px; cursor: pointer; }
.bar .rail { position: absolute; left: 0; right: 0; top: 50%; height: 14px; margin-top: -7px; border-radius: 7px; background: var(--ink); }
.bar .mk, .bar .tr { position: absolute; top: 50%; width: 4px; height: 70px; margin: -35px 0 0 -2px; background: var(--game); border-radius: 2px; }
.bar .tr { background: var(--serial); height: 96px; margin-top: -48px; }
.bar em { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: 14px; white-space: nowrap; }
.bar .tr em { top: auto; bottom: -26px; color: var(--serial); }
.dial { width: min(100%, 300px); aspect-ratio: 1; cursor: pointer; }
.field { position: relative; width: 100%; height: 250px; background: var(--paper); border-radius: 10px; overflow: hidden; cursor: crosshair; }
.field .dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); margin: -7px 0 0 -7px; }
.field .disc { position: absolute; border-radius: 50%; background: var(--game); opacity: .9; }
.field .pin { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.field .pin.true { background: var(--serial); border-color: #fff; }
.num { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; }
.num output { font-weight: 800; font-stretch: 75%; font-size: 84px; line-height: 1; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.num button { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); background: none; font-size: 28px; font-weight: 700; line-height: 1; }
.clock { font-weight: 800; font-stretch: 75%; font-size: 96px; line-height: 1; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 14px; border-radius: 7px; background: var(--track, var(--line)); }
input[type=range]::-moz-range-track { height: 14px; border-radius: 7px; background: var(--track, var(--line)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -8px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }

/* ---------- shade ---------- */
.swatches { display: grid; grid-template-columns: 1fr; width: 100%; height: 200px; border-radius: 12px; overflow: hidden; position: relative; }
.swatches.two { grid-template-columns: 1fr 1fr; }
.swatches div { display: flex; align-items: end; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.swatches .blank { background: repeating-linear-gradient(135deg, var(--paper) 0 10px, #eef1f8 10px 20px); color: var(--soft); align-items: center; justify-content: center; font-size: 16px; }
.fuse { height: 5px; border-radius: 3px; background: var(--ink); transform-origin: left; width: 100%; margin-top: 10px; }
.sliders { width: 100%; display: grid; gap: 2px; margin-top: 8px; }
.sliders label { display: grid; grid-template-columns: 92px 1fr; align-items: center; font-size: 15px; font-weight: 600; }

/* ---------- rungs ---------- */
.ladder { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; justify-items: center; }
.word { display: flex; gap: 6px; }
.word span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 8px; background: var(--paper); font-weight: 800; font-size: 26px; text-transform: uppercase; }
.word.end span { background: var(--ink); color: #fff; }
.word span.ch { background: var(--game); color: var(--ink); }
.word.goal span { background: none; box-shadow: inset 0 0 0 2px var(--ink); }
.word.hit span { background: var(--mint); color: #fff; box-shadow: none; }
.gap { color: var(--soft); font-size: 14px; padding: 2px 0; }
.type { width: 226px; height: 56px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; text-align: center; font-weight: 800; font-size: 26px; letter-spacing: .5em; text-indent: .5em; text-transform: uppercase; outline-offset: 2px; }
.type.bad { animation: shake .3s; border-color: var(--serial); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- lone star ---------- */
.grid { display: grid; grid-template-columns: repeat(6, 1fr); width: min(100%, 372px); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; }
.grid button { border: 0; border-right: 1px solid rgba(18, 26, 58, .22); border-bottom: 1px solid rgba(18, 26, 58, .22); background: var(--c); display: grid; place-items: center; font-size: 30px; line-height: 1; padding: 0; color: var(--ink); min-width: 0; }
.grid button.r { border-right: 3px solid var(--ink); }
.grid button.b { border-bottom: 3px solid var(--ink); }
.grid button.x { color: rgba(18, 26, 58, .45); font-size: 20px; font-weight: 700; }
.grid button.clash { color: var(--serial); }
.grid button svg { width: 62%; height: 62%; }

/* ---------- room temp ---------- */
.take { width: 100%; }
.take .deg { font-weight: 800; font-stretch: 75%; font-size: 84px; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; }
.take .ends { margin-top: 18px; display: flex; justify-content: space-between; gap: 16px; font-size: 15px; font-weight: 600; }
.take .ends span:last-child { text-align: right; }
.take .scale { position: relative; margin: 6px 0 30px; }
.take .room { position: absolute; top: -8px; width: 4px; height: 60px; margin-left: -2px; background: var(--serial); border-radius: 2px; pointer-events: none; transition: left .6s cubic-bezier(.2, .8, .2, 1); }
.take .room em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: 14px; color: var(--serial); white-space: nowrap; padding-top: 2px; }

/* ---------- text pages, archive, footer ---------- */
.page { padding: 20px 0; }
.page h1 { font-weight: 800; font-stretch: 75%; font-size: 46px; line-height: .95; margin: 8px 0 16px; letter-spacing: -.015em; }
.page h2 { font-size: 21px; font-weight: 700; margin: 28px 0 6px; }
.page p, .page li { max-width: 36em; }
.page table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.page td, .page th { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.days { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.days li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--paper); align-items: center; }
.days b { font-weight: 700; }
.days .links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.days .links a { color: var(--soft); }
.days .links a.did { color: var(--ink); font-weight: 600; text-decoration: none; }
footer { margin-top: 44px; padding: 20px 0 36px; border-top: 1px solid var(--line); color: var(--soft); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
@media (max-width: 380px) { .ticket { grid-template-columns: 52px 1fr 88px; } .ticket::before, .ticket::after { right: 88px; } .tbody b { font-size: 24px; } .word span { width: 46px; height: 46px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- pair up ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.pick { min-height: 48px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.pick.sel { border-color: var(--ink); background: var(--paper); }
.pick.ok { border-color: var(--mint); background: #dff3ee; color: var(--ink); }
.pick.shown { border-style: dashed; color: var(--soft); }
.pick.used { opacity: .35; border-style: dashed; }
.pick small { display: block; font-weight: 700; color: var(--ink); margin-top: 2px; }
.pick.no { animation: shake .3s; border-color: var(--serial); }
.pick:disabled { cursor: default; }

/* ---------- dig ---------- */
.digwrap { width: 100%; display: grid; gap: 10px; justify-items: center; }
.cur { font-weight: 800; font-stretch: 75%; font-size: 34px; line-height: 1; letter-spacing: .04em; min-height: 34px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 320px); user-select: none; -webkit-user-select: none; }
.tile { aspect-ratio: 1; border: 0; border-radius: 12px; background: var(--paper); font-weight: 800; font-size: 30px; text-transform: uppercase; padding: 0; }
.tile.on { background: var(--game); color: #fff; }
.tile.last { box-shadow: inset 0 0 0 4px var(--ink); }
.left { margin: 4px 0 0; font-size: 14px; color: var(--soft); text-align: center; min-height: 1.4em; }
.found { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.found span { background: var(--paper); border-radius: 6px; padding: 3px 8px; font-size: 14px; font-weight: 600; text-transform: uppercase; }
.gridnote { font-size: 14px; color: var(--soft); margin: 0 0 8px; }
