/* =========================
   🔒 ISOLATION
========================= */
html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh; /* 🔥 für iPhone Safari (wichtig!) */
}

body {
  display: flex;
  flex-direction: column;
}
body .quiz-app {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  margin: 40px 0 60px 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
  padding: 0 16px !important;

}
.quiz-app {
  flex: 1;
}

/* =========================
   🧊 CARD (Apple Glass)
========================= */

body .quiz-app .card {
  width: 100% !important;
  max-width: 540px !important;   /* vorher 440px */

  background: rgba(255,255,255,0.85) !important;
  backdrop-filter: blur(30px) saturate(140%) !important;

  border-radius: 32px !important;
  padding: 36px 28px !important;  /* mehr Luft */

  box-shadow:
    0 30px 60px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.7) !important;

  text-align: center !important;
}

@media (max-width: 600px) {

  body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;

    min-height: 100dvh !important;
    overflow: hidden !important; /* 🔥 kein Scrollen mehr */
  }

  .quiz-app {
    flex: none !important;
    width: 100% !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }


  body .quiz-app .card {
    max-width: 92% !important;
    width: 100% !important;

    padding: 32px 22px !important;
    border-radius: 28px !important;

    transform: translateY(-10px); /* leicht höher = besserer Fokus */
  }

    body .quiz-app .options {
    gap: 16px !important;
  }

  body .quiz-app .options button {
    padding: 20px 16px !important;
    font-size: 1.1rem !important;
    border-radius: 24px !important;
  }
  body .quiz-app h3 {
    font-size: 1.8rem !important;
    margin: 24px 0 26px 0 !important;
  }
  body .quiz-app .progress-bar {
    height: 8px !important;
  }


  body {
    background: linear-gradient(180deg,#f3f7ff 0%,#f7f9ff 50%,#faf8f3 100%) !important;
  }
  
}

@media (max-width: 600px) {

  header,
  .section--footer {
    display: none !important;
  }

}

@media (min-width: 900px) {
  body .quiz-app .card {
    max-width: 600px !important;
    padding: 44px 36px !important;
  }
}

/* =========================
   🧠 TYPO
========================= */

body .quiz-app h2 {
  font-size: 1.8rem !important;
  font-weight: 600 !important;
  margin-bottom: 6px !important;
}

body .quiz-app p {
  font-size: 0.95rem !important;
  opacity: 0.6 !important;
  margin-bottom: 14px !important;
}

body .quiz-app h3 {
  font-size: 1.7rem !important;
  font-weight: 600 !important;
  margin: 22px 0 24px 0 !important;
}


/* =========================
   📊 PROGRESS BAR
========================= */

body .quiz-app .progress-wrapper {
  margin-bottom: 16px !important;
}

body .quiz-app .progress-bar {
  width: 100% !important;
  height: 8px !important;
  background: rgba(0,0,0,0.08) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

body .quiz-app .progress-fill {
  height: 100% !important;
  background: linear-gradient(90deg,#007aff,#5ac8fa) !important;
  border-radius: 10px !important;
  transition: width 0.3s ease !important;
}

body .quiz-app .top-meta {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 0.75rem !important;
  opacity: 0.6 !important;
  margin-top: 6px !important;
}


/* =========================
   🔲 BUTTON GRID
========================= */

body .quiz-app .options {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px !important;
  margin-top: 20px !important;
}


/* =========================
   🔘 BUTTONS (Apple Style)
========================= */

body .quiz-app .options button {
  appearance: none !important;
  border: none !important;

  padding: 20px 16px !important;
  border-radius: 22px !important;

  background: rgba(255,255,255,0.95) !important;

  font-size: 1.05rem !important;
  font-weight: 500 !important;

  box-shadow:
    0 8px 18px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.7) !important;

  transition: all 0.2s ease !important;
}


/* Hover */
body .quiz-app .options button:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 14px 26px rgba(0,0,0,0.1) !important;
}


/* Active */
body .quiz-app .options button:active {
  transform: scale(0.96) !important;
}


/* =========================
   ✅ FEEDBACK
========================= */

