@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Nunito:wght@400;700;900&display=swap');

:root {
  --sky: #6ec6ff;
  --sky-deep: #2f8fe0;
  --grass: #7ed957;
  --grass-deep: #3fa34d;
  --sun: #ffd93d;
  --coral: #ff6b6b;
  --wood: #8b5a2b;
  --cream: #fff7dc;
  --ink: #1b2340;
  --ink-2: #2b3563;
  --shadow: 0 6px 0 rgba(0,0,0,.18), 0 12px 24px rgba(0,0,0,.18);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sky);
  overflow: hidden;
}

/* ---------- MAP ---------- */
#map { position: absolute; inset: 0; background: #bfe6ff; }
/* filter per tile (not per pane): each tile is a cached GPU layer, so panning stays smooth */
/* no per-tile layer promotion (causes sub-pixel seams); overlap tiles by half a pixel to hide any remaining gaps */
#map .leaflet-tile-pane .leaflet-tile { outline: 1px solid transparent; }
#map .leaflet-tile-container img.leaflet-tile { width: 256.5px !important; height: 256.5px !important; }
#map .leaflet-shadow-pane { opacity: .95; }
/* while a zoom animation runs, drop the filter so scaled tiles don't re-rasterize every frame */
#map.leaflet-zoom-anim .leaflet-tile-pane .leaflet-tile { filter: none; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-control-zoom a {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink);
  background: var(--cream); border: 3px solid var(--ink) !important; border-radius: 12px !important; margin-bottom: 6px;
  box-shadow: 0 4px 0 var(--ink);
  width: 40px; height: 40px; line-height: 34px;
}
.leaflet-control-zoom a:hover { background: var(--sun); transform: translateY(-2px); }
.leaflet-bar { border: 0 !important; box-shadow: none !important; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,247,220,.85); border-radius: 8px 0 0 0; }

.boundary-line { animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -24; } }

/* vignette + paper grain over map */
.map-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 400;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(27,35,64,.45) 100%);
}

/* ---------- MARKERS ---------- */
.poi-marker { background: none; border: 0; }
.poi-badge {
  position: relative; width: 52px; height: 52px; margin-left: -26px; margin-top: -58px;
  display: grid; place-items: center; font-size: 28px; line-height: 1;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 50%;
  box-shadow: 0 5px 0 var(--ink), 0 10px 18px rgba(0,0,0,.25);
  transition: transform .15s cubic-bezier(.34,1.56,.64,1);
  cursor: pointer;
  animation: pop .5s cubic-bezier(.34,1.56,.64,1) both;
}
.poi-badge::after {
  content: ""; position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%);
  border: 10px solid transparent; border-top: 12px solid var(--ink); border-bottom: 0;
}
.poi-badge:hover { transform: translateY(-6px) scale(1.1) rotate(-4deg); }
.poi-badge .label {
  position: absolute; top: -34px; left: 50%; transform: translateX(-50%) scale(0);
  white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 14px;
  background: var(--ink); color: var(--cream); padding: 4px 10px; border-radius: 10px;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1); pointer-events: none;
}
.poi-badge:hover .label { transform: translateX(-50%) scale(1); }
.poi-badge.hero { background: var(--sun); animation: pop .5s both, bob 2.2s ease-in-out infinite 0.5s; }
@keyframes pop { from { transform: scale(0) translateY(40px); } to { transform: scale(1) translateY(0); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* level of detail by zoom (set on #map as data-lod) */
#map[data-lod="mid"] .poi-badge:not(.hero) { width: 34px; height: 34px; margin-left: -17px; margin-top: -40px; font-size: 18px; border-width: 3px; box-shadow: 0 3px 0 var(--ink), 0 6px 12px rgba(0,0,0,.25); }
#map[data-lod="mid"] .poi-badge:not(.hero)::after { bottom: -12px; border-width: 7px; border-top-width: 9px; }
#map[data-lod="far"] .poi-badge:not(.hero) {
  width: 14px; height: 14px; margin-left: -7px; margin-top: -7px; font-size: 0; border-width: 2px; background: var(--sun);
  box-shadow: 0 0 0 2px rgba(255,247,220,.7), 0 2px 6px rgba(0,0,0,.35); animation: none;
}
#map[data-lod="far"] .poi-badge:not(.hero)::after { display: none; }
#map[data-lod="far"] .poi-badge:not(.hero):hover { transform: scale(1.6); }
#map[data-lod="far"] .poi-badge:not(.hero) .label { top: -30px; font-size: 12px; }
#map[data-lod="far"] .poi-badge.hero { transform: scale(.75); }
.poi-badge { transition: width .2s, height .2s, margin .2s, font-size .2s, transform .15s cubic-bezier(.34,1.56,.64,1); }

.pin-marker { background: none; border: 0; }
.pin {
  width: 34px; height: 34px; margin-left: -17px; margin-top: -34px; position: relative;
  background: var(--coral); border: 4px solid var(--ink); border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 4px 0 var(--ink);
  animation: pinDrop .6s cubic-bezier(.34,1.56,.64,1) both;
}
.pin::after { content: ""; position: absolute; inset: 7px; background: var(--cream); border-radius: 50%; }
@keyframes pinDrop { from { transform: rotate(-45deg) translate(-60px, -60px); opacity: 0; } to { transform: rotate(-45deg); opacity: 1; } }

/* ---------- HUD ---------- */
.hud { position: absolute; z-index: 500; pointer-events: none; }
.hud > * { pointer-events: auto; }

.title-banner {
  top: 18px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 44px); letter-spacing: 2px;
  color: var(--cream); background: var(--ink); padding: 8px 28px; border-radius: 20px;
  border: 4px solid var(--sun); box-shadow: var(--shadow); text-shadow: 0 3px 0 var(--sky-deep);
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
}
.title-banner small { font-size: .42em; letter-spacing: 3px; color: var(--sun); text-shadow: none; }
.title-banner .coin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--sun);
  border: 3px solid #d9a800; animation: spin 1.6s linear infinite; }
