/* ====================================================================
   Kernfeld - dunkles "AI OS" wie das Trading-Dashboard: Monospace,
   feine Linien, kleine Großbuchstaben-Labels, Neon auf Nachtblau.
   ==================================================================== */

:root {
  --bg: #0a0c0f;
  --bg2: #0d1014;
  --panel: rgba(15, 19, 23, .88);
  --panel-solid: #0f1317;
  --line: #1c2229;
  --line2: #262e37;
  --text: #d9d6cf;
  --dim: #7d8691;
  --mute: #4b535d;
  --cyan: #6edce8;
  --teal: #3fd6c0;
  --violet: #a07cf0;
  --blue: #6f86ff;
  --accent: #f0883e;
  --accent2: #ffb27a;
  --up: #5fd38d;
  --down: #ef6461;
  --yellow: #e6c35c;
  --hc: rgba(110, 220, 232, .6);
  --team1: #6f86ff;
  --team2: #ef6461;
  --team3: #5fd38d;
  --team4: #e6c35c;
  --mono: "JetBrains Mono", "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
b { font-weight: 600; }
code, kbd { font-family: var(--mono); }
kbd { border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font-size: 10.5px; color: var(--accent); background: var(--bg2); }
h1 { font-size: 20px; font-weight: 500; margin: 4px 0 12px; letter-spacing: .02em; }

.label {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 10px; font-weight: 600;
}
.label::before { content: "▸ "; color: var(--accent); }
.dim { color: var(--dim); }
.small { font-size: 11.5px; }
.mt { margin-top: 14px; }
.up { color: var(--up); }
.down { color: var(--down); }
.accent { color: var(--accent); }
.r { text-align: right; }

/* ------------------------------ Hintergrund ------------------------------ */
canvas.bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scan {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(150, 220, 235, .022) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 80% 75% at 50% 50%, transparent 58%, rgba(3, 5, 8, .45) 100%);
}
.page > header, .page > main { position: relative; z-index: 1; }

/* ------------------------------ Kopfzeile ------------------------------ */
.topbar {
  height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
  position: sticky; top: 0; background: rgba(10, 12, 15, .85); backdrop-filter: blur(6px); z-index: 20;
}
.status-dots { display: flex; gap: 18px; align-items: center; }
.brand { color: var(--accent); font-weight: 700; letter-spacing: .2em; text-shadow: 0 0 12px rgba(240, 136, 62, .45); }
.brand:hover { color: #fff; }
.dot-label b { color: var(--text); margin-left: 4px; font-weight: 600; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mute); margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--up); box-shadow: 0 0 8px var(--up); }
.dot.warn { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot.err { background: var(--down); box-shadow: 0 0 8px var(--down); }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a, .nav .link { padding: 4px 9px; border: 1px solid transparent; border-radius: 3px; color: var(--dim); font: inherit; letter-spacing: inherit; text-transform: inherit; }
.nav a:hover, .nav .link:hover { color: var(--text); border-color: var(--line2); }
.nav a.active { color: var(--text); border-color: var(--line2); background: var(--panel-solid); }
.nav .user { padding: 0 6px; color: var(--teal); }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; cursor: pointer; color: var(--dim); font: inherit; padding: 0; }

/* ------------------------------ Bausteine ------------------------------ */
.btn {
  font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--line2);
  padding: 9px 14px; border-radius: 3px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--accent); color: #fff; box-shadow: 0 0 12px rgba(240, 136, 62, .18); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn.primary { background: var(--accent); color: #140b04; border-color: var(--accent); box-shadow: 0 0 14px rgba(240, 136, 62, .3); }
