/* 2AM. One typeface, two inks, red for rares. Hard edges. */

@font-face {
  font-family: '2AM Mono';
  src: url('../fonts/DejaVuSansMono.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: block;
  ascent-override: 92.822%; descent-override: 23.584%; line-gap-override: 0%;
}
@font-face {
  font-family: '2AM Mono';
  src: url('../fonts/DejaVuSansMono-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: block;
  ascent-override: 92.822%; descent-override: 23.584%; line-gap-override: 0%;
}
@font-face {
  font-family: '2AM Mono';
  src: url('../fonts/DejaVuSansMono-Oblique.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: block;
  ascent-override: 92.822%; descent-override: 23.584%; line-gap-override: 0%;
}

:root {
  --bg: #080808;
  --ink: #F2F2F2;
  --red: #ED1C24;
  --dim: rgba(242, 242, 242, 0.5);
  --faint: rgba(242, 242, 242, 0.18);
  --mono: '2AM Mono', 'DejaVu Sans Mono', ui-monospace, Menlo, Consolas, monospace;
  --gutter: 16px;
  --t: 90ms;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 var(--mono);
  display: flex; flex-direction: column;
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--bg); }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: stretch; justify-content: space-between;
  border-bottom: 3px solid var(--ink);
  position: sticky; top: 0; z-index: 20; background: var(--bg);
}
.mark {
  display: flex; align-items: center; gap: 2px;
  padding: 10px var(--gutter); font-weight: 700; font-size: 22px; letter-spacing: 0.02em;
  text-decoration: none;
}
.cursor { display: inline-block; width: 0.6em; height: 0.95em; background: var(--ink); margin-left: 4px; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav { display: flex; }
.nav a {
  display: flex; align-items: center; padding: 0 var(--gutter);
  text-decoration: none; font-weight: 700; letter-spacing: 0.12em; font-size: 13px;
  border-left: 3px solid var(--ink); min-height: 48px;
}
.nav a[aria-current='page'] { background: var(--ink); color: var(--bg); }
@media (max-width: 420px) {
  .mark { font-size: 18px; padding: 10px 12px; }
  .nav a { padding: 0 12px; font-size: 12px; letter-spacing: 0.08em; }
}

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 20px var(--gutter) 40px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  background: var(--bg); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 0;
  font-weight: 700; letter-spacing: 0.1em; font-size: 13px; text-transform: uppercase;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background var(--t) linear, color var(--t) linear;
}
.btn:hover, .btn[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; background: var(--bg); color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--bg); }
.btn.solid:hover { background: var(--bg); color: var(--ink); }
.btn.solid:disabled { background: var(--ink); color: var(--bg); }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; }
.seg .btn + .btn { border-left-width: 0; }
.field {
  display: flex; align-items: center; border: 2px solid var(--ink); min-height: 44px; padding: 0 12px; gap: 8px;
}
.field input {
  background: transparent; border: 0; outline: 0; min-width: 0; flex: 1; height: 40px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.field input::placeholder { color: var(--dim); }
.field:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.prompt { font-weight: 700; }
.label { font-weight: 700; letter-spacing: 0.14em; font-size: 12px; text-transform: uppercase; }
.dim { color: var(--dim); }
.red { color: var(--red); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- card face (see web/js/face.js) ---------- */
.cf {
  position: relative; width: 100%; aspect-ratio: 63 / 88;
  container-type: inline-size; overflow: hidden;
  background: var(--bg); color: var(--ink);
  --u: calc(100cqw / 750);
  font-family: var(--mono); line-height: 1.164; user-select: none; text-align: left; font-weight: 400; letter-spacing: 0;
}
.cf > * { position: absolute; margin: 0; }
.cf-frame { left: 0; top: 0; width: 100%; height: auto; fill: none; stroke: var(--ink); stroke-width: 3; }
.cf-frame text { fill: var(--ink); stroke: none; font: 700 30px var(--mono); }
.cf-name { font-weight: 700; text-align: center; white-space: nowrap; line-height: 1.164; }
.cf-type { font-weight: 400; text-align: center; white-space: nowrap; }
.cf-art { font: 700 1em/1.164 var(--mono); white-space: pre; letter-spacing: 0; tab-size: 1; font-kerning: none; font-variant-ligatures: none; }
.cf-red { color: var(--red); }
.cf-rules { white-space: pre; line-height: calc(33 * var(--u)); }
.cf-flavor { font-style: italic; white-space: pre; }
.cf-set { text-align: right; }
.cb { background: var(--bg); }
.cb-svg { left: 0; top: 0; width: 100%; height: auto; }
.cb-svg rect { fill: none; stroke: var(--ink); stroke-width: 3; }
.cb-svg rect.cb-cursor { fill: var(--ink); stroke: none; animation: blink 1.06s steps(1) infinite; }
.cb-svg text { fill: var(--ink); font-family: var(--mono); white-space: pre; }

/* ---------- gallery ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.tools .field { flex: 1 1 200px; max-width: 360px; }
.count { margin-left: auto; font-weight: 700; letter-spacing: 0.1em; }
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, calc(50% - 9px)), 1fr));
}
@media (max-width: 480px) { .grid { gap: 10px; } }
.tile { display: block; text-decoration: none; position: relative; }
.tile:hover .cf, .tile:focus-visible .cf { outline: 2px solid var(--ink); outline-offset: 3px; }
.empty { padding: 60px 0; text-align: center; font-weight: 700; letter-spacing: 0.1em; }

/* ---------- card detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; gap: 20px; } }
.flipper { cursor: pointer; display: block; width: 100%; padding: 0; border: 0; background: none; }
.facts { border-top: 3px solid var(--ink); }
.facts .row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--faint); }
.facts .row b { letter-spacing: 0.12em; font-size: 12px; }
.big { font-size: 40px; font-weight: 700; line-height: 1; }
.stats { display: flex; gap: 0; border-top: 3px solid var(--ink); }
.stats > div { flex: 1; padding: 14px 0; }
.stats > div + div { border-left: 1px solid var(--faint); padding-left: 16px; }
.pager { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.json { white-space: pre-wrap; word-break: break-all; font-size: 12px; border: 1px dashed var(--faint); padding: 12px; margin: 16px 0 0; max-height: 280px; overflow: auto; }

/* ---------- footer: flyer tear-off tabs ---------- */
.foot { border-top: 3px solid var(--ink); margin-top: auto; }
.tabs { display: flex; overflow: hidden; height: 132px; border-bottom: 1px dashed var(--ink); }
.tabs a {
  flex: 0 0 44px; writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; justify-content: center;
  border-left: 1px dashed var(--ink); text-decoration: none; font-weight: 700; font-size: 12px; letter-spacing: 0.08em;
  transition: transform var(--t) linear;
}
.tabs a:hover { background: var(--ink); color: var(--bg); }
.credit { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 16px var(--gutter) 28px; max-width: 1360px; margin: 0 auto; font-size: 12px; }
.credit p { margin: 0; }
.credit a { color: var(--ink); }
.credit .px { color: var(--dim); }
.credit .px a { color: var(--dim); }

/* ---------- prose pages ---------- */
.prose { max-width: 64ch; }
.prose h1 { font-size: 28px; letter-spacing: 0.04em; margin: 8px 0 20px; }
.prose p { margin: 0 0 14px; }

/* ---------- deckbuilder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.pool { grid-template-columns: repeat(auto-fill, minmax(min(180px, calc(50% - 9px)), 1fr)); }
.pick { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.pick .cf { opacity: 0.55; transition: opacity var(--t) linear; }
.pick:hover .cf, .pick.on .cf { opacity: 1; }
.pick.on .cf { outline: 2px solid var(--ink); outline-offset: 3px; }
.chip { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.pick.on .chip { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pick.on .chip .dim { color: rgba(8, 8, 8, 0.72); }
.deckpanel { position: sticky; top: 72px; border: 3px solid var(--ink); padding: 14px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 92px); overflow: auto; scroll-margin-top: 64px; }
.deckpanel > * { flex-shrink: 0; }
.panelhead { display: flex; gap: 10px; align-items: center; }
.deckname { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 2px solid var(--ink); font-weight: 700; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 0; outline: 0; }
.panelhead .count { margin: 0; font-size: 22px; }
.count.short { color: var(--dim); }
.split .seg-row { display: grid; grid-template-columns: 52px 1fr 24px; gap: 8px; align-items: center; }
.ticks { letter-spacing: 0.08em; overflow: hidden; white-space: nowrap; font-weight: 700; }
.split b { text-align: right; }
.curve { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; height: 108px; }
.curve .col { display: flex; flex-direction: column; text-align: center; font-size: 12px; font-weight: 700; }
.curve .well { flex: 1; display: flex; align-items: flex-end; }
.curve .bar { width: 100%; background: var(--ink); min-height: 2px; }
.curve .k { border-top: 2px solid var(--ink); padding-top: 2px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }
.btn.off { opacity: 0.35; pointer-events: none; }
.msg { margin: 0; padding: 8px 10px; border: 1px dashed var(--ink); font-size: 12px; }
.import { min-height: 40px; padding-right: 2px; }
.import input { height: 36px; font-size: 12px; }
.decklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--faint); }
.decklist li { display: grid; grid-template-columns: 22px 1fr 34px 32px; align-items: center; gap: 6px; border-bottom: 1px solid var(--faint); font-size: 12px; min-height: 34px; }
.decklist .cost { font-weight: 700; }
.decklist .pl { color: var(--dim); text-align: right; }
.x { background: none; border: 0; cursor: pointer; font-weight: 700; min-height: 34px; min-width: 32px; }
.x:hover { background: var(--ink); color: var(--bg); }
.saved { border-top: 1px solid var(--faint); padding-top: 10px; }
.savedrow { display: grid; grid-template-columns: 1fr 30px 32px; align-items: center; font-size: 12px; }
.linkish { background: none; border: 0; text-align: left; padding: 8px 0; cursor: pointer; font-weight: 700; letter-spacing: 0.06em; text-decoration: underline; text-underline-offset: 3px; }
.deckbar { display: none; }
@media (max-width: 860px) {
  .builder { grid-template-columns: 1fr; }
  .deckpanel { position: static; max-height: none; }
  .deckbar {
    display: flex; align-items: center; gap: 12px; justify-content: space-between;
    position: sticky; bottom: 0; z-index: 15; background: var(--bg); border-top: 3px solid var(--ink);
    padding: 8px var(--gutter); margin: 0 calc(-1 * var(--gutter)) -40px; font-weight: 700; font-size: 16px;
  }
}

/* ---------- play: setup ---------- */
.setup { max-width: 640px; display: flex; flex-direction: column; gap: 20px; }
.resume { border: 3px solid var(--ink); padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.deckline { display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid var(--faint); padding-bottom: 12px; }
.dname { font-size: 22px; font-weight: 700; letter-spacing: 0.06em; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .modes { grid-template-columns: 1fr; } }
.mode { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 150px; padding: 18px; border: 3px solid var(--ink); background: var(--bg); cursor: pointer; text-align: left; }
button.mode:hover, .mode:has(.linkbtn:hover) { background: var(--ink); color: var(--bg); }
.mode .big, .linkbtn .big { font-size: 34px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.linkbtn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; flex: 1; display: flex; align-items: flex-start; }
.p2deck { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.sel { background: var(--bg); color: var(--ink); border: 2px solid currentColor; border-radius: 0; min-height: 34px; padding: 0 8px; font-weight: 700; flex: 1; }
.first-time { color: var(--dim); max-width: 60ch; margin: 0; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 15px; padding: 0 24px; }

/* ---------- play: table ---------- */
.table { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; border-bottom: 3px solid var(--ink); padding-bottom: 10px; }
.st-turn { display: flex; align-items: baseline; gap: 6px; }
.st-turn b { font-size: 24px; }
.pips { font-size: 20px; letter-spacing: 0.08em; }
.st-clout { margin-left: auto; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.st-clout b { font-size: 24px; }
.st-clout .first { font-size: 11px; }
.flags { width: 100%; font-weight: 700; font-size: 12px; letter-spacing: 0.08em; border: 1px dashed var(--ink); padding: 6px 8px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .board { grid-template-columns: 1fr; gap: 10px; } }
.spot { border: 2px solid var(--ink); display: flex; flex-direction: column; min-height: 220px; transition: background var(--t) linear; }
.spot.rare { border-color: var(--red); }
.spot.target { outline: 3px dashed var(--ink); outline-offset: 3px; }
.spot.target .spot-head { background: var(--ink); color: var(--bg); }
.spot.target .spot-head .red { color: var(--bg); }
.spot.nope { opacity: 0.4; }
.spot-head { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 2px solid var(--ink); background: var(--bg); cursor: pointer; }
.spot-name { padding-right: 56px; font-weight: 700; font-size: 16px; letter-spacing: 0.04em; }
.spot-rule { font-size: 12px; line-height: 1.35; margin-top: 4px; min-height: 2.7em; }
.meter { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.meter .gauge { letter-spacing: 0; overflow: hidden; }
.spot-things { margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.side { padding: 8px 12px; }
.side.them { border-bottom: 1px dashed var(--faint); }
.side.me { flex: 1; }
.side-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.side-head b { font-size: 18px; }
.cap { margin-left: auto; font-size: 11px; font-weight: 700; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 28px; font-size: 13px; border-bottom: 1px solid var(--faint); }
.side li:last-child { border-bottom: 0; }
.u .nm { display: flex; flex-direction: column; align-items: flex-start; flex: 1; background: none; border: 0; padding: 4px 0; text-align: left; cursor: zoom-in; font-size: inherit; }
.u.flash .nm { color: inherit; }
.u .tag { font-size: 10px; letter-spacing: 0.06em; color: var(--dim); }
.u .things { font-size: 11px; color: var(--dim); }
.u b { font-size: 15px; }
.planned { border: 1px dashed var(--ink) !important; padding: 0 0 0 8px; margin: 4px 0; }
.planned .nm { flex: 1; }
.planned .ord { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border: 1px solid var(--ink); font-size: 11px; font-weight: 700; }
.facedown { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }

.hand { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 4px; scroll-snap-type: x proximity; align-items: flex-start; flex-wrap: nowrap; }
.hand.empty-hand { padding: 18px 0; font-weight: 700; letter-spacing: 0.1em; }
.hc { flex: 0 0 132px; padding: 0; border: 0; background: none; cursor: pointer; scroll-snap-align: start; text-align: left; transition: transform var(--t) linear; }
.hc .chip { margin-top: 6px; }
.hc.on { transform: translateY(-6px); }
.hc.on .cf { outline: 3px solid var(--ink); outline-offset: 2px; }
.hc.on .chip { background: var(--ink); color: var(--bg); }
.hc.cant .cf { opacity: 0.4; }
.hand-meta { flex: 0 0 auto; align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; padding: 0 4px; }
@media (min-width: 1100px) { .hc { flex-basis: 150px; } }

.actions { display: flex; gap: 10px; align-items: center; position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 3px solid var(--ink); z-index: 10; }
.ticker { flex: 1; min-width: 0; font-weight: 700; letter-spacing: 0.06em; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions .btn.big { min-width: 150px; }

.tape summary { cursor: pointer; padding: 8px 0; }
.tape ol { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.tape li { padding: 3px 0; border-bottom: 1px solid var(--faint); }
.tape .t-pop, .tape .t-win { font-weight: 700; }
.tablefoot .btn { flex: 0 0 auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg);
  border-top: 3px solid var(--ink); padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 820px) { .sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border: 3px solid var(--ink); bottom: 16px; } }
.sheet-head { display: flex; flex-direction: column; gap: 4px; }
.sheet-head b { font-size: 16px; letter-spacing: 0.04em; }
.opts { display: flex; flex-direction: column; }
.opt { text-align: left; min-height: 46px; padding: 8px 12px; background: var(--bg); border: 2px solid var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.opt + .opt { border-top-width: 0; }
.opt:hover, .opt:focus-visible { background: var(--ink); color: var(--bg); }
.reveal-row { display: flex; gap: 10px; overflow-x: auto; }
.mini { flex: 0 0 120px; }

.curtain { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: var(--gutter); }
.curtain-in { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.huge { font-size: clamp(44px, 14vw, 120px); font-weight: 700; line-height: 0.95; letter-spacing: 0.02em; }
.over { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 24px var(--gutter); }
.over .huge { font-size: clamp(36px, 9vw, 96px); max-width: 14ch; }
.over .score { font-size: 48px; font-weight: 700; }
.over .row-btns { max-width: 520px; }

.zoom { position: fixed; inset: 0; z-index: 70; background: rgba(8, 8, 8, 0.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: var(--gutter); cursor: zoom-out; }
.zoom-card { width: min(420px, 88vw, calc((100vh - 120px) * 0.716)); }
.zoom-meta { font-weight: 700; letter-spacing: 0.12em; }

/* ---------- dev panel ---------- */
.dev { position: fixed; right: 0; top: 0; bottom: 0; width: min(460px, 100vw); z-index: 80; background: var(--bg); border-left: 3px solid var(--ink); display: flex; flex-direction: column; }
.dev-head { display: flex; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--faint); }
.dev-head .label { margin-right: auto; }
.dev-json { flex: 1; overflow: auto; margin: 0; padding: 10px; font-size: 11px; line-height: 1.3; }

/* phone: hand + actions dock at the bottom, board scrolls above it */
.dock { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 820px) {
  .dock { position: sticky; bottom: 0; z-index: 12; background: var(--bg); border-top: 3px solid var(--ink); margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) env(safe-area-inset-bottom); }
  .dock .actions { position: static; border-top: 1px solid var(--faint); padding: 8px 0; }
  .hc { flex-basis: 92px; }
  .hc .chip { font-size: 10px; padding: 3px 5px; margin-top: 4px; }
  .hc.on { transform: none; }
  .hand-meta { font-size: 9px; }
  .spot { min-height: 0; }
  .spot-rule { min-height: 0; }
  .actions .btn.big { min-width: 130px; min-height: 48px; }
}

/* house rules */
.house { border-top: 1px solid var(--faint); padding-top: 4px; }
.house summary { cursor: pointer; padding: 8px 0; }
.house-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.house-row .label { min-width: 72px; }
.house .first-time { margin-top: 8px; }
.house-tag { border: 1px solid var(--ink); padding: 1px 6px; margin-left: 6px; font-size: 10px; }

/* reveal: each card lands inverted for one step; a pop stamps its spot */
.spot { position: relative; }
.u.flash { background: var(--ink); color: var(--bg); margin: 0 -6px; padding: 0 6px; }
.u.flash .tag, .u.flash .things { color: rgba(8, 8, 8, 0.6); }
.spot.hit .spot-head { background: var(--ink); color: var(--bg); }
.stamp {
  position: absolute; inset: 0; z-index: 3; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 3px solid var(--ink); text-align: center; padding: 12px;
  animation: stamp 650ms linear both;
}
.stamp-big { font-size: clamp(48px, 9vw, 88px); font-weight: 700; line-height: 0.9; letter-spacing: 0.04em; }
.stamp-line { font-weight: 700; letter-spacing: 0.08em; font-size: 13px; }
@keyframes stamp { 0% { opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* replay viewer + share */
.paste { width: 100%; background: var(--bg); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; padding: 10px; font-size: 12px; resize: vertical; }
.replay .actions .btn { min-width: 48px; }
.over .share { align-self: flex-start; }

.zoom-cards { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; max-width: 100%; }
.zoom-cards.many .zoom-card { width: min(320px, 70vw, calc((100vh - 120px) * 0.716)); flex: 0 0 auto; }
.zoom-card.thing { width: min(220px, 50vw) !important; }

/* 404 */
.lost { display: flex; flex-direction: column; gap: 24px; justify-content: center; }
.lost-art { font-weight: 700; font-size: 16px; line-height: 1.164; margin: 0; }
.lost .huge { margin: 0; }

/* planning preview: what a card would add at each lit spot */
.gain { position: absolute; top: 8px; right: 10px; font-size: 28px; font-weight: 700; line-height: 1; }
.spot.target .gain { color: var(--bg); }
.spot-head { position: relative; }

/* coach tips (first nights) */
.coach { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 8px 10px; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; line-height: 1.35; }
.coach .cursor { background: var(--bg); width: 0.55em; height: 1em; vertical-align: -2px; }
.coach-text { flex: 1; }
.coach .btn { border-color: var(--bg); background: var(--ink); color: var(--bg); }
.coach .btn:hover { background: var(--bg); color: var(--ink); }
.coach .x { color: var(--bg); }
.coach .x:hover { background: var(--bg); color: var(--ink); }

/* end-of-night recap */
.over { overflow: auto; }
.over-in { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.strip { display: flex; gap: 6px; flex-wrap: wrap; }
.strip .pip { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 2px solid var(--ink); font-weight: 700; font-size: 18px; }
.strip .pip.won { background: var(--ink); color: var(--bg); }
.strip .pip.lost { border-style: dashed; color: var(--dim); }
.mvp { display: flex; gap: 16px; align-items: center; }
.mvp-card { width: 120px; flex: 0 0 auto; }
.mvp .dname { margin: 2px 0 4px; }
.best { margin-top: 6px; font-size: 12px; }
.record { display: flex; gap: 18px; font-size: 14px; letter-spacing: 0.08em; }
.record b { font-size: 22px; }
.st-clout b.bump { background: var(--ink); color: var(--bg); padding: 0 6px; }
.ticker i { font-weight: 400; }

/* TONIGHT */
.mode.tonight { border-width: 3px; min-height: 0; gap: 10px; }
.mode.tonight .big { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; }
.mode.tonight.done { cursor: default; }
.tonight-res { font-weight: 700; font-size: 18px; letter-spacing: 0.06em; }
.mode.tonight .btn { align-self: flex-start; }

.zoom-note { font-weight: 700; letter-spacing: 0.06em; border: 2px solid var(--ink); padding: 8px 12px; background: var(--ink); color: var(--bg); max-width: 420px; text-align: center; }

/* about */
.about { max-width: 880px; display: flex; flex-direction: column; gap: 18px; }
.about > p { max-width: 64ch; margin: 0; }
.about .lede { font-size: 20px; font-weight: 700; line-height: 1.35; }
.about h1.huge { margin: 0; }
.about section { border-top: 3px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.about h2.label { margin: 0; }
.tie { display: grid; grid-template-columns: 260px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--faint); align-items: start; }
.tie-cards { display: flex; gap: 6px; }
.tie-card { flex: 0 0 calc((100% - 12px) / 3); min-width: 0; display: block; }
.tie-card:hover .cf { outline: 2px solid var(--ink); outline-offset: 2px; }
.tie-text h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: 0.06em; }
.tie-text p { margin: 0 0 8px; max-width: 60ch; }
.tie-names { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.tie-names a { text-decoration: none; }
.tie-names a:hover { text-decoration: underline; }
.tie-links { font-weight: 700; }
@media (max-width: 640px) { .tie { grid-template-columns: 1fr; gap: 10px; } .tie-cards { max-width: 300px; } }
.irl { border-top: 1px solid var(--faint); margin-top: 4px; padding-top: 10px; }
.irl:empty { display: none; }
.irl p { margin: 6px 0; font-size: 13px; }

@media (max-width: 360px) {
  .mark { font-size: 16px; padding: 10px 8px; }
  .nav a { padding: 0 7px; font-size: 11px; letter-spacing: 0.04em; border-left-width: 2px; }
}
