:root {
  --cosmic-dark: #0a0718;
  --cosmic-mid: #1e1247;
  --cosmic-accent: #8b5cf6;
  --cosmic-accent-2: #4ade80;
  --accent-cyan: #45d4ff;
  --text-light: #f6f3ff;
  --text-muted: #a89bce;
  --text-faint: #6f6396;
  --red: #ef4444;
  --yellow: #eab308;
  --green: #22c55e;

  /* Glas-Karten-System, einheitlich fuer HUD/Profil/Untermenues */
  --glass-fill: rgba(255,255,255,0.055);
  --glass-fill-strong: rgba(255,255,255,0.09);
  --glass-border: rgba(255,255,255,0.14);
  --glass-border-strong: rgba(255,255,255,0.26);

  /* Rarity-Skala (siehe RARITY_COLORS in js/data.js, hier gespiegelt fuer CSS) */
  --rarity-common: #5eead4;
  --rarity-uncommon: #4ade80;
  --rarity-rare: #60a5fa;
  --rarity-epic: #c084fc;
  --rarity-legendary: #fbbf24;

  --font-mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--cosmic-dark);
  color: var(--text-light);
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh; /* Fallback fuer Browser ohne dvh-Unterstuetzung */
  height: 100dvh; /* beruecksichtigt dynamische Browser-UI (Adressleiste etc.) */
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}
.screen.active {
  display: block;
}

/* ============ MAP SCREEN ============ */
#screen-map { background: var(--cosmic-dark); }
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0d0820;
}
/* Voyager-Tiles sind schon farbig/hell genug (Strassen, Wasser, Parks) —
   nur ein ganz leichter Farbwasch in den App-Cosmic-Toenen fuer den
   Wiedererkennungswert, keine Verdunkelung/Invertierung mehr noetig. */
.map-tint {
  position: absolute;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 20% 0%, rgba(44,26,94,0.14), transparent 70%),
    radial-gradient(55% 40% at 100% 0%, rgba(20,40,79,0.1), transparent 70%);
}

/* ---- Glas-Karten-Baustein, Basis fuer HUD/Profil/Untermenues ---- */
.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 0;
  background: linear-gradient(to bottom, rgba(10,7,24,0.85), rgba(10,7,24,0));
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }

.avatar-btn {
  /* Responsiv statt fixer px-Werte: skaliert mit der Viewport-Breite,
     gedeckelt nach unten/oben (52-68px) statt einer starren Groesse. */
  width: clamp(52px, 15vw, 68px);
  height: clamp(52px, 15vw, 68px);
  border-radius: 50%;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  border: none;
  cursor: pointer;
  background: conic-gradient(from 0deg, var(--accent-cyan), var(--cosmic-accent), var(--accent-cyan));
}
.avatar-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--cosmic-dark);
}
/* Platzhalter-Avatar (generisches Icon statt Foto) — dieselbe Bildflaeche/
   Rahmung wie spaeter das echte <img>, siehe Kommentar in index.html. */
.avatar-dummy {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cosmic-mid);
  border: 2px solid var(--cosmic-dark);
  color: var(--text-muted);
}
.avatar-dummy .icon {
  width: 56%;
  height: 56%;
}

.icon-btn {
  width: clamp(46px, 13vw, 60px);
  height: clamp(46px, 13vw, 60px);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.icon-btn .icon {
  width: clamp(21px, 6vw, 27px);
  height: clamp(21px, 6vw, 27px);
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn.action {
  border-color: rgba(69,212,255,0.4);
  box-shadow: 0 0 14px -4px var(--accent-cyan), 0 2px 10px rgba(0,0,0,0.35);
}
.icon-btn.action .icon { color: var(--accent-cyan); }
.icon-btn-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-cyan);
  color: #0a0718;
  font-family: var(--font-mono);
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cosmic-dark);
}
.icon-btn-badge.hidden { display: none; }
.hud-icon-decorative { opacity: 0.6; cursor: default; }

