/* ==========================================================================
   SHIFTCADE // CYBER-NOIR TV TERMINAL DESIGN SYSTEM
   Paleta: Void Black (#050505), Electric Cyan (#06b6d4), Neon Crimson (#f43f5e)
   Czysty, ultraszybki CSS bez ciężkich frameworków.
   ========================================================================== */

:root {
  --bg-void: #050505;
  --bg-panel: rgba(10, 12, 16, 0.82);
  --bg-panel-solid: #0a0b0e;

  --cyan: #06b6d4;
  --cyan-bright: #22d3ee;
  --cyan-dim: rgba(6, 182, 212, 0.16);
  --cyan-border: rgba(6, 182, 212, 0.45);

  --crimson: #f43f5e;
  --crimson-bright: #fb7185;
  --crimson-dim: rgba(244, 63, 94, 0.16);
  --crimson-border: rgba(244, 63, 94, 0.48);

  --text-main: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #64748b;

  --font-display: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ==========================================================================
   TŁO CYBER-NOIR (SIATKA PERSPEKTYWICZNA, POŚWIATA, SCANLINES)
   ========================================================================== */

.bg-void {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-void);
  overflow: hidden;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: -40% -20% -20% -20%;
  background-image:
    linear-gradient(to right, rgba(6, 182, 212, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6, 182, 212, 0.08) 1px, transparent 1px);
  background-size: 68px 68px;
  transform: perspective(650px) rotateX(62deg) translateY(12%);
  transform-origin: center bottom;
  animation: gridScroll 16s linear infinite;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9) 10%, transparent 78%);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9) 10%, transparent 78%);
}

@keyframes gridScroll {
  from { background-position: 0 0; }
  to { background-position: 0 68px; }
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.24;
  will-change: transform, opacity;
}

.bg-glow-cyan {
  width: 55vw;
  height: 55vw;
  max-width: 780px;
  max-height: 780px;
  background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
  top: -22%;
  left: -12%;
  animation: glowDriftCyan 14s ease-in-out infinite alternate;
}

.bg-glow-crimson {
  width: 52vw;
  height: 52vw;
  max-width: 740px;
  max-height: 740px;
  background: radial-gradient(circle, var(--crimson) 0%, transparent 70%);
  bottom: -24%;
  right: -12%;
  animation: glowDriftCrimson 16s ease-in-out infinite alternate;
}

@keyframes glowDriftCyan {
  0% { transform: translate(0, 0) scale(1); opacity: 0.20; }
  100% { transform: translate(6%, 8%) scale(1.12); opacity: 0.30; }
}

@keyframes glowDriftCrimson {
  0% { transform: translate(0, 0) scale(1); opacity: 0.18; }
  100% { transform: translate(-6%, -7%) scale(1.14); opacity: 0.28; }
}

.bg-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.018) 3px,
    rgba(0, 0, 0, 0.28) 4px
  );
  opacity: 0.7;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, 0.88) 100%);
}

/* Narożniki HUD terminala */
.hud-corner {
  position: fixed;
  width: 28px;
  height: 28px;
  z-index: 4;
  pointer-events: none;
  opacity: 0.65;
}

.hud-corner.top-left {
  top: 18px;
  left: 18px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  box-shadow: -3px -3px 12px rgba(6, 182, 212, 0.35);
}

.hud-corner.top-right {
  top: 18px;
  right: 18px;
  border-top: 2px solid var(--crimson);
  border-right: 2px solid var(--crimson);
  box-shadow: 3px -3px 12px rgba(244, 63, 94, 0.35);
}

.hud-corner.bottom-left {
  bottom: 18px;
  left: 18px;
  border-bottom: 2px solid var(--crimson);
  border-left: 2px solid var(--crimson);
  box-shadow: -3px 3px 12px rgba(244, 63, 94, 0.35);
}

.hud-corner.bottom-right {
  bottom: 18px;
  right: 18px;
  border-bottom: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
  box-shadow: 3px 3px 12px rgba(6, 182, 212, 0.35);
}

/* ==========================================================================
   GŁÓWNA POWŁOKA I NAGŁÓWEK SHIFTCADE
   ========================================================================== */

