/* =====================================================
   BIBELSTELLEN QUIZ – Neon Glass Design System
   Dark Mode · Magenta · Violett · Electric Blue
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ─────────────────────────── */
:root {
  --bg-primary:    #07050d;
  --bg-secondary:  #0f0a1d;
  --bg-card:       rgba(27, 17, 49, 0.72);
  --bg-card-hover: rgba(48, 29, 83, 0.88);
  --bg-overlay:    rgba(5, 3, 12, 0.82);

  --gold:          #ff42c6;
  --gold-light:    #f3b4ff;
  --gold-dim:      #8055ff;
  --gold-glow:     rgba(255, 66, 198, 0.28);
  --blue:          #3974ff;
  --blue-glow:     rgba(57, 116, 255, 0.3);

  --text-primary:  #faf8ff;
  --text-secondary:#c3bbd9;
  --text-muted:    #8f86ad;

  --success:       #3db87a;
  --success-glow:  rgba(61, 184, 122, 0.25);
  --error:         #e05252;
  --error-glow:    rgba(224, 82, 82, 0.25);

  --border:        rgba(195, 163, 255, 0.19);
  --border-strong: rgba(244, 139, 255, 0.58);

  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-xl:     32px;

  --shadow-gold:   0 0 32px rgba(255, 66, 198, 0.18), 0 0 56px rgba(57, 116, 255, 0.11);
  --shadow-card:   0 12px 38px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255,255,255,.07);
  --shadow-deep:   0 24px 70px rgba(0, 0, 0, 0.68);

  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at 10% 6%, rgba(255, 34, 181, .19), transparent 29rem),
    radial-gradient(circle at 94% 3%, rgba(47, 94, 255, .22), transparent 30rem),
    radial-gradient(circle at 50% 82%, rgba(129, 58, 255, .15), transparent 36rem),
    var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* ── Subtiles Neon-Raster ───────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(217, 191, 255, .16) .6px, transparent .7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.46), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

/* ── App-Wrapper ────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(20, 11, 42, 0.82), rgba(8, 5, 17, 0.88));
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 0 18px var(--gold-glow);
}

.app-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.score-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(255, 66, 198, .17), rgba(57, 116, 255, .12));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
}

.streak-badge .streak-flame {
  font-size: 0.9rem;
}

.hamburger-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition);
  padding: 8px;
}

.hamburger-btn:hover {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--gold);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Main Content ───────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 20px 16px 32px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ── Start Screen ───────────────────────────────────── */
#start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  text-align: center;
  gap: 24px;
  padding: 32px 16px;
}

.start-hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 0 42px var(--gold-glow), 0 0 72px var(--blue-glow), var(--shadow-deep);
  animation: float 4s ease-in-out infinite;
}

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

.start-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.065em;
  color: var(--text-primary);
  line-height: 1.2;
}

.start-title span {
  color: var(--gold);
}

.start-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.6;
}

.start-stats {
  display: flex;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 80px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.length-selector-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
}

.length-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.length-options {
  display: flex;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 4px;
  gap: 4px;
}

.length-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: var(--transition);
}

.length-btn:hover {
  color: var(--gold-light);
}

.length-btn.active {
  background: linear-gradient(118deg, var(--gold), #c849f4 52%, var(--blue));
  color: var(--bg-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(118deg, var(--gold), #c849f4 52%, var(--blue));
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-xl);
  padding: 16px 48px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px var(--gold-glow), 0 0 18px var(--blue-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  border-radius: inherit;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--gold-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ── Game Screen ────────────────────────────────────── */
#game-screen {
  display: none;
  flex-direction: column;
  gap: 20px;
}

#game-screen.active { display: flex; }

/* Verse Card */
.verse-card {
  background: linear-gradient(135deg, rgba(38, 23, 68, .82), rgba(14, 9, 29, .76));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card), var(--shadow-gold);
  position: relative;
  overflow: hidden;
  transition: var(--transition-slow);
}

.verse-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 7rem;
  color: var(--gold);
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
}

.verse-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.verse-num {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  margin: 0 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.verse-text {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.verse-card.correct {
  border-color: var(--success);
  box-shadow: var(--shadow-card), 0 0 30px var(--success-glow);
}

.verse-card.wrong {
  border-color: var(--error);
  box-shadow: var(--shadow-card), 0 0 30px var(--error-glow);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: var(--transition);
}

.step.inactive {
  color: var(--text-muted);
  background: transparent;
}

.step.active {
  color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 66, 198, .14), rgba(57, 116, 255, .13));
  border: 1px solid var(--border);
}

.step.done {
  color: var(--success);
  background: rgba(61, 184, 122, 0.1);
}

.step-divider {
  width: 20px;
  height: 1px;
  background: var(--border);
}

/* ── Book Grid ──────────────────────────────────────── */
.section-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-weight: 500;
}

