/* ============================================
   DETEKTYWI GDYNI - System Designu CSS
   Wersja produkcyjna dla ~100 użytkowników
   ============================================ */

/* === CSS VARIABLES (Design Tokens) === */
:root {
  /* Kolory główne */
  --color-gold: #FFD700;
  --color-gold-light: #FFD54F;
  --color-gold-dark: #FF8F00;
  --color-gold-shadow: #B8860B;

  /* Kolory tła */
  --color-bg-dark: #0d1b4c;
  --color-bg-medium: #1a3a7c;
  --color-bg-light: #2d5aa0;
  --color-bg-lighter: #4a90c2;

  /* Kolory stacji */
  --color-historia: #4a7fc4;
  --color-sport: #4caf50;
  --color-sztuka: #9c27b0;
  --color-przyroda: #2e7d32;
  --color-ciekawostki: #ff9800;

  /* Kolory feedbacku */
  --color-success: #4caf50;
  --color-success-dark: #43a047;
  --color-error: #ef5350;
  --color-error-dark: #c62828;
  --color-warning: #ff9800;

  /* Tekst */
  --color-text-white: #ffffff;
  --color-text-light: rgba(255, 255, 255, 0.9);
  --color-text-muted: rgba(255, 255, 255, 0.7);
  --color-text-dark: #1a237e;

  /* Typografia */
  --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 28px;
  --font-size-4xl: 36px;
  --font-size-5xl: 42px;

  /* Spacing */
  --space-xs: 5px;
  --space-sm: 10px;
  --space-md: 15px;
  --space-lg: 20px;
  --space-xl: 30px;

  /* Border radius */
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --radius-full: 50px;

  /* Shadows */
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-button: 0 6px 0 var(--color-gold-shadow), 0 8px 20px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --transition-fast: 0.1s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Z-index */
  --z-base: 1;
  --z-header: 100;
  --z-modal: 1000;
  --z-loading: 2000;
}

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--color-bg-dark);
}

/* === GŁÓWNE TŁO GRY === */
.game-bg {
  background: linear-gradient(180deg,
    var(--color-bg-dark) 0%,
    var(--color-bg-medium) 30%,
    var(--color-bg-light) 60%,
    var(--color-bg-lighter) 100%
  );
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* Fale na dole */
.game-bg::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath fill='%23051030' d='M0 120L50 110C100 100 150 90 200 95C250 100 300 110 350 100C400 90 450 70 500 65C550 60 600 70 650 80C700 90 750 100 800 95C850 90 900 70 950 60C1000 50 1050 50 1100 60C1150 70 1200 90 1200 90V120H0Z'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
  opacity: 0.5;
  pointer-events: none;
}

/* Skyline Gdyni */
.skyline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: url('/assets/bg-gdynia-skyline.svg') no-repeat bottom;
  background-size: cover;
  pointer-events: none;
  z-index: 1;
}

/* === EKRANY === */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-lg);
  position: relative;
  z-index: var(--z-base);
}

.screen.active {
  display: flex;
}

/* === LOGO === */
.logo-container {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.logo-image {
  max-width: 280px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.logo-title {
  font-size: var(--font-size-5xl);
  font-weight: 900;
  color: var(--color-gold);
  text-shadow: 3px 3px 0 var(--color-gold-shadow), 5px 5px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.logo-subtitle {
  font-size: var(--font-size-4xl);
  font-weight: 900;
  color: var(--color-gold);
  text-shadow: 3px 3px 0 var(--color-gold-shadow), 5px 5px 10px rgba(0, 0, 0, 0.5);
}

.logo-badge {
  display: inline-block;
  background: linear-gradient(180deg, #1a4a8a 0%, #0d2d5a 100%);
  border: 3px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-xl);
  margin: var(--space-lg) 0;
}

.logo-badge-text {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-gold);
}

.logo-badge-years {
  font-size: var(--font-size-sm);
  color: #87ceeb;
}

/* === PRZYCISKI === */
.btn-gold {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: var(--space-sm) auto;
  padding: 18px 30px;
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text-dark);
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, var(--color-gold-light) 0%, var(--color-gold) 50%, var(--color-gold-dark) 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-button);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-gold:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--color-gold-shadow), 0 4px 10px rgba(0, 0, 0, 0.4);
}

.btn-gold:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-blue {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: var(--space-sm) auto;
  padding: 16px 30px;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-white);
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #4a7fc4 0%, var(--color-bg-light) 50%, var(--color-bg-medium) 100%);
  border: 3px solid #87ceeb;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 0 #0d2d5a, 0 6px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-blue:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0d2d5a, 0 3px 8px rgba(0, 0, 0, 0.3);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.btn-icon img {
  width: 24px;
  height: 24px;
}

/* === KARTY === */
.card {
  background: linear-gradient(180deg, rgba(30, 60, 120, 0.9) 0%, rgba(20, 40, 80, 0.95) 100%);
  border: 2px solid rgba(135, 206, 235, 0.5);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-sm) 0;
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: var(--space-md);
}

/* === INPUTY === */
.input-field {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #333;
  background: #fff;
  border: none;
  border-radius: var(--radius-md);
  margin: 8px 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: outline var(--transition-fast);
}

.input-field::placeholder {
  color: #999;
}

.input-field:focus {
  outline: 3px solid var(--color-gold);
}

.input-label {
  display: block;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text-white);
  margin: var(--space-md) 0 var(--space-xs);
}

