:root {
  --bg: #f6f5f1; --card: #fff; --ink: #1d1d22; --muted: #666a75; --line: #dcdad2;
  --accent: #2b59c3; --accent-ink: #fff; --good: #1e8e5a; --bad: #c4372c; --warn: #b8801a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15161a; --card: #202228; --ink: #ececf0; --muted: #9a9eab; --line: #34363f; --accent: #6b93f0; --accent-ink: #0d1020; --good: #3fc08a; --bad: #ef6a5e; --warn: #e0a642; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
#app, .wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
.bar { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.bar h1 { font-size: 1.25rem; margin: 0; flex: 1; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.code { font: 700 1.1rem ui-monospace, Menlo, monospace; letter-spacing: .2em; padding: 6px 12px; border: 1px dashed var(--line); background: var(--card); color: var(--ink); border-radius: 8px; cursor: pointer; }
.card, main > section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.players { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 4px 0 8px; }
.players li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: .9rem; }
.players li.away { opacity: .5; }
.tag { margin-left: 6px; font-size: .7rem; text-transform: uppercase; color: var(--muted); }
.btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, .code:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=text], input:not([type]) { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-height: 44px; width: 100%; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 8px 0 4px; }
.sr { position: absolute; left: -9999px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row input#code, .row input#room { width: 6.5em; text-transform: uppercase; letter-spacing: .15em; text-align: center; }
.row input:not(#code):not(#room):not([type=number]) { flex: 1; min-width: 10em; }
.or { color: var(--muted); }
.error { color: var(--bad); font-weight: 600; }
.banner { background: var(--warn); color: #000; text-align: center; padding: 6px; border-radius: 8px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; max-width: 90vw; }
.muted { color: var(--muted); }
.big { font-size: 1.6rem; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick { text-align: left; }
.pick[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.log { padding-left: 1.2em; }
.win { color: var(--good); font-weight: 700; }
.lose { color: var(--bad); font-weight: 700; }
/* hub */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.tile { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.tile:hover, .tile:focus-visible { border-color: var(--accent); }
.tile h2 { margin: 0 0 6px; font-size: 1.1rem; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }
/* wavelength */
.ends { display: flex; justify-content: space-between; font-weight: 600; }
.dial { width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
thead th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; }
/* wavelength dial */
.dial-wrap { max-width: 520px; margin: 8px auto; }
.dial-svg { width: 100%; height: auto; display: block; touch-action: none; }
.dial-svg.live { cursor: grab; }
.dial-face { stroke: var(--ink); stroke-width: 3; }
.wedge.z2 { fill: #ffd95a; } .wedge.z3 { fill: #ff9f2e; } .wedge.z4 { fill: #1e9a5a; }
.needle { stroke: var(--ink); stroke-width: 6; }
.target-tick { stroke: var(--good); stroke-width: 5; }
.hub { fill: var(--ink); }
.dial-hint { font: 700 56px system-ui, sans-serif; fill: var(--ink); opacity: .35; }
.dial-wrap .ends { margin-top: 6px; }
/* team games */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team { border: 2px solid var(--line); border-radius: 12px; padding: 10px; }
.team.red { border-color: #d1664a; } .team.blue { border-color: #4a6fd1; }
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile-card { font: inherit; font-weight: 600; min-height: 56px; padding: 4px; border: 2px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; word-break: break-word; }
.tile-card:disabled { cursor: default; }
.tile-card[data-color=red] { background: #d1664a; color: #fff; border-color: #d1664a; }
.tile-card[data-color=blue] { background: #4a6fd1; color: #fff; border-color: #4a6fd1; }
.tile-card[data-color=neutral] { background: #bdb7a5; color: #222; border-color: #bdb7a5; }
.tile-card[data-color=assassin] { background: #111; color: #fff; border-color: #111; }
.tile-card.hint[data-color=red] { box-shadow: inset 0 0 0 3px #d1664a; background: var(--card); color: var(--ink); }
.tile-card.hint[data-color=blue] { box-shadow: inset 0 0 0 3px #4a6fd1; background: var(--card); color: var(--ink); }
.tile-card.hint[data-color=assassin] { box-shadow: inset 0 0 0 3px #111; background: var(--card); color: var(--ink); text-decoration: underline; }
.dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .3em; }
.dot.red { background: #d1664a; } .dot.blue { background: #4a6fd1; }
@media (max-width: 480px) { .board { gap: 4px; } .tile-card { font-size: .75rem; min-height: 48px; } }
/* drawing */
.draw-wrap { position: relative; }
.pad { width: 100%; aspect-ratio: 4 / 3; background: #fff; border: 2px solid var(--line); border-radius: 8px; touch-action: none; display: block; cursor: crosshair; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { border-color: var(--ink); }
.mask { font: 700 1.6rem ui-monospace, Menlo, monospace; letter-spacing: .25em; }
.chat { max-height: 220px; overflow: auto; }
.group { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 0; }

[hidden] { display: none !important; }
.players .x { font: inherit; margin-left: 6px; padding: 0 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 50%; }
.players .x:hover, .players .x:focus-visible { color: var(--bad); }
/* fleet */
.fb { display: inline-block; }
.fb-row { display: flex; }
.fb-label { width: 1.6em; text-align: center; font-size: .75rem; color: var(--muted); line-height: 2.2em; }
.fb-cell { width: 2.2em; height: 2.2em; border: 1px solid var(--line); background: #3d6fa8; color: #fff; font: 700 .9rem system-ui; padding: 0; display: flex; align-items: center; justify-content: center; }
button.fb-cell { cursor: crosshair; }
button.fb-cell:hover:not(:disabled), button.fb-cell:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.fb-cell.ship { background: #6b7280; } .fb-cell.ship.dim { opacity: .55; }
.fb-cell.miss { background: #9db7d1; color: #234; }
.fb-cell.hit { background: #c4372c; } .fb-cell.sunk { background: #5b1a14; }
.fb-pair { display: flex; gap: 20px; flex-wrap: wrap; }
@media (max-width: 480px) { .fb-cell { width: 1.8em; height: 1.8em; font-size: .75rem; } }
/* trivia */
.win-card { background: var(--good) !important; color: #fff !important; border-color: var(--good) !important; }
.lose-card { background: var(--bad) !important; color: #fff !important; border-color: var(--bad) !important; }
.tap { width: 100%; min-height: 160px; border: 0; border-radius: 16px; font: 800 2rem system-ui; background: var(--bad); color: #fff; cursor: pointer; }
.tap.go { background: var(--good); }
select { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-height: 44px; width: 100%; margin-top: 8px; }
.banner.info { background: var(--accent); color: var(--accent-ink); }
.waiting { list-style: none; padding: 0; margin: 0; }
.waiting li { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.waiting li span { flex: 1; font-weight: 600; }
/* two truths / tier list */
.card.lie { border-color: var(--bad); }
.rate { margin: 14px 0; }
.rate input[type=range] { flex: 1; min-width: 8em; }
.tier { display: inline-block; min-width: 1.8em; text-align: center; padding: 2px 8px; border-radius: 6px; font-weight: 800; color: #111; }
.tier-row { display: flex; gap: 10px; align-items: baseline; margin: 8px 0; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.bar-name { width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-num { width: 2em; text-align: right; font-weight: 700; }
textarea { font: inherit; width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.skip { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
/* phish or legit */
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); margin: 8px 0; }
.msg-kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.msg-from { font-weight: 600; word-break: break-all; }
.msg-subject { font-weight: 700; margin: 4px 0 8px; }
.msg-body p { margin: 6px 0; }
.msg-sms, .msg-chat { border-radius: 18px; }
.msg-web .addr { font-family: ui-monospace, Menlo, monospace; background: var(--bg); padding: 6px 10px; border-radius: 6px; word-break: break-all; }
.msg-call { border-style: dashed; }
.attach { margin-top: 8px; padding: 6px 10px; background: var(--bg); border-radius: 6px; display: inline-block; }
.link { margin-top: 10px; padding: 8px 10px; background: var(--bg); border-radius: 6px; word-break: break-all; }
.link code { font-size: .85rem; }
/* quest */
.qbox { display: inline-flex; flex-direction: column; align-items: center; min-width: 5.5em; padding: 6px 8px; border: 2px solid var(--line); border-radius: 8px; background: var(--card); }
.qbox strong { font-size: 1.3rem; } .qbox small { color: var(--muted); font-size: .7rem; text-align: center; }
/* rules panel */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding: 20px 12px; overflow-y: auto; z-index: 50; }
.modal-card { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 680px; padding: 16px 18px 22px; }
.modal-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; position: sticky; top: 0; background: var(--card); padding-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.rules h3 { margin: 18px 0 6px; font-size: 1rem; }
.rules p, .rules ul { margin: 6px 0; } .rules ul { padding-left: 1.2em; }
.rules table { margin: 8px 0; }
/* cipher room */
.cipher-text { font: 700 1.4rem ui-monospace, Menlo, monospace; word-break: break-all; letter-spacing: .06em; }
.chart { max-height: 240px; overflow: auto; }
.chart table { font-size: .85rem; }
/* breach protocol */
.device { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 8px; font-family: ui-monospace, Menlo, monospace; }
.ind.lit { color: var(--good); font-weight: 700; }
section.done { opacity: .55; }
.cable { min-width: 64px; min-height: 64px; border-radius: 10px; border: 3px solid rgba(0,0,0,.35); font: 700 1.1rem system-ui; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cable span { font-size: .65rem; font-weight: 400; }
.cable-red { background: #d33a2c; } .cable-blue { background: #2f6fe0; } .cable-yellow { background: #f2c94c; color: #222; } .cable-white { background: #f4f4f4; color: #222; } .cable-black { background: #222; } .cable-green { background: #2e9e5b; }
.cable.cut { opacity: .35; text-decoration: line-through; }
.bigbtn { width: 180px; height: 180px; border-radius: 50%; border: 6px solid rgba(0,0,0,.3); font: 800 1.2rem system-ui; color: #fff; cursor: pointer; touch-action: none; user-select: none; }
.bigbtn-red { background: #d33a2c; } .bigbtn-blue { background: #2f6fe0; } .bigbtn-yellow { background: #f2c94c; color: #222; } .bigbtn-white { background: #f4f4f4; color: #222; }
.bigbtn:active { transform: scale(.96); }
.strip { margin-top: 8px; padding: 4px 10px; border-radius: 6px; display: inline-block; background: var(--line); }
.strip-blue { background: #2f6fe0; color: #fff; } .strip-white { background: #f4f4f4; color: #222; } .strip-yellow { background: #f2c94c; color: #222; } .strip-red { background: #d33a2c; color: #fff; } .strip-green { background: #2e9e5b; color: #fff; }
.pw { align-items: flex-start; } .pwcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pwletter { font: 800 2rem ui-monospace, Menlo, monospace; width: 2em; text-align: center; border: 2px solid var(--line); border-radius: 8px; }
.port { min-width: 84px; padding: 8px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.port.open { background: var(--good); color: #fff; border-color: var(--good); } .port span { font-size: .7rem; font-weight: 400; }
.alert-GREEN { color: var(--good); } .alert-YELLOW { color: var(--warn); } .alert-ORANGE { color: #f08a24; } .alert-RED { color: var(--bad); }
.words { font-family: ui-monospace, Menlo, monospace; line-height: 1.9; }
/* hookhunter */
progress { flex: 1; height: 14px; } .art { border-radius: 10px; } .check { display: inline-flex; align-items: center; gap: 4px; margin: 0 10px 0 0; color: var(--ink); font-size: 1rem; }
.sithcard { width: 120px; height: auto; border-radius: 6px; vertical-align: middle; }
.sithcard.big { width: 170px; display: block; margin: 8px 0; }
.sithcard.small { width: 90px; }
.playmat { width: 100%; max-width: 640px; height: auto; border-radius: 6px; display: block; }
.sithbtn { background: none; border: 2px solid transparent; border-radius: 8px; padding: 4px; cursor: pointer; color: inherit; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.sithbtn:hover, .sithbtn:focus-visible { border-color: var(--line); }
.avcard { width: 120px; height: auto; border-radius: 8px; vertical-align: middle; }
.avcard.big { width: 170px; display: block; margin: 8px 0; }
.avcard.small { width: 100px; }
.avboard { width: 100%; max-width: 640px; height: auto; border-radius: 6px; display: block; margin-bottom: 8px; }
.avbtn { background: none; border: 2px solid transparent; border-radius: 10px; padding: 4px; cursor: pointer; }
.avbtn:hover, .avbtn:focus-visible { border-color: var(--line); }
.mock { border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin: 8px 0; overflow: hidden; }
.mock > * { padding-left: 14px; padding-right: 14px; }
.mock-bar { padding-top: 8px; padding-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.mock-head { display: flex; gap: 10px; align-items: center; padding-top: 10px; padding-bottom: 4px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; flex: none; }
.mock .msg-subject { padding-top: 6px; }
.mock .msg-body { padding-bottom: 10px; }
.mock .attach, .mock .link { margin: 0 14px 12px; padding: 8px 10px; }
.mock-sms .bubble, .mock-chat .bubble { max-width: 85%; margin: 8px 14px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; }
.mock-sms, .mock-chat { padding-bottom: 6px; }
.browser-bar { display: flex; gap: 10px; align-items: center; padding-top: 8px; padding-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.browser-bar .dots { color: var(--muted); font-size: .6rem; letter-spacing: 2px; }
.browser-bar .url { font: .85rem ui-monospace, Menlo, monospace; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; word-break: break-all; flex: 1; }
.mock-web .page { padding-top: 12px; padding-bottom: 8px; }
.mock-call .callhead { display: flex; gap: 12px; align-items: center; padding-top: 14px; padding-bottom: 8px; }
.mock-item { padding: 12px 14px; }
.fakelink { color: #2f6fe0; text-decoration: underline; }
.peek-row { display: block; margin-top: 4px; }
.peek { background: none; border: 1px dashed var(--line); border-radius: 6px; padding: 2px 8px; font-size: .78rem; color: var(--muted); cursor: pointer; }
.peek-out code { word-break: break-all; }
.chipbtn { font: inherit; border: 1px solid var(--line); background: var(--card); color: inherit; border-radius: 16px; padding: 4px 12px; cursor: pointer; }
.chipbtn:hover, .chipbtn:focus-visible { border-color: var(--accent); }
.avcard.tiny { width: 64px; } .lcard { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; }
.spycard { width: 150px; height: auto; border-radius: 8px; vertical-align: middle; }
.spycard.big { width: 200px; display: block; margin: 8px 0; }
.spycard.small { width: 90px; }
.locbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; }
.loccard { width: 100%; max-width: 110px; height: 70px; object-fit: cover; object-position: top; border-radius: 6px; }
.locbtn[aria-pressed="true"] { opacity: .35; text-decoration: line-through; }
.turnpill { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .8rem; border-radius: 999px; padding: 3px 10px; }
@media (prefers-reduced-motion: no-preference) {
  main.phase-in > section, main.phase-in > div { animation: phasein .22s ease-out both; }
  @keyframes phasein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: no-preference) {
  .reveal .flip { display: inline-block; animation: flipin .5s ease-out both; }
  @keyframes flipin { from { transform: rotateY(90deg) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
}
.ekcard { width: 120px; height: auto; border-radius: 8px; vertical-align: middle; }
.ekcard.small { width: 80px; }
.ekbtn { background: none; border: 3px solid transparent; border-radius: 12px; padding: 2px; cursor: pointer; color: inherit; }
.ekbtn.on { border-color: var(--accent); transform: translateY(-6px); }
.ekbtn:hover, .ekbtn:focus-visible { border-color: var(--line); }
.ekbtn.on:hover { border-color: var(--accent); }
.actcard { width: 58px; height: auto; border-radius: 5px; display: block; }
.cardbtn { padding: 3px; }
.rolecard { width: 110px; height: auto; border-radius: 8px; }
.toolicon { width: 18px; height: 18px; vertical-align: middle; }
.trainbtn { background: none; border: 2px solid transparent; border-radius: 8px; padding: 1px; cursor: pointer; }
.trainbtn:hover:not(:disabled), .trainbtn:focus-visible { border-color: var(--accent); }
.trainbtn:disabled { opacity: .4; cursor: default; }
.tile-card { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; text-align: center; }
.board.pics { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile-card.pic { padding: 0; min-height: 0; aspect-ratio: 5 / 7; align-items: center; }
.tile-card.pic[data-color=""], .tile-card.pic.hint { background: #dcc79c; border-color: #b59a62; }
.tile-card.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-card.pic[data-color=red], .tile-card.pic[data-color=blue], .tile-card.pic[data-color=neutral], .tile-card.pic[data-color=assassin] { align-items: center; }
.tile-card.pic .agent { position: static; width: 60%; max-width: none; }
.tile-card.pic.hint[data-color] { box-shadow: none; border-width: 4px; }
.tile-card.pic.hint[data-color=red] { border-color: #d1664a; } .tile-card.pic.hint[data-color=blue] { border-color: #4a6fd1; }
.tile-card.pic.hint[data-color=assassin] { border-color: #111; } .tile-card.pic.hint[data-color=neutral] { border-color: #8a8470; }
.tile-card .agent { position: absolute; inset: 2px 0 auto 0; margin: 0 auto; width: 56%; max-width: 44px; opacity: .9; }
.tile-card[data-color=red] .agent, .tile-card[data-color=blue] .agent, .tile-card[data-color=neutral] .agent, .tile-card[data-color=assassin] .agent { filter: brightness(1.25); }
.tile-card .cw { position: relative; text-shadow: 0 0 3px rgba(0,0,0,.55); }
.keycard { width: 90px; height: 90px; float: right; margin: 0 0 6px 8px; }
.dscreen { width: 100%; max-width: 360px; display: block; }
.nb { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 12px; font-size: .85rem; }
.nbcol { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; min-height: 3.2em; }
.nbhead { font-weight: 800; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.scene3d { width: 100%; max-width: 860px; display: block; border-radius: 8px; background: #1a1612; }
.scenebox p { margin: 6px 0 0; }
.ts { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .2em; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 16px; opacity: 0; animation-name: confall; animation-timing-function: ease-in; animation-fill-mode: forwards; }
@keyframes confall { 0% { opacity: 1; translate: 0 0; } 100% { opacity: 1; translate: var(--drift) 110vh; rotate: 540deg; } }
/* ticket to ride train cards */
.tcard { position: relative; display: inline-block; line-height: 0; }
.tcard img { display: block; width: 88px; height: auto; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.tcard b { position: absolute; right: 5px; top: 3px; line-height: 1; font-size: 1.05rem; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
/* codenames: long words get smaller instead of breaking in the middle; a bystander is outlined for the spymaster like the other colours */
.tile-card { word-break: normal; overflow-wrap: break-word; hyphens: none; }
@media (max-width: 480px) { .board:not(.pics) .tile-card .cw { font-size: min(.75rem, calc(((100vw - 96px) / 5 - 12px) / (var(--len, 6) * .62))); } }
.tile-card.hint[data-color=neutral] { box-shadow: inset 0 0 0 3px #a49b82; background: var(--card); color: var(--ink); }
/* the game header: the buttons were thin outlines that vanished on a dark page; give them a body and a stronger edge */
.bar { margin-bottom: 6px; row-gap: 8px; }
.bar .btn { min-height: 40px; padding: 7px 14px; font-size: .92rem; }
.bar .btn.secondary { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border: 2px solid var(--accent); color: var(--ink); font-weight: 700; }
.bar .btn.secondary:hover { background: color-mix(in srgb, var(--accent) 30%, var(--card)); }
.bar .btn.secondary[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.bar .back { padding: 6px 0; }

/* ===== design pass: one spacing rhythm, aligned forms, softer surfaces, icons instead of walls of outlined text ===== */
:root { --radius: 14px; --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 28px rgba(0, 0, 0, .07); --edge: color-mix(in srgb, var(--ink) 12%, transparent); }
@media (prefers-color-scheme: dark) { :root { --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .28); --edge: color-mix(in srgb, var(--ink) 14%, transparent); } }
body { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--bg)) 0, var(--bg) 340px) no-repeat, var(--bg); }
#app { max-width: 820px; }

/* cards: even padding, no stray gap at the top or bottom, consistent headings */
.card, main > section { border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; border-color: var(--edge); box-shadow: var(--shadow); }
.card > :first-child, main > section > :first-child { margin-top: 0; }
.card > :last-child, main > section > :last-child { margin-bottom: 0; }
main > section h2, .card h2 { font-size: 1.12rem; line-height: 1.25; margin: 0 0 12px; letter-spacing: -.01em; }
main > section h2:not(:first-child) { margin-top: 22px; }
main > section p, .card p { margin: 0 0 12px; }
main > section ul, main > section ol { margin: 0 0 12px; }
.row { margin-top: 16px; gap: 10px 12px; }
.row:first-child { margin-top: 0; }

/* buttons */
.btn { border-radius: 10px; padding: 10px 18px; transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:not(.secondary) { box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }
.btn.secondary { background: color-mix(in srgb, var(--accent) 11%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); color: var(--ink); font-weight: 600; box-shadow: none; }
.btn.secondary:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.btn.secondary[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.ibtn { display: inline-flex; align-items: center; gap: 8px; }
.ibtn .ic { flex: none; opacity: .9; }

/* forms: labels sit above their control, every control is the same height and baseline */
.row label { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.row label > input, .row label > select { text-transform: none; letter-spacing: normal; font-size: 1rem; font-weight: 400; color: var(--ink); width: auto; }
.row:has(label) { align-items: flex-end; }
input[type=number], input[type=search] { font: inherit; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); min-height: 44px; }
input[type=text], input:not([type]), textarea { border-radius: 10px; }
select { appearance: none; -webkit-appearance: none; margin-top: 0; width: auto; min-width: 9rem; max-width: 100%; padding: 0 38px 0 12px; border-radius: 10px; background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 14px center; }
.row > select, .row > label > select { height: 44px; }
label + select { margin-top: 5px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* players: an avatar and a name, not a bordered block of caps */
.players { gap: 8px; margin: 8px 0 12px; }
.players li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border: 1px solid var(--edge); background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); font-size: .92rem; font-weight: 500; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; flex: none; box-shadow: 0 0 0 2px var(--card); }
.tag { margin-left: 2px; padding: 1px 8px; border-radius: 999px; font-size: .64rem; font-weight: 700; letter-spacing: .06em; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--muted); }
.players li .btn { min-height: 30px; padding: 2px 10px; font-size: .8rem; }

/* the header */
.bar { align-items: center; gap: 8px 10px; padding: 16px 0 8px; }
.bar h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.bar .btn, .bar .btn.secondary { min-height: 40px; padding: 7px 13px; font-size: .9rem; }
.bar .btn.secondary { border-width: 1px; }
.code { border-radius: 10px; border-style: solid; border-color: var(--edge); }
.back { display: inline-flex; align-items: center; padding: 6px 10px 6px 4px; border-radius: 8px; }
.back:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
@media (max-width: 560px) {
  .ibtn .lbl { display: none; }
  .ibtn { padding: 0 12px; min-width: 44px; justify-content: center; }
  .bar .ibtn { min-width: 42px; }
  .card, main > section { padding: 18px 16px; margin: 14px 0; }
  #app { padding-left: 12px; padding-right: 12px; }
}
.muted { line-height: 1.45; }
.big { line-height: 1.2; letter-spacing: -.01em; }
.banner { border-radius: 10px; }
.row + p, .row + .muted, .row + .btn, p + .row, p + .btn, .muted + .btn { margin-top: 14px; }
.row + .row { margin-top: 12px; }
.row label { min-width: 0; max-width: 100%; }
.row label > select, .row > select { max-width: min(100%, 24rem); min-width: 0; text-overflow: ellipsis; }
.row label.check, label.check { flex-direction: row; align-items: center; gap: 6px; text-transform: none; letter-spacing: normal; font-size: 1rem; font-weight: 400; color: var(--ink); }

/* hook hunter: difficulty */
.hh-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.hh-level { font: inherit; text-align: left; display: grid; gap: 4px; padding: 12px 14px; border: 2px solid var(--edge); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.hh-level strong { font-size: 1.05rem; } .hh-level > span:last-child { font-size: .85rem; color: var(--muted); line-height: 1.3; }
.hh-level[aria-checked=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.pips { display: flex; gap: 4px; } .pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); } .pips i.on { background: var(--accent); }
.hh-easy .pips i.on { background: var(--good); } .hh-medium .pips i.on { background: var(--warn); } .hh-hard .pips i.on { background: var(--bad); }
.hh-badge { display: inline-block; vertical-align: middle; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; color: #fff; }
.hh-badge.hh-easy { background: var(--good); } .hh-badge.hh-medium { background: #b8801a; } .hh-badge.hh-hard { background: var(--bad); }
/* tick-box choices (decades, genres, options) as chips, not stretched inputs */
.row input[type=checkbox], .row input[type=radio], label.check input { flex: none !important; min-width: 0 !important; width: 18px !important; height: 18px; margin: 0; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px 6px 10px; border: 1px solid var(--edge); border-radius: 999px; background: var(--card); cursor: pointer; font-size: .95rem; }
label.check:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
label.check:has(input:checked) { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-color: var(--accent); font-weight: 600; }
.row:has(label.check) { gap: 8px; align-items: center; }

/* drawing controls, grouped by purpose */
.pad-tools { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 12px; background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
.tgroup { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tlabel { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.thint { font-size: .82rem; color: var(--muted); line-height: 1.3; max-width: 22rem; }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { font: inherit; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; min-height: 40px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--edge); }
.seg button[aria-checked=true] { background: var(--accent); color: var(--accent-ink); }
.seg button:not([aria-checked=true]):hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sizes { display: inline-flex; gap: 6px; align-items: center; }
.sizes button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--edge); background: var(--card); display: grid; place-items: center; cursor: pointer; padding: 0; }
.sizes button i { display: block; border-radius: 50%; background: var(--ink); opacity: .75; }
.sizes button[aria-checked=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.sizes button[aria-checked=true] i { background: var(--accent); opacity: 1; }
.pad-tools .swatches { margin: 0; gap: 7px; max-width: 30rem; }
.swatch { width: 30px; height: 30px; border: 2px solid var(--edge); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .1s ease; }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed=true] { border-color: var(--card); box-shadow: 0 0 0 3px var(--accent), 0 1px 2px rgba(0, 0, 0, .25); transform: scale(1.1); }
.tactions { flex-direction: row; gap: 8px; margin-left: auto; align-self: flex-end; }
@media (max-width: 560px) { .tactions { margin-left: 0; } .pad-tools { padding: 12px; } .seg button span { font-size: .85rem; } }

/* card hover detail */
.tipcard { position: fixed; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.35); pointer-events: none; font-size: .92rem; }
.tipcard img { height: 170px; width: auto; border-radius: 8px; flex: none; }
.tipcard strong { display: block; font-size: 1.02rem; margin-bottom: 2px; }
.tipcard p { margin: 0; color: var(--muted); line-height: 1.35; }

/* rules panel, digestible */
.rules { display: grid; gap: 10px; margin-top: 6px; }
.rsummary { margin: 0 !important; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); font-size: 1.02rem; line-height: 1.45; }
.rtools { display: flex; gap: 14px; justify-content: flex-end; }
.linkbtn { all: unset; cursor: pointer; font-size: .85rem; color: var(--accent); text-decoration: underline; }
.rsec { border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.rsec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-weight: 700; font-size: 1rem; }
.rsec > summary::-webkit-details-marker { display: none; }
.rsec > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.rsec[open] > summary::after { transform: rotate(-135deg); }
.rnum { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #fff); font-size: .8rem; }
.rbody { padding: 0 14px 12px 48px; line-height: 1.5; }
.rbody p { margin: 6px 0; }
.rbody ul { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.rbody li { position: relative; padding-left: 16px; }
.rbody li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7; }
.rbody .lead { color: var(--ink); }
.rtable { overflow-x: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; }
.rtable table { width: 100%; border-collapse: collapse; margin: 0; font-size: .92rem; }
.rtable th, .rtable td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.rtable thead th { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.rtable tr:last-child > * { border-bottom: 0; }
@media (max-width: 560px) { .rbody { padding-left: 14px; } }

/* battleship */
.fb-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: start; }
.fb-pair h2 { margin: 0 0 8px; }
.fl-board { display: block; width: 100%; max-width: 440px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.28); margin: 10px 0 0; }
.fl-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.fl-setup .fl-board { margin-top: 12px; }
.fl-roster { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.fl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .78rem; color: var(--muted); }
.fl-chip svg { display: block; height: 14px; width: auto; }
.fl-chip.next { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.fl-chip.placed .fl-tick { color: var(--good, #2e9d55); font-weight: 700; }
.fl-chip.wait { opacity: .6; }
.fl-chip.sunk { opacity: .6; text-decoration: line-through; }
.fl-chip.sunk .fl-name { color: var(--bad, #d6342b); }
.fl-hit { transform-box: fill-box; transform-origin: center; animation: flpop .35s ease-out; }
.fl-miss { transform-box: fill-box; transform-origin: center; animation: flripple .5s ease-out; }
@keyframes flpop { from { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.25); } to { transform: scale(1); opacity: 1; } }
@keyframes flripple { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fl-hit, .fl-miss { animation: none; } }

/* game option switch */
label.opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 12px; background: var(--card); cursor: pointer; max-width: 560px; margin: 0 0 4px; text-transform: none; letter-spacing: normal; }
label.opt:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
label.opt:has(input:checked) { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-color: var(--accent); }
label.opt input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; }
label.opt strong { display: block; font-size: 1rem; color: var(--ink); }
label.opt small { display: block; margin-top: 3px; font-size: .88rem; line-height: 1.4; color: var(--muted); font-weight: 400; }
.startbar { margin-top: 16px; }
.startbar p { margin: 8px 0 0; }
label.check { border-radius: 14px; }
section > label.check { margin-bottom: 8px; }
section > label.check + *, section > label.opt + * { margin-top: 14px; }

/* the log beside the game on a laptop or desktop */
@media (min-width: 1100px) {
  #app.has-log { max-width: 1180px; }
  main.with-log { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 20px; align-items: start; }
  main.with-log > * { grid-column: 1; }
  main.with-log > .sidelog { grid-column: 2; grid-row: 1 / span var(--rows, 1); position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  main.with-log > .sidelog .log { font-size: .92rem; }
}

/* modal: the card stays put and only its body scrolls, under a solid header */
.modal { overflow: hidden; align-items: center; }
.modal-card { display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal-head { position: static; flex: none; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--card); }
.modal-card > :not(.modal-head) { overflow-y: auto; padding: 14px 18px 22px; overscroll-behavior: contain; }
.modal-card > .rules { grid-auto-rows: max-content; align-content: start; }
.qsides { display: grid; gap: 8px; margin: 10px 0; }
.qsides > p { margin: 0; }
.qside { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 12px; background: var(--card); max-width: 560px; }
button.qside { cursor: pointer; }
button.qside:hover, button.qside:focus-visible { border-color: var(--accent); }
.qside.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.qside small { grid-column: 1 / -1; color: var(--muted); font-size: .88rem; }
.qsizes { display: flex; gap: 6px; }
.qsz { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; border: 2px solid var(--edge); }
.recap { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.recap li { padding: 8px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); border-radius: 0 8px 8px 0; line-height: 1.4; }

/* Secret Sith play mats with the enacted policies laid on them */
.mats { display: grid; gap: 10px; max-width: 640px; }
.mat { position: relative; aspect-ratio: 1100 / 385; overflow: hidden; border-radius: 8px; background: #2b2e33; }
.mat .matart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 0; }
.mat .matpolicy { position: absolute; border-radius: 4%; box-shadow: 0 3px 8px rgba(0,0,0,.45); animation: matdrop .45s ease-out; }
.mat .mattracker { position: absolute; width: 3.1%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #f2a516; border: 2px solid #5a3b00; box-shadow: 0 0 0 3px rgba(242,165,22,.35); transition: left .4s ease; }
@keyframes matdrop { from { transform: translateY(-30%) scale(1.15); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mat .matpolicy { animation: none; } }

/* Secret Sith: the table */
.sithtable { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin: 0 0 12px; }
.sithtable .felt { position: absolute; inset: 14% 12%; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #31485f, #1b2a3a 70%); border: 3px solid #0f1822; box-shadow: inset 0 0 30px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.3); display: grid; place-items: center; }
.section-danger .felt, section.danger .felt { border-color: #b3261e; animation: dangerpulse 1.6s ease-in-out infinite; }
@keyframes dangerpulse { 0%, 100% { box-shadow: inset 0 0 30px rgba(0,0,0,.5), 0 0 0 0 rgba(214,52,43,.55); } 50% { box-shadow: inset 0 0 30px rgba(0,0,0,.5), 0 0 0 10px rgba(214,52,43,0); } }
.felt-mid { display: grid; gap: 8px; justify-items: center; }
.felt-deck { width: 46px; height: 62px; border-radius: 6px; background: #3b5d7d; border: 2px solid #9fc3de; color: #fff; display: grid; place-items: center; font-size: 1.1rem; box-shadow: 3px 3px 0 #2a4560, 6px 6px 0 #1e3348; }
.felt-trk { display: flex; gap: 6px; }
.felt-trk i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #9fc3de; }
.felt-trk i.on { background: #f2a516; border-color: #f2a516; }
.felt-danger { color: #ffd0cc; background: #8e1f19; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; }
.seat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; width: 84px; }
.seat-av { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.2rem; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.seat.me .seat-av { border-color: #ffd24a; }
.seat.acting .seat-av { animation: seatpulse 1.2s ease-in-out infinite; }
@keyframes seatpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,210,74,.8), 0 3px 8px rgba(0,0,0,.35); } 50% { box-shadow: 0 0 0 9px rgba(255,210,74,0), 0 3px 8px rgba(0,0,0,.35); } }
.seat-name { font-size: .74rem; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.seat.out .seat-av { filter: grayscale(1) brightness(.55); }
.seat.out .seat-name { text-decoration: line-through; color: var(--muted); }
.badge { position: absolute; font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.4); }
.badge.crown { top: -12px; right: -10px; background: #f2c14e; color: #5a3b00; }
.badge.vice { top: -10px; left: -12px; background: #7fb3e8; color: #0d2b4a; }
.badge.nominee { top: -10px; left: -12px; background: #fff; color: #333; }
.badge.dead { inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; background: transparent; border: 0; box-shadow: none; color: #ff6b61; font-size: 2rem; }
.seat-vote { position: absolute; right: -4px; bottom: 14px; width: 28px; height: auto; border-radius: 3px; box-shadow: 0 2px 5px rgba(0,0,0,.45); transform: rotate(8deg); }
@media (max-width: 520px) { .sithtable { aspect-ratio: 1 / 1; } .sithtable .felt { inset: 24% 14%; } .seat { width: 64px; } .seat-av { width: 40px; height: 40px; font-size: 1rem; } .seat-name { font-size: .68rem; max-width: 64px; } }

/* Trivia Showdown */
.tv-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tv-howto div { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font-size: .86rem; color: var(--muted); }
.tv-howto b { font-size: 1.8rem; color: var(--ink); }
.tv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tv-cat { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; font-size: .85rem; padding: 4px 12px 4px 8px; border-radius: 999px; }
.tv-cat b { font-size: 1.1rem; }
.tv-q { font-weight: 700; color: var(--muted); font-size: .85rem; }
.tv-dots { display: flex; gap: 3px; margin-left: auto; }
.tv-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tv-dots i.on { background: var(--accent); }
.tv-card { border-left: 6px solid var(--cat); background: color-mix(in srgb, var(--cat) 9%, var(--card)); border-radius: 0 14px 14px 0; padding: 14px 18px; margin-bottom: 12px; display: grid; gap: 6px; justify-items: start; }
.tv-card h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.tv-pic { font-size: 5rem; line-height: 1.05; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.tv-time { position: relative; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0 0 14px; }
.tv-time i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, #2e9d55, #e0a100); animation: tvdrain linear forwards; border-radius: 999px; }
.tv-time.low i { background: #d6342b; }
.tv-time b { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: .72rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
@keyframes tvdrain { from { transform: scaleX(var(--from, 1)); } to { transform: scaleX(0); } }
.tv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .tv-tiles { grid-template-columns: 1fr; } }
.tv-tile { all: unset; box-sizing: border-box; position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border-radius: 14px; background: var(--tc); color: #fff; font-weight: 700; font-size: 1.02rem; cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--tc) 60%, #000); transition: transform .08s, opacity .2s; }
.tv-tile:hover:not(:disabled) { transform: translateY(-2px); }
.tv-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--tc) 60%, #000); }
.tv-tile:disabled { cursor: default; }
.tv-tile.mine { outline: 4px solid #fff; outline-offset: -4px; }
.tv-tile.dim { opacity: .38; }
.tv-tile.right { opacity: 1; animation: tvpop .5s ease-out; box-shadow: 0 0 0 4px #fff, 0 0 22px 6px color-mix(in srgb, var(--tc) 70%, #fff); }
.tv-tile.wrong { opacity: .6; text-decoration: line-through; }
.tv-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@keyframes tvpop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.tshape { width: 26px; height: 26px; flex: none; opacity: .92; }
.tv-opt { flex: 1; line-height: 1.25; }
.tv-mark { font-size: 1.5rem; }
.tv-picks { position: absolute; right: 8px; bottom: -8px; display: flex; gap: 2px; }
.tv-picks i { width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: .7rem; display: grid; place-items: center; color: #fff; border: 2px solid var(--card); }
.tv-status, .tv-verdict { text-align: center; margin: 14px 0 0; }
.tv-verdict { font-size: 1.3rem; font-weight: 800; }
.tv-verdict.win { color: var(--good, #2e9d55); } .tv-verdict.lose { color: var(--bad, #d6342b); }
.tv-arena { display: flex; flex-wrap: wrap; gap: 10px; }
.tv-player { display: grid; justify-items: center; gap: 3px; width: 84px; padding: 8px 4px; border-radius: 12px; border: 1px solid transparent; }
.tv-player.me { border-color: var(--accent); }
.tv-player.danger { background: color-mix(in srgb, #d6342b 14%, transparent); border-color: #d6342b; animation: tvshake .5s ease-in-out infinite alternate; }
@keyframes tvshake { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
.tv-player.out { opacity: .4; filter: grayscale(1); }
.tv-av { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.tv-ok { position: absolute; right: -6px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: #2e9d55; color: #fff; font-style: normal; font-size: .7rem; display: grid; place-items: center; border: 2px solid var(--card); }
.tv-name { font-size: .78rem; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-score { font-size: .78rem; font-weight: 700; color: var(--muted); }
.tv-hearts { display: inline-flex; gap: 1px; font-size: .95rem; }
.tv-hearts i { font-style: normal; color: var(--line); }
.tv-hearts i.on { color: #e0405f; }
.tv-sd { border: 2px solid #d6342b; }
.tv-sd-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.tv-sd-head h2 { margin: 0 0 2px; }
.tv-sd-head p { margin: 0; }
.tv-sd-icon { font-size: 3rem; }
.tv-tap { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 100%; min-height: 150px; border-radius: 18px; font-size: 1.8rem; font-weight: 900; color: #fff; cursor: pointer; background: #2f6fd0; box-shadow: 0 6px 0 #1d4b94; user-select: none; touch-action: manipulation; }
.tv-tap.go { background: #2e9d55; box-shadow: 0 6px 0 #1b6b38; animation: tvpop .3s; }
.tv-tap.stop { background: #d6342b; box-shadow: 0 6px 0 #8e1f19; }
.tv-tap.mash { background: #9b51c9; box-shadow: 0 6px 0 #6a3590; margin-top: 12px; }
.tv-tap:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.4); }
.tv-ready { text-align: center; }
.tv-clock { margin: 6px 0 14px; text-align: center; }
.tv-clock-time { font: 800 3.4rem ui-monospace, Menlo, monospace; }
.tv-clock.hidden .tv-clock-time { color: var(--muted); }
.tv-clock-track { position: relative; height: 16px; border-radius: 999px; background: var(--line); }
.tv-clock-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; }
.tv-clock.hidden .tv-clock-track i { opacity: .15; }
.tv-clock-track em { position: absolute; top: -14px; font-style: normal; font-size: 1.4rem; transform: translateX(-50%); }
.tv-gauge { position: relative; height: 18px; border-radius: 999px; background: var(--line); margin: 6px 0; }
.tv-gauge i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #e0a100, #2e9d55); }
.tv-gauge em { position: absolute; top: -18px; font-style: normal; font-size: .75rem; transform: translateX(-50%); color: var(--muted); }
.tv-count { display: block; text-align: center; font-size: 2.6rem; }
.tv-mashleft { display: block; text-align: center; font: 700 1.2rem ui-monospace, Menlo, monospace; color: var(--muted); }
.tv-results { display: grid; gap: 8px; }
.tv-res { display: grid; grid-template-columns: auto 90px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); }
.tv-res.ok { border-color: #2e9d55; background: color-mix(in srgb, #2e9d55 10%, transparent); }
.tv-res.bad { border-color: #d6342b; background: color-mix(in srgb, #d6342b 10%, transparent); }
.tv-meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.tv-meter i { display: block; height: 100%; background: var(--accent); }
.tv-verdict-icon { font-size: 1.3rem; }
.tv-over { text-align: center; }
.tv-crown { font-size: 4rem; margin: 0; animation: tvpop .6s; }
.tv-podium { list-style: none; margin: 14px auto; padding: 0; display: grid; gap: 8px; max-width: 460px; text-align: left; }
.tv-podium li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); }
.tv-podium li.first { border-color: #e0a100; background: color-mix(in srgb, #e0a100 12%, transparent); }
.tv-podium .tv-name { flex: 1; max-width: none; font-size: 1rem; }
.tv-medal { font-size: 1.6rem; width: 2rem; text-align: center; }
.tv-credit { font-size: .78rem; text-align: center; margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .tv-player.danger, .tv-tile.right, .tv-crown, .tv-tap.go { animation: none; } }
