:root {
  --gold: #d7b45a;
  --gold-dim: #8c6f32;
  --red: #8b1a1a;
  --ink: #0b0b0d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050506; color: #eee; font-family: "Trebuchet MS", "Segoe UI", sans-serif; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.72) 100%); }
#topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; font-size: 12px; letter-spacing: .14em; color: #b9b0a0; background: linear-gradient(#000c, transparent); z-index: 5; }
.brand { color: var(--gold); font-weight: 700; }
.brand span { color: #c33; }
.stats { display: flex; gap: 16px; font-variant-numeric: tabular-nums; }
#hud { position: fixed; top: 34px; left: 0; right: 0; display: flex; justify-content: space-between; gap: 20px; padding: 0 3vw; z-index: 4; pointer-events: none; }
.hud-player { width: 38vw; max-width: 520px; }
.hud-player.p2 { text-align: right; }
.hud-name { font-size: 15px; letter-spacing: .18em; color: var(--gold); text-shadow: 0 1px 2px #000; margin-bottom: 4px; }
.bar, .meter { height: 13px; border: 1px solid #000; background: #211; box-shadow: 0 0 0 1px #5b4a2a inset; transform: skewX(-18deg); overflow: hidden; }
.bar .fill { height: 100%; width: 100%; background: linear-gradient(90deg, #7a1010, #d33, #ff9b3d); transition: width .08s linear; }
.meter { height: 6px; margin-top: 4px; width: 55%; background: #111; }
.p2 .meter { margin-left: auto; }
.meter .fill { height: 100%; width: 0%; background: linear-gradient(90deg, #1d4b7a, #48c, #9ef); }
.p2 .bar .fill { background: linear-gradient(90deg, #123f6b, #2b8fd6, #bdf); }
.hud-center { text-align: center; width: 160px; }
.timer { font-size: 34px; font-weight: 800; color: var(--gold); text-shadow: 0 0 12px #000, 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.round { font-size: 10px; letter-spacing: .2em; color: #aaa; }
.wins { font-size: 11px; color: #c9a85d; margin-top: 2px; }
.combo { height: 16px; color: #ffcf6a; font-size: 12px; letter-spacing: .1em; }
#menu { position: fixed; inset: 0; z-index: 3; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 6vh 4vw; background: radial-gradient(ellipse at 50% 42%, rgba(40,20,10,.55), rgba(0,0,0,.78) 70%); }
.hidden { display: none !important; }
.title-mark { font-size: 72px; font-weight: 900; color: #1a1a1c; letter-spacing: -.06em; text-shadow: 0 0 1px #d7b45a, 0 0 30px #d7b45a; }
.title-mark span { color: #9b1616; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 86px); letter-spacing: .08em; color: var(--gold); text-shadow: 0 3px 0 #000, 0 0 30px #000; }
h2 { margin: 2px 0 8px; font-size: 15px; letter-spacing: .24em; color: var(--gold); font-weight: 600; }
h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: .2em; color: #c9b98f; }
.sub { letter-spacing: .5em; color: #b9a77a; font-size: 13px; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
button { cursor: pointer; font: inherit; font-size: 12px; letter-spacing: .08em; color: #e7dcc4; background: linear-gradient(#231c13, #120e0a); border: 1px solid #6b5426; padding: 10px 16px; text-transform: uppercase; box-shadow: 0 2px 0 #000; }
button:hover { border-color: var(--gold); color: #fff3cf; }
button.primary { border-color: #a33; background: linear-gradient(#3a1212, #180707); color: #ffd9a1; }
.hint { max-width: 900px; text-align: center; font-size: 11px; line-height: 1.7; color: #948b7a; margin: 4px 0 0; }
.select-row { display: flex; gap: 24px; width: min(1200px, 92vw); justify-content: center; }
.select-col { flex: 1; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-height: 38vh; overflow: auto; padding: 2px; }
.grid button, .stage-grid button, .mode-grid button { padding: 6px 4px; font-size: 9px; letter-spacing: .02em; text-transform: none; }
.grid button.sel { border-color: var(--gold); background: #3a2a12; color: #ffe9b0; }
.stage-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: min(1100px, 92vw); max-height: 22vh; overflow: auto; padding: 2px; }
.stage-grid button.sel { border-color: var(--gold); background: #3a2a12; color: #ffe9b0; }
.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 8px; width: min(900px, 92vw); }
.mode-grid button { padding: 16px; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #050505; z-index: 20; color: var(--gold); letter-spacing: .2em; font-size: 12px; }
#netpanel { position: fixed; right: 14px; bottom: 14px; z-index: 6; font-size: 10px; color: #9a917f; background: #000a; padding: 8px 10px; border: 1px solid #332a1b; max-width: 360px; }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(4, 1fr); } .stage-grid { grid-template-columns: repeat(4, 1fr); } .title-mark { font-size: 48px; } }
