:root {
  --ink: #e9f7ff;
  --muted: #7d93aa;
  --panel: rgba(6, 11, 29, .88);
  --red: #ff365f;
  --red-glow: #ff1b50;
  --blue: #27c7ff;
  --cyan: #59ffe1;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #02040c; color: var(--ink); font-family: "Arial Narrow", "Roboto Condensed", system-ui, sans-serif; }
body { overflow-x: hidden; background: radial-gradient(circle at 50% 20%, #102044 0, #050817 42%, #010209 100%); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .13; background-image: linear-gradient(rgba(78, 202, 255, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(78, 202, 255, .13) 1px, transparent 1px); background-size: 64px 64px; transform: perspective(500px) rotateX(58deg) scale(1.6); transform-origin: center 100%; }

.shell { width: min(1500px, 100vw); min-height: 100vh; margin: auto; padding: 18px 24px 12px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.masthead, footer { display: flex; align-items: center; justify-content: space-between; letter-spacing: .18em; font-size: 11px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 12px; color: white; font-size: 16px; font-weight: 900; letter-spacing: .24em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: #06101b; background: var(--cyan); clip-path: polygon(0 0, 85% 0, 100% 25%, 100% 100%, 15% 100%, 0 75%); box-shadow: 0 0 22px var(--cyan); }
.status { display: flex; align-items: center; gap: 9px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.status span { color: var(--cyan); margin-left: 10px; }

.game-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 560px; max-height: calc(100vh - 100px); overflow: hidden; border: 1px solid rgba(86, 231, 255, .25); background: #050817; box-shadow: 0 22px 80px #000, inset 0 0 70px rgba(22, 88, 160, .11); }
.game-frame::before, .game-frame::after { content: ""; position: absolute; z-index: 20; pointer-events: none; width: 90px; height: 90px; border-color: var(--cyan); opacity: .65; }
.game-frame::before { left: 9px; top: 9px; border-left: 2px solid; border-top: 2px solid; }
.game-frame::after { right: 9px; bottom: 9px; border-right: 2px solid; border-bottom: 2px solid; }
canvas { display: block; width: 100%; height: 100%; }
.scanlines { position: absolute; z-index: 15; inset: 0; pointer-events: none; opacity: .14; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(98, 235, 255, .11) 4px); mix-blend-mode: screen; }

.overlay { position: absolute; z-index: 10; inset: 0; }
.lobby { padding: clamp(42px, 5vw, 82px) clamp(40px, 7vw, 110px); background: linear-gradient(90deg, rgba(2,5,15,.96) 0%, rgba(2,5,15,.82) 47%, rgba(2,5,15,.12) 75%); }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .28em; text-transform: uppercase; }
h1 { margin: 14px 0 8px; font-size: clamp(48px, 6vw, 94px); line-height: .82; letter-spacing: -.055em; font-style: italic; }
h1 em { color: transparent; -webkit-text-stroke: 1px var(--cyan); text-shadow: 0 0 28px rgba(62, 227, 255, .28); }
.lede { margin: 20px 0 28px; color: #9db0c4; font-size: 14px; letter-spacing: .04em; }
.player-slots { width: min(1080px, 83vw); display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.player-slot { min-height: 74px; padding: 9px 10px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; background: rgba(10, 18, 39, .84); border: 1px solid rgba(113, 178, 212, .2); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.player-slot.joined.red { border-color: rgba(255, 54, 95, .7); box-shadow: inset 3px 0 var(--red); }
.player-slot.joined.blue { border-color: rgba(39, 199, 255, .7); box-shadow: inset 3px 0 var(--blue); }
.slot-id { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #39516a; font-weight: 900; font-size: 16px; color: #6d8297; }
.joined.red .slot-id { color: var(--red); border-color: var(--red); text-shadow: 0 0 12px var(--red); }
.joined.blue .slot-id { color: var(--blue); border-color: var(--blue); text-shadow: 0 0 12px var(--blue); }
.slot-copy b, .slot-copy span { display: block; }
.slot-copy b { overflow: hidden; font-size: 10px; letter-spacing: .1em; text-overflow: ellipsis; white-space: nowrap; }
.slot-copy span { margin-top: 5px; color: #71869a; font-size: 10px; letter-spacing: .08em; }
.team-chip { border: 0; padding: 7px 8px; color: white; font: inherit; font-size: 8px; font-weight: 900; letter-spacing: .08em; background: #172239; cursor: pointer; }
.slot-actions { display: grid; gap: 4px; }
.character-chip { min-width: 68px; padding: 5px 7px; border: 1px solid #344a64; color: #a9bad0; background: #0b1528; font-size: 7px; font-weight: 900; letter-spacing: .09em; cursor: pointer; }
.character-chip:disabled { opacity: .45; cursor: default; }
.joined .character-chip { border-color: currentColor; }
.red .team-chip { background: rgba(255, 54, 95, .2); color: #ff9eb1; }
.blue .team-chip { background: rgba(39, 199, 255, .2); color: #8ee4ff; }
.ready .team-chip { color: #071119; background: var(--cyan); box-shadow: 0 0 15px rgba(89, 255, 225, .45); }
.lobby-footer { width: min(1080px, 83vw); margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.start-rule { color: #6f8397; font-size: 10px; letter-spacing: .08em; }
button { font-family: inherit; }
#startButton { padding: 12px 22px; border: 1px solid var(--cyan); color: #06131a; background: var(--cyan); font-size: 11px; font-weight: 900; letter-spacing: .14em; cursor: pointer; box-shadow: 0 0 22px rgba(89, 255, 225, .26); }
#startButton:disabled { color: #607484; border-color: #26384a; background: #111b2c; cursor: default; box-shadow: none; }
.controls { position: absolute; bottom: 33px; left: clamp(40px, 7vw, 110px); width: min(1080px, 83vw); color: #7d93aa; font-size: 10px; }
.controls summary { cursor: pointer; letter-spacing: .14em; text-transform: uppercase; }
.control-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; padding: 14px; background: rgba(3, 8, 20, .94); border: 1px solid #1b334a; }
.control-grid b, .control-grid span { display: block; margin-bottom: 5px; }
.control-grid b { color: var(--cyan); }

.score-hud { position: absolute; z-index: 8; top: 17px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; filter: drop-shadow(0 5px 12px #000); }
.team-score { min-width: 205px; padding: 8px 16px; display: flex; align-items: center; gap: 12px; background: rgba(4, 9, 23, .88); border-top: 1px solid currentColor; }
.team-score.red { color: var(--red); justify-content: flex-end; transform: skewX(12deg); }
.team-score.blue { color: var(--blue); transform: skewX(-12deg); }
.team-score > * { transform: skewX(-12deg); }
.team-score.blue > * { transform: skewX(12deg); }
.team-score span { color: white; font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.team-score b { font-size: 24px; }
.team-score div { display: flex; gap: 4px; }
.team-score i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid currentColor; }
.team-score i.filled { background: currentColor; box-shadow: 0 0 8px currentColor; }
.round-clock { min-width: 95px; padding: 7px 14px; text-align: center; background: #eaf8ff; color: #07101b; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%); }
.round-clock small, .round-clock strong { display: block; }
.round-clock small { font-size: 8px; letter-spacing: .13em; }
.round-clock strong { font-size: 22px; line-height: 1.05; }
.kill-feed { position: absolute; z-index: 8; right: 28px; top: 75px; width: 250px; text-align: right; }
.feed-line { margin-bottom: 5px; padding: 6px 9px; color: #a7b8c9; background: linear-gradient(90deg, transparent, rgba(3,8,19,.78)); font-size: 10px; letter-spacing: .08em; animation: feed-in .2s ease-out; }
.feed-line b.red { color: var(--red); }.feed-line b.blue { color: var(--blue); }
@keyframes feed-in { from { opacity: 0; transform: translateX(15px); } }

.announcement { display: grid; place-content: center; text-align: center; background: radial-gradient(circle, rgba(9,20,45,.5), rgba(2,4,12,.78)); backdrop-filter: blur(2px); }
.announcement h2 { margin: 9px 0; font-size: clamp(50px, 8vw, 110px); font-style: italic; letter-spacing: -.04em; text-shadow: 0 0 35px currentColor; }
.announcement p { color: #9db0c4; font-size: 13px; letter-spacing: .16em; }
.sound-toggle { position: absolute; z-index: 21; right: 18px; bottom: 16px; border: 0; color: #7390a6; background: transparent; font-size: 9px; font-weight: 900; letter-spacing: .12em; cursor: pointer; }
.hidden { display: none !important; }
footer { padding: 0 3px; font-size: 9px; }

@media (max-width: 800px) {
  .shell { padding: 0; }.masthead, footer { display: none; }.game-frame { min-height: 100vh; aspect-ratio: auto; border: 0; }
  .lobby { padding: 42px 25px; }.player-slots { width: 100%; grid-template-columns: 1fr; }.lobby-footer, .controls { width: calc(100% - 50px); }
  .controls { left: 25px; }.control-grid { grid-template-columns: 1fr; }.team-score { min-width: 110px; }.team-score div { display: none; }
}
@media (min-width: 801px) and (max-width: 1150px) { .player-slots { grid-template-columns: repeat(2, 1fr); } .player-slot:nth-child(n+7) { display: none; } }
