:root {
  --bg: #05070b;
  --console-bg: rgba(7, 10, 16, 0.96);
  --console-border: #1e283d;
  --console-border-bright: #334366;
  
  --panel-bg: rgba(10, 13, 20, 0.98);
  --panel-border: #232e44;
  
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.18);
  --cyan: #38bdf8;
  
  --text: #f1f5f9;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --font-mono: Consolas, "Roboto Mono", "Courier New", ui-monospace, monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* =========================================================
   TAKTISK ATMOSFÆRE & KINEMATISKE OVERLAYS
   ========================================================= */
#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, transparent 50%, rgba(2, 4, 8, 0.78) 100%);
  z-index: 2;
}

#damage-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(239, 68, 68, 0.35);
  box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.7);
  opacity: 0;
  z-index: 15;
  transition: opacity 0.08s ease-out;
}
#damage-overlay.flash {
  opacity: 1;
}

#laser-flash-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6) 0%, rgba(56, 189, 248, 0.4) 45%, rgba(14, 165, 233, 0.2) 100%);
  box-shadow: inset 0 0 140px rgba(56, 189, 248, 0.95);
  opacity: 0;
  z-index: 16;
  transition: opacity 0.32s cubic-bezier(0.1, 0.9, 0.2, 1);
}
#laser-flash-overlay.flash {
  opacity: 1;
  transition: opacity 0.04s ease-in;
}

/* Taktisk trådkors */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0);
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 8;
  backface-visibility: hidden;
}
.cross-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.45);
}
.cross-line.h-left { top: 11px; left: 0; width: 7px; height: 2px; }
.cross-line.h-right { top: 11px; right: 0; width: 7px; height: 2px; }
.cross-line.v-top { left: 11px; top: 0; width: 2px; height: 7px; }
.cross-line.v-bottom { left: 11px; bottom: 0; width: 2px; height: 7px; }
.cross-center {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 4px;
  height: 4px;
  background: var(--amber);
}
#crosshair.locked .cross-line {
  background: var(--green);
}
#crosshair.locked .cross-center {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* =========================================================
   UNIFISERT TAKTISK BUNN-KONSVOLL (RETNING A)
   Alt samlet i én solid, forankret kontrollbar nederst
   ========================================================= */
#bottom-console {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: var(--console-bg);
  border-top: 2px solid var(--console-border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.85);
  display: grid;
  grid-template-columns: 290px 1fr 290px;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 20;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.console-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.console-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.console-mono-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

/* --- VENSTRE MODUL: FORSVAR / HELSEBAR --- */
.console-defense {
  gap: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding-right: 16px;
}
.console-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.health-bar-bg {
  width: 100%;
  height: 16px;
  background: #000000;
  border: 1px solid var(--console-border-bright);
  padding: 1px;
}
/* Segmenterte LED-blokker (Hardware / avionics stil) */
.health-bar-fill {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0px,
    var(--green) 7px,
    transparent 7px,
    transparent 9px
  );
  transition: width 0.15s linear;
}
.health-bar-fill.warning {
  background: repeating-linear-gradient(
    90deg,
    var(--amber) 0px,
    var(--amber) 7px,
    transparent 7px,
    transparent 9px
  );
}
.health-bar-fill.danger {
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0px,
    var(--red) 7px,
    transparent 7px,
    transparent 9px
  );
}

.console-controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.camera-toggle-btn {
  background: transparent;
  border: 1px solid var(--console-border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.camera-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text);
  color: #ffffff;
}
.ctrl-bracket {
  color: var(--amber);
}

.perf-toggle-btn.active-school {
  color: #10b981;
  border-color: #10b981;
}
.perf-toggle-btn.active-school .ctrl-bracket {
  color: #10b981;
}

.btn-perf-pill {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  transition: all 0.15s ease;
}
.btn-perf-pill:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}
.btn-perf-pill.active-school {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* --- MIDTRE MODUL: AKTIVT ORD / SKRIVEDEKK --- */
.console-target {
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 16px;
}
.deck-topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.deck-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.deck-status.status-idle {
  color: var(--text-muted);
}
.deck-status.status-locked {
  color: var(--amber);
}

.deck-main {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.deck-letter {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  padding: 1px 7px;
  background: #000000;
  border: 1px solid #29354d;
  color: #94a3b8;
  line-height: 1.1;
  min-width: 28px;
  text-align: center;
}
.deck-letter.typed {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-dim);
}
.deck-letter.current {
  color: #000000;
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 900;
}
.deck-letter.remaining {
  color: #f8fafc;
  border-color: #3b4863;
}

.deck-idle-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.deck-bottombar {
  display: flex;
  align-items: center;
  justify-content: center;
}
.deck-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.deck-hint strong {
  color: var(--amber);
  margin-left: 4px;
}

/* Risting på tastaturfeil */
#active-word-deck.deck-error {
  animation: deckFault 0.18s ease-in-out;
}
@keyframes deckFault {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  75% { transform: translateY(3px); }
}