.hud-title {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.hud-footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  padding: 14px 20px;
  border-radius: 26px;
  /* Kraeftiger Cyan-Farbblock statt gedecktem Glas — auf der hellen,
     bunten Voyager-Karte ging ein dunkler/subtiler Ton komplett unter.
     Dieselbe dunkel-auf-cyan-Logik wie .primary-btn, nur als Leiste. */
  background: linear-gradient(120deg, var(--accent-cyan), #8ff0ff);
  border: none;
  box-shadow: 0 10px 28px -8px rgba(69,212,255,0.6), 0 4px 14px rgba(0,0,0,0.35);
}
.footer-energy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-level {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-level-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.footer-level-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(10,7,24,0.7);
  white-space: nowrap;
}
.xp-track { flex: 1; height: 14px; border-radius: 7px; background: rgba(10,7,24,0.18); overflow: hidden; }
.xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 7px;
  background: linear-gradient(90deg, #4c1d95, #7c3aed);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 10px rgba(124,58,237,0.55);
  transition: width 0.4s ease;
}

/* Energie-Leiste: eigenes Amber/Blitz-Motiv statt Cyan/Navy der Levelleiste,
   damit auf einen Blick klar ist, dass es sich um eine andere Ressource
   (Energie, nicht Level/XP) handelt. */
.footer-energy .icon { width: 17px; height: 17px; color: #d97706; flex-shrink: 0; }
.energy-track { height: 10px; }
.energy-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.energy-label { min-width: 24px; text-align: right; }

.quest-btn.hidden { display: none; }

.quest-modal {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5,3,14,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.quest-modal.hidden { display: none; }
.quest-modal-card {
  width: min(100%, 360px);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
  background: rgba(30,18,71,0.94);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 14px 40px rgba(0,0,0,0.55);
}
.quest-modal-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.quest-modal-text { font-size: 14px; opacity: 0.9; margin-bottom: 16px; line-height: 1.4; }
.quest-modal-item-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  text-align: left;
}
.quest-modal-item-preview img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(251,191,36,0.5));
}
.quest-modal-item-info { min-width: 0; }
.quest-modal-item-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.quest-modal-reward { margin-bottom: 14px; }
.quest-modal-hint { font-size: 12px; opacity: 0.7; margin-bottom: 18px; line-height: 1.4; }

.gps-banner {
  position: absolute;
  top: 124px;
  left: 14px;
  right: 14px;
  z-index: 500;
  background: rgba(96, 24, 58, 0.92);
  border: 1px solid rgba(239,68,68,0.5);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
}
.gps-banner.hidden { display: none; }

.primary-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--accent-cyan), #7ce8ff);
  color: #0a0718;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px -10px var(--accent-cyan);
  transition: transform 0.1s ease;
}
.primary-btn:active { transform: scale(0.97); }
.primary-btn:disabled {
  background: rgba(255,255,255,0.08);
  color: var(--text-faint);
  cursor: default;
  box-shadow: none;
}

.dev-btn {
  position: absolute;
  bottom: calc(97px + env(safe-area-inset-bottom, 0px));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--accent-cyan);
  cursor: pointer;
  background: rgba(10,7,24,0.6);
  border: 1.5px dashed rgba(69,212,255,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
  opacity: 0.9;
}
.dev-btn:active { transform: scale(0.9); }
.dev-btn .icon { width: 21px; height: 21px; }
.dev-btn-left { left: 14px; }
.dev-btn-right { right: 14px; }
.dev-btn-center { left: 50%; transform: translateX(-50%); }
.dev-btn-center:active { transform: translateX(-50%) scale(0.9); }

/* Leaflet marker helpers */
/* Spieler-Standort: Punkt + drehbarer Blickrichtungs-Kegel (Pokemon-Go-
   artig). Der Wrapper wird per JS auf playerHeading rotiert (siehe
   updatePlayerMarker() in map.js); da Punkt und Kegel-Spitze exakt im
   Rotationszentrum (30,30 von 60x60) liegen, bleibt der Punkt beim Drehen
   an Ort und Stelle, nur der Kegel schwenkt. */
.player-marker-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  transition: transform 0.35s ease;
}
.player-cone {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.player-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 3px solid var(--cosmic-dark);
  box-shadow: 0 0 0 6px rgba(69,212,255,0.22), 0 0 14px var(--accent-cyan);
}
.creature-marker {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.creature-marker.out-of-range { opacity: 0.55; filter: grayscale(0.4); }
.creature-marker.in-range img {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)) drop-shadow(0 0 10px currentColor);
}
.creature-marker img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
  position: relative;
}