@keyframes spin { 0% { transform: scaleX(1); } 50% { transform: scaleX(.15); } 100% { transform: scaleX(1); } }

.sidebar { top: 90px; left: 18px; width: 280px; display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; padding: 14px 16px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s cubic-bezier(.34,1.56,.64,1);
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px) rotate(-1deg); }
.card:active { transform: translateY(2px); }
.card h3 {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink-2); display: flex; justify-content: space-between; align-items: center;
}
.card h3 .more { font-size: 11px; background: var(--sun); color: var(--ink); padding: 2px 8px; border-radius: 8px; border: 2px solid var(--ink); }
.card .muted { opacity: .7; font-size: 13px; }

.weather-now { display: flex; align-items: center; gap: 14px; }
.weather-now .icon { font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); animation: bob 3s ease-in-out infinite; }
.weather-now .temp { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; }
.weather-now .desc { font-size: 13px; font-weight: 700; color: var(--ink-2); }

.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.news-list li { font-size: 13px; font-weight: 700; line-height: 1.25; display: flex; gap: 8px; }
.news-list li::before { content: "★"; color: var(--coral); flex-shrink: 0; }
.news-list li.local::before { content: "🏡"; }

/* ---------- DIALOG (Zelda-style) ---------- */
.dialog-wrap {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(140%);
  width: min(720px, calc(100% - 36px)); z-index: 600; transition: transform .35s cubic-bezier(.34,1.3,.64,1);
}
.dialog-wrap:not(.open) { visibility: hidden; pointer-events: none; transition: transform .35s cubic-bezier(.34,1.3,.64,1), visibility 0s .35s; }
.dialog-wrap.open { transform: translateX(-50%) translateY(0); }
.dialog {
  background: var(--ink); color: var(--cream); border: 4px solid var(--cream); outline: 4px solid var(--ink);
  border-radius: 18px; padding: 18px 22px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.4); position: relative;
  display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: start;
}
.dialog .avatar {
  width: 72px; height: 72px; display: grid; place-items: center; font-size: 40px;
  background: var(--cream); border-radius: 50%; border: 4px solid var(--sun);
}
.dialog .name { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--sun); letter-spacing: 1px; margin-bottom: 4px; }
.dialog .text { font-size: 16px; line-height: 1.45; min-height: 44px; }
.dialog .tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.dialog .tag { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; background: var(--ink-2); padding: 2px 8px; border-radius: 8px; color: var(--sky); }
.dialog .actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.dialog .close { position: absolute; top: -18px; right: -14px; }
.dialog .cursor { display: inline-block; width: 0; height: 0; border: 7px solid transparent; border-top: 10px solid var(--sun); border-bottom: 0;
  margin-left: 6px; animation: bob 1s ease-in-out infinite; vertical-align: middle; }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .5px; text-decoration: none;
  background: var(--sun); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 7px 16px;
  box-shadow: 0 4px 0 var(--ink); cursor: pointer; transition: transform .1s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.alt { background: var(--sky); }
