/* ============================================
   Bloxys Dorf-Abenteuer – Erlenbach bei Kandel
   Theme: "Roblox-bunt" – Blau / Grün / Rot / Gold
   ============================================ */

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

:root {
  --bg:        #14213d;   /* Hintergrund - tiefes Blau */
  --bg2:       #1f3158;   /* Karten-Hintergrund */
  --blue:      #3a86ff;   /* Akzentfarbe 1 - Roblox-Blau */
  --blue-dim:  #25406e;
  --green:     #36d399;   /* Erfolg / GPS unlocked */
  --red:       #ff5d5d;   /* Akzentfarbe 2 - Warnung/Badge */
  --gold:      #ffd23f;   /* Haupt-Akzent - Buttons, Highlights */
  --gold-dim:  #b89a2e;
  --purple:    #9d6bff;   /* Audio-Akzent */
  --text:      #f4f6ff;
  --text-dim:  #9fb3d1;
  --border:    #2c4474;
  --radius:    14px;
  --font-title:'Baloo 2', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--bg) 0%, #0c1830 100%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }

/* ---------- Layout ---------- */
.site-header {
  text-align: center;
  padding: 22px 16px 14px;
  background: linear-gradient(180deg, #1c2f57 0%, transparent 100%);
  border-bottom: 3px solid var(--gold);
}

.site-header .eyebrow {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(255, 210, 63, 0.12);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 8px;
}

.site-header h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.7rem;
  margin: 4px 0 2px;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

.site-header .subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0;
}

.container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.card h2 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 10px;
  color: var(--gold);
}

.card h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  margin-right: 8px;
  vertical-align: middle;
}

.card p { line-height: 1.55; margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }

.story-text {
  font-style: italic;
  color: var(--text-dim);
  border-left: 4px solid var(--purple);
  padding-left: 12px;
}

/* ---------- Stations-Badge ---------- */
.station-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 8px;
}

/* ---------- GPS-Status ---------- */
.gps-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 700;
  font-family: var(--font-title);
}

.gps-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255,93,93,0.6);
  animation: pulse-red 1.6s infinite;
}

.gps-dot.searching {
  background: var(--gold);
  animation: pulse-gold 1.2s infinite;
}

.gps-dot.locked,
.gps-dot.unlocked {
  background: var(--green);
  animation: pulse-green 1.6s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255,93,93,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255,93,93,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,93,93,0); }
}
@keyframes pulse-gold {
  0% { box-shadow: 0 0 0 0 rgba(255,210,63,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255,210,63,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,210,63,0); }
}
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(54,211,153,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(54,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(54,211,153,0); }
}

/* ---------- Audio-Button ---------- */
.audio-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, var(--purple), #6f3df0);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(157,107,255,0.35);
}

.audio-btn .icon { font-size: 1.4rem; }
.audio-btn:active { transform: scale(0.98); }

/* ---------- Puzzle-Area ---------- */
.puzzle-area {
  position: relative;
  min-height: 80px;
}

.puzzle-area.locked {
  filter: blur(4px) grayscale(0.6);
  pointer-events: none;
  user-select: none;
}

.puzzle-area.locked::after {
  content: "🔒 Bewege dich zur markierten Stelle auf der Karte!";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(20,33,61,0.85);
  border-radius: var(--radius);
  padding: 20px;
  filter: none;
  color: var(--gold);
}

/* ---------- Inputs ---------- */
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #0e1b35;
  color: var(--text);
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-align: center;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--blue);
}

label { font-weight: 700; display: block; margin: 10px 0 6px; }

/* ---------- Feedback ---------- */
.feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-family: var(--font-title);
  display: none;
}
.feedback.show { display: block; }
.feedback.success { background: rgba(54,211,153,0.15); border: 2px solid var(--green); color: var(--green); }
.feedback.error { background: rgba(255,93,93,0.15); border: 2px solid var(--red); color: var(--red); }
.feedback.info { background: rgba(58,134,255,0.15); border: 2px solid var(--blue); color: var(--blue); }

/* ---------- Bypass ---------- */
.bypass-card {
  opacity: 0.75;
}
.bypass-row {
  display: flex;
  gap: 8px;
}
.bypass-row input { flex: 1; }
.bypass-row .btn { flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-gold { background: var(--gold); color: #14213d; box-shadow: 0 4px 12px rgba(255,210,63,0.35); }
.btn-green { background: var(--green); color: #0c1830; }
.btn-ghost { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-small { padding: 8px 14px; font-size: 0.85rem; width: auto; }

/* ---------- Stationsübersicht ---------- */
.station-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.station-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.station-list .station-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 800; color: #fff;
}
.station-list .station-info { flex: 1; }
.station-list .station-info strong { display: block; font-family: var(--font-title); }
.station-list .station-info span { color: var(--text-dim); font-size: 0.85rem; }
.tag-gps {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--green);
  color: #0c1830;
  border-radius: 6px;
  padding: 3px 8px;
  flex-shrink: 0;
}

/* ---------- Cipher / Sortier / Minigames ---------- */
.cipher-display {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  text-align: center;
  background: #0e1b35;
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0;
  word-break: break-all;
}
.rot-label {
  text-align: center;
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0e1b35;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-weight: 700;
}
.timeline-item .letter-badge {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--gold);
  color: #14213d;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
}
.timeline-item .label { flex: 1; }
.move-btns { display: flex; gap: 6px; }
.move-btns button {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.move-btns button:active { transform: scale(0.95); }

.preview-word {
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  margin: 12px 0;
  color: var(--gold);
}

/* ---------- Canvas Minigames ---------- */
.minigame-canvas {
  width: 100%;
  border-radius: 10px;
  background: #0e1b35;
  border: 2px solid var(--border);
  touch-action: none;
  display: block;
}

/* ---------- Finale ---------- */
.finale-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.finale-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.finale-field .station-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 800; color: #fff;
}
.finale-field input.correct { border-color: var(--green); background: rgba(54,211,153,0.12); }
.finale-field input.incorrect { border-color: var(--red); background: rgba(255,93,93,0.12); }

.victory {
  display: none;
  text-align: center;
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold), #ff9f3a);
  color: #14213d;
  margin-top: 14px;
  animation: pop-in 0.5s ease;
}
.victory.show { display: block; }
#victory-msg {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 0 8px;
}
@keyframes pop-in {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- Divider & Nav ---------- */
.divider {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 4px 0;
}
.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

/* ---------- Map ---------- */
#station-map { height: 220px; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); }
.leaflet-container { background: var(--bg2); }
.map-fallback {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.85rem;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 18px;
}