/* --- HØYRE MODUL: TELEMETRI & STATS --- */
.console-stats {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 16px;
  gap: 6px;
}
.stats-toprow {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wave-badge {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
}
.combo-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
  padding: 2px 7px;
  transition: all 0.2s ease;
}
.combo-pill.super {
  color: #ffffff;
  background: rgba(236, 72, 153, 0.25);
  border-color: #ec4899;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.8);
  animation: pulseLaser 0.9s infinite;
}

/* Flytende poeng-popup ved feilfri ordeliminering */
.score-popup {
  position: absolute;
  top: -26px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #10b981;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.85);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: none;
  z-index: 20;
}
.score-popup.pop {
  opacity: 1;
  transform: translateY(-18px);
  transition: transform 0.65s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.65s ease-out;
}
.score-popup.perfect {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.9), 0 0 24px rgba(255, 255, 255, 0.7);
}

.stats-grid {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.stat-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

/* =========================================================
   TAKTISK RUNDE-SPLASH (HORISONTALT MØRKT BANNER)
   ========================================================= */
.splash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  pointer-events: none;
  background: rgba(3, 5, 8, 0.7);
  transition: opacity 0.15s ease-out;
}
.splash-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-box {
  width: 100%;
  background: #05070c;
  border-top: 3px solid var(--amber);
  border-bottom: 3px solid var(--amber);
  padding: 24px 0;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95);
  animation: splashIn 0.2s ease-out forwards;
}
@keyframes splashIn {
  0% { transform: scaleY(0); opacity: 0; }
  100% { transform: scaleY(1); opacity: 1; }
}