.tv-shell {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 28px 46px 26px 46px;
}

.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-mark {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--crimson);
  text-shadow: 0 0 12px var(--crimson), 0 0 24px rgba(244, 63, 94, 0.65);
  letter-spacing: -2px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--text-main);
  text-shadow: 0 0 18px rgba(6, 182, 212, 0.45);
}

.brand-accent {
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan), 0 0 32px rgba(6, 182, 212, 0.7);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 9px;
  border-radius: 4px;
  margin-left: 6px;
}

.header-telemetry {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-room-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--cyan-border);
  border-radius: 6px;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.18);
}

.mini-room-pill.hidden {
  display: none;
}

.mini-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.mini-code {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--cyan-bright);
  text-shadow: 0 0 10px var(--cyan);
}

/* Status kontrolera: ROZŁĄCZONY / POŁĄCZONY */
.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-radius: 6px;
  background: var(--bg-panel);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  transition: all 0.35s ease;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-prefix {
  color: var(--text-muted);
  font-size: 11px;
}

.status-pill.disconnected {
  border: 1px solid var(--crimson-border);
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.25), inset 0 0 14px rgba(244, 63, 94, 0.08);
}

.status-pill.disconnected .status-dot {
  background: var(--crimson);
  box-shadow: 0 0 12px var(--crimson), 0 0 24px var(--crimson);
  animation: pulseDotCrimson 1.3s ease-in-out infinite;
}

.status-pill.disconnected .status-value {
  color: var(--crimson-bright);
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.85);
}

.status-pill.connected {
  border: 1px solid var(--cyan-border);
  box-shadow: 0 0 26px rgba(6, 182, 212, 0.32), inset 0 0 16px rgba(6, 182, 212, 0.12);
}

.status-pill.connected .status-dot {
  background: var(--cyan-bright);
  box-shadow: 0 0 14px var(--cyan), 0 0 28px var(--cyan);
}

.status-pill.connected .status-value {
  color: var(--cyan-bright);
  text-shadow: 0 0 14px rgba(6, 182, 212, 0.9);
}

@keyframes pulseDotCrimson {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* ==========================================================================
   PRZEŁĄCZANIE WIDOKÓW (LOBBY <-> GAME STAGE)
   ========================================================================== */

.stage-view {
  flex: 1;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 0;
  padding-top: 12px;
}

#lobby-view {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.4) transparent;
}

.stage-view.active {
  display: flex;
}

/* ==========================================================================
   WIDOK 1: KONSOLA PAROWANIA I GIGANTYCZNY ROOM CODE
   ========================================================================== */

.pairing-console {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 1040px;
  gap: 16px;
}

.console-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.65);
}

.eyebrow-line {
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.pairing-prompt {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 44px);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.25;
  color: var(--text-main);
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.22);
}

.highlight-brand {
  color: var(--crimson-bright);
  text-shadow:
    0 0 14px rgba(244, 63, 94, 0.85),
    0 0 36px rgba(244, 63, 94, 0.45);
}

/* Ramka z 4 ogromnymi cyframi kodu pokoju */
.room-code-frame {
  position: relative;
  padding: 26px 40px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(12, 16, 22, 0.92) 0%, rgba(5, 5, 8, 0.96) 100%);
  border: 2px solid var(--cyan-border);
  box-shadow:
    0 0 45px rgba(6, 182, 212, 0.22),
    0 0 90px rgba(244, 63, 94, 0.10),
    inset 0 0 34px rgba(6, 182, 212, 0.12);
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.35s ease;
}

.room-code-frame.paired {
  border-color: var(--cyan-bright);
  box-shadow:
    0 0 65px rgba(6, 182, 212, 0.48),
    0 0 120px rgba(6, 182, 212, 0.22),
    inset 0 0 42px rgba(6, 182, 212, 0.24);
}

.code-scan-line {
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.22), transparent);
  transform: skewX(-18deg);
  animation: codeScanSweep 4.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes codeScanSweep {
  0% { left: -35%; }
  45%, 100% { left: 135%; }
}

.code-digits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vw, 28px);
  position: relative;
  z-index: 2;
}

