/* Style CrossGuard - jadymy na kolorach Motoroli */
:root {
  --moto-blue: #003DA5;
  --moto-cyan: #00A3E0;
  --moto-dark: #001a47;
  --moto-darker: #000d24;
  --moto-light: #e8f3ff;
  --moto-green: #00b074;
  --moto-amber: #ffb800;
  --moto-red: #e63946;
  --moto-white: #ffffff;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  font-family: var(--font);
  color: var(--moto-white);
  background: var(--moto-darker);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  display: block;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  outline: none;
}

.hidden { display: none !important; }

/* Ramki na ekrany (pauza, info) */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,163,224,0.12), transparent 60%),
    linear-gradient(160deg, #000d24 0%, #001f54 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(1.01); }
  to   { opacity: 1; transform: scale(1); }
}

/* Ekran menu startowego bez ramki */
.menu-screen {
  background-color: #020e1c;
  background-image:
    linear-gradient(rgba(0,163,224,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,163,224,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
}

/* Miekka poswiata (ambient glow) */
.mbg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 20% 60%, rgba(0,50,140,0.5), transparent),
    radial-gradient(ellipse 35% 40% at 80% 20%, rgba(0,163,224,0.07), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Zjezdzajaca linia skanera */
.mbg-scan {
  position: absolute;
  left: 0; right: 0;
  height: 100px;
  background: linear-gradient(180deg, transparent, rgba(0,163,224,0.035), transparent);
  animation: menuScan 7s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes menuScan {
  0%   { top: -100px; }
  100% { top: 100%; }
}

/* Kosmiczne narozniki z HUDa */
.hud-corner {
  position: absolute;
  width: 28px; height: 28px;
  z-index: 2;
  pointer-events: none;
}
.hud-corner.tl { top: 18px; left: 18px; border-top: 1.5px solid rgba(0,163,224,0.55); border-left: 1.5px solid rgba(0,163,224,0.55); }
.hud-corner.tr { top: 18px; right: 18px; border-top: 1.5px solid rgba(0,163,224,0.55); border-right: 1.5px solid rgba(0,163,224,0.55); }
.hud-corner.bl { bottom: 18px; left: 18px; border-bottom: 1.5px solid rgba(0,163,224,0.55); border-left: 1.5px solid rgba(0,163,224,0.55); }
.hud-corner.br { bottom: 18px; right: 18px; border-bottom: 1.5px solid rgba(0,163,224,0.55); border-right: 1.5px solid rgba(0,163,224,0.55); }

/* Pasek na gorze okna */
.menu-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 34px;
  border-bottom: 1px solid rgba(0,163,224,0.15);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(0,163,224,0.55);
  text-transform: uppercase;
  flex-shrink: 0;
}
.live-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--moto-green);
  margin-right: 9px;
  vertical-align: middle;
  box-shadow: 0 0 5px var(--moto-green);
  animation: pulse 2s ease-in-out infinite;
}

/* Rozbicie layoutu na kolumny */
.menu-layout {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  min-height: 0;
}

/* Kolumna z brandingiem i cta */
.menu-brand {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 52px 48px 64px;
  border-right: 1px solid rgba(0,163,224,0.12);
  position: relative;
}

.brand-eyebrow {
  font-size: 10px;
  letter-spacing: 3.5px;
  color: rgba(0,163,224,0.6);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.menu-logo {
  display: block;
  margin-bottom: 22px;
  line-height: 0.88;
}
.logo-cross {
  display: block;
  font-size: clamp(64px, 8vw, 108px);
  font-weight: 900;
  letter-spacing: -1px;
  color: #ffffff;
  text-transform: uppercase;
}
.logo-guard {
  display: block;
  font-size: clamp(64px, 8vw, 108px);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--moto-cyan);
  text-transform: uppercase;
}

.menu-rule {
  width: 48px;
  height: 2px;
  background: var(--moto-cyan);
  margin-bottom: 22px;
  opacity: 0.7;
}

.menu-tagline {
  font-size: 15px;
  line-height: 1.85;
  color: rgba(190,220,255,0.6);
  margin: 0 0 38px;
}

.menu-ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 310px;
}

.brand-credit {
  position: absolute;
  bottom: 24px;
  left: 64px;
  font-size: 9px;
  letter-spacing: 2.5px;
  color: rgba(0,163,224,0.28);
  text-transform: uppercase;
  line-height: 1.8;
}
.brand-team {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(0,163,224,0.55);
}