.testament-group {
  margin-bottom: 20px;
}

.testament-label {
  font-size: 0.65rem;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0 2px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.book-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.3;
}

.book-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.book-btn.selected {
  border-color: var(--gold);
  color: var(--bg-primary);
  background: linear-gradient(118deg, var(--gold), #c849f4 52%, var(--blue));
  font-weight: 600;
}

.book-btn.not-in-filter {
  opacity: 0.22;
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Chapter Selector ───────────────────────────────── */
#chapter-section {
  display: none;
}

#chapter-section.active {
  display: block;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.chapter-grid::-webkit-scrollbar {
  width: 3px;
}
.chapter-grid::-webkit-scrollbar-track {
  background: transparent;
}
.chapter-grid::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 2px;
}

.chapter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.chapter-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: var(--bg-card-hover);
}

.chapter-btn.selected {
  border-color: var(--gold);
  color: var(--bg-primary);
  background: linear-gradient(118deg, var(--gold), #c849f4 52%, var(--blue));
  font-weight: 700;
}

/* ── Result Overlay ─────────────────────────────────── */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.result-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.result-card {
  background: linear-gradient(145deg, rgba(41, 24, 75, .96), rgba(10, 7, 22, .96));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-deep);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-slow);
}

.result-overlay.show .result-card {
  transform: scale(1) translateY(0);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.result-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-title.correct { color: var(--success); }
.result-title.wrong   { color: var(--error); }

.result-reference {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.result-reference strong {
  color: var(--gold);
  font-weight: 600;
}

.points-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.points-badge {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
}

.points-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-next {
  background: linear-gradient(118deg, var(--gold), #c849f4 52%, var(--blue));
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-xl);
  padding: 14px 40px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.04em;
  width: 100%;
}

.btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--gold-glow);
}

/* ── Hamburger Panel ────────────────────────────────── */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.panel-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 92vw);
  background: linear-gradient(160deg, rgba(24, 13, 48, .98), rgba(7, 4, 16, .99));
  border-left: 1px solid var(--border);
  z-index: 301;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  color: var(--gold);
}

.panel-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.panel-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.filter-btn:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.filter-btn.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 66, 198, .14), rgba(57, 116, 255, .11));
  color: var(--gold-light);
  font-weight: 500;
}

.filter-btn .filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.filter-btn.active .filter-dot {
  background: var(--gold);
  border-color: var(--gold);
}

.panel-divider {
  height: 1px;
  background: var(--border);
}

/* Highscore im Panel */
.highscore-card {
  background: linear-gradient(135deg, rgba(255, 66, 198, .12), rgba(57, 116, 255, .06));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.highscore-value {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.highscore-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.btn-reset {
  background: transparent;
  border: 1px solid rgba(224, 82, 82, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--error);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-reset:hover {
  background: rgba(224, 82, 82, 0.1);
  border-color: var(--error);
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* ── Screen Transitions ─────────────────────────────── */
.screen {
  display: none;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

/* ── Swipe Edge Indicator ───────────────────────────── */
.swipe-edge {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 4px;
  height: 48px;
  background: linear-gradient(180deg, transparent, var(--gold-dim), transparent);
  border-radius: 2px 0 0 2px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 50;
  transition: opacity var(--transition);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 380px) {
  .app-title { font-size: 1.1rem; }
  .start-title { font-size: 1.8rem; }
  .verse-text { font-size: 0.95rem; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}

@media (min-width: 600px) {
  .main-content { padding: 28px 24px 48px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
