:root {
  --level-count: 4; /* später z. B. 5 oder 6 – automatisch ändert sich die Höhe */
}

body {
  background: radial-gradient(circle at top left, #aee1f9, #d4f8d3 70%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

        html {
            height: 100%;
        }

        .game-container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
            min-height: 50%;
        }

        .header {
            text-align: center;
            background: white;
            border-radius: 20px;
            padding: 20px;
            margin-bottom: 30px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        .title {
            font-size: 2.5rem;
            font-weight: bold;
            color: #e74c3c;
            margin: 0;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
        }

/* =========================================================
   ⚡ Subtitle – Markenintegration
   ========================================================= */
.subtitle {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 500;
  color: #444;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.powered {
  opacity: 0.85;
}

.brand-link {
  color: #0d47a1;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  letter-spacing: 0.2px;
}

.brand-link strong {
  color: #e74c3c;
}

.brand-link:hover {
  color: #1565c0;
  text-decoration: underline;
}

.tagline {
  font-weight: 400;
  opacity: 0.85;
  color: #333;
  font-size: 0.95rem;
}

/* 🌙 DARK MODE */
@media (prefers-color-scheme: dark) {
  .subtitle {
    color: #e5e7eb;
  }



  .brand-link {
    color: #4fc3f7;
    text-shadow: 0 0 6px rgba(79,195,247,0.3);
  }

    /* 🔧 spezielle Farbkorrektur nur für die „2“ */
  .brand-link strong {
    color: #fdd835; /* dunkleres, gedeckteres Cyan */
    text-shadow: none; /* kein Glow, ruhiger Look */
  }

  .brand-link:hover {
    color: #81d4fa;
    text-shadow: 0 0 10px rgba(129,212,250,0.4);
  }

  .tagline {
    color: #cbd5e1;
    opacity: 0.85;
  }
}

/* 📱 Mobilfreundlich */
@media (max-width: 600px) {
  .subtitle {
    flex-direction: column;
    gap: 4px;
    font-size: 0.95rem;
  }

  .tagline {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}



/* =========================================================
   🎮 Header + Fortschrittsleiste
   ========================================================= */
.progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  padding: 15px 25px;
  border-radius: 15px;
  margin-top: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.coins { color: #f39c12; }
.stars { color: #e74c3c; }
.level-progress { color: #3498db; }

/* =========================================================
   🎯 Spielfeld / Karte
   ========================================================= */
.game-map {
  background: white;
  border-radius: 20px;
  padding: 40px 40px;                 /* ausgewogener Innenabstand */
  margin: 40px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  max-width: 520px;
  min-height: calc(var(--level-count, 4) * 160px + 120px); /* dynamisch mit Luft */
  overflow: visible;
}

/* =========================================================
   🧩 Vertikaler Pfad
   ========================================================= */
.map-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;     /* gleichmäßig verteilt */
  position: relative;
  height: calc(var(--level-count, 4) * 160px);
  padding: 0;
}

/* Linie: startet und endet genau hinter den Icons */
.map-path::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 40px;                          /* halbe Icon-Höhe → perfekt hinter erstem Icon */
  bottom: 40px;                       /* halbe Icon-Höhe → perfekt hinter letztem Icon */
  width: 4px;
  background: linear-gradient(180deg, #3498db, #e74c3c, #f39c12, #27ae60);
  border-radius: 2px;
  z-index: 1;
}

/* =========================================================
   💎 Level-Knoten
   ========================================================= */
.level-node {
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.level-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: bold;
  color: white;
  border: 4px solid white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.level-node:hover .level-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Farbzuweisung */
.level-1 { background: #3498db; }
.level-2 { background: #e74c3c; }
.level-3 { background: #f39c12; }
.level-4 { background: #27ae60; }

/* =========================================================
   📍 Level-Texte
   ========================================================= */
.level-label {
  margin-top: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

        .level-1 { background: #3498db; }
        .level-2 { background: #e74c3c; }
        .level-3 { background: #f39c12; }
        .level-4 { background: #27ae60; }
        .level-5 { background: #9b59b6; }



        .level-completed::after {
            content: '⭐';
            position: absolute;
            top: -10px;
            right: -10px;
            font-size: 1.5rem;
            animation: sparkle 2s infinite;
        }

.level-locked {
  position: relative;
  z-index: 5;                  /* liegt über der Linie */
  cursor: not-allowed;
  opacity: 1;                  /* volle Deckkraft (nicht durchsichtig!) */
}

.level-locked .level-icon {
  position: relative;
  background: #cfd8dc;         /* neutraler Grauton */
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  filter: grayscale(0.5);
  overflow: hidden;            /* wichtig für Overlay */
}

/* Graues Overlay – deckt Linie vollständig ab */
.level-locked .level-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55); /* halbtransparentes Weiß */
  z-index: 2;                            /* über Hintergrund, unter Schloss */
}

/* Schloss-Icon als Symbol für „locked“ */
.level-locked .level-icon::after {
  content: "🔒";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  color: rgba(0,0,0,0.3);
  z-index: 3;
}

/* Label leicht ausgegraut */
.level-locked .level-label {
  opacity: 0.75;
  filter: grayscale(0.3);
}

        @keyframes sparkle {
            0%, 100% { transform: scale(1) rotate(0deg); }
            50% { transform: scale(1.2) rotate(180deg); }
        }



.character {
  position: absolute;
  left: 50%;
  transform: translateX(-60%); /* leicht links, visuell zentriert */
  font-size: 5rem;
  transition: all 2s cubic-bezier(0.25, 1, 0.5, 1); /* 🕊️ weiches, langsames Gleiten */
  animation: bounce 2s infinite;
  z-index: 999;
  pointer-events: none;  /* 🧠 ignoriert Mausaktionen */
  cursor: default;       /* kein „Hand“-Cursor */
  
}





        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-10px); }
            60% { transform: translateY(-5px); }
        }

        .challenge-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .challenge-content {
            background: white;
            border-radius: 20px;
            padding: 30px;
            max-width: 600px;
            width: 90%;
            max-height: 80%;
            overflow-y: auto;
            position: relative;
        }

        .challenge-header {
            text-align: center;
            margin-bottom: 25px;
        }

        .challenge-title {
            font-size: 1.8rem;
            color: #2c3e50;
            margin: 0 0 10px 0;
        }

        .challenge-progress {
            font-size: 1.1rem;
            color: #7f8c8d;
        }

        .question-card {
            background: #f8f9fa;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 20px;
            text-align: center;
        }

        .spanish-word {
            font-size: 2rem;
            font-weight: bold;
            color: #e74c3c;
            margin-bottom: 20px;
        }

        .options-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-top: 20px;
        }

        .option-btn {
            padding: 15px 20px;
            border: 3px solid #3498db;
            background: white;
            border-radius: 12px;
            font-size: 1.1rem;
            font-weight: bold;
            color: #2c3e50;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .option-btn:hover {
            background: #3498db;
            color: white;
            transform: translateY(-2px);
        }

        .option-correct {
            background: #27ae60 !important;
            color: white !important;
            border-color: #27ae60 !important;
        }

        .option-wrong {
            background: #e74c3c !important;
            color: white !important;
            border-color: #e74c3c !important;
        }

     .feedback {
    text-align: center;
    font-size: 1rem;           /* etwas kleiner */
    font-weight: 600;            /* leicht reduziert */
    margin: 8px 0 5px;          /* kompakter */
    padding: 8px 10px;           /* weniger vertikal */
    border-radius: 8px;
    line-height: 1.3;            /* dichterer Zeilenabstand */
    max-width: 90%;
    margin-inline: auto;         /* zentriert */
}

.feedback-correct {
    background: #d5f4e6;
    color: #27ae60;
    border: 1px solid #b2e2c8;   /* feiner Rahmen statt viel Raum */
}

.feedback-wrong {
    background: #fadbd8;
    color: #e74c3c;
    border: 1px solid #f5b7b1;
}


        .next-btn {
            background: #3498db;
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 12px;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            display: block;
            margin: 20px auto;
            transition: all 0.3s ease;
        }

        .next-btn:hover {
            background: #2980b9;
            transform: translateY(-2px);
        }

        .close-btn {
            position: absolute;
            top: 15px;
            right: 20px;
            background: none;
            border: none;
            font-size: 2rem;
            cursor: pointer;
            color: #7f8c8d;
        }

        .results-screen {
            text-align: center;
            padding: 20px;
        }

        .results-title {
            font-size: 2rem;
            margin-bottom: 20px;
        }

        .results-success {
            color: #27ae60;
        }

        .results-fail {
            color: #e74c3c;
        }

        .results-stats {
            font-size: 1.2rem;
            margin: 20px 0;
            color: #2c3e50;
        }

        .celebration {
            font-size: 3rem;
            animation: celebrate 1s ease-in-out;
        }

        @keyframes celebrate {
            0% { transform: scale(0); }
            50% { transform: scale(1.2); }
            100% { transform: scale(1); }
        }

        @media (max-width: 768px) {
            .title { font-size: 2rem; }
            .map-path { gap: 40px; }
            .level-icon { width: 60px; height: 60px; font-size: 1.8rem; }
            .options-grid { grid-template-columns: 1fr; }
                .feedback {
        font-size: 1rem;
        padding: 6px 8px;
        margin: 8px 0 0;
    }

    .question-card {
        padding: 18px 12px;
    }

    .spanish-word {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }
        }
/* ============================
   📱 Kompaktere Darstellung für Tablets & Smartphones
   ============================ */
@media (max-width: 900px) {
  .challenge-content {
    padding: 20px 16px;
    max-width: 90%;
    max-height: 90%;
  }

  .challenge-title {
    font-size: 1.4rem;
    margin-bottom: 6px;
  }

  .challenge-progress {
    font-size: 0.95rem;
  }

  .question-card {
    padding: 16px 12px;
    margin-bottom: 12px;
  }

  .spanish-word {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }

  .options-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .option-btn {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-width: 2px;
    border-radius: 8px;
  }

  .feedback {
    font-size: 0.95rem;
    padding: 6px 8px;
    margin: 6px 0 0;
    line-height: 1.3;
  }

  .next-btn {
    font-size: 1rem;
    padding: 10px 24px;
    border-radius: 8px;
    margin-top: 12px;
  }
}

/* noch kompakter auf sehr kleinen Geräten */
@media (max-width: 600px) {
  .challenge-content {
    padding: 16px 12px;
  }

  .spanish-word {
    font-size: 1.3rem;
  }

  .option-btn {
    font-size: 0.9rem;
    padding: 8px 10px;
  }

  .next-btn {
    font-size: 0.95rem;
    padding: 8px 20px;
  }
}
/* 🎯 Finale – Game Completed Screen */
.results-screen {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 30px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  animation: fadeIn 0.8s ease;
}

.results-screen .celebration {
  font-size: 3.5rem;
  margin-bottom: 10px;
  animation: popIn 0.8s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}
/* =========================================================
   🎬 INTRO-OVERLAY (cinematisch + modern + mobil-optimiert)
   ========================================================= */
#intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-overlay.active {
  opacity: 1;
  visibility: visible;
}

.intro-content {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 40px 50px;
  text-align: center;
  color: #f8fafc;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
  animation: fadeUp 0.9s ease both;
  max-width: 480px;
  width: 90%;
}

.intro-content h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.intro-content h2 span {
  color: #ffe082; /* goldener Akzent */
}

.intro-content p {
  font-size: 1.1rem;
  line-height: 1.5;
  color: #e0e0e0;
  margin-bottom: 30px;
}

.intro-btn {
  background: linear-gradient(90deg, #fdd835, #fbc02d);
  color: #111;
  border: none;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 36px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 235, 59, 0.4);
  transition: all 0.3s ease;
}

.intro-btn:hover {
  background: linear-gradient(90deg, #fff176, #fbc02d);
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 235, 59, 0.6);
}

/* Fade + Slide Animation */
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(40px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}


/* =========================================================
   📱 MOBILE-OPTIMIERUNG
   ========================================================= */
@media (max-width: 768px) {
  .intro-content {
    padding: 28px 24px;
    border-radius: 12px;
    max-width: 80%;      /* ✅ neu: Container auf kleinen Displays schmaler */
    animation: fadeUp 1s ease both;
  }

  .intro-content h2 {
    font-size: 1.7rem;
    margin-bottom: 10px;
  }

  .intro-content p {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 24px;
  }

  .intro-btn {
    font-size: 1rem;
    padding: 12px 28px;
    border-radius: 8px;
  }
}

/* Sehr kleine Geräte (z. B. iPhone SE) */
@media (max-width: 480px) {
  .intro-content {
    padding: 22px 18px;
    max-width: 80%;      /* bleibt auch hier konstant bei 80% */
  }

  .intro-content h2 {
    font-size: 1.5rem;
  }

  .intro-content p {
    font-size: 0.95rem;
  }

  .intro-btn {
    font-size: 0.95rem;
    padding: 10px 22px;
  }
}

/* =========================================================
   🌙 DARK MODE
   ========================================================= */
@media (prefers-color-scheme: dark) {
  #intro-overlay {
    background: rgba(15, 23, 42, 0.9);
  }

  .intro-content {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
  }

  .intro-btn {
    background: linear-gradient(90deg, #22d3ee, #0ea5e9);
    color: white;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.4);
  }

  .intro-btn:hover {
    background: linear-gradient(90deg, #38bdf8, #06b6d4);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
  } /* ✅ Diese schließende Klammer hat vorher gefehlt! */

  body {
    background: linear-gradient(160deg, #0b1623, #162336);
    color: #f5f7fa;
  }

  .header {
    background: #1e2a38 !important;
    color: #f5f7fa !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
  }

  .title {
    color: #fdd835 !important;
    text-shadow: 0 0 8px rgba(253, 216, 53, 0.5);
  }

  .progress-bar {
    background: #243447 !important;
    color: #f8f9fa !important;
  }


@media (prefers-color-scheme: dark) {

  /* 🧭 Level-Beschriftung: weniger Grau, mehr Tiefe */
  .level-label {
    background: linear-gradient(180deg, rgba(45,55,72,0.9), rgba(26,32,44,0.95)) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: #f8fafc !important;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow:
      inset 0 1px 3px rgba(255,255,255,0.05),
      0 2px 6px rgba(0,0,0,0.4);
    opacity: 1 !important;
    backdrop-filter: blur(3px);
  }

  /* 💎 Aktive Level-Icons – mehr Glow */
  .level-node:not(.level-locked) .level-icon {
    box-shadow: 0 0 15px rgba(255,255,255,0.15),
                0 0 25px rgba(52,152,219,0.25);
    border-color: rgba(255,255,255,0.08) !important;
  }

  /* 🔒 Gesperrte Level – matter, realistisch */
  .level-locked .level-icon {
    background: radial-gradient(circle at 40% 30%, #2d3748, #1a202c) !important;
    filter: grayscale(0.7) brightness(0.8);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.05);
  }

  .level-locked .level-icon::after {
    color: rgba(255,255,255,0.25);
    font-size: 1.4rem;
  }

  /* 🌈 Linie leicht weicher machen */
  .map-path::before {
    background: linear-gradient(
      180deg,
      rgba(52,152,219,0.8),
      rgba(192,57,43,0.8),
      rgba(243,156,18,0.8),
      rgba(39,174,96,0.8)
    ) !important;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.05));
  }

  /* ✨ Hintergrund dunkler + mit sanftem Verlauf */
  .game-map {
    background: linear-gradient(180deg, #18222f, #101822) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.05);
  }

}



  .challenge-modal {
    background: rgba(0, 0, 0, 0.85) !important;
  }

  .challenge-content {
    background: #1e2a38 !important;
    color: #f1f1f1 !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  }

  .question-card {
    background: #243447 !important;
    color: #f5f7fa !important;
  }

  .option-btn {
    background: #1b2735 !important;
    color: #f1f1f1 !important;
    border-color: #3498db !important;
  }

  .option-btn:hover {
    background: #3498db !important;
    color: #fff !important;
  }

  .feedback-correct {
    background: rgba(39, 174, 96, 0.2) !important;
    border-color: rgba(39, 174, 96, 0.4);
    color: #2ecc71 !important;
  }

  .feedback-wrong {
    background: rgba(231, 76, 60, 0.2) !important;
    border-color: rgba(231, 76, 60, 0.4);
    color: #e74c3c !important;
  }

  .next-btn {
    background: #3498db !important;
    color: #fff !important;
  }

  .next-btn:hover {
    background: #2980b9 !important;
  }


    /* =========================================================
     🏁 RESULTS + GAME COMPLETED – DARK MODE
     ========================================================= */
  .results-screen {
    background: #1e2a38 !important;
    color: #f5f7fa !important;
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8) !important;
  }

  .results-title {
    color: #f5f7fa !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
  }

  .results-success {
    color: #2ecc71 !important;
  }

  .results-fail {
    color: #e74c3c !important;
  }

  .results-stats {
    color: #d0d8e0 !important;
  }

  .celebration {
    color: #fdd835 !important;
    text-shadow: 0 0 10px rgba(253, 216, 53, 0.5);
  }

  .next-btn {
    background: linear-gradient(90deg, #22d3ee, #0ea5e9) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4) !important;
  }

  .next-btn:hover {
    background: linear-gradient(90deg, #38bdf8, #06b6d4) !important;
    transform: scale(1.04);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6) !important;
  }

}
