*{box-sizing:border-box}
:root{
  --bg:#070b14;--panel:#0e1524;--panel2:#131d2f;--line:#26344d;--text:#f7f8fb;
  --muted:#91a0b7;--blue:#3b82f6;--blue2:#1d4ed8;--orange:#fb923c;--orange2:#c2410c;
  --good:#22c55e;--bad:#ef4444;--warn:#f59e0b;--glow:rgba(59,130,246,.26)
}
html,body{margin:0;min-height:100%;background:
radial-gradient(circle at 20% 0%,rgba(37,99,235,.18),transparent 30%),
radial-gradient(circle at 100% 20%,rgba(249,115,22,.14),transparent 26%),var(--bg);
color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{min-height:100vh}
button{font:inherit}
button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.app{width:min(1280px,100%);margin:auto;padding:16px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.eyebrow{font-size:11px;letter-spacing:.18em;color:#7f8ba0;font-weight:700}
h1{font-size:clamp(30px,6vw,58px);letter-spacing:.18em;margin:0;font-weight:900}
h1::after{content:"";display:inline-block;width:11px;height:11px;margin-left:8px;background:var(--orange);transform:rotate(45deg)}
.header-actions,.bottom-actions{display:flex;gap:8px;flex-wrap:wrap}
button{border:1px solid var(--line);background:#111a2b;color:var(--text);padding:11px 14px;border-radius:13px;cursor:pointer;transition:.15s ease}
button:hover{background:#18243a}
button.active{background:linear-gradient(180deg,#2f4e7e,#1b3153);border-color:#4f7fc6}
button.ghost{background:rgba(255,255,255,.03)}
.hidden{display:none!important}
.shell{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px}
.game-card,.side-card{background:rgba(14,21,36,.93);border:1px solid var(--line);border-radius:22px}
.game-card{padding:14px}
.side-card{padding:18px;height:max-content}
.statusbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.turn-badge{font-weight:800}
.scores{display:flex;gap:14px;font-size:14px;color:var(--muted)}
.dot{width:12px;height:12px;border-radius:999px;display:inline-block;margin-right:6px;box-shadow:inset 0 0 0 2px rgba(255,255,255,.2)}
.dot.blue{background:var(--blue)} .dot.orange{background:var(--orange)}
.actions{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:10px}
.action{padding:10px 8px}
.board-stage{position:relative;border:1px solid #1c293d;border-radius:18px;background:
linear-gradient(rgba(255,255,255,.015),rgba(255,255,255,.005)),#0a101b;overflow:auto}
#board{display:block;width:100%;min-width:620px;height:auto}
.legend{position:absolute;left:12px;bottom:10px;display:flex;gap:12px;padding:7px 10px;border-radius:999px;background:rgba(4,8,14,.72);backdrop-filter:blur(8px);font-size:11px;color:var(--muted)}
.legend-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px}.legend-dot.valid{background:var(--good)}.legend-dot.selected{background:#fff}
.notice{margin-top:10px;padding:12px 14px;border-radius:14px;border:1px solid var(--line);font-size:14px}
.notice.info{background:rgba(59,130,246,.08);color:#c9ddff}
.notice.success{background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.35);color:#b9f7ce}
.notice.error{background:rgba(239,68,68,.08);border-color:rgba(239,68,68,.38);color:#ffc0c0}
.notice.warn{background:rgba(245,158,11,.08);border-color:rgba(245,158,11,.35);color:#ffe0a3}
.bottom-actions{margin-top:10px}
.bottom-actions button{flex:1}
.side-card p{color:var(--muted);font-size:14px;line-height:1.5;margin:5px 0 16px}
.mini-title{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:#cbd4e1;font-weight:800}
dialog{border:0;background:transparent;padding:0;max-width:560px;width:calc(100% - 24px)}
dialog::backdrop{background:rgba(0,0,0,.68);backdrop-filter:blur(5px)}
.dialog-card{background:#101827;border:1px solid var(--line);border-radius:20px;padding:18px;color:var(--text)}
.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{margin:0}.dialog-head button{font-size:22px;padding:4px 10px}
.dialog-card ol{color:var(--muted);line-height:1.55;padding-left:22px}
@media(max-width:920px){.shell{grid-template-columns:1fr}.side-card{display:none}}
@media(max-width:640px){.app{padding:10px}.topbar{align-items:flex-start;flex-direction:column}.header-actions{width:100%}.header-actions button{flex:1}.game-card{padding:10px;border-radius:18px}.legend{display:none}}