.digit-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(84px, 11vw, 146px);
  height: clamp(104px, 14vw, 174px);
  border-radius: 12px;
  background: rgba(5, 5, 5, 0.92);
  border: 1.5px solid rgba(6, 182, 212, 0.5);
  font-family: var(--font-mono);
  font-size: clamp(58px, 7.6vw, 114px);
  font-weight: 800;
  color: var(--cyan-bright);
  text-shadow:
    0 0 18px rgba(6, 182, 212, 0.95),
    0 0 42px rgba(6, 182, 212, 0.65),
    3px 0 0 rgba(244, 63, 94, 0.35);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    inset 0 0 22px rgba(6, 182, 212, 0.14);
  transition: transform 0.25s ease, border-color 0.3s ease;
}

.digit-box.pop {
  animation: digitPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes digitPop {
  0% { transform: scale(0.84) translateY(8px); opacity: 0.2; }
  65% { transform: scale(1.05) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Baner statusu pod kodem */
.lobby-banner {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.5px;
  transition: all 0.35s ease;
}

.lobby-banner.disconnected {
  background: rgba(244, 63, 94, 0.10);
  border: 1px solid var(--crimson-border);
  color: var(--crimson-bright);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.20);
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.lobby-banner.connected {
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid var(--cyan-bright);
  color: var(--cyan-bright);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.35);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.8);
}

.banner-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  animation: pulseDotCrimson 1.2s ease-in-out infinite;
}

.lobby-banner.connected .banner-pulse {
  animation: none;
}

/* ==========================================================================
   5 DUŻYCH KAFELKÓW GIER W LOBBY (GAME CARDS GRID)
   ========================================================================== */

.game-cards-section {
  width: 100%;
  max-width: 1240px;
  margin-top: 14px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cards-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.cards-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.game-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px;
  min-height: 175px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  text-align: left;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.25s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(6, 182, 212, 0.2);
}

.game-card:hover::before {
  background: var(--cyan);
}

.game-card.active {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.09);
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.3), inset 0 0 14px rgba(6, 182, 212, 0.1);
}

.game-card.active::before {
  background: var(--cyan-bright);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.game-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--crimson-bright);
  background: rgba(225, 29, 72, 0.12);
  padding: 2px 5px;
  border-radius: 4px;
}

.game-card-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--cyan);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-icon-wrap {
  display: flex;
  align-items: center;
  margin: 4px 0 8px;
}

.game-card-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
  transition: transform 0.25s ease;
}

.game-card:hover .game-card-icon {
  transform: scale(1.15);
}

.game-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
  margin: 0;
  text-transform: uppercase;
}

.game-card-desc {
  font-family: var(--font-body);
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card-footer {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-card-ctrl {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.4px;
}

.game-card-arrow {
  font-size: 10px;
  color: var(--cyan);
  transition: transform 0.2s ease;
}

.game-card:hover .game-card-arrow {
  transform: translateX(3px);
}

.catalog-pills {
  display: none;
}

/* ==========================================================================
   WIDOK 2: LUKSUSOWA SCENA GRY (PLACEHOLDER POD THREE.JS)
   ========================================================================== */

.game-showcase {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  padding: 20px;
}

.game-showcase.reveal-anim {
  animation: gameStageReveal 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gameStageReveal {
  0% {
    opacity: 0;
    transform: scale(0.86) translateY(24px);
    filter: brightness(2.4) blur(10px);
  }
  55% {
    opacity: 1;
    transform: scale(1.02) translateY(-4px);
    filter: brightness(1.3) blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: brightness(1) blur(0);
  }
}

/* Reaktor / Emblemat gry */
.game-orbit-emblem {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
}

.orbit-outer {
  inset: 0;
  border: 2px solid var(--cyan);
  border-top-color: var(--crimson);
  border-bottom-color: transparent;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.45), inset 0 0 20px rgba(6, 182, 212, 0.2);
  animation: spinOrbit 7s linear infinite;
}

.orbit-inner {
  inset: 14px;
  border: 1.5px dashed var(--crimson);
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.35);
  animation: spinOrbitReverse 10s linear infinite;
}

@keyframes spinOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinOrbitReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.game-icon {
  font-size: 62px;
  filter: drop-shadow(0 0 22px rgba(6, 182, 212, 0.85));
  z-index: 2;
}

.game-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.5px;
  padding: 5px 14px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-crimson {
  background: var(--crimson-dim);
  border: 1px solid var(--crimson-border);
  color: var(--crimson-bright);
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.28);
}