/* Kolumna wybierania map */
.menu-zones-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 36px 44px 36px 40px;
  overflow-y: auto;
}

.zones-col-hdr {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,163,224,0.15);
}
.zones-col-title {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(0,163,224,0.6);
  text-transform: uppercase;
}
.zones-col-count {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(0,163,224,0.3);
}

/* Kafelki stref (mialy byc taktyczne) */
.zone-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zone-card {
  position: relative;
  background: rgba(0, 18, 44, 0.5);
  border: 1px solid rgba(0,163,224,0.14);
  border-left: 3px solid rgba(0,163,224,0.3);
  border-radius: 2px;
  padding: 14px 18px 14px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
}
.zone-card:hover {
  background: rgba(0,163,224,0.08);
  border-left-color: var(--moto-cyan);
  transform: translateX(3px);
}
.zone-card.selected {
  background: rgba(0,163,224,0.1);
  border-color: rgba(0,163,224,0.4);
  border-left-color: var(--moto-cyan);
  border-left-width: 3px;
}
.zone-card.locked {
  opacity: 0.38;
  cursor: not-allowed;
  border-left-color: rgba(255,184,0,0.35);
}
.zone-card.locked:hover { transform: none; background: rgba(0, 18, 44, 0.5); }

/* Numerek strefy */
.znum {
  font-size: 30px;
  font-weight: 800;
  color: rgba(0,163,224,0.12);
  line-height: 1;
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  transition: color 0.18s;
}
.zone-card.selected .znum,
.zone-card:hover .znum { color: rgba(0,163,224,0.28); }

