:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: #0d1822;
  --panel-2: #111f2b;
  --line: #263a48;
  --text: #f4f7f9;
  --muted: #a8bac6;
  --cyan: #53d6e8;
  --blue: #5f8cff;
  --green: #69d391;
  --amber: #f0c56a;
  --red: #f06c6c;
  --coral: #f17867;
  --violet: #a78bfa;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-width: 320px; background: radial-gradient(circle at 50% -20%, #132b3a 0, var(--bg) 50%);
  color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select, input { font: inherit; }
button { min-height: 42px; }
.page { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 14px 0 36px; }
.game-shell { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(7, 16, 25, .96); box-shadow: 0 18px 60px rgba(0,0,0,.28); }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:14px; padding: 10px 14px; border-bottom:1px solid var(--line); background:#0a151f; }
.brand { min-width:0; }
.eyebrow { color:var(--coral); font-size:.72rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
h1 { margin:2px 0 0; font-size:clamp(1.15rem, 3vw, 1.75rem); line-height:1.05; }
.subtitle { color:var(--muted); font-size:.84rem; margin-top:4px; }
.top-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.btn { border:1px solid #365264; border-radius:10px; padding:8px 12px; color:var(--text); background:#132330; cursor:pointer; font-weight:750; }
.btn:hover:not(:disabled) { background:#192e3d; }
.btn:disabled { opacity:.48; cursor:not-allowed; }
.btn:focus-visible, select:focus-visible, input:focus-visible { outline:3px solid rgba(83,214,232,.35); outline-offset:2px; }
.btn.primary { background:#17404c; border-color:#277384; }
.btn.danger { background:#3a2024; border-color:#6e343d; }
.btn.tool { border-color:#6c58ad; background:#241f3b; }
.btn.tool[aria-pressed="true"] { background:#43347a; border-color:#a78bfa; box-shadow: inset 0 0 0 1px rgba(167,139,250,.2); }
.hud { display:grid; grid-template-columns:repeat(6, 1fr); gap:1px; background:var(--line); border-bottom:1px solid var(--line); }
.metric { min-width:0; background:var(--panel); padding:6px 9px; }
.metric span { display:block; color:var(--muted); font-size:.68rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.metric strong { display:block; margin-top:2px; font-size:.92rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.canvas-wrap { position:relative; background:#061018; touch-action:none; }
canvas { display:block; width:100%; height:auto; aspect-ratio:16/9; background:#061018; cursor:crosshair; }
.canvas-wrap.tool-armed canvas { cursor:cell; }
.overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:20px; pointer-events:none; }
.overlay-card { width:min(560px, 92%); background:rgba(7,16,25,.95); border:1px solid #3e5a6b; border-radius:16px; padding:18px; text-align:center; box-shadow:0 14px 48px rgba(0,0,0,.42); pointer-events:auto; }
.overlay-card[hidden], .overlay[hidden] { display:none !important; }
.overlay-kicker { color:var(--coral); font-size:.72rem; font-weight:850; letter-spacing:.15em; }
.overlay h2 { margin:4px 0 6px; font-size:clamp(1.3rem, 4vw, 2rem); }
.overlay p { margin:6px 0 14px; color:var(--muted); line-height:1.45; }
.overlay .row { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; }
.status-strip { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:8px 14px; border-top:1px solid var(--line); background:#09141d; color:var(--muted); font-size:.82rem; }
.status-strip b { color:var(--text); }
.toast { min-height:1.2em; color:var(--cyan); text-align:right; }
.guide { margin-top:12px; border:1px solid var(--line); border-radius:14px; background:var(--panel); overflow:hidden; }
.guide summary { cursor:pointer; padding:13px 15px; font-weight:850; list-style:none; }
.guide summary::-webkit-details-marker { display:none; }
.guide summary::after { content:'−'; float:right; color:var(--cyan); }
.guide:not([open]) summary::after { content:'+'; }
.guide-body { display:grid; grid-template-columns:1.1fr .9fr; gap:18px; padding:0 15px 16px; border-top:1px solid var(--line); }
.guide h2 { font-size:1rem; margin:14px 0 8px; }
.guide p, .guide li { color:var(--muted); font-size:.9rem; line-height:1.5; }
.guide ul { padding-left:19px; margin:6px 0 0; }
.kbd { display:inline-block; min-width:1.7em; text-align:center; padding:.08em .42em; border:1px solid #456071; border-bottom-width:2px; border-radius:6px; background:#152632; color:var(--text); font-size:.78em; font-weight:800; }
.field label { display:block; color:var(--muted); font-size:.75rem; font-weight:800; margin-bottom:5px; }
.field select, .field input { width:100%; min-height:42px; border:1px solid #3a5262; border-radius:9px; background:#10202c; color:var(--text); padding:7px 9px; }
.switch { display:flex !important; align-items:center; gap:9px; min-height:34px; }
.switch input { width:20px !important; height:20px; accent-color:#53d6e8; }
.footer-note { color:#7f95a4; font-size:.75rem; text-align:center; margin:14px 0 0; }
@media (max-width: 920px) {
  
.hud { grid-template-columns:repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .page { width:min(100% - 12px, 1180px); padding-top:6px; }
  .topbar { align-items:flex-start; }
  .subtitle { display:none; }
  .guide-body { grid-template-columns:1fr; gap:0; }
  
.status-strip { align-items:flex-start; flex-direction:column; }
  .toast { text-align:left; }
}
@media (max-width: 520px) {
  .hud { grid-template-columns:repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .topbar { flex-direction:column; }
  .top-actions { width:100%; justify-content:stretch; }
  .top-actions .btn { flex:1 1 42%; }
  .metric { padding:7px; }
  .metric strong { font-size:.86rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto !important; } }

/* v1.0.0 accepted full-campaign tool polish */
.top-actions .btn { padding:7px 10px; }
.btn.tool.rate { border-color:#6c58ad; background:#241f3b; }
.btn.tool.rate[aria-pressed="true"] { background:#43347a; border-color:#a78bfa; }
.btn.tool.anycast { border-color:#4768bc; background:#182543; }
.btn.tool.anycast[aria-pressed="true"] { background:#29447f; border-color:#7fa1ff; }
.btn.tool.failover { border-color:#3e7855; background:#173225; }
.btn.tool.failover[aria-pressed="true"] { background:#275b3d; border-color:#69d391; }
@media (max-width: 880px) {
  .topbar { align-items:flex-start; }
  .top-actions { max-width:58%; }
}
@media (max-width: 700px) {
  .top-actions { max-width:none; }
}