.badge-cyan {
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-border);
  color: var(--cyan-bright);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.28);
}

/* Wielki neonowy tytuł gry */
.game-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6.2vw, 84px);
  font-weight: 900;
  letter-spacing: 5px;
  line-height: 1.08;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow:
    0 0 18px rgba(6, 182, 212, 0.95),
    0 0 46px rgba(6, 182, 212, 0.65),
    4px 0 0 rgba(244, 63, 94, 0.8),
    -4px 0 0 rgba(6, 182, 212, 0.75);
}

.title-laser-bar {
  width: min(560px, 76vw);
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--crimson) 22%, var(--cyan-bright) 50%, var(--crimson) 78%, transparent 100%);
  box-shadow: 0 0 22px var(--cyan), 0 0 36px rgba(244, 63, 94, 0.7);
  border-radius: 4px;
}

.game-description {
  max-width: 760px;
  font-size: clamp(18px, 1.9vw, 24px);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-soft);
  letter-spacing: 0.6px;
}

/* Karty telemetrii na makiecie silnika */
.engine-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 820px;
  margin-top: 10px;
}

.telemetry-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 2px solid var(--cyan);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(6, 182, 212, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.telemetry-card.signal-hit {
  border-top-color: var(--crimson);
  box-shadow: 0 0 34px rgba(244, 63, 94, 0.48), inset 0 0 22px rgba(244, 63, 94, 0.18);
  transform: scale(1.04);
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.telemetry-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-main);
}

.telemetry-value.cyan {
  color: var(--cyan-bright);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.75);
}

.telemetry-value.crimson {
  color: var(--crimson-bright);
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.75);
}

.lobby-actions {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   CYBER-NOIR HALL OF FAME / TOP 5 DOMOWNIKÓW
   ========================================================================== */

.leaderboard-card {
  width: 100%;
  max-width: 680px;
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 12px;
  padding: 12px 18px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), inset 0 0 16px rgba(6, 182, 212, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.lb-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--cyan);
}

.lb-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-main);
}

.lb-clear-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 5px 10px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--crimson-bright);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-clear-btn:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--crimson-bright);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
}

.lb-row {
  display: grid;
  grid-template-columns: 68px 1fr 130px 90px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-body);
  font-size: 14px;
}

.lb-row.rank-1 {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.18);
}

.lb-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: var(--cyan);
  text-align: left;
}

.lb-row.rank-1 .lb-rank {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
}

.lb-name {
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-main);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  color: var(--cyan-bright);
  text-align: right;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

.lb-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.lb-empty {
  text-align: center;
  padding: 14px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.game-stage-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.play-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28) 0%, rgba(244, 63, 94, 0.32) 100%);
  border: 2px solid var(--cyan-bright);
  padding: 15px 42px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow:
    0 0 28px rgba(6, 182, 212, 0.45),
    0 0 54px rgba(244, 63, 94, 0.25),
    inset 0 0 18px rgba(6, 182, 212, 0.22);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.9);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  animation: playPulseGlow 2.2s ease-in-out infinite alternate;
}

.play-cta-btn .play-icon {
  font-size: 18px;
  color: var(--cyan-bright);
  text-shadow: 0 0 14px var(--cyan);
  transition: transform 0.2s ease, color 0.2s ease;
}

.play-cta-btn:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: #ffffff;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--crimson) 100%);
  box-shadow:
    0 0 42px rgba(6, 182, 212, 0.78),
    0 0 72px rgba(244, 63, 94, 0.5);
}

.play-cta-btn:hover .play-icon {
  color: #ffffff;
  transform: translateX(3px);
}

.play-cta-btn:active {
  transform: scale(0.97);
}

