/* ═══════════════════════════════════════════════════════════
   Feen-Schnitzeljagd Freiburg — Stylesheet
   Feen-Thema: Purple/Mint/Gold, grosszügige Touch-Targets
   ═══════════════════════════════════════════════════════════ */

:root {
  --purple:      #7B2D8E;
  --purple-dark: #4A1A57;
  --purple-lt:   #A45CB8;
  --mint:        #4ECDC4;
  --mint-dark:   #2A9D8F;
  --gold:        #FFD23F;
  --gold-dark:   #E0A800;
  --pink:        #FF6B9D;
  --bg:          #1A0B2E;
  --bg-lt:       #2D1547;
  --card:        #2D1547;
  --card-lt:     #3D1F5C;
  --text:        #F5EFFF;
  --text-dim:    #C4B0DC;
  --radius:      22px;
  --shadow:      0 6px 22px rgba(0,0,0,.45);
  --shadow-lg:   0 12px 44px rgba(0,0,0,.6);
  --font:        'Trebuchet MS', 'Segoe UI', Verdana, sans-serif;
  --font-fancy:  'Georgia', 'Trebuchet MS', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; overflow: hidden;
  font-family: var(--font);
  background: var(--bg); color: var(--text);
  user-select: none; -webkit-user-select: none;
}

.screen { display: none; height: 100vh; height: 100dvh; }
.screen.active { display: block; }

/* ══════════ START ══════════ */
#screen-start {
  position: relative; overflow-y: auto;
  display: none; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 24px 20px 40px;
  background:
    radial-gradient(ellipse 80% 55% at 50% 12%, rgba(164,92,184,.42), transparent 70%),
    linear-gradient(170deg, var(--purple-dark) 0%, var(--bg) 60%, #12061F 100%);
}
#screen-start.active { display: flex; }

.start-glow {
  position: absolute; top: 4%; left: 50%; transform: translateX(-50%);
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,210,63,.28), transparent 68%);
  animation: pulse 4s ease-in-out infinite; pointer-events: none;
}
@keyframes pulse { 0%,100% { transform: translateX(-50%) scale(1); opacity:.75 } 50% { transform: translateX(-50%) scale(1.18); opacity:1 } }

.start-fig { position: relative; z-index: 2; margin-bottom: 6px; }
#marcel-start {
  width: 190px; height: 190px; object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.6)) drop-shadow(0 0 26px rgba(255,210,63,.32));
  animation: float 3.4s ease-in-out infinite;
}
/* APNG-Animation: Float kombiniert mit der Figuren-Animation */
@media (prefers-reduced-motion: no-preference) {
  #marcel-start { image-rendering: auto; }
}
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-13px) } }

.start-title {
  position: relative; z-index: 2;
  font-family: var(--font-fancy); font-size: 30px; font-weight: 800;
  line-height: 1.22; margin-bottom: 8px;
  background: linear-gradient(180deg, #FFF4C9, var(--gold) 55%, #E58B00);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 3px 16px rgba(255,210,63,.22);
}
.start-title .city { display: block; font-size: .68em; margin-top: 4px; color: var(--mint); -webkit-text-fill-color: var(--mint); }

.start-subtitle { position: relative; z-index: 2; font-size: 16px; color: var(--text-dim); margin-bottom: 22px; line-height: 1.5; }

.start-info {
  position: relative; z-index: 2;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,210,63,.22);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 26px;
  font-size: 15px; line-height: 1.85; max-width: 380px; text-align: left;
  backdrop-filter: blur(8px);
}
.start-info p { margin: 0; }

.btn-start {
  position: relative; z-index: 2;
  background: linear-gradient(135deg, var(--purple-lt), var(--purple));
  color: #fff; border: none; padding: 19px 46px; font-size: 21px; font-weight: 700;
  border-radius: 50px; cursor: pointer; font-family: var(--font);
  box-shadow: var(--shadow-lg), 0 0 26px rgba(164,92,184,.42);
  transition: transform .18s, box-shadow .18s; min-height: 62px; min-width: 260px;
}
.btn-start:active { transform: scale(.95); }

.btn-reset {
  position: relative; z-index: 2; margin-top: 14px;
  background: transparent; color: var(--text-dim); border: 1px solid rgba(255,255,255,.2);
  padding: 11px 26px; font-size: 14px; border-radius: 30px; cursor: pointer;
  font-family: var(--font); min-height: 44px;
}
.btn-reset:active { background: rgba(255,255,255,.08); }

