/* Games — shares the paper's tokens. Feedback colours are the design
   system's action blue for "right", its blue tint for "near", and the
   paper's hairline grey for "wrong". No yellow, no green, no red. */
:root {
  --g-right: #166dfc;
  --g-near:  #eaf2fe;
  --g-wrong: #e2e2e2;
  --g-ink:   #121212;
}
.game { max-width: 560px; margin: 0 auto; padding: 28px 0 70px; }
.game__kicker { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.game__title { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 6vw, 46px); line-height: 1.02; letter-spacing: -.015em; margin: 6px 0 10px; }
.game__rules { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink-2); margin: 0 0 22px; }
.game__rules b { color: var(--ink); }
.game__meta { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--rule-hard); border-bottom: 1px solid var(--rule); padding: 10px 0; margin-bottom: 26px; }

.btn { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
       background: var(--ink); color: #fff; border: 1px solid var(--ink); padding: 12px 22px; cursor: pointer; border-radius: 0; }
.btn:hover { background: #000; }
.btn:disabled { opacity: .35; cursor: default; }
.btn--ghost { background: #fff; color: var(--ink); }
.btn--ghost:hover { background: #f4f4f4; }
.btn--wide { width: 100%; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* the card a prompt sits on */
.card { border: 1px solid var(--rule-mid); padding: 26px 24px; margin-bottom: 16px; background: #fff; }
.card__text { font-family: var(--serif); font-size: 22px; line-height: 1.35; margin: 0; white-space: pre-line; }
.card__meta { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }
.card--right { border-color: var(--g-right); box-shadow: inset 0 0 0 1px var(--g-right); }
.card--wrong { border-color: var(--ink); background: #fafafa; }

/* small square progress dots, the emoji grid's on-page twin */
.dots { display: flex; gap: 6px; margin: 18px 0; }
.dot { width: 22px; height: 22px; border: 1px solid var(--rule-mid); background: #fff; }
.dot--right { background: var(--g-right); border-color: var(--g-right); }
.dot--near { background: var(--g-near); border-color: #b9d0fb; }
.dot--wrong { background: var(--g-wrong); border-color: var(--g-wrong); }
.dot--miss { background: var(--ink); border-color: var(--ink); }

/* text input, in the paper's style: a hairline, not a box */
.field { display: flex; gap: 10px; align-items: stretch; margin: 14px 0; }
.field input { flex: 1; font-family: var(--sans); font-size: 18px; padding: 10px 2px; border: 0; border-bottom: 2px solid var(--ink); outline: none; background: transparent; border-radius: 0; min-width: 0; }
.field input:focus { border-bottom-color: var(--g-right); }
.field .unit { font-family: var(--sans); font-size: 13px; color: var(--ink-3); align-self: center; white-space: nowrap; }

/* headline with blanks (Redact) and tappable words (Splice) */
.words { font-family: var(--serif); font-weight: 700; font-size: clamp(24px, 4.6vw, 32px); line-height: 1.32; letter-spacing: -.01em; margin: 10px 0 22px; }
.blank { display: inline-flex; gap: 2px; vertical-align: -3px; margin: 0 1px; }
.blank i { display: inline-block; width: .62em; height: 1.15em; border-bottom: 2px solid var(--ink); }
.blank--solved { border-bottom: 3px solid var(--g-right); color: var(--g-right); }
.word { cursor: pointer; padding: 0 2px; border-radius: 2px; }
.word:hover { background: var(--g-near); }
.word--seam { background: var(--g-right); color: #fff; }
.word--picked { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; text-decoration-color: var(--ink); }
.word--after { color: var(--ink-3); }

/* guess log (Ballpark) */
.log { font-family: var(--sans); font-size: 14px; border-top: 1px solid var(--rule); }
.log__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.log__guess { font-weight: 600; font-variant-numeric: tabular-nums; }
.log__verdict { color: var(--ink-2); }
.log__row--hit .log__verdict { color: var(--g-right); font-weight: 700; }

/* ordering list (Timeline) */
.order { list-style: none; margin: 0; padding: 0; counter-reset: pos; }
.order li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--rule-mid); padding: 12px 12px 12px 14px; margin-bottom: 8px; background: #fff; cursor: pointer; user-select: none; }
.order li::before { counter-increment: pos; content: counter(pos); font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--ink-3); width: 16px; }
.order li .t { flex: 1; font-family: var(--serif); font-size: 17px; line-height: 1.3; }
.order li .d { font-family: var(--sans); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.order li .mv { display: flex; flex-direction: column; gap: 2px; }
.order li .mv button { border: 1px solid var(--rule-mid); background: #fff; width: 26px; height: 20px; font-size: 10px; cursor: pointer; padding: 0; color: var(--ink-2); }
.order li.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.order li.ok { border-color: var(--g-right); box-shadow: inset 0 0 0 1px var(--g-right); cursor: default; }
.order li.ok::before { color: var(--g-right); }
.order li.bad { background: #fafafa; }

/* end state */
.result { border-top: 1px solid var(--rule-hard); margin-top: 26px; padding-top: 18px; }
.result__title { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; }
.result__grid { font-size: 22px; line-height: 1.25; letter-spacing: 1px; margin: 8px 0 14px; }
.result__actions { display: flex; align-items: center; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.result__next { font-family: var(--sans); font-size: 13px; color: var(--ink-3); }
.result__clock { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.result p { font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; margin-top: 14px; }
.stat { text-align: center; }
.stat__v { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1; }
.stat__l { font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.note { font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.note a { text-decoration: underline; text-underline-offset: 3px; }

/* logic grids */
.board { display: grid; gap: 2px; background: var(--rule-mid); border: 2px solid var(--ink); padding: 2px; margin: 0 auto 18px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cell { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; font-family: var(--sans); }
.cell--lit { background: var(--g-near); }
.cell--wall { background: var(--ink); color: #fff; font-weight: 700; font-size: 18px; cursor: default; }
.cell--wall.ok { color: var(--g-right); }
.cell--wall.over { color: #ff8a80; }
.cell .lamp { width: 58%; height: 58%; border-radius: 50%; background: var(--g-right); }
.cell .lamp.bad { background: #fff; border: 3px solid #c9221c; }
.cell .x { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-mid); }
.cell--tree { cursor: default; }
.cell .tree { width: 44%; height: 44%; background: var(--ink); border-radius: 2px; }
.cell .tent { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 26px solid var(--g-right); }
.cell .tent.bad { border-bottom-color: #c9221c; }
.margins { display: grid; margin: 0 auto; }
.margin { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; justify-content: center; }
.margin.ok { color: var(--g-right); }
.margin.over { color: #c9221c; }
.boardwrap { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 28px 1fr; max-width: 420px; margin: 0 auto 18px; }
/* inside the margin frame the board must fill its track: an auto margin
   on a grid item shrinks it to its content, which is a few pixels */
.boardwrap .board { margin: 0; width: 100%; }
.boardwrap .margins { width: 100%; height: 100%; }
.clock { font-family: var(--sans); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.board--done .cell { cursor: default; }

/* letters (Nine) */
.entry { font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: .08em; min-height: 52px; text-align: center; border-bottom: 2px solid var(--ink); margin: 6px 0 18px; text-transform: uppercase; }
.entry .caret { display: inline-block; width: 2px; height: 34px; background: var(--g-right); vertical-align: -6px; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { visibility: hidden; } }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 260px; margin: 0 auto 18px; }
.tile-l { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 30px; text-transform: uppercase; border: 1px solid var(--rule-mid); background: #fff; cursor: pointer; user-select: none; -webkit-user-select: none; }
.tile-l:hover { border-color: var(--ink); }
.tile-l.used { background: var(--g-near); border-color: #b9d0fb; color: var(--ink-3); cursor: default; }
.tile-l.centre { border-color: var(--ink); }
.rank { font-family: var(--sans); font-size: 13px; margin: 20px 0 6px; display: flex; justify-content: space-between; }
.rank b { color: var(--ink); }
.bar { height: 2px; background: var(--rule); position: relative; margin-bottom: 18px; }
.bar i { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 1px solid var(--rule-mid); transform: translateX(-50%); }
.bar i.hit { background: var(--g-right); border-color: var(--g-right); }
.bar b { position: absolute; left: 0; top: 0; height: 2px; background: var(--g-right); }
.found { font-family: var(--sans); font-size: 14px; line-height: 1.7; columns: 2; column-gap: 24px; border-top: 1px solid var(--rule); padding-top: 10px; }
.found .nine9 { color: var(--g-right); font-weight: 700; }
.found--empty { color: var(--ink-3); columns: 1; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; font-family: var(--sans); font-size: 13px; padding: 10px 16px; opacity: 0; transition: .25s; pointer-events: none; z-index: 9; }
.toast--in { opacity: 1; transform: translate(-50%, 0); }

/* the hub */
.hub { max-width: 1000px; margin: 0 auto; padding: 30px 0 70px; }
.hub__lede { font-family: var(--sans); font-size: 15px; color: var(--ink-2); max-width: 560px; margin: 0 0 30px; }
.hub__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 32px; border-top: 1px solid var(--rule-hard); }
.tile { border-bottom: 1px solid var(--rule); padding: 22px 0 24px; display: block; }
.tile__glyph { font-size: 22px; letter-spacing: 2px; line-height: 1; margin-bottom: 14px; }
.tile__name { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.tile__pitch { font-family: var(--sans); font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 0 0 12px; }
.tile__cta { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tile:hover .tile__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
