/* CTRL+ALT+DEL Arena – builds on the Forge's styles.css (palette, fonts, topbar, .btn). */

:root {
  --ink-900: #0f1216;
  --ink-800: #14181d;
  --ink-700: #1b2027;
  --ink-600: #222831;
  --r: 10px;
  --gap: 10px;
  --slot-w: 90px;
  --hand-w: 110px;
  --me: #ffb43c;
  --op: #7cc4ff;
  --ok: #39b54a;
  --bad: #ef4136;
  --tap: 44px;
}
html, body { background: var(--ink-900, #0f1216); }
body.arena { margin: 0; color: var(--text, #e9e5df); font-family: var(--font, 'JetBrains Mono', monospace); -webkit-tap-highlight-color: transparent; }
body.arena * { box-sizing: border-box; }
.arena button { font: inherit; color: inherit; }
.arena .btn { min-height: 38px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.arena .btn[disabled] { opacity: .45; cursor: default; }
.arena .btn.primary { background: var(--amber, #f0901b); color: #1a1206; border-color: var(--amber-hi, #ffb43c); font-weight: 700; }
.arena .btn.big { min-height: 48px; padding: 0 18px; font-size: 1.02rem; }
.arena .btn.ghost { background: transparent; }
.arena .btn.file { position: relative; overflow: hidden; }
.arena .btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.linkbtn { background: none; border: 0; color: var(--amber-hi, #ffb43c); cursor: pointer; padding: 4px; font-size: .82rem; }
.muted { color: var(--text-dim, #98a0a9); }
.small { font-size: .8rem; }
.hint { color: var(--text-dim, #98a0a9); font-size: .86rem; line-height: 1.45; margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.arena-tag { font-size: .7rem; padding: 2px 6px; border-radius: 4px; background: var(--ink-600); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.arena-tag.first { background: var(--amber-dim, #8a5410); color: #fff; }
.arena-tag.warn { background: var(--bad); color: #fff; }
.chip { display: inline-block; padding: 3px 8px; border-radius: 99px; background: var(--ink-600); margin: 2px; font-size: .82rem; }
.chip.ghost { background: transparent; border: 1px dashed var(--line, #3a414a); color: var(--text-dim); }
.loading { padding: 40px; text-align: center; color: var(--text-dim); }
.err { white-space: pre-wrap; font-size: .75rem; max-height: 40vh; overflow: auto; background: var(--ink-800); padding: 10px; border-radius: 6px; }

/* top bar: the Forge's, but compact on narrow screens */
.arena-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arena-top .brand { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 10px; }
.arena-top .topbar-right { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 820px) {
  .arena-top .topbar-right .btn span { display: none; }
  .arena-top .topbar-right .btn { padding: 0 10px; }
}
body.in-game .arena-top { margin-top: 8px; }
@media (max-width: 1180px) { body.in-game .arena-top .brand-sub { display: none; } }

/* ------------------------------------------------------------ panels */
.panel { background: var(--ink-800); border: 1px solid var(--line, #3a414a); border-radius: var(--r); padding: 14px 16px; }
.panel h3 { margin: 0 0 8px; font-size: 1rem; letter-spacing: .03em; }
.setup { max-width: 1240px; margin: 16px auto 120px; padding: 0 clamp(10px, 2.5vw, 28px); display: flex; flex-direction: column; gap: 14px; }
.setup-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .setup-grid { grid-template-columns: 1fr; } }
.resume { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-color: var(--amber-dim); }
.field { margin-top: 12px; }
.field > label, .field.two label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: 4px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field input { width: 100%; min-height: 40px; background: var(--ink-700); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; font: inherit; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; min-height: var(--tap); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--amber); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink-700); cursor: pointer; }
.seg button.on { border-color: var(--amber); background: rgba(240, 144, 27, .16); color: var(--amber-hi); }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.pick { padding: 8px; border-radius: 8px; background: var(--ink-700); }
.pick.p0 b { color: var(--me); } .pick.p1 b { color: var(--op); }
.facs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.fac { position: relative; text-align: left; min-height: 86px; padding: 10px 34px 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink-700); cursor: pointer; display: flex; flex-direction: column; gap: 4px; border-left: 5px solid var(--fc, var(--gray)); }
.fac .fac-name { font-weight: 800; font-size: 1.05rem; }
.fac .fac-ab { font-size: .78rem; color: var(--text-dim); line-height: 1.35; }
.fac .fac-meta { font-size: .7rem; color: var(--text-faint, #6c747d); text-transform: uppercase; }
.fac .fac-info { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; color: var(--text-dim); }
.fac .fac-info:hover { background: var(--ink-600); color: var(--text); }
.fac.taken.p0 { outline: 2px solid var(--me); background: rgba(255, 180, 60, .08); }
.fac.taken.p1 { outline: 2px solid var(--op); background: rgba(124, 196, 255, .08); }
.c-red { --fc: var(--red); } .c-yellow { --fc: var(--yellow); } .c-blue { --fc: var(--blue); } .c-gray { --fc: var(--gray); } .c-green { --fc: var(--green); } .c-purple { --fc: #9b59d0; }
.rules summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; list-style: none; }
.rules summary h3 { margin: 0; }
.startbar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: rgba(15, 18, 22, .94); border-top: 1px solid var(--line); backdrop-filter: blur(6px); border-radius: var(--r) var(--r) 0 0; }

/* rich text from the card renderer stays inline and readable outside cards */
.cardtext, .fac-ab, .ask-q { line-height: 1.5; }
.cardtext .rich-text, .fac-ab .rich-text { font-size: inherit; }
.rt .kw { background: var(--paper, #f3f3f4); color: #222; padding: 0 4px; border-radius: 3px; font-size: .85em; }

/* ------------------------------------------------------------ game layout */
.game { display: grid; gap: var(--gap); padding: 8px clamp(8px, 1.6vw, 20px) calc(var(--hand-w) * 1.6 + 120px); }
.game.wide { grid-template-columns: 1fr 360px; align-items: start; }
.game.narrow { grid-template-columns: 1fr; }
.game.narrow .side { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (max-width: 760px) { .game.narrow .side { grid-template-columns: 1fr; } }
.side { display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 8px; }
.game.narrow .side { position: static; }

.pbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--r); background: var(--ink-800); border: 1px solid var(--line); }
.pbar.active { border-color: var(--amber); box-shadow: var(--glow); }
.pbar.passed { opacity: .8; }
.pbar .pname { display: flex; gap: 6px; align-items: center; }
.pbar.bottom .pname b { color: var(--me); }
.pbar.top .pname b { color: var(--op); }
.pbar .stat { display: inline-flex; gap: 5px; align-items: center; color: var(--text-dim); background: none; border: 0; font-size: .92rem; }
.pbar .stat.link { cursor: pointer; }
.pbar .fchips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.fchip { min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--fc, var(--line)); background: transparent; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; }
.fchip.on { background: var(--fc); color: #111; font-weight: 700; }
.fchip.off { color: var(--text-dim); }
.disks { display: inline-flex; gap: 4px; }
.disk { display: inline-flex; align-items: center; gap: 2px; font-size: .95rem; opacity: .22; }
.disk.have { opacity: 1; }
.disk.l0 { color: var(--red); } .disk.l1 { color: var(--yellow); } .disk.l2 { color: var(--blue); }
.charge-mini { display: inline-flex; gap: 4px; align-items: center; color: var(--yellow); }
.mini-card { font-size: .7rem; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); background: var(--ink-700); cursor: pointer; }

/* board: three lanes side by side, each with the rival row on top and your row below */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: var(--gap) 0; }
.lane { border-radius: var(--r); background: var(--ink-800); border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.lane.l0 { --lc: var(--red); } .lane.l1 { --lc: var(--yellow); } .lane.l2 { --lc: var(--blue); }
.lane { border-top: 4px solid var(--lc); }
.lane.asked { outline: 3px solid var(--amber-hi); cursor: pointer; }
.lane.forced { box-shadow: inset 0 0 0 2px var(--bad); }
.lane-head { display: flex; gap: 4px; align-items: center; justify-content: center; flex-direction: column; min-height: 46px; text-align: center; font-size: .72rem; color: var(--text-dim); }
.lane-head b { color: var(--lc); font-size: .9rem; letter-spacing: .05em; text-transform: uppercase; }
.lane-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; background: var(--ink-700); font-size: .86rem; position: relative; }
.lane-score .sc { font-weight: 800; font-size: 1.05rem; }
.lane-score .sc.op { color: var(--op); text-align: left; }
.lane-score .sc.me { color: var(--me); text-align: right; }
.lane-score .vs { font-size: .7rem; color: var(--text-dim); text-transform: uppercase; }
.lane-score.me { box-shadow: inset 0 -2px 0 var(--me); }
.lane-score.op { box-shadow: inset 0 2px 0 var(--op); }
.lane-score .hack { position: absolute; right: -4px; top: -10px; font-size: .65rem; font-weight: 900; padding: 2px 6px; border-radius: 4px; background: var(--bad); color: #fff; letter-spacing: .08em; }
.lane-score .hack.me { background: var(--amber); color: #111; }
.row-slots { display: grid; grid-template-columns: var(--slot-w); grid-template-rows: repeat(3, calc(var(--slot-w) * 1.507)); justify-content: center; gap: 8px; }
.gslot { position: relative; width: var(--slot-w); height: calc(var(--slot-w) * 1.507); border-radius: 6px; border: 1px dashed #2c333c; display: grid; place-items: center; }
.gslot .empty { color: var(--amber-hi); font-size: 1.6rem; }
.gslot .slot-index { position:absolute;left:4px;bottom:3px;font-size:9px;color:#596573;pointer-events:none; }
@media (max-width: 760px) {
  .board { gap:6px; }
  .lane { padding:5px 3px; }
  .lane-head { min-height:58px;font-size:.63rem; }
  .lane-head b { font-size:.76rem; }
  .lane-score { grid-template-columns:1fr 1fr;gap:2px;padding:4px 2px; }
  .lane-score .vs { grid-column:1 / -1;grid-row:2;font-size:.56rem; }
  .lane-score .sc { font-size:.8rem; }
}
.gslot.target { border: 2px solid var(--amber-hi); background: rgba(240, 144, 27, .14); cursor: pointer; animation: pulse 1.6s infinite; }
.gslot.asked { border: 2px solid var(--amber-hi); cursor: pointer; }
@keyframes pulse { 50% { background: rgba(240, 144, 27, .28); } }
@media (prefers-reduced-motion: reduce) { .gslot.target { animation: none; } }
.under { position: absolute; left: 0; right: 0; bottom: -2px; z-index: 0; font-size: .58rem; padding: 2px 3px; border-radius: 0 0 6px 6px; border: 0; background: #4a4f57; color: #fff; display: flex; gap: 3px; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; cursor: pointer; }
.under.virus { background: #6b2a2a; }
.gslot:has(.fcard) .under { bottom: -14px; height: 16px; }
.fcard { position: relative; z-index: 1; cursor: pointer; border-radius: 6px; }
.fcard.asked { outline: 3px solid var(--amber-hi); outline-offset: 1px; }
.fcard.picked { outline: 3px solid var(--ok); }
.fcard.moved { animation: arrive .7s ease-out; }
@keyframes arrive { from { transform: translateY(-8px) scale(1.06); filter: brightness(1.4); } }
.fcard .ctrl { position: absolute; right: -6px; top: -6px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; background: #111; border: 2px solid var(--amber-hi); color: #fff; font-weight: 900; font-size: .88rem; display: grid; place-items: center; z-index: 2; }
.fcard .ctrl.neg { border-color: var(--bad); }
.toks { position: absolute; left: -4px; bottom: 4px; display: flex; flex-direction: column; gap: 2px; z-index: 2; }
.tok { font-size: .66rem; font-weight: 800; padding: 1px 4px; border-radius: 4px; display: inline-flex; gap: 2px; align-items: center; color: #111; }
.tok.c { background: var(--red); color: #fff; } .tok.g { background: var(--purple); color: #fff; } .tok.s { background: var(--yellow); } .tok.d { background: var(--blue); } .tok.f { background: #cfe9ff; }

/* card faces */
.cf { position: relative; overflow: visible; flex: none; }
.cf .card { filter: none; }
.cf.back .back-in { width: 100%; height: 100%; border-radius: 6px; background: repeating-linear-gradient(135deg, #273041 0 8px, #222a38 8px 16px); border: 2px solid #3d4a60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #9fb0c8; text-align: center; padding: 4px; }
.cf.back .back-in i { font-size: 1.4em; }
.cf.back .back-in span { font-size: .6rem; line-height: 1.1; overflow: hidden; max-height: 3.4em; word-break: break-word; }
.cf.back .back-in b { color: #fff; }
.standin { width: 128.72px; height: 193.92px; background: #d8d8da; color: #222; border-radius: 6px; display: flex; flex-direction: column; font-size: 8px; padding: 6px; gap: 3px; }
.standin .si-top { display: flex; gap: 4px; align-items: center; } .standin .si-cost { background: #222; color: #fff; padding: 1px 4px; border-radius: 3px; font-weight: 800; }
.standin .si-name { font-weight: 800; font-size: 9px; }
.standin .si-art { flex: 1; background: #333; color: #fff; border-radius: 4px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px; }
.standin .si-lanes { display: flex; gap: 2px; } .standin .si-lanes i { width: 10px; height: 6px; border: 1px solid #fff; }
.standin .si-bottom { display: flex; justify-content: space-between; } .standin .si-pow { font-weight: 900; font-size: 11px; }
.standin .si-text { font-size: 7px; line-height: 1.25; min-height: 36px; }

/* market + log */
.market-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mslot { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 8px; background: var(--ink-700); border: 1px solid transparent; flex: 1 1 150px; }
.mslot.empty { color: var(--text-faint); justify-content: center; align-items: center; min-height: 60px; }
.mslot.can { border-color: rgba(240, 144, 27, .5); }
.mslot.selected { border-color: var(--amber-hi); box-shadow: var(--glow); }
.mcard { background: none; border: 0; padding: 0; cursor: pointer; }
.mmeta { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; }
.log-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; font-size: .78rem; line-height: 1.45; }
.game.narrow .log-list { max-height: 260px; }
.log-list li { padding: 1px 0; color: var(--text-dim); }
.log-list li.me b { color: var(--me); } .log-list li.op b { color: var(--op); }
.log-list li.sys { color: var(--text-faint); font-style: italic; }
.log-list li.log-round { color: var(--amber-hi); font-weight: 700; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; font-style: normal; }

/* dock: status line + hand, always at the bottom */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(15, 18, 22, .96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); padding: 8px clamp(8px, 1.6vw, 20px) calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.status .prompt { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.thinking::after { content: '…'; animation: dots 1s steps(3) infinite; }
@keyframes dots { 0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } }
.ask { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(240, 144, 27, .1); border: 1px solid var(--amber-dim); }
.ask-q { font-weight: 700; color: var(--amber-hi); }
.ask-opts { display: flex; gap: 6px; flex-wrap: wrap; max-height: 30vh; overflow: auto; }
.opt { min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink-700); cursor: pointer; text-align: left; }
.opt.on { border-color: var(--ok); background: rgba(57, 181, 74, .18); }
.hands { display: flex; gap: 14px; align-items: flex-end; overflow-x: auto; padding-bottom: 2px; }
.hand { display: flex; gap: 6px; }
.hcard { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 8px; transition: transform .12s; position: relative; }
.hcard.can:focus-visible { transform: translateY(-6px); }
@media (hover:hover) and (pointer:fine) { .hcard.can:hover { transform: translateY(-6px); } }
.hcard.can::after { content: ''; position: absolute; inset: -3px; border-radius: 9px; border: 2px solid rgba(240, 144, 27, .55); pointer-events: none; }
.hcard.selected::after { border-color: var(--amber-hi); border-width: 3px; }
.hcard.asked::after { content: ''; position: absolute; inset: -3px; border-radius: 9px; border: 3px solid var(--amber-hi); }
.hcard.picked::after { border-color: var(--ok); }
.hcard:not(.can):not(.asked) { opacity: .78; }
.charge { display: flex; gap: 6px; align-items: flex-end; padding-left: 12px; border-left: 1px dashed var(--line); }
.charge .lbl { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .7rem; color: var(--yellow); }

/* play sheet + modals */
.sheet, .modal { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.modal { align-items: center; }
.sheet[hidden], .modal[hidden] { display: none; }
.sheet-box { width: min(760px, 100%); background: var(--ink-800); border: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 16px; display: flex; gap: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (max-width: 560px) { .sheet-box { flex-direction: column; align-items: center; } }
.sheet-info { flex: 1; min-width: 0; }
.sheet-info h3 { margin: 0 0 4px; }
.modal-box { position: relative; width: min(720px, 94vw); max-height: 90vh; overflow: auto; background: var(--ink-800); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.modal-box .close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 8px; border: 0; background: var(--ink-700); font-size: 1.4rem; cursor: pointer; }
.modal-box.handoff, .modal-box.over { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.big-icon { font-size: 2.4rem; color: var(--amber-hi); }
.pv { display: flex; gap: 16px; flex-wrap: wrap; }
.pv-info { flex: 1; min-width: 220px; }
.notes { margin: 8px 0 0; padding-left: 18px; color: var(--text-dim); font-size: .82rem; }
.facgrid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fg { background: none; border: 0; padding: 0; cursor: pointer; }
.stats { border-collapse: collapse; margin: 6px 0 10px; }
.stats td, .stats th { padding: 4px 12px; border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------ start + rules pages */
.hub { max-width: 1100px; margin: 18px auto 60px; padding: 0 clamp(10px, 2.5vw, 28px); }
.hub-hero { padding: 26px 22px; border-radius: 14px; background: linear-gradient(135deg, rgba(240, 144, 27, .18), rgba(39, 170, 225, .08)); border: 1px solid var(--line); }
.hub-hero h2 { margin: 0 0 6px; font-family: 'Bungee', var(--font); font-weight: 400; letter-spacing: .02em; font-size: clamp(1.4rem, 3.6vw, 2.2rem); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; background: var(--ink-800); border: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 130px; }
.tile:hover, .tile:focus-visible { border-color: var(--amber); box-shadow: var(--glow); }
.tile i { font-size: 1.6rem; color: var(--amber-hi); }
.tile b { font-size: 1.1rem; }
.tile span { color: var(--text-dim); font-size: .86rem; line-height: 1.4; }
.tile.primary { background: rgba(240, 144, 27, .12); border-color: var(--amber-dim); }
.doc { max-width: 900px; margin: 18px auto 80px; padding: 0 clamp(12px, 3vw, 28px); line-height: 1.6; }
.doc h2 { font-family: 'Bungee', var(--font); font-weight: 400; margin-top: 28px; }
.doc h3 { margin-top: 18px; color: var(--amber-hi); }
.doc table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.doc td, .doc th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc .toc { display: flex; flex-wrap: wrap; gap: 6px; }
.doc .toc a { padding: 6px 10px; border-radius: 6px; background: var(--ink-700); color: inherit; text-decoration: none; font-size: .86rem; }
.doc code { background: var(--ink-700); padding: 1px 4px; border-radius: 4px; }
.status-ok { color: var(--ok); } .status-bad { color: var(--bad); }

/* Play view: board + hand share the viewport. Auxiliary panels are opened on demand. */
body.in-game{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}
body.in-game .arena-top{flex:none;margin:4px 8px 0;padding:6px 10px;gap:8px;flex-wrap:nowrap;min-height:42px}
body.in-game .arena-top .brand-mark{width:28px;height:28px;font-size:15px}
body.in-game .arena-top h1{font-size:17px;white-space:nowrap}
body.in-game .arena-top .brand-sub{display:none}
body.in-game .arena-top .topbar-right{flex-wrap:nowrap;gap:4px}
body.in-game .arena-top .btn{min-height:30px;padding:3px 7px;font-size:12px}
body.in-game #app{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
body.in-game .game{flex:1;min-height:0;overflow:auto;padding:6px 8px 2px;gap:12px}
body.in-game .game.wide{grid-template-columns:minmax(0,1fr) 310px}
body.in-game .game.narrow{grid-template-columns:minmax(0,1fr)}
body.in-game .board-col{min-height:0;display:flex;flex-direction:column}
body.in-game .board{width:100%;max-width:760px;margin:4px auto;gap:6px;align-items:start}
body.in-game .lane{padding:4px;gap:4px;border-top-width:3px}
body.in-game .lane-head{min-height:32px;font-size:10px;gap:1px}
body.in-game .lane-head b{font-size:12px}
body.in-game .lane-score{padding:3px 4px;gap:2px;grid-template-columns:1fr auto 1fr}
body.in-game .lane-score .vs{grid-column:auto;grid-row:auto;font-size:8px}
body.in-game .lane-score .sc{font-size:12px}
body.in-game .row-slots{gap:8px}
body.in-game .pbar{padding:5px 8px;gap:4px 10px;flex-wrap:nowrap;min-height:34px;font-size:11px}
body.in-game .pbar .pname{gap:4px;white-space:nowrap}
body.in-game .pbar .stat{font-size:11px;gap:3px;padding:0;white-space:nowrap}
body.in-game .fchips{gap:4px;flex-wrap:nowrap}.in-game .fchip{font-size:10px;min-height:25px;padding:0 5px;gap:3px}
body.in-game .disk{font-size:12px;gap:1px}.in-game .disks{gap:3px}
body.in-game .side{position:static;min-height:0;max-height:100%;overflow:auto;gap:10px}
body.in-game .side .panel{padding:12px}.in-game .side .market-row{gap:6px}.in-game .side .mslot{flex-basis:100%;padding:5px}.in-game .side .mmeta{font-size:11px}
body.in-game .side .log-list{max-height:170px}
body.in-game .dock{position:relative;inset:auto;flex:none;padding:5px 10px calc(5px + env(safe-area-inset-bottom));gap:5px;max-height:55dvh}
.dock-tools{display:flex;align-items:center;justify-content:space-between;gap:8px}.dock-turn{font-size:10px;color:var(--text-dim)}
.arena .dock-tool{min-height:28px;font-size:11px;padding:3px 8px}.dock-tools .row{gap:5px}
body.in-game .status .prompt{min-height:32px;font-size:12px;gap:4px;flex-wrap:nowrap}
body.in-game .status .prompt>.row{flex-wrap:nowrap;flex:none;gap:5px}
body.in-game .status .btn{min-height:30px;font-size:11px;padding:4px 8px}
body.in-game .hands{padding:4px 4px 2px;min-height:0;gap:10px;flex:none;scrollbar-width:thin;overscroll-behavior-x:contain}
body.in-game .hand{gap:6px}.in-game .charge{gap:5px;padding-left:8px}.in-game .charge .lbl{font-size:10px}
body.in-game .fcard .ctrl{width:20px;min-width:20px;height:20px;font-size:10px;right:-6px;top:-4px;border-width:1px;padding:0 2px}
body.in-game .tok{font-size:9px;padding:1px 3px;gap:2px}.in-game .toks{bottom:3px;left:-8px;gap:1px}
body.in-game .under,body.in-game .gslot:has(.fcard) .under{z-index:3;left:-21px;right:auto;bottom:2px;width:18px;height:22px;padding:2px;border:1px solid #71808f;border-radius:4px;font-size:10px}
.hardware-card{background:none;border:0;padding:0;cursor:pointer;position:relative}.hardware-card::after{content:'⚙';position:absolute;left:-16px;bottom:2px;color:var(--amber-hi);font-size:14px}
body.in-game .ask{gap:5px;padding:6px 8px;font-size:12px;max-height:28dvh;overflow:auto}
body.in-game .ask-opts{max-height:14dvh}.in-game .opt{min-height:32px;font-size:11px;padding:4px 8px}
body.in-game .modal-box{max-height:92dvh;padding:20px 14px 14px}.modal-box>.market>h3,.modal-box>.log h3{padding-right:30px}
body.in-game .sheet-box{max-height:90dvh;overflow:auto;align-items:start;padding:14px;gap:12px}
body.in-game .sheet-info .muted{font-size:11px}.in-game .sheet-info .cardtext{font-size:12px}.in-game .sheet-info .btn.big{min-height:40px;font-size:12px;padding:8px}
@media(max-width:760px){body.in-game .pbar{flex-wrap:wrap;gap:3px 8px;padding:4px 6px}.in-game .pbar .pname .arena-tag{font-size:8px;padding:2px 3px}.in-game .pbar .fchips{margin-left:auto}.in-game .fchip{font-size:9px;min-height:22px;padding:0 4px}.in-game .pbar .pname b{max-width:110px;overflow:hidden;text-overflow:ellipsis}.in-game .lane-head{min-height:30px}.in-game .lane-score .vs{font-size:7px}.in-game .status .prompt{font-size:11px}.in-game .status .prompt>span{max-width:64%}.in-game .sheet-box{flex-direction:row}.in-game .pv{flex-wrap:nowrap;gap:12px}.in-game .pv-info{min-width:0;overflow-wrap:anywhere}.in-game .pv .cf{max-width:42vw}.in-game .pv-info h3{font-size:15px}.in-game .pv-info p{font-size:12px}.in-game .pv-info .notes{font-size:11px}}
@media(max-width:480px){body.in-game .arena-top h1{font-size:12px}.in-game .arena-top .brand-mark{display:none}.in-game .arena-top .brand{gap:4px}.in-game .arena-top .btn{padding:4px 7px}.in-game .arena-top .topbar-right{gap:3px}.in-game .lane-head{font-size:8px}.in-game .lane-head b{font-size:10px}.in-game .dock-turn{font-size:9px}.in-game .lane-score .vs{font-size:6px}}
@media(max-height:520px){body.in-game .dock-tools{display:none}body.in-game .pbar .fchips{display:none}body.in-game .arena-top{min-height:32px;padding:2px 8px}body.in-game .ask{max-height:32dvh}}
/* Wrapped player stats and action buttons retain their measured height. */
body.in-game .pbar{flex:none}
body.in-game .status{min-width:0;width:100%;white-space:normal;padding:0;border:0;border-radius:0;background:none;overflow:visible}
body.in-game .status .prompt{width:100%;min-width:0;white-space:normal}
body.in-game .status .prompt>span{flex:1;min-width:0;max-width:none;white-space:normal;overflow-wrap:break-word}
body.in-game .status .prompt>.row{flex-shrink:0}
body.in-game .pbar .ai-kind{display:none}
body.in-game .gslot.target::before,body.in-game .gslot.asked::before{content:'';position:absolute;inset:-3px -15px}
@media(max-width:760px){body.in-game .pbar .fchips{flex-basis:100%;justify-content:flex-end;margin-left:0}}

/* Player information sits alongside each hand, outside the board. */
body.in-game .player-tray{display:grid;grid-template-columns:minmax(0,1fr) clamp(144px,22vw,250px);align-items:center;gap:8px;min-width:0}
body.in-game .opponent-tray{flex:none;padding:4px 8px 0}
body.in-game .player-tray .pbar{display:flex;flex-wrap:wrap;gap:3px 6px;align-content:center;width:100%;min-height:0;padding:5px 6px;overflow:hidden}
body.in-game .player-tray .pname{flex-basis:100%;min-width:0;font-size:12px}
body.in-game .player-tray .pbar .stat{font-size:10px;gap:2px}
body.in-game .player-tray .pbar .fchips{flex-basis:100%;justify-content:flex-start;gap:3px;margin:0;min-width:0}
body.in-game .player-tray .fchip{min-height:20px;font-size:9px;padding:0 4px}
body.in-game .player-tray .charge-mini{max-width:100%;overflow-x:auto;white-space:nowrap}
.rival-cards{min-width:0;padding:0 6px}.rival-hand-label{display:block;font-size:9px;color:var(--text-dim);margin-bottom:4px}
.opponent-hand{display:flex;gap:3px;max-width:100%;overflow:hidden;align-items:center}.opponent-hand .back-in{padding:2px}.opponent-hand .back-in i{font-size:10px}
body.in-game .board{max-width:none;margin:3px 0}
body.in-game .lane{gap:4px}
body.in-game .row-slots{grid-template-columns:minmax(0,1fr);width:100%;gap:6px;justify-items:center}
body.in-game .gslot{width:calc(100% - 16px);padding-bottom:var(--slot-footer,0px);min-width:0}
body.in-game .gslot .slot-index{left:5px;bottom:3px}
body.in-game .gslot .empty{font-size:20px;line-height:1}
body.in-game .under,body.in-game .gslot:has(.fcard) .under{left:0;right:0;bottom:0;top:auto;width:100%;height:14px;font-size:8px;border-radius:3px;padding:0 3px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body.in-game .hardware-card::after{content:none}
body.in-game .toks{flex-direction:row;flex-wrap:wrap;max-width:calc(100% + 12px);left:-6px;bottom:0;gap:2px}
body.in-game .own-tray .hands{min-width:0;width:100%;padding:8px 4px 3px;gap:10px}
body.in-game .hand{gap:0;align-items:flex-end}
body.in-game .hand .hcard{z-index:var(--hand-order,0);flex:none}
body.in-game .hand .hcard:focus-visible{z-index:30}
@media (hover:hover) and (pointer:fine){body.in-game .hand .hcard:hover{z-index:30}}
body.in-game .charge:has(>.lbl:only-child){display:none}
.card-hover{position:fixed;z-index:35;width:max-content;max-width:calc(100vw - 16px);padding:9px;border:1px solid #66717f;border-radius:12px;background:#10161ef5;box-shadow:0 18px 60px #000b;pointer-events:none}
.card-hover[hidden]{display:none!important}.card-hover .cf{filter:drop-shadow(0 3px 5px #0005)}
.card-hover__caption{font:600 11px/1.4 var(--font);color:#ecf0f4;padding:7px 1px 0;max-width:280px;overflow-wrap:anywhere}
.card-hover__stats{font-size:11px;color:var(--amber-hi);display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px}
.card-hover .toks{position:static;max-width:none;display:flex;flex-direction:row;gap:3px}
@media(max-width:760px){body.in-game .player-tray .pbar .pname b{max-width:115px}body.in-game .player-tray .disk{font-size:10px}.rival-hand-label{font-size:8px}body.in-game .dock{padding-left:8px;padding-right:8px}.card-hover__caption{font-size:10px}}
/* Align the three lane columns even when a reward wraps onto a second line. */
body.in-game .lane-head{height:42px;min-height:42px;justify-content:center}
body.in-game .lane-score{height:24px;min-height:24px}
@media(max-width:760px){body.in-game .player-tray .pbar{gap:2px 3px}body.in-game .player-tray .pbar .stat{font-size:9px;gap:2px}body.in-game .player-tray .disks{gap:2px}}

/* iPad mini and similarly sized tablets: give play controls finger-sized
   targets while the existing fitted board remains scrollable. */
@media (min-width:700px) and (max-width:1180px) {
  .arena .btn, .arena .seg button, .arena .linkbtn,
  .arena .modal-box .btn, .arena .game-row .btn, .arena .replay-tools .btn {
    min-width:44px; min-height:44px; touch-action:manipulation;
  }
  .arena .linkbtn { min-width:44px; padding:8px; }
  .arena .field input { min-height:44px; font-size:16px; }
  .arena .fac { padding-right:54px; }
  .arena .fac .fac-info { top:4px; right:4px; width:44px; height:44px; touch-action:manipulation; }
  .arena .modal-box .close { width:44px; height:44px; }
  .arena .notebox textarea, .arena .modal-box textarea { font-size:16px; }
  body.in-game .arena-top .btn { min-width:44px; min-height:44px; justify-content:center; }
  body.in-game .dock { gap:7px; }
  body.in-game .dock-tools { gap:6px; }
  body.in-game .dock-tools .row { gap:6px; }
  body.in-game .dock-tool,
  body.in-game .status .btn { min-width:44px; min-height:44px; padding:8px 10px; font-size:12px; justify-content:center; touch-action:manipulation; }
  body.in-game .player-tray .fchip { min-height:44px; padding:0 5px; font-size:10px; touch-action:manipulation; }
  body.in-game .player-tray .pbar .stat.link { min-height:44px; padding:0 5px; border-radius:6px; background:var(--ink-700); touch-action:manipulation; }
  body.in-game .player-tray .mini-card { min-height:44px; padding:4px 8px; }
  body.in-game .opt { min-height:44px; padding:8px 12px; font-size:12px; touch-action:manipulation; }
  body.in-game .sheet-info .btn { min-height:44px; }
  body.in-game .sheet-info .btn.big { min-height:48px; padding:10px 14px; }
  body.in-game .modal-box .close { width:44px; height:44px; }
  body.in-game .game,
  body.in-game .hands,
  body.in-game .side,
  body.in-game .modal-box,
  body.in-game .sheet-box,
  body.in-game .ask-opts { -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
  body.in-game .hcard,
  body.in-game .mcard,
  body.in-game .fcard,
  body.in-game .gslot.target { touch-action:manipulation; -webkit-user-select:none; user-select:none; }
}

/* ------------------------------------------------------------ playtest: archive, replay, notes, review */
.arena-tag.ok { background: var(--ok); color: #071a0a; }
.arena-tag.note { background: var(--amber-dim, #8a5410); color: #fff; margin-left: 6px; }
.archive summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.archive summary h3 { margin: 0; }
.games { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 420px; overflow: auto; }
.game-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: var(--ink-700); }
.game-row .gr-main { min-width: 0; flex: 1 1 320px; }
.game-row .gr-meta { font-size: .76rem; color: var(--text-dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.game-row .btn { min-height: 36px; }

/* replay bar in the dock */
body.replaying .dock { max-height: 62dvh; }
.replay { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.replay-controls { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.replay-controls .btn { min-width: 38px; justify-content: center; }
.replay-pos { font-size: 12px; color: var(--text-dim); margin-left: 6px; white-space: nowrap; }
.replay-track { display: flex; flex-direction: column; gap: 2px; }
.replay-range { width: 100%; accent-color: var(--amber); min-height: 26px; }
.curve { width: 100%; height: 44px; display: block; background: var(--ink-800); border-radius: 6px; cursor: pointer; }
.curve .mid { stroke: #3a414a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve .round { stroke: #2b323b; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.curve .line { fill: none; stroke: var(--amber-hi, #ffb43c); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve .now { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve circle.up { fill: var(--ok); } .curve circle.down { fill: var(--bad); }
.replay-step { font-size: 12.5px; line-height: 1.45; }
.replay-step b.me { color: var(--me); } .replay-step b.op { color: var(--op); }
.replay-log { list-style: none; margin: 0; padding: 4px 8px; max-height: 84px; overflow: auto; font-size: 11px; line-height: 1.4; background: var(--ink-800); border-radius: 6px; color: var(--text-dim); }
.replay-log li.me b { color: var(--me); } .replay-log li.op b { color: var(--op); } .replay-log li.sys { color: var(--text-faint); font-style: italic; }
.replay-tools .btn { min-height: 32px; font-size: 12px; }
.replay-tools .btn.on { border-color: var(--amber); color: var(--amber-hi); }
body.replaying .opponent-hand { overflow-x: auto; }
@media (max-width: 760px) { .replay-pos { width: 100%; margin: 0; } .curve { height: 34px; } }

/* notes */
.notebox { margin-top: 12px; padding: 10px; border-radius: 8px; background: var(--ink-700); display: flex; flex-direction: column; gap: 6px; position: relative; }
.notebox .btn { min-height: 34px; min-width: 38px; justify-content: center; }
.notebox textarea, .modal-box textarea, .review input, .review textarea { width: 100%; background: var(--ink-800); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; }
.review input { min-height: 36px; }
.note-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.note-list li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.note-list i { color: var(--amber-hi); }
.flash { position: absolute; right: 10px; top: 8px; font-size: 11px; color: var(--ok); }

/* review sheet */
.modal-box.review { width: min(980px, 98vw); max-height: 94dvh; padding: 0 0 12px; }
.review-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; background: var(--ink-800); border-bottom: 1px solid var(--line); }
.review-head h2 { margin: 0; font-size: 1.15rem; }
.review-head .hint { margin: 4px 0 0; }
.rv-sec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rv-sec h3 { margin: 0 0 8px; color: var(--amber-hi); font-size: 1rem; }
.rv-sec h4 { margin: 14px 0 6px; font-size: .9rem; }
.rq { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.rq-l { font-size: 12px; color: var(--text-dim); }
@media (max-width: 600px) { .rq { grid-template-columns: 1fr; gap: 3px; } }
.seg.small { gap: 4px; }
.seg.small button { min-height: 34px; padding: 0 9px; font-size: 12px; }
.rv-fac { display: grid; grid-template-columns: 150px auto 1fr; gap: 8px; align-items: center; padding: 6px 8px 6px 10px; margin: 4px 0; border-radius: 8px; background: var(--ink-700); border-left: 4px solid var(--fc, var(--gray)); }
@media (max-width: 760px) { .rv-fac { grid-template-columns: 1fr; } }
.rv-card { display: flex; gap: 12px; padding: 10px; margin: 6px 0; border-radius: 10px; background: var(--ink-700); }
.rv-face { flex: none; align-self: flex-start; }
.rv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-scales { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.rv-scales > div { display: flex; flex-direction: column; gap: 3px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
/* Review and board chips share the Forge's .tag class with card keywords.
   Limit these controls to direct children of .tags so card text keeps its own
   font size, icon size and hexagonal banner. */
.tags > .tag { min-height: 28px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line); background: transparent; font-size: 11px; cursor: pointer; }
.tags > .tag.on { border-color: var(--amber); background: rgba(240, 144, 27, .18); color: var(--amber-hi); }
.rv-unused summary { cursor: pointer; color: var(--text-dim); font-size: 13px; padding: 6px 0; }
.review-foot { padding: 12px 16px 0; }
.bigcard { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .78); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; cursor: zoom-out; }
.bigcard .cardtext { max-width: 420px; text-align: center; font-size: 14px; }
/* The Forge's styles.css also defines .modal (820px wide, 84vh high): the Arena overlay must cover the whole viewport. */
body.arena .modal, body.arena .sheet { width: auto; max-height: none; box-shadow: none; }

/* playtest insights page */
.insights { max-width: 1280px; margin: 16px auto 80px; padding: 0 clamp(10px, 2.5vw, 28px); display: flex; flex-direction: column; gap: 14px; }
.ins-title { margin: 0; font-family: 'Bungee', var(--font); font-weight: 400; font-size: 1.4rem; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.kpis > div { background: var(--ink-700); border-radius: 8px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 120px; }
.kpis b { font-size: 1.6rem; color: var(--amber-hi); } .kpis span { font-size: 12px; color: var(--text-dim); }
.scroll { overflow-x: auto; }
table.ins { border-collapse: collapse; width: 100%; font-size: 13px; }
table.ins th, table.ins td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.ins td.num, table.ins th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ins th.sortable { cursor: pointer; user-select: none; }
table.ins tr.click { cursor: pointer; } table.ins tr.click:hover { background: var(--ink-700); }
table.ins tr.detail td { white-space: normal; background: var(--ink-700); }
.heat.hot2 { color: #fff; background: rgba(239, 65, 54, .55); } .heat.hot1 { background: rgba(239, 65, 54, .22); }
.heat.cold2 { color: #fff; background: rgba(39, 170, 225, .55); } .heat.cold1 { background: rgba(39, 170, 225, .22); }
.filters { margin: 6px 0 10px; } .filters select, .filters input[type=search], .filters input[type=number] { min-height: 38px; background: var(--ink-700); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font: inherit; }
.filters .check { margin: 0; }

/* playtest board */
.board .composer .field input, .board .composer .field textarea, .board .comment-add input, .board .designer-tools textarea, .board .tagpick input, .board .proposal input, .board .proposal select, .board .proposal textarea, .board .designer-tools select {
  width: 100%; min-height: 38px; background: var(--ink-700); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 13px; }
.board .composer .seg button { min-height: 38px; }
.board .err-line { color: var(--bad); min-height: 1em; margin: 4px 0; }
.tagpick { display: flex; flex-direction: column; gap: 6px; }
.tag-groups { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tag-group summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
.tag-group .tags { max-height: 120px; overflow: auto; padding: 4px 0; }
.tags.chosen:empty { display: none; }
.proposal { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 16px; margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--ink-700); }
.proposal-form { display: flex; flex-direction: column; gap: 8px; }
.proposal-form .pf { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-dim); }
.proposal-form .pf-group { display: flex; flex-direction: column; gap: 8px; }
.proposal-form .pf-group[hidden] { display: none; }
.proposal-form .check { margin: 0; min-height: 30px; color: var(--text); }
.proposal-preview { display: flex; flex-direction: column; gap: 8px; }
.proposal-host { width: 200px; pointer-events: none; }
.proposal-host.small { width: 130px; flex: none; }
.new-item-preview-title { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.new-item-checks { margin: 0; padding-left: 16px; color: var(--amber-hi); font-size: 12px; line-height: 1.4; }
.new-item-checks:empty { display: none; }
@media (max-width: 700px) { .proposal { grid-template-columns: 1fr; } .proposal-preview { order: -1; align-items: center; } }
.post { padding: 10px 14px; }
.post-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; cursor: pointer; }
.ptitle { flex: 1 1 260px; min-width: 0; }
.pmeta { font-size: 12px; color: var(--text-dim); }
.ptype, .pstatus { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--ink-600); white-space: nowrap; }
.ptype.t-rule { background: rgba(39, 170, 225, .25); } .ptype.t-idea { background: rgba(247, 148, 29, .25); } .ptype.t-card { background: rgba(57, 181, 74, .25); }
.ptype.t-balance { background: rgba(155, 89, 208, .3); } .ptype.t-bug { background: rgba(239, 65, 54, .3); }
.pstatus.s-open { color: var(--amber-hi); } .pstatus.s-answered, .pstatus.s-accepted, .pstatus.s-done { color: var(--ok); } .pstatus.s-rejected { color: var(--text-dim); } .pstatus.s-faq { background: var(--ok); color: #071a0a; }
.btn.vote { min-height: 32px; } .btn.vote.on { border-color: var(--amber); color: var(--amber-hi); }
.post .tags { margin-top: 6px; }
.ptext { white-space: pre-wrap; line-height: 1.5; }
.proposal-view { display: flex; gap: 14px; align-items: flex-start; margin: 8px 0; padding: 10px; border-radius: 10px; background: var(--ink-700); }
.answer { margin: 10px 0; padding: 10px 12px; border-left: 4px solid var(--ok); background: rgba(57, 181, 74, .1); border-radius: 6px; }
.answer p { margin: 6px 0 0; white-space: pre-wrap; }
.comments { list-style: none; margin: 10px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.comments li { padding: 6px 10px; border-radius: 6px; background: var(--ink-700); font-size: 13px; }
.comments li.designer { border-left: 3px solid var(--ok); }
.comment-add input { flex: 1; }
.designer-tools { margin-top: 10px; padding: 10px; border: 1px dashed var(--amber-dim, #8a5410); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.designer-tools label { font-size: 12px; color: var(--text-dim); display: inline-flex; gap: 6px; align-items: center; }
.doc dl.faq dt { font-weight: 700; margin-top: 12px; color: var(--amber-hi); }
.doc dl.faq dd { margin: 4px 0 0 0; white-space: pre-wrap; }
/* proposed keywords (board) */
.kw-editor { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--ink-700); display: flex; flex-direction: column; gap: 6px; }
.kw-rows { display: flex; flex-direction: column; gap: 10px; }
.kw-row { padding: 8px; border-radius: 8px; background: var(--ink-800); display: flex; flex-direction: column; gap: 6px; }
.kw-row-head { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; align-items: end; }
.kw-row .pf { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-dim); }
.kw-row input, .kw-row textarea { width: 100%; min-height: 36px; background: var(--ink-700); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 13px; }
.kw-row-icon { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kw-row-icon input[type=text], .kw-row-icon > input:not([type]) { flex: 1 1 220px; }
.kw-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--paper, #f3f3f4); color: #555; }
.kw-icon img { max-width: 30px; max-height: 30px; }
.kw-warn { color: var(--bad); font-size: 12px; }
.kw-warn:empty { display: none; }
.kw-unknown { display: flex; flex-direction: column; }
.kw-unknown .hint { margin: 2px 0; color: var(--amber-hi); }
.kw-proposals { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.kw-prop { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; background: var(--ink-700); }
.kw-prop p { margin: 4px 0 0; }
@media (max-width: 600px) { .kw-row-head { grid-template-columns: 1fr 90px auto; } }

/* replay analysis and move feedback */
.replay-analysis { text-transform: none; letter-spacing: normal; font-family: inherit; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--ink-700, #333); padding-top: 6px; max-height: 46dvh; overflow: auto; font-size: 12.5px; }
.replay-analysis.off { max-height: none; }
.an-head { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.an-head .btn { min-height: 32px; font-size: 12px; }
.an-head .btn.on { border-color: var(--amber); color: var(--amber-hi); }
.an-who { margin: 0; }
.an-line { margin: 0; line-height: 1.45; }
.an-list { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.an-list li { display: grid; grid-template-columns: 2.2em 1fr minmax(60px, 22%) 3.4em; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 6px; background: var(--ink-800); cursor: pointer; }
.an-list li.best { outline: 1px solid var(--amber); }
.an-list li.played { background: color-mix(in srgb, var(--me) 18%, var(--ink-800)); cursor: default; }
.an-list li.chosen { outline: 2px solid var(--amber-hi); }
.an-rank { color: var(--text-dim); text-align: right; }
.an-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--amber) var(--p), rgba(255,255,255,.12) var(--p)); }
.an-prob { text-align: right; font-variant-numeric: tabular-nums; }
.fb-form { display: flex; flex-direction: column; gap: 6px; }
.fb-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.fb-chips .chip { min-height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--ink-700, #444); background: var(--ink-800); color: inherit; font-size: 12px; cursor: pointer; }
.fb-chips .chip.on { border-color: var(--amber); color: var(--amber-hi); }
.fb-form select, .fb-form textarea { width: 100%; font: inherit; background: var(--ink-800); color: inherit; border: 1px solid var(--ink-700, #444); border-radius: 6px; padding: 6px; }
.fb-form .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.fb-list li { background: var(--ink-800); border-radius: 6px; padding: 4px 6px; }
@media (max-width: 760px) { .an-list li { grid-template-columns: 2em 1fr 3.2em; } .an-bar { display: none; } }
/* iPhone portrait: respect the sensor housing, home indicator and finger-sized controls. */
@media (max-width: 699px) {
  html, body.arena { max-width: 100%; overflow-x: hidden; }
  .arena-top { padding-top: max(8px, env(safe-area-inset-top)); }
  body.arena .arena-top .topbar-right > a { display: none; }
  body.arena .arena-top .topbar-right > .account-links { display: none; }
  body.arena .arena-top .arena-compact-menu { display: block; position: relative; }
  body.arena .arena-top .tablet-nav-toggle { display: none !important; }
  body.arena .arena-top .topbar-right { margin-left: auto; }
  body.arena .arena-top .arena-compact-menu > summary { min-width: 44px; min-height: 44px; }
  .arena .btn, .arena .seg button, .arena .linkbtn,
  .arena .modal-box .close, .arena .fac .fac-info,
  body.in-game .dock-tool, body.in-game .status .btn,
  body.in-game .opt { min-width: 44px; min-height: 44px; touch-action: manipulation; }
  .arena .field input, .arena input[type="text"], .arena input[type="search"],
  .arena textarea, .arena select { font-size: 16px; }
  .arena .fac { padding-right: 54px; }
  .arena .fac .fac-info { top: 4px; right: 4px; display: grid; place-items: center; }
  .setup { margin-bottom: 0; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .startbar { bottom: env(safe-area-inset-bottom); padding-bottom: 14px; }
  .hub { padding: 0 12px calc(36px + env(safe-area-inset-bottom)); }
  .hub-hero { padding: 20px 16px; }
  body.in-game .arena-top { margin-top: 0; padding-top: max(6px, env(safe-area-inset-top)); }
  body.in-game .game { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  body.in-game .board { gap: 3px; }
  body.in-game .lane { padding: 3px 2px; }
  body.in-game .dock { max-height: 48dvh; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  body.in-game .dock-tools { min-width: 0; }
  body.in-game .dock-tools .row { min-width: 0; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  body.in-game .dock-tools .row > * { flex: none; }
  body.in-game .status .prompt { min-height: 44px; }
  body.in-game .status .prompt > .row { flex-wrap: wrap; justify-content: flex-end; }
  body.in-game .hands, body.in-game .ask-opts, body.in-game .side,
  body.in-game .sheet-box, body.in-game .modal-box { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  body.in-game .gslot.target, body.in-game .gslot.asked,
  body.in-game .hcard, body.in-game .mcard { touch-action: manipulation; }
}

/* A short, thumb-friendly review appears after a completed game. */
.modal-box.quick-review { width: min(520px, calc(100vw - 20px)); max-height: min(92dvh, 720px); padding: 0; overflow: auto; }
.quick-review .review-head { padding: 18px 18px 14px; }
.quick-review .review-head h2 { font-size: 1.25rem; }
.quick-questions { display: grid; gap: 2px; padding: 4px 18px 18px; }
.quick-question { padding: 14px 0; border-bottom: 1px solid var(--line); }
.quick-question:last-child { border: 0; }
.quick-question h3 { margin: 0 0 10px; font-size: .94rem; }
.quick-question .seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 7px; }
.quick-question .seg button { min-height: 52px; padding: 8px 4px; white-space: normal; text-align: center; font-size: .82rem; }
.quick-actions { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 10px; padding: 14px 18px max(14px, env(safe-area-inset-bottom)); background: var(--ink-800); border-top: 1px solid var(--line); }
.quick-actions .btn { min-height: 50px; justify-content: center; }
.quick-actions .btn.primary { flex: 1; }

/* Card previews show the full Forge face; the duplicate text lives behind Info. */
body.arena .modal-box.card-preview { width: min(540px, calc(100vw - 20px)); max-height: 96dvh; padding: 12px; overflow: hidden; }
.card-preview .close { z-index: 3; }
.pv-large { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.pv-toolbar { width: 100%; min-height: 44px; display: flex; align-items: center; }
.pv-info-toggle { min-height: 44px; min-width: 76px; position: relative; z-index: 3; }
.pv-info-panel { position: absolute; inset: 64px 12px auto; max-height: calc(100% - 76px); z-index: 2; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-800); box-shadow: 0 12px 30px rgba(0,0,0,.5); overscroll-behavior: contain; }
.pv-info-panel[hidden] { display: none; }
.pv-info-panel h3 { margin: 0 0 10px; }
.pv-info-panel .cardtext { font-size: 15px; }
.bigcard .pv-info-toggle { position: absolute; top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
.bigcard .pv-info-panel { inset: 74px max(12px, calc((100vw - 520px) / 2)) auto; max-height: calc(100dvh - 94px); }