/* ══════════ KARTE ══════════ */
#screen-main { position: relative; height: 100vh; height: 100dvh; }
#screen-main.active { display: block; }
#map-canvas { width: 100%; height: 100%; background: #241238; position: relative; }
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text); text-align: center; padding: 20px;
}
.map-icon { font-size: 62px; margin-bottom: 14px; animation: float 3s ease-in-out infinite; }
.map-placeholder p { font-size: 16px; font-weight: 600; max-width: 300px; line-height: 1.5; }

.map-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 500;
  background: rgba(20,8,38,.9); color: var(--text);
  padding: 11px 16px; display: flex; align-items: center; gap: 12px;
  backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,210,63,.18);
}
.map-header h2 { font-family: var(--font-fancy); font-size: 16px; flex: 1; color: var(--gold); }
.progress-bar-wrap { flex: 1; max-width: 150px; height: 12px; background: rgba(255,255,255,.13); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--gold)); border-radius: 10px; transition: width .5s ease; }
.progress-badge { background: rgba(255,210,63,.18); color: var(--gold); border-radius: 20px; padding: 5px 13px; font-size: 14px; font-weight: 700; white-space: nowrap; }

.gps-hint {
  position: absolute; top: 52px; left: 12px; right: 12px; z-index: 499;
  background: rgba(255,240,200,.96); color: #5C4100; padding: 11px 16px;
  border-radius: 14px; font-size: 14px; font-weight: 600; text-align: center;
  display: none; box-shadow: var(--shadow);
}
.gps-hint.show { display: block; }