.splash-marker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 6px;
}
.splash-title {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.splash-stats {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.splash-divider {
  color: var(--text-muted);
}
.splash-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* =========================================================
   TAKTISK TOAST (STATUSVARSEL)
   ========================================================= */
#toast {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #090d16;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 18px;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: all 0.15s ease-out;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================
   MODALER (STARTMENY OG GAME OVER: 2020 GAMING SWEET SPOT)
   ========================================================= */
/* =========================================================
   EKTE SPILLMENY - HOVEDSKJERM (FILMATISK & REN)
   ========================================================= */
.menu-screen {
  background: radial-gradient(circle at 50% 45%, rgba(10, 15, 26, 0.4) 0%, rgba(4, 6, 12, 0.85) 100%);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  animation: heroMenuIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroMenuIn {
  0% { transform: translateY(16px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.game-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.game-title-hero {
  font-family: 'Russo One', 'Montserrat', 'Impact', sans-serif;
  font-size: clamp(3.8rem, 8.5vw, 6.2rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-transform: uppercase;
  margin: 0;
  padding: 0 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fed7aa 28%, #f97316 68%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 0 #7c2d12) drop-shadow(0 14px 30px rgba(249, 115, 22, 0.55));
  transform: perspective(600px) rotateX(8deg);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.game-title-hero:hover {
  transform: perspective(600px) rotateX(4deg) scale(1.02);
  filter: drop-shadow(0 8px 0 #7c2d12) drop-shadow(0 18px 38px rgba(249, 115, 22, 0.75));
}

.menu-btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 320px;
}

.btn-game-hero {
  width: 100%;
  font-family: 'Russo One', var(--font-mono), sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
}

/* START-KNAPP */
.btn-hero-start {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 900;
  padding: 16px 28px;
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.btn-hero-start:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(234, 88, 12, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  filter: brightness(1.08);
}
.btn-hero-start:active {
  transform: translateY(1px) scale(0.99);
}

/* SEKUNDÆRKNAPPER (EGEN TEKST / MUTE) */
.btn-hero-sub {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 13px 22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}
.btn-hero-sub:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--cyan);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}
.btn-hero-sub:active {
  transform: translateY(1px);
}

.btn-hero-mute.muted {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-hero-mute.muted:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
}

/* Modaler */
.modal-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.78) 0%, rgba(3, 5, 10, 0.94) 100%);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  transition: opacity 0.25s ease;
}
.modal-layer.hidden {
  display: none;
}

.menu-card {
  background: linear-gradient(170deg, rgba(16, 23, 38, 0.95) 0%, rgba(9, 13, 22, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  width: 90%;
  max-width: 480px;
  padding: 34px 38px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 50px rgba(245, 158, 11, 0.08);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: cardFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardFadeIn {
  0% { transform: scale(0.96) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.terminal-danger {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 60px rgba(239, 68, 68, 0.18);
}

.menu-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.btn-mute-toggle {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #cbd5e1;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.btn-mute-toggle:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-mute-toggle.muted {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.btn-mute-toggle.muted:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
}

.sound-hud-btn {
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sound-hud-btn.muted #sound-icon-hud {
  filter: grayscale(1) opacity(0.5);
}

.system-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--amber);
}
.system-danger {
  color: var(--red);
}

.menu-title {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 40%, #fdba74 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(245, 158, 11, 0.35));
}
.danger-title {
  background: linear-gradient(180deg, #ffffff 30%, #f87171 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(239, 68, 68, 0.4));
}

.menu-sub {
  font-size: 0.92rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-top: 6px;
}

/* 2020 Gaming Knapper */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  border-radius: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

/* Primær Start-knapp (Hades / Apex stil) */
.btn-play-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 16px 24px;
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-play-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(1.08);
}
.btn-play-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
}
.btn-play-text {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.btn-play-sub {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 3px;
}

/* Sekundær knapp */
.btn-secondary {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 12px 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: var(--cyan);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-sec-text {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.custom-badge-inline {
  font-size: 0.65rem;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* =========================================================
   SPILL OVER / GAME OVER MODAL (2-KOLONNER MED 300x250 ANNONSE)
   ========================================================= */
.gameover-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.gameover-columns {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 860px;
  animation: gameoverPopIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.18) forwards;
}

@keyframes gameoverPopIn {
  from {
    transform: scale(0.88) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Venstre kort: Resultater */
.gameover-card {
  flex: 1 1 380px;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(18, 38, 70, 0.94) 0%, rgba(9, 20, 38, 0.98) 100%);
  backdrop-filter: blur(14px);
  border: 2px solid rgba(144, 224, 239, 0.4);
  border-radius: 20px;
  padding: 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.go-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 2px;
}

.go-header-icon {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.5));
}

.go-header-text {
  text-align: left;
}

.go-header-text .go-title {
  font-family: 'Russo One', 'Montserrat', Impact, sans-serif;
  font-size: 2.2rem;
  font-style: italic;
  font-weight: 900;
  color: #ef4444;
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
}

.go-newbest {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 9999px;
  margin: 4px 0 2px 0;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.go-summary {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* 3 Store metrikkbokser */
.go-big-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0;
}

.go-metric-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(144, 224, 239, 0.24);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.go-metric-box small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #90e0ef;
  margin-bottom: 4px;
}

.go-metric-box b {
  display: block;
  font-family: 'Russo One', 'Montserrat', Impact, sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.go-metric-box.primary {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.55);
}

.go-metric-box.primary b {
  color: #ffd166;
  text-shadow: 0 2px 14px rgba(255, 209, 102, 0.4);
}

.go-metric-box.wave {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.48);
}

.go-metric-box.wave b {
  color: #38bdf8;
}

.go-metric-box.words {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.38);
}

.go-metric-box.words b {
  color: #4ade80;
}

/* Sekundære stats */
.go-secondary-stats {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.go-substat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #94a3b8;
}

.go-substat-label {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.go-substat-val {
  font-weight: 900;
  font-size: 0.95rem;
  color: #ffffff;
  letter-spacing: 0.05em;
}

/* Stor Grønn Prøv Igjen-knapp */
.play-btn-gameover {
  width: 100%;
  padding: 14px;
  font-family: 'Russo One', 'Montserrat', Impact, sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #042f1a;
  background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.play-btn-gameover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.65), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(1.08);
}

.play-btn-gameover:active {
  transform: translateY(1px);
}

.go-actions-row {
  display: flex;
  gap: 10px;
}

.ghost-btn-gameover {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-align: center;
}

.ghost-btn-gameover:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

/* Høyre kort: 300x250 Annonsekort */
.gameover-ad-card {
  flex: 0 0 340px;
  width: 340px;
  background: linear-gradient(180deg, rgba(18, 38, 70, 0.94) 0%, rgba(9, 20, 38, 0.98) 100%);
  backdrop-filter: blur(14px);
  border: 2px solid rgba(144, 224, 239, 0.3);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
}

.ad-card-header {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding-left: 4px;
}

.ad-card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}

.ad-slot-300x250 {
  width: 300px;
  height: 250px;
  min-width: 300px;
  min-height: 250px;
  background: rgba(10, 18, 32, 0.72);
  border: 1.5px dashed rgba(144, 224, 239, 0.32);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.ad-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.ad-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.25);
}

.ad-megaphone-icon {
  line-height: 1;
}

.ad-title-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.ad-sub-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #94a3b8;
  max-width: 220px;
  line-height: 1.35;
}

.ad-pill-badge {
  display: inline-block;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .gameover-columns {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .gameover-card,
  .gameover-ad-card {
    width: 100%;
    max-width: 360px;
    flex: initial;
  }
}

.val-gold { color: var(--amber) !important; }
.val-green { color: var(--green) !important; }

/* 2020 Gaming Tema-velger (Pills) */
.theme-selector-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theme-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
  text-transform: uppercase;
}
.theme-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.theme-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 9px 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.theme-pill:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(30, 41, 59, 0.8);
  color: #ffffff;
}
.theme-pill.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
}

.btn-perf-pill {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
}

/* Skjerm-risting */
.shake {
  animation: screenShake 0.22s ease-in-out;
}
@keyframes screenShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-5px, 3px); }
  50% { transform: translate(4px, -4px); }
  75% { transform: translate(-2px, 2px); }
  100% { transform: translate(0, 0); }
}