.store-marker {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--cosmic-mid);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(69,212,255,0.15), 0 0 16px -3px var(--accent-cyan), 0 2px 12px rgba(0,0,0,0.55);
  cursor: pointer;
}
.store-marker.out-of-range { opacity: 0.55; box-shadow: 0 2px 12px rgba(0,0,0,0.55); }
.store-marker-landmark {
  cursor: default;
  width: 38px;
  height: 38px;
  background-color: var(--cosmic-dark);
  border-color: var(--glass-border-strong);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.store-marker-landmark .store-marker-badge {
  position: static;
  width: 100%;
  height: 100%;
  font-size: 17px;
  background: transparent;
  border: none;
}
.store-marker-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cosmic-dark);
  border: 1.5px solid var(--glass-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.leaflet-popup-content-wrapper {
  background: var(--cosmic-mid);
  color: var(--text-light);
  border-radius: 10px;
}
.leaflet-popup-tip { background: var(--cosmic-mid); }

/* ============ FULLSCREEN SCENES (Fang/Draw/Success) ============ */
.fullscreen-scene {
  background: #000;
  color: var(--text-light);
  display: none;
}
.fullscreen-scene.active { display: flex; flex-direction: column; }

.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.scene-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.55));
  z-index: 2;
}
.scene-top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
}
.btn-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10,7,24,0.55);
  border: 1px solid var(--glass-border);
}
.attempt-label {
  background: rgba(10,7,24,0.55);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.scene-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ar-toggle-btn {
  background: rgba(10,7,24,0.55);
  border: 1px solid var(--glass-border);
  color: var(--text-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.ar-toggle-btn.on {
  background: rgba(69,212,255,0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(69,212,255,0.4);
}

.catch-stage {
  position: relative;
  z-index: 5;
  flex: 1;
}
.catch-creature-img {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(46vw, 210px);
  height: min(46vw, 210px);
  object-fit: contain;
  z-index: 1;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.6));
  pointer-events: none;
  display: none;
}
/* Fest auf Hoehe der Fuesse im Fauli-Echtfoto positioniert (nicht an das
   Wesen-Icon gekoppelt, da Faulis Foto kein Icon-Overlay nutzt). */
.catch-bar-track {
  position: absolute;
  top: 74%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(86vw, 420px);
  height: 26px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
  background: linear-gradient(
    to right,
    #ef4444 0%, #ef4444 25%,
    #eab308 25%, #eab308 40%,
    #22c55e 40%, #22c55e 60%,
    #eab308 60%, #eab308 75%,
    #ef4444 75%, #ef4444 100%
  );
}
.catch-bar-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: 0%;
  width: 5px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255,255,255,0.9), 0 0 2px rgba(0,0,0,0.6);
  transform: translateX(-50%);
  pointer-events: none;
}
.catch-hint {
  position: absolute;
  top: calc(74% + 26px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  text-align: center;
  white-space: nowrap;
}

/* ============ Draw / Nachmal-Minigame ============ */
.draw-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.draw-svg {
  width: min(80vw, 340px);
  height: min(80vw, 340px);
  background: rgba(0,0,0,0.25);
  border-radius: 20px;
  touch-action: none;
}
.draw-guide {
  fill: none;
  stroke: rgba(255,255,255,0.85);
  stroke-width: 3;
  stroke-dasharray: 8 8;
}
.draw-user {
  fill: none;
  stroke: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56,189,248,0.8));
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw-feedback {
  position: relative;
  z-index: 10;
  text-align: center;
  min-height: 24px;
  font-weight: 600;
  padding: 0 20px;
}
.draw-bottom { padding-top: 0; }
.opt-out-label {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-size: 14px;
  background: rgba(0,0,0,0.4);
  padding: 10px 14px;
  border-radius: 10px;
}
.opt-out-label input { width: 18px; height: 18px; }

/* ============ Bon-Scan ============ */
.scan-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}
.scan-hint {
  font-size: 15px;
  line-height: 1.5;
  max-width: 320px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.scan-status {
  font-size: 14px;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 8px 16px;
  border-radius: 20px;
}
.scan-error {
  font-size: 14px;
  font-weight: 600;
  color: #fca5a5;
  background: rgba(96,24,58,0.6);
  border: 1px solid rgba(239,68,68,0.5);
  padding: 8px 16px;
  border-radius: 10px;
  max-width: 340px;
  white-space: pre-wrap;
  text-align: left;
}
.scan-status.hidden, .scan-error.hidden { display: none; }
.scan-btn {
  width: min(80vw, 320px);
}
.scan-btn.secondary {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: none;
}

/* ============ Success Scenes ============ */
.success-scene {
  background: radial-gradient(ellipse at top, var(--cosmic-mid), var(--cosmic-dark));
  align-items: center;
  justify-content: center;
}
.success-card {
  width: min(90vw, 380px);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(30, 18, 71, 0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.success-banner {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}
.success-img-wrap {
  position: relative;
  width: 160px;
  margin: 0 auto 14px;
}
.success-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5));
  display: block;
}
.success-img.hidden { display: none; }
.success-creature-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: 62%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  display: none;
}
/* .success-img ist display:block mit fester Breite (160px) und sitzt in
   einem gleich breiten Wrapper — bei Wesen (volle 160px) sieht das
   zentriert aus, aber .item-img macht das Bild schmaler (130px), wodurch
   ein Block-Element ohne eigenes margin:auto immer linksbuendig im
   Wrapper haengenbleibt (text-align:center wirkt nur auf Inline-Inhalte).
   Deshalb hier explizit zentrieren. */
