/* Kolory i akcenty unikalne dla Krasnalowej Wyprawy */
:root {
  --bg: #0a0c07;
  --surface: #171c13;
  --card: #232a1f;
  --border: #5c4a32;
  --gold: #e5b85b;
  --gold2: #cc9e40;
  --ember: #bd7a3a;
  --text: #f2efdf;
  --muted: #aca38a;
  --found: #5f8b5f;
  --radius: 14px;
}

body {
  background: var(--bg);
  color: var(--text);
}

.leaflet-tile-pane {
  filter: brightness(0.55) saturate(0.7) sepia(0.3) hue-rotate(5deg);
}

#title-card {
  flex: 1;
  background: rgba(23, 28, 19, 0.88);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  padding: 8px 14px 8px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

#title-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

#dragon-hero,
#drawer-hero-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(229, 184, 91, 0.6));
  animation: dragonFloat 3s ease-in-out infinite;
}

@keyframes dragonFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

#title-card h1 {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  white-space: nowrap;
}

#prog-wrap {
  margin-top: 5px;
  background: var(--surface);
  border-radius: 4px;
  height: 5px;
  width: 100%;
  overflow: hidden;
}

#prog-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ember), var(--gold), var(--gold2));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 4px var(--gold);
}

#count-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

.hud-btn {
  background: rgba(23, 28, 19, 0.88);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 18px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.hud-btn:hover {
  border-color: var(--gold2);
  background: rgba(229, 184, 91, 0.2);
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 2500;
}
#overlay.show { display: block; }

#drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(340px, 92vw);
  background: rgba(23, 28, 19, 0.97);
  border-left: 1px solid var(--gold);
  backdrop-filter: blur(20px);
  transform: translateX(110%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3000;
  display: flex;
  flex-direction: column;
}
#drawer.open { transform: translateX(0); }

#drawer-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-hero-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.drawer-hero-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(229,184,91,0.5));
}
#drawer-head h2 {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  color: var(--gold);
}
#filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.filter-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active {
  background: var(--gold);
  color: #0a0c07;
  border-color: var(--gold);
}
#drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.action-btn {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
#dragon-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
}
.krasnal-item {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--card), var(--surface));
  border-left: 3px solid var(--gold);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.krasnal-item:hover {
  border-left-color: var(--gold2);
  transform: translateX(-2px);
  box-shadow: 0 4px 16px rgba(229,184,91,0.2);
}
.krasnal-item.found {
  border-left-color: var(--found);
  opacity: 0.7;
}
.krasnal-item .emoji { font-size: 20px; flex-shrink: 0; }
.krasnal-item .info { flex: 1; min-width: 0; }
.krasnal-item .dname { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krasnal-item .daddr { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krasnal-item .check { font-size: 16px; flex-shrink: 0; }
.krasnal-item .locate-icon { font-size: 14px; cursor: pointer; flex-shrink: 0; margin-left: 4px; }
.krasnal-item .krasnal-photos {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-left: 32px;
  flex-basis: 100%;
  order: 10;
}
.krasnal-item.expanded .krasnal-photos { display: flex; }
.menu-photo-wrapper {
  position: relative;
  display: inline-block;
}
.menu-photo-wrapper img {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--gold);
  cursor: pointer;
  transition: transform 0.2s;
}
.menu-photo-wrapper img:hover { transform: scale(1.05); border-color: #fff; }
.delete-photo-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}
.marker-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(0,0,0,0.5);
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 8px var(--gold);
  transition: 0.2s;
}
.marker-pin::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.marker-pin.red { background: var(--ember); }
.marker-pin.green { background: var(--found); }
.leaflet-popup-content-wrapper {
  background: var(--card) !important;
  border: 1px solid var(--gold) !important;
  border-radius: 14px !important;
  color: var(--text) !important;
  font-family: 'Crimson Pro', serif !important;
  font-size: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip { background: var(--card) !important; }
.leaflet-popup-close-button {
  font-size: 24px !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  color: var(--gold) !important;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  margin: 4px;
}
.popup-inner h3 {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 6px;
}
.popup-inner .addr, .popup-inner .hint { font-size: 16px; margin-bottom: 8px; }
.popup-inner .hint { font-style: italic; background: var(--surface); padding: 8px 12px; border-radius: 8px; border-left: 4px solid var(--gold); }
.popup-inner .story { font-size: 16px; background: var(--surface); padding: 8px 12px; border-radius: 8px; border-left: 4px solid var(--gold); margin-bottom: 12px; }
.popup-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ember), var(--gold2));
  border: 1px solid var(--gold);
  color: white;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}
.popup-btn:hover { background: linear-gradient(135deg, var(--gold2), var(--gold)); transform: scale(1.02); }
.popup-photos { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; justify-content: center; }
.popup-photos img { width: 55px; height: 55px; object-fit: cover; border-radius: 6px; border: 2px solid var(--gold); cursor: pointer; }
@keyframes pulse-magic {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; box-shadow: 0 0 0 0 var(--gold); }
  70% { transform: translate(-50%, -50%) scale(1.8); opacity: 0.3; box-shadow: 0 0 0 20px rgba(229,184,91,0); }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}
.pulse-circle { animation: pulse-magic 1.8s infinite; background: radial-gradient(circle, var(--gold), transparent); }
#congrats {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 99999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
#congrats.show { display: flex; }
#congrats-dragon { width: 120px; animation: congratsDragon 0.7s cubic-bezier(0.2,1.5,0.5,1) both; filter: drop-shadow(0 0 30px rgba(229,184,91,0.8)); }
@keyframes congratsDragon {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
#splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.6s;
  text-align: center;
}
#splash.hidden { opacity: 0; pointer-events: none; }
#splash-dragon { width: 160px; animation: splashFloat 2s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(229,184,91,0.65)); }
#splash h1,
#splash p {
  width: min(90vw, 520px);
  margin-inline: auto;
  text-align: center;
}
@keyframes splashFloat {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}
.splash-bar-wrap { width: 200px; height: 3px; background: var(--surface); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.splash-bar { height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); animation: load 2s ease forwards; }
@keyframes load { 0% { width: 0; } 100% { width: 100%; } }
.leaflet-control-zoom { position: absolute !important; bottom: 20px !important; left: 12px !important; top: auto !important; right: auto !important; }
body.drawer-open #title-card { opacity: 0; pointer-events: none; transform: translateY(-8px); }
#drawer-footer { padding: 8px; border-top: 1px solid var(--border); text-align: center; flex-shrink: 0; }
.logo-link { text-decoration: none; }
.logo-text { font-family: 'Roboto', sans-serif; font-weight: 400; color: #fff; font-size: 14px; letter-spacing: 0.5px; }
.logo-dot { color: #eab308; }
.logo-link:hover .logo-text { background: linear-gradient(90deg, #e5b85b, #eab308, #c93a2b); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
#photo-modal img { animation: modalFadeIn 0.3s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.leaflet-routing-container {
  position: absolute !important;
  bottom: 20px !important;
  right: 20px !important;
  background: rgba(23,28,19,0.95) !important;
  border: 1px solid var(--gold) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px);
}
.leaflet-routing-container .leaflet-routing-collapse-btn,
.leaflet-routing-container .leaflet-routing-close-btn {
  background: var(--ember) !important;
  border-radius: 50% !important;
}
