/* =========================================================
   SPEYER ESCAPE – Gothic Medieval Stylesheet
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=IM+Fell+English:ital@0;1&display=swap');

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

:root {
  --bg:        #070509;
  --bg2:       #0f0a13;
  --gold:      #b8922a;
  --gold-dim:  #7a5f1a;
  --blood:     #8b1a1a;
  --blood-dim: #5a0f0f;
  --purple:    #7030d0;
  --purple-dim:#4a1f8a;
  --text:      #d4c8b0;
  --text-dim:  #7a6e58;
  --border:    #2a1e3a;
  --success:   #2a6b3a;
  --error:     #8b1a1a;
  --radius:    6px;
  --font-title:'Cinzel Decorative', serif;
  --font-body: 'IM Fell English', serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 60px;
}

/* ── Max-width container ── */
.container {
  width: 100%;
  max-width: 480px;
  padding: 0 16px;
}

/* ── Header / Hero ── */
.site-header {
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 32px 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.site-header .eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.site-header h1 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1.3;
  text-shadow: 0 0 24px rgba(184,146,42,0.4);
}

.site-header .subtitle {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Station badge */
.station-badge {
  display: inline-block;
  background: var(--blood);
  color: var(--text);
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 12px;
}

.card p, .card li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 8px;
}

/* ── GPS Status ── */
.gps-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  font-size: 0.85rem;
  background: var(--bg2);
}

.gps-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gps-dot.searching { background: var(--gold-dim); animation: pulse 1.5s infinite; }
.gps-dot.locked    { background: var(--blood); }
.gps-dot.unlocked  { background: #2db35d; }

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

/* ── Puzzle area ── */
.puzzle-area {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}

.puzzle-area.locked::after {
  content: '🔒 Bewege dich zur markierten Position';
  position: absolute;
  inset: 0;
  background: rgba(7,5,9,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-radius: var(--radius);
  padding: 20px;
}

.puzzle-area h2 {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ── Inputs ── */
input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: #110d17;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 14px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

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

input.correct  { border-color: #2db35d; background: #0a1f10; }
input.incorrect { border-color: var(--blood); background: #1f0a0a; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  width: 100%;
  margin-bottom: 10px;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--blood);
  color: var(--text);
}
.btn-primary:hover { background: #a02020; }

.btn-gold {
  background: var(--gold);
  color: #070509;
}
.btn-gold:hover { background: #d4a830; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--gold-dim); color: var(--text); }

.btn-small {
  width: auto;
  padding: 6px 14px;
  font-size: 0.72rem;
}

/* ── Feedback messages ── */
.feedback {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-top: 10px;
  display: none;
}

.feedback.show { display: block; }

.feedback.success {
  background: #0a1f10;
  border: 1px solid #2db35d;
  color: #5be890;
}

.feedback.error {
  background: #1f0a0a;
  border: 1px solid var(--blood);
  color: #e87070;
}

.feedback.info {
  background: #100a1f;
  border: 1px solid var(--purple-dim);
  color: #c0a0f0;
}

/* ── Audio button ── */
.audio-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #100a1f;
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius);
  color: #c0a0f0;
  padding: 10px 16px;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.audio-btn:hover { border-color: var(--purple); }
.audio-btn .icon { font-size: 1.2rem; }

/* ── Navigation breadcrumb ── */
.nav-hint {
  text-align: center;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 8px;
}

.nav-hint a {
  color: var(--gold-dim);
  text-decoration: none;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Bypass input row ── */
.bypass-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.bypass-row input {
  width: 80px;
  margin-bottom: 0;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
}

/* ── Station list (index page) ── */
.station-list { list-style: none; }

.station-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.station-list .num {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--gold);
  width: 28px;
  flex-shrink: 0;
}

.station-list .info { flex: 1; }
.station-list .info strong { display: block; color: var(--text); font-style: normal; }
.station-list .info span  { font-size: 0.8rem; color: var(--text-dim); font-style: italic; }

.station-list .tag {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag-gps { background: #1a2a3a; color: #6ab0e8; }
.tag-qr  { background: #1a2a1a; color: #6ae880; }

/* ── Finale ── */
.finale-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.finale-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.finale-field input {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1rem;
  margin-bottom: 0;
}

/* ── Victory animation ── */
@keyframes goldGlow {
  0%   { box-shadow: 0 0 10px var(--gold); }
  50%  { box-shadow: 0 0 40px var(--gold), 0 0 80px rgba(184,146,42,0.4); }
  100% { box-shadow: 0 0 10px var(--gold); }
}

.victory {
  animation: goldGlow 2s infinite;
  border-color: var(--gold) !important;
}

/* ── Slider (Station 3 Caesar) ── */
.cipher-display {
  font-family: monospace;
  font-size: 1.8rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-align: center;
  padding: 16px;
  background: #0a0610;
  border-radius: var(--radius);
  margin: 12px 0;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
}

.rot-label {
  text-align: center;
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ── Timeline cards (Station 4) ── */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f0a16;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
  user-select: none;
}

.timeline-item .move-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-item .move-btns button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.timeline-item .move-btns button:hover { border-color: var(--gold-dim); color: var(--text); }
.timeline-item .event-text { flex: 1; font-size: 0.9rem; }

/* ── Canvas (Station 5 pendulum / Station 6 mirror) ── */
canvas {
  display: block;
  border-radius: var(--radius);
  touch-action: none;
}

.pendulum-fields {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.hit-log {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 8px;
  min-height: 24px;
  text-align: center;
}

/* ── Mirror grid (Station 6) ── */
.mirror-grid-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

/* ── Responsive adjustments ── */
@media (max-width: 360px) {
  .site-header h1 { font-size: 1.2rem; }
  .cipher-display { font-size: 1.4rem; }
}
