:root { --bg: #1b1916; --panel: #25221e; --line: #3b362f; --text: #ece6dc; --muted: #a39a8c; --accent: #e8b64c; --good: #8fd18a; --bad: #ec7d6c; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, sans-serif; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font-size: 18px; }
h2 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
label { color: var(--muted); display: flex; gap: 6px; align-items: center; }
select, button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font: inherit; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: default; }
button.on { border-color: var(--accent); background: #3a2f1d; }
.link { color: var(--accent); }
main { display: grid; grid-template-columns: 1fr 300px; gap: 12px; padding: 12px; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
.table { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.boardwrap { position: relative; }
.zoom { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.zoom button { padding: 2px 10px; background: rgba(37,34,30,.85); min-width: 34px; }
#board { display: block; width: 100%; height: 62vh; background: #eee8dc; border-radius: 8px; cursor: crosshair; touch-action: none; }
.status { min-height: 22px; color: var(--muted); }
.status b { color: var(--text); }
.status .bad { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions .sep { width: 1px; background: var(--line); margin: 0 4px; }
.combat { border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px; background: #2b241a; }
.combat .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.handbar { display: flex; align-items: center; gap: 10px; }
.handbar .label { color: var(--muted); white-space: nowrap; }
.hand { display: flex; flex-wrap: wrap; gap: 6px; }
.tile { position: relative; width: 60px; height: 60px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; overflow: hidden; display: grid; grid-template: 1fr 1fr / 1fr 1fr; }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tile.mark { border-color: var(--bad); }
.tile .order.kind { min-width: 34px; padding: 0 3px; }
.tile .order { position: absolute; z-index: 2; left: 3px; top: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 16px; }
.tile.nofit { opacity: .45; }
.tile .q { width: 100%; height: 100%; }
.tile canvas.art { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.55); }
.tile .d0 { left: 4px; top: 4px; } .tile .d1 { right: 4px; top: 4px; } .tile .d2 { left: 4px; bottom: 4px; } .tile .d3 { right: 4px; bottom: 4px; }
.tile .pips { z-index: 1; right: auto; left: 50%; transform: translateX(-50%); bottom: 3px; }
.tile .pips { position: absolute; right: 3px; bottom: 2px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.55); border-radius: 4px; padding: 0 4px; }
aside { min-width: 0; }
.player { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
.player.turn { border-color: var(--accent); }
.player .who { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.player .who .cls { color: var(--muted); font-weight: 400; font-size: 12px; }
.player .who .score { margin-left: auto; font-size: 16px; }
.player .info { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.log { margin: 0; padding-left: 22px; max-height: 40vh; overflow: auto; font-size: 12px; color: var(--muted); }
.log li { margin-bottom: 2px; }
[hidden] { display: none !important; }
.over { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
.over .card { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 20px 26px; min-width: 280px; }
.over h3 { margin: 0 0 10px; }
.over ol { padding-left: 20px; }
.maingroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.grouptag { color: var(--muted); font-size: 12px; margin-right: 2px; }
/* Round 80: live scores are a debug aid; scoring happens only at the end */
.scorenote { margin: 0 0 6px; font-size: 12px; color: #e8b64c; border: 1px dashed #e8b64c; border-radius: 6px; padding: 3px 6px; }