/* Opis strefy */
.zinfo { flex: 1; min-width: 0; }
.zname {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.8px;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.zdesc {
  font-size: 11px;
  color: rgba(170,200,240,0.55);
  line-height: 1.4;
}
.zbest {
  font-size: 10px;
  color: var(--moto-green);
  letter-spacing: 1.2px;
  margin-top: 6px;
  text-transform: uppercase;
}

/* Klodeczka ze zablokowane */
.zlock {
  font-size: 10px;
  color: var(--moto-amber);
  letter-spacing: 1px;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}
.zunlocked {
  color: rgba(0,163,224,0.5);
  font-size: 12px;
  flex-shrink: 0;
}

/* Boxy wspolne na podstrony */
.menu-content {
  max-width: 900px;
  width: 92%;
  padding: 36px;
  text-align: center;
  background: rgba(0, 10, 30, 0.75);
  border: 1px solid rgba(0, 163, 224, 0.25);
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}
.menu-content h1 {
  font-size: 42px;
  letter-spacing: 6px;
  margin: 0 0 6px;
  font-weight: 900;
  color: #ffffff;
}
.menu-content h2 {
  font-size: 16px;
  letter-spacing: 5px;
  margin: 0 0 24px;
  color: var(--moto-cyan);
  font-weight: 500;
}

/* Glowny styl buttonow */
.primary-btn, .ghost-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 15px 28px;
  margin: 6px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.primary-btn {
  background: var(--moto-cyan);
  color: #020e1c;
}
.primary-btn:hover { background: #ffffff; transform: translateY(-1px); }
.ghost-btn {
  background: transparent;
  color: rgba(0,163,224,0.75);
  border: 1px solid rgba(0,163,224,0.35);
}
.ghost-btn:hover { border-color: var(--moto-cyan); color: var(--moto-cyan); }
.primary-btn:disabled, .primary-btn.disabled-btn {
  background: rgba(0, 163, 224, 0.15) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(0, 163, 224, 0.15) !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Przyciski CTA na szerokosc */
.menu-ctas .primary-btn,
.menu-ctas .ghost-btn {
  width: 100%;
  margin: 0;
  text-align: left;
  padding: 16px 24px;
}

/* Nakladka HUD */
#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
#hud .hidden { display: none !important; }

.hud-label {
  display: block;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--moto-cyan);
  text-transform: uppercase;
  margin-bottom: 3px;
  opacity: 0.85;
}

#hudTopBar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(0,13,36,0.85), rgba(0,13,36,0));
  gap: 20px;
}
#hudTopBar .hud-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#hudTopBar .hud-block.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; align-items: center; }
#hudTopBar .hud-block.right { align-items: flex-end; flex-direction: row; gap: 24px; }
#hudTopBar .hud-block.right > div { display: flex; flex-direction: column; align-items: flex-end; }
.hud-status { color: var(--moto-green); font-size: 12px; font-weight: 600; letter-spacing: 1px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--moto-green); margin-right: 6px; }
.pulse { animation: pulse 1.3s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hud-mission { font-size: 15px; font-weight: 600; }
.hud-timer span:last-child,
.hud-score span:last-child { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
#scoreText { color: var(--moto-cyan); }

#hudBottomBar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  padding: 10px 18px 14px;
  background: linear-gradient(0deg, rgba(0,13,36,0.85), rgba(0,13,36,0));
  font-size: 13px;
}
#hudBottomBar .hud-block { text-align: center; }
#hudBottomBar span:last-child { font-weight: 600; font-size: 14px; }

/* Minimapka (radar) */
#minimap {
  position: absolute;
  top: 80px; right: 18px;
  background: transparent;
  border: none;
  padding: 0;
  filter: drop-shadow(0 4px 18px rgba(0,140,220,0.22));
}
.minimap-wrap {
  position: relative;
  width: 220px; height: 220px;
}
/* Outer ring – dekoracyjna obramówka */
.minimap-wrap::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(0,163,224,0.7) 0deg,
    rgba(0,80,140,0.3) 90deg,
    rgba(0,163,224,0.55) 180deg,
    rgba(0,40,80,0.2) 270deg,
    rgba(0,163,224,0.7) 360deg
  );
  z-index: 0;
  animation: minimapRingSpin 12s linear infinite;
}
/* Wewnętrzne ciemne obramowanie */
.minimap-wrap::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: rgba(4,16,36,0.92);
  z-index: 1;
  -webkit-mask: radial-gradient(transparent 106px, black 108px);
  mask: radial-gradient(transparent 106px, black 108px);
}
@keyframes minimapRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
#minimapCanvas {
  display: block;
  position: relative;
  z-index: 2;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: #060e1f;
  image-rendering: crisp-edges;
  box-shadow:
    0 0 0 2px rgba(0,163,224,0.5),
    inset 0 0 20px rgba(0,0,0,0.5);
}
/* Etykieta RADAR nad mapą */
.minimap-label {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(0,163,224,0.6);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.minimap-compass {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'Orbitron', sans-serif;
  z-index: 3;
}
.minimap-compass span {
  position: absolute;
  line-height: 1;
}
.minimap-compass .cn { top: 5px; left: 50%; transform: translateX(-50%); color: #ff5555; text-shadow: 0 0 8px rgba(255,60,60,0.8); }
.minimap-compass .cs { bottom: 5px; left: 50%; transform: translateX(-50%); color: rgba(0,163,224,0.45); }
.minimap-compass .cw { left: 7px; top: 50%; transform: translateY(-50%); color: rgba(0,163,224,0.45); }
.minimap-compass .ce { right: 7px; top: 50%; transform: translateY(-50%); color: rgba(0,163,224,0.45); }

/* Box z podpowiedziami asystenta */
#assist {
  position: absolute;
  top: 80px; left: 18px;
  width: 280px;
  background: rgba(0, 13, 36, 0.82);
  border: 1px solid rgba(0, 163, 224, 0.5);
  border-radius: 8px;
  padding: 12px;
  backdrop-filter: blur(4px);
}
.assist-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 1.5px;
  color: var(--moto-cyan);
  margin-bottom: 8px;
}
.ai-icon {
  display: inline-block;
  width: 18px; height: 18px;
  background: linear-gradient(135deg, var(--moto-cyan), var(--moto-blue));
  border-radius: 4px;
  text-align: center;
  line-height: 18px;
  color: white;
  font-size: 11px;
}
#assistMsg { font-size: 13px; line-height: 1.5; color: #e8f3ff; min-height: 38px; }