/* Responsiv tilpasning for mindre skjermer */
@media (max-width: 960px) {
  #bottom-console {
    grid-template-columns: 210px 1fr 210px;
    padding: 0 12px;
    gap: 10px;
    height: 84px;
  }
  .deck-letter {
    font-size: 1.5rem;
    padding: 1px 5px;
    min-width: 22px;
  }
  .splash-title {
    font-size: 2.1rem;
  }
}

/* =========================================================
   SJOKKGRANAT & TAKTISK TELEMETRI
   ========================================================= */
.grenade-slot {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border: 1px solid var(--console-border);
  transition: all 0.15s ease;
}
.grenade-title {
  color: var(--text-muted);
}
.grenade-counter {
  color: var(--cyan);
}
.grenade-bracket {
  color: var(--text-muted);
}

/* Klar til detonasjon / laser-avfyring */
.grenade-slot.ready,
.laser-slot.ready {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.65);
  animation: pulseLaser 1.0s infinite;
}
.grenade-slot.ready .grenade-title,
.laser-slot.ready .grenade-title {
  color: #ffffff;
  text-shadow: 0 0 6px #38bdf8;
}
.grenade-slot.ready .grenade-counter,
.laser-slot.ready .grenade-counter {
  color: #38bdf8;
  font-weight: 900;
  text-shadow: 0 0 10px #38bdf8;
}
@keyframes pulseLaser {
  0%, 100% {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  }
  50% {
    border-color: #ffffff;
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.95), 0 0 35px rgba(255, 255, 255, 0.5);
  }
}
@keyframes pulseGrenade {
  0%, 100% { border-color: var(--amber); box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
  50% { border-color: #ffffff; box-shadow: 0 0 16px rgba(245, 158, 11, 0.6); }
}

/* Nærhetsalarm (under 4m unna) */
.danger-proximity {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--red);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  padding: 2px 7px;
  animation: blinkDanger 0.6s infinite alternate;
}
@keyframes blinkDanger {
  0% { opacity: 0.35; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); }
}

/* =========================================================
   EGNE ORD / LÆRERMODUS PANEL
   ========================================================= */
.custom-words-btn {
  border-color: rgba(56, 189, 248, 0.35);
}
.custom-words-btn:hover {
  border-color: var(--cyan);
}
.custom-badge-inline {
  font-size: 0.68rem;
  color: var(--cyan);
  font-weight: 600;
}

.custom-words-card {
  max-width: 580px;
  width: 92%;
}

.custom-words-body {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-presets-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

.preset-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  font-weight: 700;
}

.preset-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-preset {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: var(--cyan);
  color: #ffffff;
}

.btn-preset:active {
  transform: translateY(1px);
}

.custom-textarea {
  width: 100%;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.custom-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.custom-words-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.custom-count-text {
  color: var(--cyan);
  font-weight: 700;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #ffffff;
  user-select: none;
}
.custom-checkbox-label input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.custom-btn-group {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 8px;
  margin-top: 8px;
}