.item-img { width: 130px; height: 130px; border-radius: 20px; margin: 0 auto; }
.success-trophy-icon {
  --trophy-color: var(--rarity-legendary);
  width: 160px;
  height: 160px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.14), transparent 60%), rgba(255,255,255,0.05);
  border: 2px solid var(--trophy-color);
  box-shadow: 0 0 30px -6px var(--trophy-color);
}
.success-trophy-icon svg { width: 72px; height: 72px; color: var(--trophy-color); stroke-width: 1.4; }
.success-trophy-icon.hidden { display: none; }
.success-progress {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: 10px;
}
.success-progress.hidden { display: none; }
.success-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.success-meta { font-size: 14px; opacity: 0.9; margin-bottom: 6px; }
.success-store { font-size: 13px; opacity: 0.8; margin-bottom: 6px; }
.success-effect { font-size: 13px; opacity: 0.85; margin-bottom: 10px; font-style: italic; }
.success-xp {
  display: inline-block;
  background: rgba(74,222,128,0.2);
  color: #4ade80;
  border-radius: 20px;
  padding: 4px 14px;
  font-weight: 700;
  margin-bottom: 14px;
}
.success-shiny-banner {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  background: linear-gradient(90deg, #38bdf8, #c084fc, #fbbf24, #38bdf8);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shiny-shimmer 2.4s linear infinite;
}
.success-shiny-banner.hidden { display: none; }
@keyframes shiny-shimmer {
  to { background-position: -300% center; }
}

.hint-text { font-size: 13px; opacity: 0.75; margin-bottom: 18px; line-height: 1.4; }

/* ============ Profil-Hub ============ */
.profile-screen {
  background:
    radial-gradient(520px 360px at 25% -6%, #2c1a5e 0%, transparent 60%),
    radial-gradient(420px 320px at 100% 0%, #14284f 0%, transparent 55%),
    var(--cosmic-dark);
  overflow-y: auto;
  padding-bottom: 30px;
}
.back-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-light);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.back-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.back-circle .icon { width: 16px; height: 16px; }

/* Profil-Hub: echte Komponenten aus renderProfileHub() (js/profile.js),
   nutzt dieselben Glas-Tokens wie HUD und Untermenues. */
.profile-screen { padding-bottom: 0; }
.profile-content {
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 16px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-id {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.profile-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--glass-border-strong);
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name { font-size: 15px; font-weight: 800; color: var(--text-light); line-height: 1.2; }
.profile-lvl { font-family: var(--font-mono); font-size: 11px; color: var(--accent-cyan); margin-top: 2px; letter-spacing: 0.04em; }

.xp-card { border-radius: 14px; padding: 11px 14px; }
.xp-card-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 7px; font-family: var(--font-mono); }
.xp-track2 { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.xp-fill2 { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cosmic-accent), var(--accent-cyan)); transition: width 0.4s ease; }

.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  border-radius: 16px;
  padding: 14px 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
}
.tile-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
}
.tile-icon-wrap .icon { width: 19px; height: 19px; color: var(--accent-cyan); }
.tile span { font-size: 11px; font-weight: 700; color: var(--text-light); }
.tile small { font-size: 9px; color: var(--text-faint); font-weight: 600; }

.scan-strip { border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.scan-strip .icon { width: 22px; height: 22px; color: var(--accent-cyan); flex-shrink: 0; }
.scan-strip-text { font-size: 11px; line-height: 1.4; color: var(--text-muted); }
.scan-strip-text b { display: block; color: var(--text-light); font-size: 12.5px; margin-bottom: 1px; }

.sub-screen-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
}
.sub-screen-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-right: 36px;
}
.sub-screen-content {
  max-width: 460px;
  margin: 10px auto 0;
  padding: 0 20px 30px;
}