/* Ostrzezenia na ekranie */
#alerts {
  position: absolute;
  top: 80px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  pointer-events: none;
}
.alert {
  background: rgba(230, 57, 70, 0.92);
  color: white;
  padding: 10px 22px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  border-left: 4px solid #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  text-transform: uppercase;
}
.alert.warn { background: rgba(255, 184, 0, 0.92); color: #2d1d00; }
.alert.good { background: rgba(0, 176, 116, 0.92); }
.alert.info { background: rgba(0, 163, 224, 0.92); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* Latajace cyferki po wpadnieciu expa */
.floater {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.75);
  animation: floatUp 1.4s ease-out forwards;
  z-index: 6;
  white-space: nowrap;
}
.floater.pos { color: #5fff9a; }
.floater.neg { color: #ff7185; }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  15%  { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(0.95); }
}

/* Popup z pomoca na start gry */
#tutorial {
  position: fixed;
  inset: 0;
  background: rgba(0, 13, 36, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  backdrop-filter: blur(3px);
}
#tutorial .tut-card {
  max-width: 560px;
  background: linear-gradient(135deg, rgba(0, 61, 165, 0.95), rgba(0, 13, 36, 0.95));
  border: 1px solid var(--moto-cyan);
  border-radius: 12px;
  padding: 28px;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#tutorial h2 { margin: 0 0 6px; color: var(--moto-cyan); letter-spacing: 2px; }
#tutorial h3 { margin: 14px 0 6px; color: var(--moto-amber); font-size: 13px; letter-spacing: 1.5px; }
#tutorial p { margin: 4px 0; line-height: 1.55; color: #d8e8ff; font-size: 13px; }
#tutorial button { margin-top: 18px; width: 100%; }

/* Podpowiedz przed zebrą */
#crossPrompt {
  position: absolute;
  bottom: 120px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 13, 36, 0.88);
  border: 2px solid var(--moto-cyan);
  border-radius: 8px;
  padding: 14px 26px;
  font-size: 16px; font-weight: 600;
  display: flex; gap: 12px; align-items: center;
}
#crossLightIcon { font-size: 22px; }