.action-buttons { position: absolute; bottom: 92px; left: 12px; right: 12px; z-index: 490; display: flex; gap: 11px; }
.btn-hint, .btn-found {
  flex: 1; border: none; border-radius: 50px; padding: 16px 12px;
  font-size: 19px; font-weight: 700; cursor: pointer; font-family: var(--font);
  min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: var(--shadow-lg); transition: transform .16s;
}
.btn-hint { background: var(--purple); color: #fff; }
.btn-hint:active { transform: scale(.95); }
.btn-found { background: var(--mint-dark); color: #fff; font-size: 20px; }
.btn-found:active { transform: scale(.95); filter: brightness(1.18); }

/* ══════════ FAIRY-BUBBLE ══════════ */
.fairy-bubble {
  position: absolute; bottom: 168px; left: 12px; right: 12px; z-index: 495;
  background: rgba(255,255,255,.96); color: #2A0F38;
  border: 2px solid var(--gold); border-radius: 20px; padding: 14px 18px;
  font-size: 15px; font-weight: 600; line-height: 1.5;
  box-shadow: var(--shadow-lg); display: none;
}
.fairy-bubble.show { display: block; animation: bubbleIn .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(16px) scale(.94) } to { opacity: 1; transform: none } }
.fairy-bubble::after {
  content: ''; position: absolute; bottom: -12px; left: 34px;
  border: 12px solid transparent; border-top-color: var(--gold);
}

/* ══════════ BOTTOM-SHEETS ══════════ */
.bottom-sheet {
  position: absolute; bottom: 62px; left: 0; right: 0; z-index: 600;
  background: var(--card); border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 30px rgba(0,0,0,.55);
  max-height: 74vh; max-height: 74dvh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(160%); transition: transform .34s cubic-bezier(.32,.72,0,1);
  border-top: 2px solid rgba(255,210,63,.3);
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle { width: 48px; height: 5px; background: rgba(255,255,255,.3); border-radius: 3px; margin: 10px auto 6px; }

.sheet-header { display: flex; align-items: center; gap: 13px; padding: 7px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.station-icon-large { font-size: 38px; flex-shrink: 0; }
.header-text { flex: 1; min-width: 0; }
.header-text h2 { font-family: var(--font-fancy); font-size: 19px; color: var(--gold); margin-bottom: 2px; }
.station-num { font-size: 13px; color: var(--text-dim); }
.sheet-close {
  background: rgba(255,255,255,.12); color: var(--text); border: none;
  width: 38px; height: 38px; border-radius: 50%; font-size: 19px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sheet-close:active { background: rgba(255,255,255,.26); }

.station-content { padding: 15px 18px 130px; }

.story-box {
  background: rgba(255,255,255,.055); border-radius: 16px; padding: 16px;
  margin-bottom: 14px; line-height: 1.72; font-size: 16px;
}
.story-box p { margin-bottom: 10px; }
.story-box p:last-child { margin-bottom: 0; }

.fact-box {
  background: linear-gradient(135deg, rgba(255,210,63,.14), rgba(164,92,184,.14));
  border-radius: 16px; padding: 16px; margin-bottom: 14px;
  border-left: 5px solid var(--gold); font-size: 15px; line-height: 1.65;
}
.fact-box .fact-header { font-family: var(--font-fancy); font-size: 17px; color: var(--gold); margin-bottom: 7px; }

.collect-box {
  background: rgba(78,205,196,.1); border: 2px solid var(--mint); border-radius: 16px;
  padding: 16px; margin-bottom: 14px; text-align: center;
}
.collect-box .item-header { font-family: var(--font-fancy); font-size: 17px; color: var(--mint); margin-bottom: 9px; }
.collect-box .item-content { font-size: 30px; margin-bottom: 11px; }
.collect-box .item-name { font-family: var(--font-fancy); font-size: 19px; }
.collect-box.done { background: rgba(78,205,196,.24); }

.collect-btn {
  background: linear-gradient(135deg, var(--mint), var(--mint-dark)); color: #06201D;
  border: none; padding: 13px 30px; font-size: 17px; font-weight: 700;
  border-radius: 50px; cursor: pointer; font-family: var(--font);
  min-height: 50px; min-width: 170px; margin-top: 12px; transition: transform .16s;
}
.collect-btn:active { transform: scale(.95); }
.collect-btn.collected { background: var(--gold); color: #3D2A00; }

.riddle-box { background: rgba(255,255,255,.055); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.riddle-box h3 { font-family: var(--font-fancy); font-size: 19px; color: var(--gold); margin-bottom: 11px; }
.riddle-question { font-size: 17px; font-weight: 700; margin-bottom: 15px; line-height: 1.5; }
.riddle-options { display: flex; flex-direction: column; gap: 9px; }
.riddle-btn {
  display: block; width: 100%; background: rgba(255,255,255,.09); color: var(--text);
  border: 3px solid transparent; padding: 15px 16px; border-radius: 14px;
  font-size: 16px; cursor: pointer; text-align: left; font-family: var(--font);
  min-height: 54px; transition: background .18s, border-color .18s, transform .1s;
}
.riddle-btn:active { background: rgba(255,255,255,.18); transform: scale(.98); }
.riddle-btn.correct { background: rgba(78,205,196,.4); border-color: var(--mint); color: #fff; }
.riddle-btn.wrong { background: rgba(255,107,157,.4); border-color: var(--pink); animation: shake .38s ease; }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }

.riddle-solved { background: rgba(78,205,196,.16); border: 2px solid var(--mint); border-radius: 16px; padding: 18px; margin-bottom: 14px; text-align: center; }
.riddle-solved h3 { font-family: var(--font-fancy); font-size: 21px; color: var(--mint); margin-bottom: 9px; }
.riddle-solved .riddle-answer { font-size: 15px; margin-top: 7px; }

.next-btn {
  display: block; width: 100%; background: linear-gradient(135deg, var(--purple-lt), var(--purple));
  color: #fff; border: none; padding: 17px; border-radius: 16px; font-size: 19px;
  font-weight: 700; cursor: pointer; font-family: var(--font); min-height: 58px;
  box-shadow: var(--shadow); transition: transform .16s; margin-bottom: 11px;
}
.next-btn:active { transform: scale(.97); }

.audio-btn {
  display: block; width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #3D2A00; border: none; padding: 15px; border-radius: 16px; font-size: 18px;
  font-weight: 700; cursor: pointer; font-family: var(--font); min-height: 54px;
  margin-bottom: 11px; box-shadow: var(--shadow); transition: transform .16s;
}
.audio-btn:active { transform: scale(.97); }
.audio-btn.playing { background: linear-gradient(135deg, var(--mint), var(--mint-dark)); color: #06201D; }

/* ══════════ SCHATZKARTE ══════════ */
.treasure-grid { padding: 16px 18px 120px; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 11px; }
.treasure-item {
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1);
  border-radius: 15px; padding: 12px 6px; text-align: center;
}
.treasure-item.found { background: rgba(255,210,63,.16); border-color: var(--gold); }
.treasure-item .t-emoji { font-size: 30px; display: block; margin-bottom: 5px; filter: grayscale(1) opacity(.32); }
.treasure-item.found .t-emoji { filter: none; }
.treasure-item .t-name { font-size: 10.5px; color: var(--text-dim); line-height: 1.3; }
.treasure-item.found .t-name { color: var(--gold); }

/* ══════════ STATIONSLEISTE ══════════ */
.station-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 550;
  background: rgba(20,8,38,.94); padding: 7px 8px;
  display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(12px); border-top: 1px solid rgba(255,210,63,.15);
}
.bar-treasure {
  flex-shrink: 0; background: rgba(255,210,63,.2); color: var(--gold);
  border: 1px solid rgba(255,210,63,.4); border-radius: 14px;
  padding: 8px 11px; font-size: 17px; cursor: pointer; font-family: var(--font);
  min-width: 56px; min-height: 46px; display: flex; align-items: center; gap: 4px; justify-content: center;
}
.station-bar-inner { flex: 1; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.station-bar-inner::-webkit-scrollbar { display: none; }
.station-pill {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.1); display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  font-size: 10px; color: var(--text-dim); position: relative;
  border: 2px solid transparent; transition: transform .15s;
}
.station-pill:active { transform: scale(.92); }
.station-pill .pill-icon { font-size: 21px; }
.station-pill.current { background: rgba(255,210,63,.28); border-color: var(--gold); }
.station-pill.done { background: rgba(78,205,196,.28); border-color: var(--mint); }
.station-pill.done::after {
  content: '✓'; position: absolute; top: -4px; right: -4px;
  background: var(--mint); color: #06201D; width: 17px; height: 17px;
  border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ══════════ MAP-MARKER ══════════ */
.station-marker {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: rgba(255,255,255,.94); border: 3px solid var(--text-dim);
  box-shadow: 0 3px 10px rgba(0,0,0,.4); transition: all .3s;
}
.station-marker.current { background: var(--gold); border-color: #fff; transform: scale(1.25); box-shadow: 0 0 18px var(--gold); }
.station-marker.done { background: var(--mint); border-color: #fff; }
.user-marker {
  width: 18px; height: 18px; border-radius: 50%; background: #3B82F6;
  border: 3px solid #fff; box-shadow: 0 0 12px #3B82F6;
}

/* ══════════ ABSCHLUSS ══════════ */
#screen-complete {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 20px; overflow-y: auto;
  background: radial-gradient(ellipse 80% 50% at 50% 8%, rgba(255,210,63,.24), transparent 70%),
              linear-gradient(165deg, var(--purple-dark), var(--bg) 65%);
}
#screen-complete.active { display: flex; }
.complete-fairy { font-size: 66px; margin-bottom: 10px; animation: float 3s ease-in-out infinite; }
.complete-title { font-family: var(--font-fancy); font-size: 28px; font-weight: 800; margin-bottom: 10px; color: var(--gold); }
.complete-text { font-size: 16px; color: var(--text-dim); margin-bottom: 20px; max-width: 330px; line-height: 1.55; }

.urkunde {
  background: rgba(255,255,255,.1); border-radius: var(--radius); padding: 22px;
  margin-bottom: 18px; max-width: 340px; width: 100%;
  border: 3px dashed rgba(255,210,63,.55); color: var(--text);
}
.urkunde h2 { font-family: var(--font-fancy); font-size: 22px; margin-bottom: 10px; color: var(--gold); }
.urkunde p { font-size: 15px; margin-bottom: 5px; line-height: 1.5; }
.urkunde .stars { font-size: 30px; margin: 9px 0; }
.urkunde .date { font-size: 13px; color: var(--text-dim); margin-top: 7px; }

.complete-facts { max-width: 340px; width: 100%; margin-bottom: 20px; text-align: left; }
.complete-facts .cf-item {
  background: rgba(255,255,255,.07); border-radius: 13px; padding: 12px 14px;
  margin-bottom: 8px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim);
}
.complete-facts .cf-item strong { color: var(--gold); }

.btn-replay {
  background: linear-gradient(135deg, var(--mint), var(--mint-dark)); color: #06201D;
  border: none; padding: 15px 38px; font-size: 19px; font-weight: 700;
  border-radius: 50px; cursor: pointer; font-family: var(--font); min-height: 54px;
  box-shadow: var(--shadow-lg);
}
.btn-replay:active { transform: scale(.95); }

/* ══════════ RESPONSIVE ══════════ */
@media (min-width: 600px) {
  .start-title { font-size: 38px; }
  .start-subtitle { font-size: 18px; }
  #marcel-start { width: 230px; height: 230px; }
  .btn-start { font-size: 23px; padding: 21px 54px; }
  .btn-hint, .btn-found { font-size: 21px; }
  .map-header h2 { font-size: 18px; }
  .header-text h2 { font-size: 21px; }
  .station-pill { width: 56px; height: 56px; font-size: 11px; }
  .station-pill .pill-icon { font-size: 24px; }
  .riddle-btn { font-size: 17px; padding: 17px 19px; }
  .next-btn { font-size: 21px; }
  .fairy-bubble { font-size: 16px; }
}