@keyframes playPulseGlow {
  0% {
    box-shadow:
      0 0 22px rgba(6, 182, 212, 0.38),
      0 0 44px rgba(244, 63, 94, 0.2),
      inset 0 0 14px rgba(6, 182, 212, 0.16);
  }
  100% {
    box-shadow:
      0 0 36px rgba(6, 182, 212, 0.65),
      0 0 64px rgba(244, 63, 94, 0.38),
      inset 0 0 22px rgba(6, 182, 212, 0.28);
  }
}

.noir-btn {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 11px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.noir-btn:hover {
  color: var(--cyan-bright);
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.4);
}

/* ==========================================================================
   POTĘŻNA NEONOWA ANIMACJA PRZEJŚCIA (SHOCKWAVE + LASER SWEEP + FLASH)
   ========================================================================== */

.transition-fx {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.transition-fx.playing {
  opacity: 1;
}

.fx-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(6, 182, 212, 0.45) 0%, rgba(244, 63, 94, 0.22) 45%, transparent 78%);
  opacity: 0;
}

.transition-fx.playing .fx-flash {
  animation: fxFlashBurst 0.85s ease-out forwards;
}

@keyframes fxFlashBurst {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

.fx-ring {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  opacity: 0;
}

.fx-ring-cyan {
  border: 4px solid var(--cyan-bright);
  box-shadow: 0 0 45px var(--cyan), inset 0 0 35px var(--cyan);
}

.fx-ring-crimson {
  border: 3px solid var(--crimson-bright);
  box-shadow: 0 0 45px var(--crimson), inset 0 0 35px var(--crimson);
}

.transition-fx.playing .fx-ring-cyan {
  animation: fxShockwave 0.82s cubic-bezier(0.12, 0.85, 0.25, 1) forwards;
}

.transition-fx.playing .fx-ring-crimson {
  animation: fxShockwave 0.92s cubic-bezier(0.12, 0.85, 0.25, 1) 0.08s forwards;
}

@keyframes fxShockwave {
  0% {
    transform: scale(0.15);
    opacity: 0.95;
  }
  70% {
    opacity: 0.65;
  }
  100% {
    transform: scale(7.5);
    opacity: 0;
  }
}

.fx-scan-beam {
  position: absolute;
  left: 0;
  width: 100%;
  height: 6px;
  top: -10%;
  background: linear-gradient(90deg, transparent, var(--crimson), var(--cyan-bright), var(--crimson), transparent);
  box-shadow: 0 0 35px var(--cyan), 0 0 60px var(--crimson);
  opacity: 0;
}

.transition-fx.playing .fx-scan-beam {
  animation: fxLaserSweep 0.72s cubic-bezier(0.25, 0.9, 0.3, 1) forwards;
}

@keyframes fxLaserSweep {
  0% { top: -6%; opacity: 1; }
  85% { opacity: 0.95; }
  100% { top: 106%; opacity: 0; }
}

/* ==========================================================================
   PASEK ŁADOWANIA SILNIKA THREE.JS (2s TRANSITION)
   ========================================================================== */

.engine-loading-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.engine-loading-track.loading {
  opacity: 1;
}

.engine-loading-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--cyan-bright) 100%);
  box-shadow: 0 0 14px var(--cyan), 0 0 22px var(--crimson);
}

.engine-loading-track.loading .engine-loading-fill {
  animation: engineLoadSweep 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes engineLoadSweep {
  0% { width: 0%; }
  100% { width: 100%; }
}

.telemetry-value.loading-pulse {
  animation: engineStatusBlink 0.65s ease-in-out infinite alternate;
}

@keyframes engineStatusBlink {
  0% { opacity: 0.55; }
  100% { opacity: 1; text-shadow: 0 0 18px var(--cyan-bright); }
}

.stage-view.fading-out {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(8px);
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

/* ==========================================================================
   WIDOK 3: PEŁNOEKRANOWY SILNIK THREE.JS + CYBER-NOIR LIVE HUD
   ========================================================================== */

.threejs-stage {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: var(--bg-void);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.threejs-stage.active {
  opacity: 1;
  pointer-events: auto;
}

.threejs-canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.threejs-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.live-hud {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 28px;
}

.live-hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.live-hud-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-hud-card {
  background: rgba(5, 5, 8, 0.78);
  border: 1px solid rgba(6, 182, 212, 0.38);
  border-top: 2px solid var(--cyan);
  border-radius: 10px;
  padding: 9px 16px;
  min-width: 112px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65), inset 0 0 14px rgba(6, 182, 212, 0.08);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.live-game-card {
  border-top-color: var(--crimson);
  border-color: rgba(244, 63, 94, 0.42);
  min-width: 210px;
}

.live-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.live-game-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--text-main);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.65);
}