/* Klawiszologia */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 22px 0;
  text-align: left;
}
.howto-card {
  background: rgba(0,61,165,0.25);
  border: 1px solid rgba(0,163,224,0.4);
  border-radius: 8px;
  padding: 16px;
}
.howto-card h3 {
  margin: 0 0 10px;
  color: var(--moto-cyan);
  font-size: 13px;
  letter-spacing: 1.5px;
}
.howto-card p { margin: 6px 0; font-size: 13px; line-height: 1.6; color: #d8e8ff; }
kbd {
  display: inline-block;
  background: rgba(0,163,224,0.25);
  border: 1px solid rgba(0,163,224,0.6);
  padding: 1px 7px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  margin: 0 2px;
}

/* Ekran wygranej/przegranej */
.results { max-width: 700px; }
.grade-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 14px auto 22px;
  padding: 14px 30px;
  background: rgba(0,163,224,0.1);
  border: 2px solid var(--moto-cyan);
  border-radius: 10px;
}
.grade-label { font-size: 11px; letter-spacing: 2px; color: var(--moto-cyan); }
#gradeLetter {
  font-size: 90px; font-weight: 800; line-height: 1;
  color: var(--moto-cyan);
  margin-top: 4px;
}
.results-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin: 18px 0 22px;
}
.results-grid > div {
  background: rgba(0,61,165,0.2);
  border: 1px solid rgba(0,163,224,0.3);
  padding: 12px;
  border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.results-grid > div span:last-child { font-size: 18px; font-weight: 700; color: white; }
.lesson {
  background: rgba(0,176,116,0.12);
  border-left: 3px solid var(--moto-green);
  padding: 12px 16px;
  border-radius: 4px;
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
  color: #d8f5e6;
}

/* ============================================================
   Loading screen — entry / exit / progress animations
   ============================================================ */
.loading-screen {
  background-color: #020e1c;
  background-image:
    linear-gradient(rgba(0,163,224,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,163,224,0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  /* odpalamy na hita zeby przejscia nie cielo */
  animation: none;
}

/* --- rogi wskakuja klatka po klatce --- */
.loading-screen .hud-corner {
  opacity: 0;
  animation: cornerSnap 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.loading-screen .hud-corner.tl { animation-delay: 0ms; }
.loading-screen .hud-corner.tr { animation-delay: 70ms; }
.loading-screen .hud-corner.bl { animation-delay: 140ms; }
.loading-screen .hud-corner.br { animation-delay: 210ms; }

@keyframes cornerSnap {
  from { opacity: 0; transform: scale(0.2); }
  to   { opacity: 1; transform: scale(1); }
}

/* --- napisy podczas ladowania --- */
.loader { text-align: center; }

.loader-eyebrow {
  font-size: 10px;
  letter-spacing: 4px;
  color: rgba(0,163,224,0.45);
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0;
  animation: riseIn 0.45s ease 0.25s forwards;
}

.loader-title {
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  color: #ffffff;
  margin-bottom: 32px;
  /* zaczyna sciete z prawej, ujawnia od lewej (fajny efekt maski) */
  clip-path: inset(0 100% 0 0);
  animation: titleReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s forwards;
}
.loader-title span { color: var(--moto-cyan); }

@keyframes titleReveal {
  0%   { clip-path: inset(0 100% 0 0); opacity: 1; }
  100% { clip-path: inset(0   0% 0 0); opacity: 1; }
}

.loader-status {
  color: rgba(180,210,255,0.45);
  font-size: 11px;
  letter-spacing: 2px;
  margin: 0 0 22px;
  text-transform: uppercase;
  opacity: 0;
  animation: riseIn 0.4s ease 0.5s forwards;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- pasek nabijania % --- */
.bar {
  width: 220px;
  height: 2px;
  background: rgba(0,163,224,0.12);
  overflow: hidden;
  margin: 0 auto;
  position: relative;
  opacity: 0;
  animation: riseIn 0.4s ease 0.6s forwards;
}
/* refleks przesuwajacy sie po pasku */
.bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: barShimmer 1.6s ease-in-out 0.7s infinite;
}
@keyframes barShimmer {
  0%   { transform: translateX(-200%); }
  100% { transform: translateX(400%); }
}

.bar-fill {
  height: 100%;
  background: var(--moto-cyan);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(0,163,224,0.6);
}
/* wlasciwa animacja wczytywania */
.bar-fill.anim {
  animation: load 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes load { from { width: 0%; } to { width: 100%; } }

/* ============================================================
   Exit animation — fired by adding .loading-exit class in JS
   ============================================================ */
.loading-screen.loading-exit {
  animation: exitBurn 0.5s cubic-bezier(0.4, 0, 1, 1) forwards !important;
  pointer-events: none;
}
/* wywal smieci z ekranu od razu jak zaczyna wyjezdzac */
.loading-screen.loading-exit .loader,
.loading-screen.loading-exit .hud-corner {
  animation: childFade 0.15s ease forwards !important;
}
@keyframes childFade {
  to { opacity: 0; transform: scale(0.96); }
}

@keyframes exitBurn {
  0%   { opacity: 1; filter: brightness(1) blur(0px); }
  25%  { opacity: 1; filter: brightness(3)  blur(1px); }
  55%  { opacity: 0.6; filter: brightness(1.5) blur(2px); }
  100% { opacity: 0; filter: brightness(1)  blur(6px); }
}

/* ============================================================
   Re-show loading (during model load — no child animations)
   ============================================================ */
.loading-screen.loading-bare {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.loading-screen.loading-bare.loading-visible {
  opacity: 1;
}
.loading-screen.loading-bare .hud-corner,
.loading-screen.loading-bare .loader-eyebrow,
.loading-screen.loading-bare .loader-title,
.loading-screen.loading-bare .loader-status,
.loading-screen.loading-bare .bar {
  animation: none;
  opacity: 1;
  clip-path: none;
}

/* Zamazanie ekranu jak zgapiasz sie w komorke */
#phoneOverlay {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 60;
  pointer-events: none;
}
.phone-screen {
  width: 180px;
  background: rgba(20, 20, 30, 0.92);
  border: 2px solid #444;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}
.phone-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--moto-cyan);
  margin-bottom: 8px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}
.phone-msg {
  font-size: 11px;
  color: #ccc;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.phone-hint {
  font-size: 10px;
  color: var(--moto-amber);
  margin-top: 8px;
  text-align: center;
}

/* Media queries zeby dzialalo u mamy na telefonie */
@media (max-width: 860px) {
  .menu-layout { flex-direction: column; }
  .menu-brand {
    flex: 0 0 auto;
    padding: 32px 28px 20px;
    border-right: none;
    border-bottom: 1px solid rgba(0,163,224,0.12);
  }
  .logo-cross, .logo-guard { font-size: 56px; }
  .menu-logo { margin-bottom: 14px; }
  .menu-tagline { display: none; }
  .brand-credit { position: static; margin-top: 8px; font-size: 8px; }
  .menu-zones-col { padding: 20px 28px; }
  .menu-ctas { flex-direction: row; max-width: none; }
  .menu-ctas .primary-btn, .menu-ctas .ghost-btn { width: auto; flex: 1; }
}
@media (max-width: 720px) {
  #minimap { top: 64px; right: 8px; }
  .minimap-wrap { width: 150px; height: 150px; }
  #minimapCanvas { width: 150px; height: 150px; }
  .minimap-wrap::after { -webkit-mask: radial-gradient(transparent 70px, black 72px); mask: radial-gradient(transparent 70px, black 72px); }
  .minimap-label { font-size: 7px; top: -17px; }
  #assist { width: 220px; top: 64px; left: 8px; }
  .menu-content h1 { font-size: 32px; }
  .results-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   TRYB POKAZOWY (cinematic) – overlay do nagrywania filmiku
   ========================================================= */
#cinema {
  position: fixed; inset: 0; z-index: 80;
  pointer-events: none;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e8f1ff;
}
.cn-bar {
  position: absolute; left: 0; right: 0; height: 11vh;
  background: #000;
  box-shadow: 0 0 60px 8px rgba(0,0,0,0.85);
  animation: cn-bar-in 1.1s cubic-bezier(.7,.05,.2,1) both;
}
.cn-top    { top: 0; transform-origin: top; }
.cn-bottom { bottom: 0; transform-origin: bottom; }
@keyframes cn-bar-in {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
.cn-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(0,40,80,0.10) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.25) 100%);
  mix-blend-mode: multiply;
}

/* Ikonka lewy gora i tip po prawej */
.cn-brand, .cn-hint {
  position: absolute; top: 11vh; padding: 10px 18px;
  font-size: 11px; letter-spacing: 0.22em;
  font-weight: 600; text-transform: uppercase;
  color: #a9c8ee;
  background: linear-gradient(180deg, rgba(8,15,28,0.55), rgba(8,15,28,0.15));
  border-bottom: 1px solid rgba(0,163,224,0.35);
  backdrop-filter: blur(2px);
  animation: cn-fade-in 1.2s ease 0.5s both;
}
.cn-brand { left: 0; border-right: 1px solid rgba(0,163,224,0.25); }
.cn-hint  { right: 0; border-left: 1px solid rgba(0,163,224,0.25); }
.cn-live {
  display: inline-block; width: 7px; height: 7px; margin-right: 9px;
  border-radius: 50%; background: #e63946; vertical-align: middle;
  box-shadow: 0 0 10px #e63946; animation: cn-pulse 1.4s ease-in-out infinite;
}
@keyframes cn-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes cn-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tytul odcinka (po srodku) */
.cn-titlecard {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 36px 60px;
  background: linear-gradient(180deg, rgba(0,15,32,0.55), rgba(0,8,18,0.30));
  border-left: 3px solid #00A3E0;
  border-right: 3px solid #00A3E0;
  backdrop-filter: blur(6px);
  min-width: 520px;
  opacity: 0;
}
.cn-titlecard.cn-hidden { display: none; }
.cn-eyebrow {
  font-size: 11px; letter-spacing: 0.4em;
  color: #00A3E0; font-weight: 700; margin-bottom: 14px;
}
.cn-title {
  font-size: 56px; letter-spacing: 0.12em;
  font-weight: 800; color: #ffffff;
  text-shadow: 0 0 24px rgba(0,163,224,0.55);
  margin-bottom: 8px;
}
.cn-subtitle {
  font-size: 15px; letter-spacing: 0.25em;
  color: #c8def8; text-transform: uppercase;
  margin-bottom: 20px;
}
.cn-rule {
  width: 80px; height: 2px;
  background: linear-gradient(90deg, transparent, #00A3E0, transparent);
  margin: 0 auto;
}
.cn-titlecard.cn-fadein  { animation: cn-title-in 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
.cn-titlecard.cn-fadeout { animation: cn-title-out 0.9s cubic-bezier(.5,0,.7,.5) forwards; }
@keyframes cn-title-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 22px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes cn-title-out {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to   { opacity: 0; transform: translate(-50%, calc(-50% - 22px)); }
}

/* Lewy dół ujęcia */
.cn-label {
  position: absolute; bottom: 11vh; left: 0;
  padding: 14px 22px;
  font-size: 13px; letter-spacing: 0.32em;
  color: #ffffff; font-weight: 700; text-transform: uppercase;
  background: linear-gradient(90deg, rgba(0,8,18,0.7), rgba(0,8,18,0));
  border-bottom: 2px solid #00A3E0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  opacity: 0;
}
.cn-label.cn-hidden { display: none; }
.cn-label.cn-fadein { animation: cn-label-in 0.6s ease forwards; }
@keyframes cn-label-in {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Napisy koncowe (choc w sumie kto by je czytal) */
.cn-credits {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,18,40,0.85), rgba(0,0,0,0.96));
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
}
.cn-credits.cn-hidden { display: none; }
.cn-credits.cn-fadein { animation: cn-fade-in 1.5s ease forwards; }
.cn-credits-inner { text-align: center; }
.cn-credits-eyebrow {
  font-size: 12px; letter-spacing: 0.42em; color: #00A3E0;
  font-weight: 700; margin-bottom: 18px;
}
.cn-credits-title {
  font-size: 84px; letter-spacing: 0.14em;
  font-weight: 800; color: #fff;
  text-shadow: 0 0 30px rgba(0,163,224,0.5);
  margin-bottom: 16px;
}
.cn-credits-sub {
  font-size: 14px; letter-spacing: 0.32em; color: #99b8e0;
  font-weight: 600; text-transform: uppercase;
}

/* Przycisk wcisniecia pauzy dema */
#cinemaBtn { margin-top: 10px; }

/* === Tryb kinowy: czarne ciecia miedzy kamerami === */
.cn-fade {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: none; /* krecimy opacity z poziomu jsa (nie chcialo mi sie robic keyframe) */
}

/* === Finalowa mozaika: pociecie mapy skosem === */
.cn-finale {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, #04162c 0%, #000 80%);
  z-index: 20;
  display: flex; flex-direction: column;
  padding: 7vh 5vw 5vh;
  opacity: 0;
}
.cn-finale.cn-hidden { display: none; }
.cn-finale.cn-show {
  animation: cn-finale-in 1.3s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes cn-finale-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

.cn-finale-header {
  text-align: center;
  margin-bottom: 28px;
  animation: cn-fade-in 0.9s ease 0.25s both;
}
.cn-finale-eyebrow {
  font-size: 12px; letter-spacing: 0.46em;
  color: #00A3E0; font-weight: 700;
  margin-bottom: 12px;
}
.cn-finale-title {
  font-size: 44px; letter-spacing: 0.14em;
  font-weight: 800; color: #fff;
  text-shadow: 0 0 22px rgba(0,163,224,0.45);
}

.cn-finale-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0;
  position: relative;
  overflow: hidden;
}

/* panele pociete w skos, na przemian (magia clip-path) */
.cn-finale-card {
  position: relative;
  overflow: hidden;
  cursor: default;
  transform: translateY(40px);
  opacity: 0;
  animation: cn-card-in 1.1s cubic-bezier(.2,.8,.2,1) var(--delay, 0.5s) forwards;
}
@keyframes cn-card-in {
  from { transform: translateY(50px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
/* tniemy po diagonali uzywajac clip-path */
.cn-finale-card:nth-child(1) { clip-path: polygon(0 0, 100% 0, calc(100% - 38px) 100%, 0 100%); margin-right: -38px; z-index: 4; }
.cn-finale-card:nth-child(2) { clip-path: polygon(38px 0, 100% 0, calc(100% - 38px) 100%, 0 100%); margin-right: -38px; z-index: 3; }
.cn-finale-card:nth-child(3) { clip-path: polygon(38px 0, 100% 0, calc(100% - 38px) 100%, 0 100%); margin-right: -38px; z-index: 2; }
.cn-finale-card:nth-child(4) { clip-path: polygon(38px 0, 100% 0, 100% 100%, 0 100%); z-index: 1; }

.cn-finale-card-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,12,28,0.4) 0%, rgba(0,0,0,0.85) 100%),
    linear-gradient(135deg, var(--accent) 0%, #0a1730 60%);
  opacity: 0.92;
}
.cn-finale-card-inner {
  position: relative; z-index: 1;
  height: 100%;
  padding: 32px 28px 30px 60px;
  display: flex; flex-direction: column;
  color: #fff;
  border-left: 3px solid var(--accent);
}
.cn-finale-num {
  font-size: 72px; line-height: 1;
  font-weight: 800; letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.85;
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 60%, transparent);
  margin-bottom: 10px;
}
.cn-finale-icon {
  font-size: 38px;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}
.cn-finale-name {
  font-size: 19px; letter-spacing: 0.14em;
  font-weight: 800; text-transform: uppercase;
  margin-bottom: 8px;
  line-height: 1.2;
}
.cn-finale-desc {
  font-size: 12px; letter-spacing: 0.06em;
  color: #c8def8;
  margin-bottom: auto;
  line-height: 1.5;
}
.cn-finale-meta {
  display: flex; gap: 14px;
  font-size: 12px; font-weight: 700;
  color: #fff; letter-spacing: 0.08em;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.18);
}

.cn-finale-footer {
  text-align: center;
  margin-top: 32px;
  animation: cn-fade-in 1s ease 1.4s both;
}
.cn-finale-cta {
  font-size: 22px; letter-spacing: 0.28em;
  font-weight: 800; color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 0 16px rgba(0,163,224,0.45);
}
.cn-finale-sub {
  font-size: 11px; letter-spacing: 0.42em;
  color: #7ea9d6; font-weight: 600;
}

@media (max-width: 900px) {
  .cn-finale-grid { grid-template-columns: 1fr 1fr; }
  .cn-finale-card:nth-child(2) { margin-right: 0; clip-path: polygon(38px 0, 100% 0, 100% 100%, 0 100%); }
  .cn-finale-card:nth-child(3) { clip-path: polygon(0 0, 100% 0, calc(100% - 38px) 100%, 0 100%); margin-right: -38px; }
  .cn-finale-title { font-size: 28px; }
  .cn-finale-num { font-size: 52px; }
}

/* --- Ekran Ustawień Grafiki --- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 28px 0;
  text-align: left;
}
.settings-card {
  background: rgba(0, 61, 165, 0.12);
  border: 1px solid rgba(0, 163, 224, 0.35);
  border-radius: 4px;
  padding: 22px;
  box-shadow: inset 0 0 15px rgba(0, 163, 224, 0.05);
}
.settings-card h3 {
  margin: 0 0 18px;
  color: var(--moto-cyan);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0, 163, 224, 0.15);
  padding-bottom: 8px;
}
.quality-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.setting-btn {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 11px 14px;
  background: rgba(0, 163, 224, 0.08);
  border: 1px solid rgba(0, 163, 224, 0.3);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  cursor: pointer;
  flex: 1;
  transition: all 0.12s ease;
}
.setting-btn:hover {
  background: rgba(0, 163, 224, 0.2);
  color: #ffffff;
  border-color: var(--moto-cyan);
}
.setting-btn.active {
  background: var(--moto-cyan);
  color: #000d24;
  border-color: var(--moto-cyan);
  box-shadow: 0 0 10px rgba(0, 163, 224, 0.45);
}
.quality-desc {
  font-size: 11px;
  color: rgba(170, 200, 240, 0.55);
  line-height: 1.55;
  margin: 8px 0 0;
  min-height: 48px;
}
.setting-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #d8e8ff;
  cursor: pointer;
  user-select: none;
}
.setting-toggle input[type="checkbox"] {
  accent-color: var(--moto-cyan);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

/* Tryb deweloperski */
#devOverlay {
  position: absolute;
  top: 260px;
  left: 18px;
  width: 280px;
  background: rgba(0, 13, 36, 0.85);
  border: 1px solid var(--moto-green);
  box-shadow: 0 0 10px rgba(0, 176, 116, 0.25);
  border-radius: 8px;
  padding: 12px;
  backdrop-filter: blur(4px);
  font-family: 'Courier New', monospace;
  color: var(--moto-light);
  z-index: 100;
  pointer-events: none;
}
#devOverlay.hidden {
  display: none !important;
}
.dev-header {
  color: var(--moto-green);
  font-weight: bold;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 176, 116, 0.3);
  padding-bottom: 6px;
  margin-bottom: 8px;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dev-status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--moto-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--moto-green);
  animation: dev-pulse 1.5s infinite;
}
@keyframes dev-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}
.dev-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
}
.dev-row span:first-child {
  color: #8caccb;
}
.dev-row span:last-child {
  font-weight: bold;
  color: var(--moto-cyan);
}
.dev-footer {
  font-size: 10px;
  color: var(--moto-amber);
  margin-top: 10px;
  text-align: center;
  border-top: 1px solid rgba(0, 163, 224, 0.2);
  padding-top: 6px;
}

/* Style dla suwaka settings */
.setting-toggle input[type="range"] {
  accent-color: var(--moto-cyan);
  background: rgba(0, 163, 224, 0.15);
  border: 1px solid rgba(0, 163, 224, 0.3);
  border-radius: 4px;
  height: 6px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.setting-toggle input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--moto-cyan);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 163, 224, 0.6);
}
.setting-toggle input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--moto-cyan);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(0, 163, 224, 0.6);
}

/* Płynne przejście ekranu śmierci */
#results {
  animation: fadeInResults 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInResults {
  from { opacity: 0; }
  to   { opacity: 1; }
}