.btn.danger { background: var(--coral); color: white; }
.btn.ghost { background: var(--cream); }
.btn.round { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; font-size: 20px; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: absolute; inset: 0; z-index: 700; background: rgba(27,35,64,.65);
  display: none; place-items: center; padding: 20px; grid-template-columns: minmax(0, 1fr);
}
.modal-backdrop.open { display: grid; }
.modal {
  width: 100%; max-width: 640px; min-width: 0; max-height: 85vh; display: flex; flex-direction: column;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1) both;
}
.modal header {
  padding: 16px 22px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 4px dashed rgba(27,35,64,.2);
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 1px;
}
.modal .body { padding: 16px 22px; overflow: auto; min-width: 0; }
.modal .row { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 2px solid rgba(27,35,64,.08); }
.modal .row:last-child { border-bottom: 0; }
.modal .row .big { font-size: 34px; width: 48px; text-align: center; }
.modal .row a { color: var(--ink); font-weight: 900; text-decoration: none; }
.modal .row a:hover { color: var(--sky-deep); }
.modal .row .meta { font-size: 12px; opacity: .65; }
.hourly { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; }
.hourly div { flex: 0 0 62px; text-align: center; background: white; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 2px; font-weight: 700; font-size: 12px; }
.hourly div span { display: block; font-size: 22px; }
.daily { display: grid; gap: 6px; }
.daily div { display: grid; grid-template-columns: 90px 40px 1fr auto; align-items: center; gap: 10px; background: white; border: 3px solid var(--ink); border-radius: 14px; padding: 6px 12px; font-weight: 700; }
.daily .bar { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--sky), var(--sun), var(--coral)); }

/* ---------- LEVEL SPLASH ---------- */
.splash {
  position: absolute; inset: 0; z-index: 900; background: var(--ink); color: var(--cream);
  display: grid; place-items: center; text-align: center; font-family: var(--font-display);
  animation: splashOut .6s ease-in 1.7s both; pointer-events: none;
}
.splash .world { font-size: 18px; letter-spacing: 6px; color: var(--sun); }
.splash .name { font-size: clamp(44px, 9vw, 96px); font-weight: 700; letter-spacing: 4px; text-shadow: 0 6px 0 var(--sky-deep); animation: pop .6s cubic-bezier(.34,1.56,.64,1) both .1s; }
.splash .sub { margin-top: 10px; font-size: 16px; opacity: .8; }
.splash .lives { margin-top: 26px; font-size: 26px; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

.toast {
  position: absolute; top: 90px; right: 18px; z-index: 800; background: var(--grass); color: var(--ink); border: 4px solid var(--ink);
  border-radius: 16px; padding: 10px 16px; font-weight: 900; box-shadow: var(--shadow); transform: translateY(-140px); transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.toast.show { transform: translateY(0); }

.mini, .modal .grip { display: none; }

/* language switch: segmented pill with sliding thumb */
.lang-switch {
  position: absolute; top: 22px; right: 18px; z-index: 520; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); isolation: isolate;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1);
}
.lang-switch:hover { transform: translateY(-2px); }
.lang-switch .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--sun);
  border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); z-index: -1; transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}
.lang-switch[data-lang="en"] .thumb { transform: translateX(100%); }
.lang-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 1px; color: var(--ink); opacity: .55; padding: 5px 12px 5px 10px; border-radius: 999px;
  transition: opacity .2s;
}
.lang-switch button.on { opacity: 1; }
.lang-switch button:hover { opacity: .85; }
.lang-switch .flag { display: inline-block; width: 22px; height: 15px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(27,35,64,.35); line-height: 0; }
.lang-switch .flag svg { width: 100%; height: 100%; display: block; }