/* === HEADER BAR === */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-medium) 100%);
  border-bottom: 2px solid var(--color-gold);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.header-logo {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-gold);
}

.header-timer {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-gold);
}

.header-timer.warning {
  color: var(--color-error);
  animation: pulse 0.5s infinite;
}

.header-score {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text-white);
}

/* === KARTY STACJI === */
.station-card {
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-sm) 0;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.station-card.locked {
  opacity: 0.7;
}

.station-card.active {
  border: 3px solid var(--color-gold);
  transform: scale(1.02);
}

.station-card.completed {
  border: 3px solid var(--color-success);
}

.station-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-md);
  overflow: hidden;
}

.station-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.station-info {
  flex: 1;
}

.station-name {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-text-dark);
}

.station-status {
  font-size: var(--font-size-sm);
  color: #666;
}

.station-lock {
  font-size: var(--font-size-2xl);
  color: #999;
}

.station-check {
  width: 30px;
  height: 30px;
}

/* === IKONY SUKCESU/BŁĘDU === */
.success-icon, .error-icon {
  width: 120px;
  height: 120px;
  margin: var(--space-lg) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: bounce 0.5s ease;
}

.success-icon {
  background: linear-gradient(180deg, #66bb6a 0%, var(--color-success-dark) 100%);
  border-radius: 50%;
}

.success-icon img {
  width: 60%;
  height: 60%;
}

.error-icon {
  background: linear-gradient(180deg, var(--color-error) 0%, var(--color-error-dark) 100%);
  border-radius: 50%;
}

.error-icon img {
  width: 50%;
  height: 50%;
}

/* === PUNKTY === */
.points-earned {
  font-size: 48px;
  font-weight: 900;
  color: var(--color-gold);
  text-shadow: 2px 2px 0 var(--color-gold-shadow);
  text-align: center;
}

.result-box {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-sm) 0;
  text-align: center;
}

.result-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.result-value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-gold);
}

/* === PODPOWIEDZI === */
.hint-box {
  background: linear-gradient(180deg, #fff9c4 0%, #fff59d 100%);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
  display: flex;
  align-items: flex-start;
}

.hint-icon {
  font-size: 30px;
  margin-right: var(--space-md);
}

.hint-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #5d4037;
}

/* === SKANER QR === */
.scanner-container {
  position: relative;
  width: 100%;
  max-width: 350px;
  margin: var(--space-lg) auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 4px solid var(--color-gold);
}

.scanner-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
}

.scanner-frame::before,
.scanner-frame::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 4px solid var(--color-gold);
}

.scanner-frame::before {
  top: -4px;
  left: -4px;
  border-right: none;
  border-bottom: none;
  border-radius: var(--radius-sm) 0 0 0;
}

.scanner-frame::after {
  bottom: -4px;
  right: -4px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 var(--radius-sm) 0;
}

/* === ODZNACZENIA === */
.achievement-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-sm);
  padding: var(--space-sm);
}

.achievement-badge img {
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-xs);
}

.achievement-badge span {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-white);
  text-align: center;
}

/* === LOADING === */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 27, 76, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 215, 0, 0.3);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* === CONFETTI === */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: var(--z-modal);
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 20px;
  animation: confetti-fall 3s linear forwards;
}

/* === ANIMACJE === */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes confetti-fall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-white { color: var(--color-text-white); }
.text-gold { color: var(--color-gold); }
.text-muted { color: var(--color-text-muted); }

.mt-5 { margin-top: var(--space-xs); }
.mt-10 { margin-top: var(--space-sm); }
.mt-20 { margin-top: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xs); }
.mb-10 { margin-bottom: var(--space-sm); }
.mb-20 { margin-bottom: var(--space-lg); }

.flex-1 { flex: 1; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-column {
  display: flex;
  flex-direction: column;
}

.subtitle {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-light);
  text-align: center;
  font-style: italic;
}

/* === DETEKTYW ITEMS === */
.detective-items {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.detective-item {
  width: 50px;
  height: 50px;
  animation: float 2s ease-in-out infinite;
}

.detective-item:nth-child(2) {
  animation-delay: 0.3s;
}

.detective-item:nth-child(3) {
  animation-delay: 0.6s;
}

/* === QUESTION BADGE === */
.question-badge {
  display: inline-block;
  background: var(--color-gold);
  color: var(--color-text-dark);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: var(--font-size-sm);
}

/* === RANKING === */
.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-item.highlighted {
  background: rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: -5px;
  border: none;
}

.ranking-position {
  width: 40px;
  font-size: var(--font-size-2xl);
  text-align: center;
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  color: var(--color-text-white);
  font-weight: 700;
}

.ranking-class {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.ranking-score {
  color: var(--color-gold);
  font-weight: 800;
  font-size: var(--font-size-lg);
}

/* === PROGRESS BAR === */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: var(--space-xs);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  border-radius: 4px;
  transition: width var(--transition-slow);
}

/* === RESPONSIVE === */
@media (max-width: 380px) {
  .logo-title {
    font-size: var(--font-size-4xl);
  }
  .logo-subtitle {
    font-size: var(--font-size-3xl);
  }
  .btn-gold, .btn-blue {
    padding: 14px 24px;
    font-size: var(--font-size-base);
  }
}

@media (min-width: 768px) {
  .screen {
    padding: var(--space-xl);
  }
  .card {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
}