.live-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-main);
}

.live-value.cyan {
  color: var(--cyan-bright);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.8);
}

.live-value.crimson {
  color: var(--crimson-bright);
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.8);
}

.live-motion-card.flash {
  border-top-color: var(--crimson-bright);
  border-color: var(--crimson-bright);
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.55), inset 0 0 16px rgba(244, 63, 94, 0.25);
  transform: scale(1.06);
}

.live-shields {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.live-shield-bar {
  width: 26px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
}

.live-shield-bar.active {
  background: var(--cyan-bright);
  border-color: var(--cyan-bright);
  box-shadow: 0 0 12px var(--cyan);
}

.live-shield-bar.lost {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
}

.live-ctrl-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(5, 5, 8, 0.78);
  border: 1px solid var(--crimson-border);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-soft);
  backdrop-filter: blur(8px);
}

.live-ctrl-pill.connected {
  border-color: var(--cyan-border);
  color: var(--cyan-bright);
}

.live-ctrl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 10px var(--crimson);
}

.live-ctrl-pill.connected .live-ctrl-dot {
  background: var(--cyan-bright);
  box-shadow: 0 0 12px var(--cyan);
}

.live-hud-btn {
  pointer-events: auto;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(5, 5, 8, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.live-hud-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan-bright);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.45);
}

.live-hud-btn-exit {
  border-color: var(--crimson-border);
  color: var(--crimson-bright);
}

.live-hud-btn-exit:hover {
  background: var(--crimson-dim);
  border-color: var(--crimson-bright);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.55);
}

/* Centralny baner gestu / punktuacji podczas gry */
.live-action-banner {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 24px var(--cyan), 3px 0 0 rgba(244, 63, 94, 0.8);
  transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-action-banner.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.06);
}

.live-action-banner.crimson {
  color: var(--crimson-bright);
  text-shadow: 0 0 26px var(--crimson), -3px 0 0 rgba(6, 182, 212, 0.7);
}

/* ==========================================================================
   WSKAŹNIK 3 TORÓW NA EKRANIE GRY (TV IN-GAME HUD)
   ========================================================================== */

.live-lane-indicator {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(5, 5, 8, 0.82);
  border: 1px solid rgba(6, 182, 212, 0.38);
  border-radius: 24px;
  padding: 6px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.75), 0 0 15px rgba(6, 182, 212, 0.2);
  pointer-events: none;
  z-index: 35;
}

.lane-box {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(148, 163, 184, 0.6);
  padding: 6px 14px;
  border-radius: 16px;
  transition: all 0.16s ease;
  text-transform: uppercase;
}

.lane-box.active {
  color: #050505;
  background: var(--cyan-bright);
  box-shadow: 0 0 18px var(--cyan), 0 0 32px rgba(6, 182, 212, 0.5);
  transform: scale(1.08);
}

/* Cyber-Noir Game Over Overlay */
.live-gameover-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(5, 5, 5, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.live-gameover-modal.hidden {
  display: none;
}

.gameover-card {
  width: 100%;
  max-width: 680px;
  background: rgba(10, 12, 16, 0.94);
  border: 2px solid var(--crimson-border);
  border-radius: 18px;
  padding: 36px 34px;
  text-align: center;
  box-shadow: 0 0 60px rgba(244, 63, 94, 0.25), 0 0 90px rgba(6, 182, 212, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.gameover-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--crimson-bright);
}

.gameover-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--text-main);
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.75);
}

.gameover-bar {
  width: 80%;
}

.gameover-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 6px 0;
}