/* ---------- MOBILE: native-feeling tab bar + bottom sheets ---------- */
@media (max-width: 720px), (max-height: 520px) {
  :root { --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Nunito", sans-serif; }
  .title-banner {
    top: calc(8px + env(safe-area-inset-top)); font-size: 17px; letter-spacing: 1.5px; padding: 6px 16px; gap: 8px;
    background: rgba(27,35,64,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid rgba(255,217,61,.45); border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.25); text-shadow: 0 1px 0 var(--sky-deep);
  }
  .title-banner small, .title-banner .mood { display: none; }
  .title-banner .coin { width: 12px; height: 12px; border-width: 2px; }
  .lang-switch { top: calc(9px + env(safe-area-inset-top)); right: 10px; border-width: 1px; border-color: rgba(27,35,64,.15); background: rgba(255,251,240,.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 4px 14px rgba(0,0,0,.2); padding: 3px; }
  .lang-switch:hover { transform: none; }
  .lang-switch .thumb { top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-width: 0; box-shadow: none; }
  .lang-switch button { font-size: 11px; padding: 5px 8px; gap: 4px; }
  .lang-switch .flag { width: 20px; height: 14px; }
  .leaflet-control-zoom { display: none; }
  .leaflet-control-attribution { font-size: 8px; opacity: .7; }

  /* tab bar */
  .sidebar {
    top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; right: 10px; width: auto;
    flex-direction: row; gap: 0; padding: 4px;
    background: rgba(255,251,240,.86); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(27,35,64,.14); border-radius: 22px; box-shadow: 0 6px 24px rgba(27,35,64,.22);
  }
  .sidebar .card { flex: 1; min-width: 0; background: transparent; border: 0; box-shadow: none; border-radius: 18px; padding: 6px 4px 5px; transform: none !important; animation: none !important; }
  .sidebar .card:active { background: rgba(27,35,64,.07); }
  .sidebar .card h3, .sidebar .weather-now, .sidebar .news-list, .sidebar .alert-list { display: none; }
  .sidebar .mini { display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; }
  .mini .mi { font-size: 22px; line-height: 1.1; }
  .mini .ml { font-size: 10px; font-weight: 700; letter-spacing: .3px; color: var(--ink-2); opacity: .75; }
  .mini .mv { font-size: 13px; font-weight: 800; color: var(--ink); line-height: 1; }
  .mini[data-badge]:not([data-badge=""])::after { content: ""; position: absolute; top: -2px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: #e53935; border: 2px solid #fff; }
  .mini[data-badge="danger"]::after { animation: alertPulse 1.2s ease-in-out infinite; }
  .card.alerts.danger .mini .mv { color: #c62828; }
  .card.alerts.warning .mini .mv { color: #b26a00; }

  /* POI dialog → bottom sheet */
  .dialog-wrap { bottom: calc(82px + env(safe-area-inset-bottom)); width: calc(100% - 20px); }
  .dialog {
    grid-template-columns: 48px 1fr; gap: 12px; padding: 16px 16px 14px; border-radius: 22px;
    background: rgba(27,35,64,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,247,220,.25); outline: 0; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  }
  .dialog .avatar { width: 48px; height: 48px; font-size: 26px; border-width: 3px; }
  .dialog .name { font-size: 18px; }
  .dialog .text { font-size: 14px; min-height: 0; }
  .dialog .tag { font-size: 10px; }
  .dialog .actions .btn { font-size: 13px; padding: 8px 14px; border-radius: 12px; box-shadow: none; border-width: 0; }
  .dialog .close { top: 8px; right: 8px; width: 32px; height: 32px; font-size: 15px; background: rgba(255,255,255,.15); color: var(--cream); border: 0; box-shadow: none; }

  /* modals → bottom sheets */
  .modal-backdrop { padding: 0; align-items: end; background: rgba(27,35,64,.45); }
  .modal {
    max-width: none; max-height: 88vh; border: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.3);
    padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .32s cubic-bezier(.2,.9,.3,1) both;
  }
  .modal .grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(27,35,64,.25); margin: 8px auto 0; }
  .modal header { padding: 8px 18px 12px; font-size: 19px; border-bottom: 1px solid rgba(27,35,64,.1); }
  .modal header .btn { width: 32px; height: 32px; font-size: 15px; border: 0; box-shadow: none; background: rgba(27,35,64,.08); }
  .modal .body { padding: 12px 16px 18px; }
  .modal .row { padding: 10px 0; border-color: rgba(27,35,64,.08); }
  .modal .row .big { font-size: 28px; width: 40px; }
  .hourly div, .daily div { border-width: 1px; border-color: rgba(27,35,64,.15); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .daily div { grid-template-columns: 62px 30px 1fr auto; font-size: 12px; padding: 7px 10px; }
  .hourly div { flex-basis: 56px; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  .splash .name { font-size: 46px; }
  .splash .lives { font-size: 18px; }
  .toast { top: calc(56px + env(safe-area-inset-top)); right: 10px; left: 10px; text-align: center; border-width: 0; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
  .poi-badge { width: 44px; height: 44px; font-size: 23px; margin-left: -22px; margin-top: -50px; border-width: 3px; box-shadow: 0 3px 0 var(--ink), 0 6px 14px rgba(0,0,0,.3); }
  .poi-badge .label { display: none; }
  .sidebar .route-list, .sidebar .danube { display: none; }
  .oldmap-ctl { left: 10px; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .oldmap-ctl .btn.round { width: 42px; height: 42px; font-size: 20px; border-width: 1px; background: rgba(255,251,240,.9); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
  .oldmap-panel { border-width: 1px; box-shadow: 0 6px 24px rgba(27,35,64,.22); }
  .dialog .photos img { height: 72px; width: 96px; }
}

/* ---------- ATMOSPHERE (season / sky / time) ---------- */
:root { --tile-filter: saturate(1.7) contrast(1.12); --tint: transparent; --cloud: #ffffff; --wind: 1; }
#map .leaflet-tile-pane .leaflet-tile { filter: var(--tile-filter); }
.atmo { position: absolute; inset: 0; pointer-events: none; z-index: 405; overflow: hidden; }
.atmo::before { content: ""; position: absolute; inset: 0; background: var(--tint); }

/* clouds — they carry the weather */
.clouds { position: absolute; inset: 0; overflow: hidden; }
.cloud { position: absolute; width: 180px; height: 60px; transform-origin: left; will-change: transform; animation: drift linear infinite; }
.cloud svg { width: 100%; height: 100%; overflow: visible; }
.cloud svg g { fill: var(--cloud); }
.cloud.heavy svg g { fill: #aeb8c8; }
.cloud.storm svg g { fill: #5d6678; animation: flash 14s linear infinite; animation-delay: var(--flash-delay, 0s); }
@keyframes drift { from { transform: translate3d(-260px,0,0); } to { transform: translate3d(calc(100vw + 260px),0,0); } }
@keyframes flash { 0%, 92%, 96%, 100% { fill: #5d6678; } 93%, 95% { fill: #fff; } }
.precip {
  position: absolute; left: 18%; top: 70%; width: 66%; height: 210px;
  -webkit-mask-image: linear-gradient(#000 0%, #000 45%, transparent 100%); mask-image: linear-gradient(#000 0%, #000 45%, transparent 100%);
}
.precip.rain {
  background: repeating-linear-gradient(100deg, transparent 0 9px, rgba(205,225,255,.75) 9px 10.5px, transparent 10.5px 16px);
  background-size: 100% 48px; animation: rainfall .35s linear infinite;
}
.cloud.storm .precip.rain { background-image: repeating-linear-gradient(100deg, transparent 0 7px, rgba(215,230,255,.85) 7px 8.5px, transparent 8.5px 12px); animation-duration: .25s; }
@keyframes rainfall { to { background-position: -8px 48px; } }
.precip.snow {
  background:
    radial-gradient(circle, #fff 1.6px, transparent 2.4px) 0 0 / 26px 26px,
    radial-gradient(circle, rgba(255,255,255,.8) 1.2px, transparent 2px) 13px 9px / 26px 26px;
  animation: snowfall 2.8s linear infinite;
}
@keyframes snowfall { to { background-position: 6px 52px, 19px 61px; } }

.sun {
  position: absolute; top: -120px; right: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,240,150,.7) 0%, rgba(255,220,100,.3) 30%, transparent 70%);
  animation: sunPulse 6s ease-in-out infinite;
}
.sun.low { top: auto; bottom: -160px; right: 10%; background: radial-gradient(circle, rgba(255,170,80,.7) 0%, rgba(255,120,60,.3) 35%, transparent 70%); }
@keyframes sunPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.stars { position: absolute; inset: 0; }
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .2; } 50% { opacity: 1; } }

/* seasons: gentle tile look only */
body[data-season="autumn"] { --tile-filter: saturate(1.45) contrast(1.12) sepia(.25); }
body[data-season="winter"] { --tile-filter: saturate(.7) contrast(1.05) brightness(1.12); }
body[data-sky="snow"], body[data-sky="frost"] { --tile-filter: saturate(.4) contrast(1.02) brightness(1.28); }
body[data-sky="fog"] .atmo::before { background: radial-gradient(ellipse at center, rgba(235,240,245,.15) 30%, rgba(235,240,245,.55) 100%); }

/* time of day: subtle */
body[data-time="night"] { --cloud: #8a93a8; }
body[data-time="night"] .atmo::before { background: rgba(10,18,60,.38); }
body[data-time="night"] .poi-badge { box-shadow: 0 5px 0 var(--ink), 0 0 18px rgba(255,217,61,.55); }
body[data-time="dusk"] .atmo::before, body[data-time="dawn"] .atmo::before { background: linear-gradient(rgba(255,120,60,.10), rgba(120,60,140,.12)); }

.mood { font-size: .38em; letter-spacing: 1px; color: var(--cream); opacity: .85; text-shadow: none; }

/* ---------- ROUTES / PHOTOS / DANUBE / OLD MAPS / PUSH ---------- */
.route-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.route-list li { font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.swatch { display: inline-block; width: 22px; height: 8px; border-radius: 4px; border: 1.5px solid rgba(27,35,64,.5); flex-shrink: 0; }
.route-row { cursor: pointer; gap: 12px; }
.route-row input { width: 22px; height: 22px; accent-color: var(--sky-deep); }
.route-row .rn { flex: 1; font-weight: 800; }
.dialog .photos { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.dialog .photos:empty { display: none; }
.dialog .photos img { height: 84px; width: 112px; object-fit: cover; border-radius: 12px; border: 3px solid var(--cream); cursor: zoom-in; flex-shrink: 0; transition: transform .15s; }
.dialog .photos img:hover { transform: scale(1.05); }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(10,14,30,.92); display: none; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 86vh; border-radius: 16px; border: 4px solid var(--cream); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox .close { position: absolute; top: 16px; right: 16px; }
.lightbox .prev, .lightbox .next { font-size: 26px; }
.poi-badge.bus { background: #ffe9a8; width: 40px; height: 40px; margin-left: -20px; margin-top: -46px; font-size: 20px; }
.danube { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: rgba(110,198,255,.25); border-radius: 10px; padding: 4px 8px; }
.oldmap-ctl { position: absolute; left: 18px; bottom: 18px; z-index: 520; display: flex; align-items: flex-end; gap: 10px; }
.oldmap-ctl .btn.round { width: 48px; height: 48px; font-size: 24px; }
.oldmap-panel { display: none; background: var(--cream); border: 4px solid var(--ink); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
.oldmap-ctl.open .oldmap-panel { display: grid; gap: 8px; }
.oldmap-panel select { font: inherit; font-weight: 700; border: 3px solid var(--ink); border-radius: 10px; padding: 4px 8px; background: white; }
.oldmap-panel label { display: flex; align-items: center; gap: 8px; }
.oldmap-panel input[type=range] { flex: 1; accent-color: var(--sun); }
.oldmap-img { image-rendering: auto; }
.push-box { margin-top: 14px; padding: 12px 14px; background: white; border: 3px solid var(--ink); border-radius: 16px; font-size: 14px; }

/* ---------- ALERTS ---------- */
.card.alerts { border-color: var(--ink); }
.card.alerts.warning { background: #fff1c2; border-color: #d98a00; }
.card.alerts.danger { background: #ffd9d9; border-color: #c62828; animation: alertPulse 1.6s ease-in-out infinite; }
@keyframes alertPulse { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 6px 0 rgba(0,0,0,.18), 0 0 0 8px rgba(198,40,40,.25); } }
.card.alerts.calm h3 { color: var(--grass-deep); }
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-list li { font-size: 13px; font-weight: 800; line-height: 1.25; display: flex; gap: 8px; }
.alert-list .ic { flex-shrink: 0; }
.modal .row.alert-danger { background: #ffe3e3; border-radius: 12px; padding: 10px; }
.modal .row.alert-warning { background: #fff5d6; border-radius: 12px; padding: 10px; }