body .quiz-app .options button.correct {
  background: linear-gradient(135deg,#34c759,#30d158) !important;
  color: white !important;
  transform: scale(1.04) !important;
  
}

body .quiz-app .options button.incorrect {
  background: linear-gradient(135deg,#ff3b30,#ff453a) !important;
  color: white !important;
}


/* =========================
   🎯 START SCREEN BUTTONS
========================= */

body .quiz-app .level-buttons {
  display: flex !important;
  justify-content: center !important;
  gap: 10px !important;
  margin-top: 18px !important;
}

body .quiz-app .level-buttons button {
  padding: 10px 18px !important;
  border-radius: 14px !important;
  border: none !important;

  background: rgba(0,0,0,0.05) !important;

  font-size: 1rem !important;
  font-weight: 500 !important;
}


/* =========================
   ✨ ANIMATIONS
========================= */

@keyframes fadeIn {
  from { opacity: 0 !important; transform: translateY(10px) !important; }
  to { opacity: 1 !important; transform: translateY(0) !important; }
}

body .quiz-app .card {
  animation: fadeIn 0.4s ease !important;
}

/* OVERLAY */
.feedback {
  position: fixed !important;
  bottom: 40px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(20px) !important;

  opacity: 0 !important;

  transition: all 0.3s ease !important;
  z-index: 9999 !important;
}

.feedback.show {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

/* BOX */
.feedback-box {
  padding: 14px 22px !important;
  border-radius: 20px !important;

  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(20px) !important;

  box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;

  text-align: center !important;
}

/* TEXT */
.feedback-main {
  font-weight: 600 !important;
  font-size: 1.1rem !important;
}

.feedback-sub {
  font-size: 0.85rem !important;
  opacity: 0.6 !important;
  margin-top: 2px !important;
}

/* COLORS */
.feedback.correct .feedback-box {
  border: 2px solid #34c759 !important;
}

.feedback.wrong .feedback-box {
  border: 2px solid #ff3b30 !important;
}

body .quiz-app .options button {
  position: relative !important;
  overflow: hidden !important;
}

.level-badge {
  padding: 4px 10px !important;
  border-radius: 12px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
}

.level-1 {
  background: rgba(0,0,0,0.05) !important;
}

.level-2 {
  background: rgba(0,122,255,0.15) !important;
  color: #007aff !important;
}

.level-3 {
  background: linear-gradient(135deg,#ff3b30,#ff9500) !important;
  color: white !important;
}

body.level-3-mode .card {
  transform: scale(1.02) !important;
  box-shadow: 0 30px 60px rgba(255,80,0,0.2) !important;
}

body.level-3-mode .progress-fill {
  background: linear-gradient(90deg,#ff3b30,#ff9500) !important;
}

.pressure {
  font-size: 0.9rem !important;
  color: #ff3b30 !important;
  font-weight: 600 !important;
  margin-bottom: 10px !important;
}

.pressure {
  font-size: 0.9rem !important;
  margin-top: 10px !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.pressure-high {
  color: #ff9500 !important;
  animation: pulseSoft 1s infinite !important;
}

.pressure-max {
  color: #ff3b30 !important;
  animation: pulseHard 0.6s infinite !important;
}

@keyframes pulseSoft {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes pulseHard {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.danger-mode {
  box-shadow: 0 30px 80px rgba(255,0,0,0.25) !important;
  animation: dangerPulse 0.6s infinite !important;
}

@keyframes dangerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.confetti {
  position: fixed !important;
  top: -10px !important;
  width: 8px !important;
  height: 8px !important;
  background: red !important;
  opacity: 0.8 !important;
  z-index: 9999 !important;
  animation: confettiFall linear forwards !important;
}

.confetti:nth-child(2n) { background: #007aff !important; }
.confetti:nth-child(3n) { background: #34c759 !important; }
.confetti:nth-child(4n) { background: #ffcc00 !important; }

@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(360deg);
  }
}

.flash {
  position: fixed !important;
  inset: 0 !important;
  background: white !important;
  opacity: 0.8 !important;
  z-index: 9998 !important;
  animation: flashAnim 0.4s ease forwards !important;
}

@keyframes flashAnim {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* =========================
   🌙 DARK MODE
========================= */

@media (prefers-color-scheme: dark) {

  body {
    background: radial-gradient(circle at 20% 20%, #0e1a2a 0%, #0a111a 70%) !important;
    color: #f5f5f7 !important;
  }

  /* CARD */
  body .quiz-app .card {
    background: rgba(30, 30, 35, 0.7) !important;
    backdrop-filter: blur(30px) saturate(140%) !important;

    box-shadow:
      0 25px 60px rgba(0,0,0,0.6),
      inset 0 1px 0 rgba(255,255,255,0.05) !important;
  }

  /* TEXT */
  body .quiz-app p {
    opacity: 0.7 !important;
  }

  body .quiz-app .top-meta {
    opacity: 0.7 !important;
  }

  /* PROGRESS */
  body .quiz-app .progress-bar {
    background: rgba(255,255,255,0.08) !important;
  }

  body .quiz-app .progress-fill {
    background: linear-gradient(90deg,#0a84ff,#64d2ff) !important;
  }

  /* BUTTONS */
  body .quiz-app .options button {
    background: rgba(40,40,45,0.9) !important;
    color: #f5f5f7 !important;

    box-shadow:
      0 10px 25px rgba(0,0,0,0.5),
      inset 0 1px 0 rgba(255,255,255,0.05) !important;
  }

  body .quiz-app .options button:hover {
    box-shadow: 0 18px 35px rgba(0,0,0,0.7) !important;
  }

  /* CORRECT / WRONG bleibt kräftig */
  body .quiz-app .options button.correct {
    background: linear-gradient(135deg,#30d158,#34c759) !important;
  }

  body .quiz-app .options button.incorrect {
    background: linear-gradient(135deg,#ff453a,#ff3b30) !important;
  }

  /* LEVEL BADGES */
  .level-1 {
    background: rgba(255,255,255,0.08) !important;
    color: #aaa !important;
  }

  .level-2 {
    background: rgba(10,132,255,0.2) !important;
    color: #0a84ff !important;
  }

  .level-3 {
    background: linear-gradient(135deg,#ff453a,#ff9f0a) !important;
  }

  /* FEEDBACK */
  .feedback-box {
    background: rgba(30,30,35,0.9) !important;
    color: #fff !important;

    box-shadow: 0 20px 40px rgba(0,0,0,0.7) !important;
  }

  /* PRESSURE TEXT */
  .pressure-high {
    color: #ff9f0a !important;
  }

  .pressure-max {
    color: #ff453a !important;
  }

  /* DANGER MODE */
  .danger-mode {
    box-shadow: 0 30px 90px rgba(255,60,0,0.35) !important;
  }

  /* FLASH weniger hart im Dark Mode */
  .flash {
    background: #ffffff !important;
    opacity: 0.2 !important;
  }

  /* CONFETTI etwas softer */
  .confetti {
    opacity: 0.9 !important;
  }

}

@media (prefers-color-scheme: dark) {
  body .quiz-app h2,
  body .quiz-app h3 {
    background: linear-gradient(90deg,#ffffff,#c7d2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.section--footer {
  margin-top: auto !important;
  padding: 30px 20px !important;

  text-align: center !important;
  font-size: 0.85rem !important;
  opacity: 0.6 !important;
}

.footer-links {
  margin-bottom: 8px !important;
}

.footer-links a {
  text-decoration: none !important;
  color: inherit !important;
}

.footer-sep {
  margin: 0 6px !important;
}

.footer-copy {
  font-size: 0.8rem !important;
}

@media (prefers-color-scheme: dark) {

  .section--footer {
    opacity: 0.5 !important;
  }

  .footer-links a {
    color: #aaa !important;
  }

}

.feedback {
  position: fixed !important;

  left: 50% !important;
  top: 65% !important;   /* 🔥 entscheidend → höher im Screen */

  transform: translate(-50%, -50%) scale(0.95) !important;

  opacity: 0 !important;
  transition: all 0.3s ease !important;

  z-index: 9999 !important;
}

.feedback.show {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
}