.placeholder-note {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  opacity: 0.85;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
}

.item-grid, .loomas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.item-cell, .looma-cell {
  --rarity-color: var(--rarity-common);
  aspect-ratio: 1;
  background: var(--glass-fill);
  border: 1.5px solid var(--rarity-color);
  border: 1.5px solid color-mix(in srgb, var(--rarity-color) 55%, transparent);
  border-radius: 14px;
  box-shadow: 0 0 16px -6px var(--rarity-color);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
}
.item-cell.locked, .looma-cell.locked {
  background: transparent;
  border: 1px solid var(--glass-border);
  box-shadow: none;
  cursor: default;
}
.item-cell img, .looma-cell img { width: 56%; height: 56%; object-fit: contain; }
.trophy-cell-icon { width: 46%; height: 46%; color: var(--rarity-color); stroke-width: 1.4; }
.cell-count {
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
}
.cell-label { font-size: 10px; text-align: center; opacity: 0.9; }

.item-detail-card {
  text-align: center;
}
.item-detail-card img { width: 100px; height: 100px; }
.detail-card-synthetic {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 28px 20px;
  border-radius: 16px;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(255,255,255,0.6), transparent),
    radial-gradient(ellipse at center, #2a1a52 0%, #150c30 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  text-align: center;
}
.detail-card-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.detail-card-rarity { font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.detail-card-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 16px rgba(192,132,252,0.5));
}
.detail-card-effect { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.detail-card-hint { font-size: 12px; opacity: 0.7; line-height: 1.4; }
.trophy-reward-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  text-align: left;
}
.trophy-reward-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(251,191,36,0.5));
}
.trophy-reward-item-info { min-width: 0; }
.trophy-reward-item-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.trophy-reward-random {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  text-align: left;
}
.trophy-reward-random-label { font-size: 12px; font-weight: 700; opacity: 0.8; margin-bottom: 10px; }
.trophy-reward-random-options { display: flex; gap: 14px; flex-wrap: wrap; }
.trophy-reward-mini { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; }
.trophy-reward-mini img { width: 40px; height: 40px; object-fit: contain; }
.trophy-reward-mini span { font-size: 10px; text-align: center; opacity: 0.85; line-height: 1.2; }

.danger-btn, .secondary-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.danger-btn:active, .secondary-btn:active { transform: scale(0.97); }
.danger-btn {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  box-shadow: 0 4px 16px rgba(220,38,38,0.4);
}
.secondary-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-light);
}
.confirm-card {
  max-width: 320px;
  margin: 40px auto 0;
  padding: 24px 20px;
  border-radius: 16px;
  background: linear-gradient(160deg, #16123a, #0c0a20);
  border: 1px solid rgba(239,68,68,0.4);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  text-align: center;
}
.confirm-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.confirm-text { font-size: 14px; opacity: 0.85; line-height: 1.4; margin-bottom: 20px; }
.confirm-actions { display: flex; flex-direction: column; gap: 10px; }

.essence-banner {
  text-align: center;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #e9d5ff;
  background: rgba(192,132,252,0.12);
  border: 1px solid rgba(192,132,252,0.35);
  border-radius: 12px;
}
.looma-exchange-owned { font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.looma-exchange-rate { font-size: 12px; opacity: 0.7; margin-bottom: 18px; }
.looma-exchange-slider-row { margin-bottom: 14px; }
.looma-exchange-slider-row input[type="range"] {
  width: 100%;
  accent-color: #c084fc;
}
.looma-exchange-preview {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}
.looma-exchange-preview #looma-exchange-result { color: #e9d5ff; }

.detail-card-full {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.rarity-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #10101a;
  margin: 6px 0;
}
.outfit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.outfit-cell {
  aspect-ratio: 87 / 100;
  border-radius: 14px;
  border: none;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
}
.outfit-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.outfit-cell:active img { filter: brightness(1.2); }
.outfit-stage {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
}
.outfit-stage img { width: 100%; display: block; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}
.toggle-switch {
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(255,255,255,0.2);
  position: relative;
  cursor: pointer;
  border: none;
}
.toggle-switch.on { background: #4ade80; }
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: left 0.2s ease;
}
.toggle-switch.on::after { left: 23px; }