.btn.primary:hover { background: #a6f2ff; }
.btn.danger { border-color: #5a2a2a; color: var(--down); }
.btn.danger:hover { background: #2a1414; border-color: var(--down); box-shadow: 0 0 12px rgba(239, 100, 97, .2); }
.btn.small { padding: 5px 8px; font-size: 10px; }
.btn.full { width: 100%; }

input, select {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line2);
  border-radius: 3px; padding: 8px 10px; font: 13px var(--mono); margin-top: 4px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(240, 136, 62, .25); }
label { display: block; color: var(--dim); font-size: 11.5px; }
.stack { display: grid; gap: 12px; }
.row-end { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin-bottom: 16px; position: relative; }
/* HUD-Ecken: kleine Winkel oben links und unten rechts */
.hud::before, .hud::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.hud::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--violet); border-right: 1px solid var(--violet); }
.msg { padding: 9px 12px; border-radius: 3px; border: 1px solid; margin: 0 0 14px; }
.msg.ok { border-color: #224a33; color: var(--up); background: #0e1d15; }
.msg.err { border-color: #5a2a2a; color: #ff9a97; background: #1d0f0f; }
.msg.warn { border-color: #5a4a22; color: var(--yellow); background: #1c180c; }
.pill { display: inline-block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 1px 7px; border: 1px solid var(--line2); border-radius: 10px; color: var(--dim); }
.pill.ok { color: var(--up); border-color: #224a33; }
.pill.warn { color: var(--yellow); border-color: #5a4a22; }
.pill.run { color: var(--accent); border-color: #1d4a5a; }

/* ------------------------------ Anmeldung ------------------------------ */
.auth-box { max-width: 400px; margin: 9vh auto 0; padding: 0 16px; }
.auth-box h1 { color: #fff; text-shadow: 0 0 18px rgba(240, 136, 62, .35); }

/* ------------------------------ Lobby ------------------------------ */
.pagewrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.matches { display: grid; gap: 10px; }
.match {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center;
  border: 1px solid var(--line2); border-radius: 4px; padding: 10px 12px; background: rgba(7, 12, 22, .7);
}
.match.mine { border-color: rgba(240, 136, 62, .55); box-shadow: inset 0 0 18px rgba(240, 136, 62, .06); }
.match .title { font-weight: 600; }
.match .meta { font-size: 11px; color: var(--dim); }
.match .seats { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.seat { font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line2); color: var(--dim); }
.seat.ready { color: var(--up); border-color: #224a33; }
.seat.host::before { content: "◆ "; color: var(--accent); }
.seat.free { border-style: dashed; color: var(--mute); }
.match .actions { display: flex; gap: 6px; }
.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px auto; gap: 10px; align-items: end; }
/* KI-Plätze: violett, Stufe als kleine Auswahl, Entfernen-Knopf */
.seat.bot { color: var(--violet); border-color: #3b2d63; display: inline-flex; align-items: center; gap: 5px; }
.seat.bot select { width: auto; margin: 0; padding: 0 2px; font-size: 10.5px; border: 0; background: transparent; color: var(--violet); cursor: pointer; }
.seat.bot select:focus { box-shadow: none; outline: 1px solid var(--violet); }
.seat.bot select option, .botadd select option { background: var(--bg2); color: var(--text); }
.seat.bot .x { background: none; border: 0; color: var(--mute); cursor: pointer; padding: 0 2px; font: inherit; }
.seat.bot .x:hover { color: var(--down); }
.botadd { display: inline-flex; gap: 6px; align-items: center; }
.botadd select { width: auto; margin: 0; padding: 4px 6px; font-size: 11px; }
.pill.ai, .ai-tag { color: var(--violet); border-color: #3b2d63; }
.ai-tag { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid #3b2d63; border-radius: 8px; padding: 0 5px; font-weight: 400; }
.stats { display: flex; gap: 28px; }
.stats > div { display: flex; flex-direction: column; }
.big { font-size: 28px; font-weight: 600; line-height: 1.1; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; font-weight: 500; color: var(--dim); font-size: 10.5px; letter-spacing: .1em; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 4px 6px; border-bottom: 1px solid rgba(23, 34, 56, .6); }
.tbl tr.me td { color: var(--accent); }
.tbl th.r, .tbl td.r { text-align: right; }
/* Verlauf: feste Höhe mit eigenem Scrollbereich statt endlos nach unten */
.history {
  list-style: none; padding: 0 6px 0 0; margin: 0; display: grid; gap: 8px;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
}
.history li { border-left: 2px solid var(--line2); padding-left: 8px; }
.history::-webkit-scrollbar { width: 6px; }
.history::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }
/* Teams: Farbe am Platz, Auswahl am Platz */
.seat { display: inline-flex; align-items: center; gap: 5px; }
.seat.t1 { box-shadow: inset 3px 0 0 var(--team1); }
.seat.t2 { box-shadow: inset 3px 0 0 var(--team2); }
.seat.t3 { box-shadow: inset 3px 0 0 var(--team3); }
.seat.t4 { box-shadow: inset 3px 0 0 var(--team4); }
.seat select.team { width: auto; margin: 0; padding: 0 2px; font-size: 10.5px; border: 0; background: transparent; color: var(--dim); cursor: pointer; }
.seat select.team:focus { box-shadow: none; outline: 1px solid var(--dim); }
.seat select.team option { background: var(--bg2); color: var(--text); }
.seat select.team.t1, .tag.t1 { color: var(--team1); }
.seat select.team.t2, .tag.t2 { color: var(--team2); }
.seat select.team.t3, .tag.t3 { color: var(--team3); }
.seat select.team.t4, .tag.t4 { color: var(--team4); }
.tag { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--dim); }

/* ------------------------------ Spiel ------------------------------ */
body.game { overflow: hidden; user-select: none; -webkit-user-select: none; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; cursor: default; }
.corners i { position: fixed; width: 22px; height: 22px; z-index: 40; pointer-events: none; filter: drop-shadow(0 0 4px rgba(110, 220, 232, .7)); }
.corners i:nth-child(1) { top: 48px; left: 8px; border-top: 1px solid var(--hc); border-left: 1px solid var(--hc); }
.corners i:nth-child(2) { top: 48px; right: 8px; border-top: 1px solid var(--hc); border-right: 1px solid var(--hc); }
.corners i:nth-child(3) { bottom: 182px; left: 8px; border-bottom: 1px solid var(--hc); border-left: 1px solid var(--hc); }
.corners i:nth-child(4) { bottom: 182px; right: 8px; border-bottom: 1px solid var(--hc); border-right: 1px solid var(--hc); }

.g-top {
  position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  background: linear-gradient(to bottom, rgba(7, 10, 18, .95), rgba(7, 10, 18, .72));
  border-bottom: 1px solid var(--line);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.g-left, .g-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.g-time { color: var(--text); font-variant-numeric: tabular-nums; }
.g-res { display: flex; gap: 18px; }
.res { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; letter-spacing: .04em; }
.res b { color: #fff; font-variant-numeric: tabular-nums; min-width: 3ch; }
.res i { width: 11px; height: 11px; display: inline-block; transform: rotate(45deg); }
.res.k i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.res.e i { background: var(--violet); border-radius: 50%; transform: none; box-shadow: 0 0 10px var(--violet); }
.res.p i { border: 1.5px solid var(--accent); border-radius: 2px; box-shadow: 0 0 8px rgba(255, 154, 77, .6); }
.res.p.full b { color: var(--down); }
.g-players { display: flex; gap: 12px; }
.g-players span { display: inline-flex; align-items: center; gap: 5px; }
.g-players span i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.g-players span.out { text-decoration: line-through; opacity: .5; }
.g-players span.off { opacity: .6; }

/* Ton: Knopf mit Pegel-Balken, darunter ein kleines Feld mit Reglern */
.snd { position: relative; }
.snd-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 27px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--line2); border-radius: 3px; background: rgba(5, 9, 17, .8); color: var(--dim);
  font: 600 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.snd-btn:hover, .snd-btn[aria-expanded="true"] { border-color: var(--accent); color: #fff; }
.snd-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.snd-ic { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.snd-ic b { width: 2px; background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.snd-ic b:nth-child(1) { height: 4px; } .snd-ic b:nth-child(2) { height: 10px; } .snd-ic b:nth-child(3) { height: 7px; }
.snd-btn.off .snd-ic b { height: 2px; background: var(--mute); box-shadow: none; }
.snd-btn.off { color: var(--mute); }
.snd-pop {
  position: absolute; right: 0; top: 32px; width: 236px; z-index: 50; padding: 12px; display: grid; gap: 10px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  text-transform: none; letter-spacing: .04em;
}
.snd-row { display: grid; grid-template-columns: 80px 1fr 30px; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; }
.snd-row b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.snd-row input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }

.g-panel {
  position: fixed; left: 0; right: 0; bottom: 0; height: 176px; z-index: 30;
  display: grid; grid-template-columns: 156px minmax(0, 1fr) 360px 68px; gap: 12px; padding: 10px 12px;
  background: linear-gradient(to top, rgba(7, 10, 18, .97), rgba(8, 12, 22, .88));
  border-top: 1px solid var(--line2);
}
.g-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(to right, transparent, rgba(240, 136, 62, .55), rgba(163, 124, 255, .45), transparent); }
.g-mini { border: 1px solid var(--line2); border-radius: 3px; background: #050811; position: relative; width: 156px; height: 156px; }
.g-mini canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.g-sel { border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; overflow: hidden; background: rgba(5, 9, 17, .55); }
.sel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sel-head .glyph { width: 46px; height: 46px; border: 1px solid var(--line2); border-radius: 3px; background: #050811; flex: none; }
.sel-head .name { font-size: 16px; color: #fff; }
.sel-head .sub { color: var(--dim); font-size: 12.5px; }
.g-sel .small { font-size: 12.5px; }
.hpbar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 4px; width: 180px; }
.hpbar i { display: block; height: 100%; background: var(--up); box-shadow: 0 0 6px var(--up); }
.sel-grid { display: flex; flex-wrap: wrap; gap: 4px; max-height: 102px; overflow: hidden; }
.sel-grid button {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--line2); border-radius: 3px; background: #050811; cursor: pointer; position: relative;
}
.sel-grid button:hover { border-color: var(--accent); }
.sel-grid button canvas { width: 100%; height: 100%; display: block; }
.sel-grid button i { position: absolute; left: 2px; right: 2px; bottom: 2px; height: 2px; background: var(--up); }
.queue { display: flex; gap: 5px; margin-top: 6px; align-items: center; }
.queue button { width: 34px; height: 34px; border: 1px solid var(--line2); background: #050811; border-radius: 3px; cursor: pointer; padding: 0; position: relative; }
.queue button:hover { border-color: var(--down); }
.queue button canvas { width: 100%; height: 100%; display: block; }
.queue .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
/* drei Reihen passen in die Leiste (Drohnen mit Kämpfern: neun Knöpfe) */
.g-cmd { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 48px; gap: 6px; align-content: start; }
.cmd {
  position: relative; border: 1px solid var(--line2); border-radius: 3px; background: rgba(5, 9, 17, .8); color: var(--text);
  font: 600 11.5px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; cursor: pointer; padding: 4px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cmd:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 14px rgba(240, 136, 62, .35), inset 0 0 10px rgba(240, 136, 62, .1); color: #fff; text-shadow: 0 0 8px rgba(240, 136, 62, .6); }
.cmd.on { border-color: var(--accent); color: var(--accent2); }
.cmd:disabled { opacity: .4; cursor: default; }
.cmd .key { position: absolute; top: 3px; left: 5px; color: var(--accent); font-size: 11px; }
.cmd .cost { color: var(--dim); font-size: 10.5px; letter-spacing: 0; text-transform: none; }
.cmd .cost.no { color: var(--down); }
/* Forschung: violette Röhre statt orange */
.cmd.tech { border-color: #3a2f5c; }
.cmd.tech .key { color: var(--violet); }
.cmd.tech:hover:not(:disabled) { border-color: var(--violet); box-shadow: 0 0 14px rgba(160, 124, 240, .35), inset 0 0 10px rgba(160, 124, 240, .12); }
.cmd.lock { opacity: .3; }
.cmd.lock .cost { color: var(--violet); }
.queue.research { margin-top: 4px; color: var(--violet); }
.queue.research button.tech { color: var(--violet); font-size: 14px; border-color: #3a2f5c; box-shadow: 0 0 10px rgba(160, 124, 240, .3); }
.queue.research .prog { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
/* Waffenruhe: grüne Röhre, pulsiert leicht */
.peace {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; padding: 2px 8px; border-radius: 2px;
  color: var(--up); border: 1px solid rgba(95, 211, 141, .5);
  text-shadow: 0 0 8px rgba(95, 211, 141, .85); box-shadow: 0 0 12px rgba(95, 211, 141, .25), inset 0 0 8px rgba(95, 211, 141, .12);
  animation: peace-pulse 2.4s ease-in-out infinite;
}
@keyframes peace-pulse { 50% { box-shadow: 0 0 18px rgba(95, 211, 141, .45), inset 0 0 10px rgba(95, 211, 141, .2); } }
@media (prefers-reduced-motion: reduce) { .peace { animation: none; } }
/* Zeitalter oben in der Leiste */
.age {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; padding: 2px 8px; border-radius: 2px;
  color: var(--cyan); border: 1px solid rgba(110, 220, 232, .45);
  text-shadow: 0 0 8px rgba(110, 220, 232, .8); box-shadow: 0 0 10px rgba(110, 220, 232, .2), inset 0 0 8px rgba(110, 220, 232, .12);
}
.age[data-age="2"] { color: var(--violet); border-color: rgba(160, 124, 240, .55); text-shadow: 0 0 8px rgba(160, 124, 240, .9); box-shadow: 0 0 12px rgba(160, 124, 240, .3), inset 0 0 8px rgba(160, 124, 240, .15); }
.age[data-age="3"] { color: #ff6fb1; border-color: rgba(255, 111, 177, .6); text-shadow: 0 0 9px rgba(255, 111, 177, .95); box-shadow: 0 0 14px rgba(255, 111, 177, .35), inset 0 0 8px rgba(255, 111, 177, .15); }
.g-idle {
  border: 1px solid var(--line2); border-radius: 3px; background: rgba(5, 9, 17, .8); color: var(--dim); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 600 13px var(--mono);
}
.g-idle span { font-size: 22px; color: var(--teal); }
.g-idle.has { border-color: var(--teal); color: #fff; box-shadow: 0 0 12px rgba(63, 214, 192, .25); }
.g-idle:hover { border-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 196px; transform: translateX(-50%); z-index: 45; pointer-events: none;
  font-size: 14px; letter-spacing: .05em; color: #ffd0cf; text-shadow: 0 0 10px rgba(239, 100, 97, .6);
  background: rgba(29, 15, 15, .82); border: 1px solid #5a2a2a; border-radius: 3px; padding: 6px 12px;
  opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.info { color: #cdf6ff; background: rgba(8, 24, 32, .85); border-color: #1d4a5a; text-shadow: 0 0 10px rgba(240, 136, 62, .5); }
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(4, 6, 12, .55); }
.end { width: min(420px, 92vw); text-align: center; }
.end h1 { font-size: 40px; letter-spacing: .2em; margin: 6px 0; text-transform: uppercase; }
.end h1.win { color: var(--accent); text-shadow: 0 0 22px rgba(240, 136, 62, .6); }
.end h1.lose { color: var(--down); text-shadow: 0 0 22px rgba(239, 100, 97, .6); }
.end .row-end { justify-content: center; }

@media (max-width: 980px) {
  .lobby { grid-template-columns: 1fr; }
  .create-grid { grid-template-columns: 1fr 1fr; }
  .g-panel { grid-template-columns: 156px minmax(0, 1fr) 280px; }
  .g-idle { display: none; }
  .g-res { gap: 10px; }
  .g-players { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.snd-pop[hidden] { display: none; }