.gameover-stat {
  background: rgba(5, 5, 5, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
}

.stat-val.cyan {
  color: var(--cyan-bright);
  text-shadow: 0 0 14px rgba(6, 182, 212, 0.7);
}

.stat-val.crimson {
  color: var(--crimson-bright);
  text-shadow: 0 0 14px rgba(244, 63, 94, 0.7);
}

/* ==========================================================================
   GAME OVER TOP 5 RECORD BOX
   ========================================================================== */

.go-record-box {
  width: 100%;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.45);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
  animation: recordPulse 2s ease-in-out infinite alternate;
}

@keyframes recordPulse {
  0% { border-color: rgba(6, 182, 212, 0.4); box-shadow: 0 0 15px rgba(6, 182, 212, 0.15); }
  100% { border-color: rgba(6, 182, 212, 0.85); box-shadow: 0 0 30px rgba(6, 182, 212, 0.35); }
}

.go-record-box.hidden { display: none; }

.go-record-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
}

.go-record-instruction {
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.5px;
}

.go-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.go-player-input {
  flex: 1;
  padding: 10px 14px;
  background: #050508;
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
  outline: none;
}

.go-player-input:focus {
  border-color: var(--cyan-bright);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.go-btn-save {
  padding: 10px 18px;
  font-size: 12px;
}

.go-quick-names-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.go-quick-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.go-quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.go-quick-chip {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--cyan-bright);
  cursor: pointer;
  transition: all 0.15s ease;
}

.go-quick-chip:hover, .go-quick-chip:active {
  background: var(--cyan);
  color: #050505;
  box-shadow: 0 0 10px var(--cyan);
}

.go-saved-confirm {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.go-saved-confirm.hidden { display: none; }

.gameover-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.noir-btn-primary {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(244, 63, 94, 0.25));
  border-color: var(--cyan-bright);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.35);
}

.noir-btn-primary:hover {
  background: var(--cyan);
  color: #050505;
}

/* ==========================================================================
   BRAMKA LICENCYJNA CYBER-NOIR (LICENSE GATE OVERLAY)
   ========================================================================== */

.license-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(16px);
  padding: 24px;
}

.license-gate-overlay.active {
  display: flex;
}

.license-gate-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--cyan-border);
  box-shadow: 0 0 60px rgba(6, 182, 212, 0.25), inset 0 0 20px rgba(6, 182, 212, 0.05);
  border-radius: 6px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.license-gate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--crimson));
}

.gate-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--cyan);
}

.gate-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.6);
}

.gate-desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.license-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.license-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--cyan);
}

.license-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan-bright);
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid var(--cyan-border);
  border-radius: 4px;
  outline: none;
  text-transform: uppercase;
  transition: all 0.2s;
}

.license-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5), inset 0 0 10px rgba(6, 182, 212, 0.1);
}

.gate-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
  width: 100%;
  margin-top: 10px;
}

.gate-actions .noir-btn {
  width: 100%;
  padding: 14px;
  font-size: 13px;
  cursor: pointer;
}

.noir-btn-subtle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.noir-btn-subtle:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--cyan-border);
  color: var(--cyan-bright);
}

.license-gate-status {
  min-height: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.license-gate-status.error {
  color: var(--crimson-bright);
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.license-gate-status.success {
  color: var(--cyan-bright);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

.gate-footer {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

/* ==========================================================================
   GRID PAROWANIA W LOBBY (PIN + KOD QR)
   ========================================================================== */

.pairing-box-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  width: 100%;
  max-width: 820px;
  margin: 16px 0;
}

.pin-subbox,
.qr-subbox {
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 6px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pin-subbox:hover,
.qr-subbox:hover {
  border-color: var(--cyan-border);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.15);
}

.subbox-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
}

.qr-frame {
  position: relative;
  padding: 10px;
  background: #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.4);
}

.lobby-qrcode {
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lobby-qrcode img,
.lobby-qrcode canvas {
  width: 130px !important;
  height: 130px !important;
  display: block;
}

.qr-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--crimson);
  box-shadow: 0 0 8px var(--crimson);
  animation: qrLaser 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes qrLaser {
  0% { top: 0; opacity: 0.3; }
  50% { opacity: 0.9; }
  100% { top: 100%; opacity: 0.3; }
}

.qr-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 1px;
  word-break: break-all;
  text-align: center;
}

.qr-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 1px;
  text-align: center;
}

.qr-link:hover {
  text-decoration: underline;
  color: var(--cyan-bright);
}

.noir-btn-guide {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid var(--cyan-border);
  color: var(--cyan-bright);
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.noir-btn-guide:hover {
  background: var(--cyan);
  color: #050505;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* ==========================================================================
   MODAL: KONFIGURACJA 0-LAG (5 MIN)
   ========================================================================== */

.noir-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.noir-modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--cyan-border);
  box-shadow: 0 0 60px rgba(6, 182, 212, 0.3);
  border-radius: 6px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  padding-bottom: 16px;
}

.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--cyan);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1.5px;
}

.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: 1px solid var(--cyan-border);
  color: var(--cyan);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #fff;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.guide-item {
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 4px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--crimson-bright);
  letter-spacing: 2px;
}

.guide-item h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan-bright);
  letter-spacing: 1px;
}

.guide-item p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  padding-top: 16px;
}

.mini-btn-license {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-btn-license:hover {
  background: rgba(244, 63, 94, 0.16);
  border-color: var(--crimson);
  color: var(--crimson-bright);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

.noir-btn-danger {
  color: var(--crimson-bright);
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.08);
}
.noir-btn-danger:hover {
  color: #fff;
  border-color: var(--crimson);
  background: rgba(244, 63, 94, 0.25);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.5);
}

.gate-legal-links {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.lobby-legal-footer {
  margin-top: 18px;
  text-align: center;
  padding: 10px 0 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
}

.legal-link {
  color: var(--cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}
.legal-link:hover {
  color: var(--cyan-bright);
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

/* ==========================================================================
   RESPONSYWNOŚĆ DLA RÓŻNYCH ROZDZIELCZOŚCI TV / MONITORÓW
   ========================================================================== */

@media (min-width: 2560px) {
  .tv-shell {
    max-width: 2200px;
    margin: 0 auto;
  }
  .pairing-prompt {
    font-size: 2.2rem;
  }
  .digit-box {
    font-size: 5rem;
    width: 110px;
    height: 130px;
  }
}

@media (max-width: 1200px) {
  .game-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .tv-shell {
    padding: 18px 20px;
  }

  .game-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tv-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .engine-telemetry-grid {
    grid-template-columns: 1fr;
  }

  .gameover-stats {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SELEKTOR POZIOMÓW TRUDNOŚCI (ŁATWY | ŚREDNI | TRUDNY)
   ========================================================================== */

.difficulty-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 14px 0 18px 0;
  flex-wrap: wrap;
}

.difficulty-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.difficulty-group {
  display: inline-flex;
  gap: 8px;
  background: rgba(10, 15, 29, 0.7);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.diff-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.diff-btn:hover {
  color: #ffffff;
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.08);
}

.diff-btn.active[data-diff="EASY"] {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.diff-btn.active[data-diff="MEDIUM"] {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #22d3ee;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}

.diff-btn.active[data-diff="HARD"] {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fb7185;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   SMART TV WARNING BANNER
   ========================================================================== */
.smart-tv-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  padding: 12px 18px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 660px;
}

.smart-tv-banner.hidden {
  display: none !important;
}

.smart-tv-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smart-tv-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.smart-tv-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #fef08a;
  letter-spacing: 0.3px;
  line-height: 1.45;
}

.smart-tv-close {
  background: none;
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.smart-tv-close:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   NET MODE PILLS (P2P WI-FI / CLOUD WS)
   ========================================================================== */
.net-mode-pill, .live-net-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.net-mode-pill.ws, .live-net-pill.ws {
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.4);
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

.net-mode-pill.p2p, .live-net-pill.p2p {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.net-mode-pill .net-dot, .live-net-pill .net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.net-mode-pill.ws .net-dot, .live-net-pill.ws .net-dot {
  background: #facc15;
  box-shadow: 0 0 6px #facc15;
}

.net-mode-pill.p2p .net-dot, .live-net-pill.p2p .net-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 1.2s infinite alternate;
}

.guide-item .guide-warn {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 2px solid #ef4444;
}
