/* Petla Dodekanezu — pamiatka. Ciemne szklo nad satelita, akcenty w blekitach flagi Grecji. */

:root {
  --ink: #f6efe6;
  --ink-soft: rgba(246, 239, 230, 0.72);
  --ink-faint: rgba(246, 239, 230, 0.48);
  --night: #081423;
  --night-2: #0d2036;
  --glass: rgba(8, 20, 35, 0.58);
  --glass-strong: rgba(8, 20, 35, 0.86);
  --glass-line: rgba(255, 255, 255, 0.12);
  /* blekit flagi Grecji (wypelnienia z bialym tekstem), jasniejszy do gradientow, blekit nieba do akcentow na ciemnym tle */
  --hellas: #0d5eaf;
  --hellas-2: #2a78d0;
  --hellas-sky: #9fd3ff;
  --on-hellas: #ffffff;
  --aegean: #5ec8e8;
  --danger: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --player-h: 76px;
  --peek-h: 84px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--ink);
  font: 500 15px/1.45 var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--hellas-sky); outline-offset: 2px; }

.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; }
.display em { font-style: italic; color: var(--hellas-sky); }

#map { position: fixed; inset: 0; }
body.gate-open .credits { display: none; }
.credits {
  position: fixed; z-index: 9; left: 10px; bottom: calc(var(--peek-h) + var(--player-h) + var(--safe-bottom) + 22px);
  font-size: 11px; color: var(--ink-faint);
}
.credits summary {
  list-style: none; cursor: pointer; width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center;
  background: rgba(8, 20, 35, 0.45); font-size: 12px; line-height: 1; opacity: 0.7;
}
.credits summary::-webkit-details-marker { display: none; }
.credits[open] summary { opacity: 1; }
.credits p {
  position: absolute; left: 0; bottom: 28px; width: min(300px, calc(100vw - 32px)); margin: 0; padding: 10px 12px;
  border-radius: 12px; background: var(--glass-strong); color: var(--ink-soft); line-height: 1.5;
}
body.is-playing .credits:not([open]) { opacity: 0.4; }

.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(4, 10, 20, 0.55) 100%),
    linear-gradient(to bottom, rgba(4, 10, 20, 0.55), transparent 22%, transparent 70%, rgba(4, 10, 20, 0.6));
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
}

/* --- przyciski i pola --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 700; letter-spacing: 0.01em;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--hellas), var(--hellas-2)); color: var(--on-hellas); }
a.btn { color: inherit; text-decoration: none; }
.btn-ghost { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-line); min-height: 40px; padding: 0 16px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08);
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.field { display: grid; gap: 6px; }
.field span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); }
.field input {
  min-height: 50px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.07); font-size: 17px;
}
.field input:focus { border-color: var(--hellas-sky); outline: none; }
.form-error { color: var(--danger); margin: 0; font-size: 14px; }

/* --- bramka z kodem --- */
.gate {
  position: fixed; inset: 0; display: grid; place-items: end center; z-index: 30;
  padding: calc(var(--safe-top) + 24px) var(--gutter) calc(var(--safe-bottom) + max(28px, 7vh));
  background: linear-gradient(to top, rgba(4, 10, 20, 0.92) 0%, rgba(4, 10, 20, 0.35) 55%, transparent 100%);
}
.gate-card { width: min(440px, 100%); text-align: center; animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; }
.gate-card .gate-lead { margin-left: auto; margin-right: auto; }
.gate-card .field { text-align: left; }
.eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--hellas-sky); }
.gate h1 { font-size: clamp(54px, 15vw, 88px); line-height: 0.92; margin: 0 0 14px; }
.gate-lead { margin: 0 0 26px; color: var(--ink-soft); font-size: 17px; max-width: 32ch; }
.gate-form { display: grid; gap: 14px; }

/* --- gorny pasek --- */
.topbar {
  position: fixed; z-index: 10; top: calc(var(--safe-top) + 10px); left: var(--gutter); right: var(--gutter);
  animation: drop 0.8s 0.2s cubic-bezier(.2, .8, .2, 1) both;
}
.topbar-inner { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--radius); }
.brand { display: grid; min-width: 0; }
.brand-title { font-size: 24px; line-height: 1; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.stats { display: flex; gap: 14px; margin: 0 0 0 auto; }
.stats div { display: grid; text-align: right; }
.stats dt { order: 2; font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.1em; }
/* skrot mil morskich pisze sie „Mm” — bez wersalikow */
.stats div:first-child dt { text-transform: none; letter-spacing: 0.04em; }
.stats dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .stats div:nth-child(n+3) { display: none; } }

/* --- odtwarzacz --- */
.player {
  position: fixed; z-index: 12; left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--peek-h) + var(--safe-bottom) + 10px);
  display: flex; align-items: center; gap: 12px; padding: 10px 22px 10px 10px; border-radius: 999px;
  transition: bottom 0.35s cubic-bezier(.2, .8, .2, 1), opacity 0.3s;
}
.sheet[data-snap='half'] ~ .player, .sheet[data-snap='full'] ~ .player { opacity: 0; pointer-events: none; }
.play-btn {
  flex: none; width: 52px; height: 52px; border-radius: 999px; border: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--hellas), var(--hellas-2)); color: var(--on-hellas);
  box-shadow: 0 0 0 0 rgba(42, 120, 208, 0.6);
}
.play-btn.attention { animation: pulse 2s infinite; }
.play-btn svg { width: 24px; height: 24px; fill: currentColor; }
.play-btn .i-pause, .playing .play-btn .i-play { display: none; }
.playing .play-btn .i-pause { display: block; }
.scrub { flex: 1; min-width: 0; display: grid; gap: 4px; }
.readout { display: flex; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; }
.readout #readout-day { color: var(--ink); font-weight: 700; text-transform: capitalize; }
.readout .nm { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--hellas-sky); font-weight: 700; }
.scrub-track { --thumb: 30px; position: relative; height: 26px; }
/* pasek i katamaran mieszcza sie w torze: srodek lodki jedzie od pol jej szerokosci do pol szerokosci od konca */
.scrub-ticks { position: absolute; inset: 11px calc(var(--thumb) / 2) auto; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); }
.scrub-ticks i { position: absolute; top: -4px; width: 1px; height: 12px; background: rgba(255, 255, 255, 0.35); }
.scrub-ticks b {
  position: absolute; top: 0; left: 0; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--hellas-2), var(--hellas-sky)); width: calc(var(--p, 0) * 100%);
}
#scrub { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scrub-thumb {
  position: absolute; top: 0; width: var(--thumb); height: 26px; pointer-events: none;
  left: calc((100% - var(--thumb)) * var(--p, 0)); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.scrub-thumb svg { display: block; width: 100%; height: 100%; }

/* --- polaroidy w trakcie odtwarzania --- */
.toasts {
  position: fixed; z-index: 11; left: 0; right: 0; pointer-events: none;
  bottom: calc(var(--peek-h) + var(--player-h) + var(--safe-bottom) + 22px);
  display: flex; justify-content: center; min-height: 0;
}
.polaroid {
  position: absolute; bottom: 0; width: 150px; padding: 8px 8px 26px; background: #fbf7f0; border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); color: #2b2620; pointer-events: auto;
  animation: polaroid-in 0.55s cubic-bezier(.2, 1.3, .3, 1) both;
}
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: #ddd; }
.polaroid figcaption { position: absolute; left: 10px; right: 10px; bottom: 6px; font: italic 15px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.polaroid .more { position: absolute; top: -10px; right: -10px; background: var(--hellas); color: var(--on-hellas); font: 700 12px var(--font-ui); border-radius: 99px; padding: 4px 8px; }
.polaroid.out { animation: polaroid-out 0.4s ease-in both; }
.stop-label {
  position: fixed; z-index: 11; top: calc(var(--safe-top) + 92px); left: 50%; transform: translateX(-50%);
  padding: 8px 18px; border-radius: 999px; font: italic 22px var(--font-display); white-space: nowrap;
  animation: fade-in-out 2.2s ease both; pointer-events: none;
}

/* --- arkusz galerii --- */
.sheet {
  position: fixed; z-index: 14; left: 0; right: 0; bottom: 0; height: calc(92dvh - var(--safe-top));
  display: flex; flex-direction: column;
  background: linear-gradient(to bottom, rgba(10, 24, 41, 0.9), rgba(8, 20, 35, 0.97));
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  border-top: 1px solid var(--glass-line); border-radius: 26px 26px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.4);
  transform: translateY(calc(100% - var(--peek-h) - var(--safe-bottom)));
  transition: transform 0.42s cubic-bezier(.2, .9, .2, 1);
  touch-action: none;
}
.sheet[data-snap='half'] { transform: translateY(45%); }
.sheet[data-snap='full'] { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grip { padding: 10px 0 4px; display: grid; place-items: center; cursor: grab; }
.sheet-grip span { width: 42px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.28); }
.tabs { display: flex; gap: 6px; padding: 4px var(--gutter) 10px; }
.tabs button {
  border: 0; background: none; padding: 8px 14px; border-radius: 999px; color: var(--ink-faint); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs button[aria-selected='true'] { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  padding: 0 var(--gutter) calc(var(--safe-bottom) + 120px);
}
.sheet-section-title { margin: 18px 0 10px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

/* karty wysp */
.island-card {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  border: 0; padding: 0; text-align: left; background: var(--night-2);
}
.island-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.island-card:hover img { transform: scale(1.05); }
.island-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 10, 20, 0.85), transparent 60%); }
.island-card .label { position: absolute; z-index: 1; left: 10px; bottom: 8px; right: 10px; }
.island-card .name { display: block; font: 24px/1 var(--font-display); }
.island-card .meta { font-size: 11px; color: var(--ink-soft); }
.island-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.island-list .island-card { height: 120px; }

.back-btn { border: 0; background: none; color: var(--ink-soft); padding: 6px 0; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.island-head h2 { font-size: 44px; line-height: 1; margin: 4px 0 2px; }
.island-head p { margin: 0 0 6px; color: var(--ink-soft); font-size: 13px; }
.spot { margin-top: 18px; }
.spot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.spot-head button { border: 0; background: none; padding: 0; text-align: left; font: 22px var(--font-display); }
.spot-head span { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: var(--radius-sm); overflow: hidden; }
.grid button { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: var(--night-2); overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.4s; }
.grid img.loaded { opacity: 1; }
.grid .who { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(4, 10, 20, 0.6); padding: 1px 6px; border-radius: 99px; }

.day-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--glass-line); }
.day-row header { display: flex; justify-content: space-between; align-items: baseline; }
.day-row h3 { margin: 0; font: 26px var(--font-display); text-transform: capitalize; }
.day-row header span { font-size: 12px; color: var(--ink-faint); }
.strip { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip img { flex: none; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.day-row .btn { justify-self: start; }

.empty { color: var(--ink-faint); padding: 18px 0; }

/* --- pinezki na mapie --- */
.pin {
  --size: 46px;
  width: var(--size); height: var(--size); border-radius: 50%; padding: 0; border: 2.5px solid #fff; overflow: visible;
  background: var(--night-2) center / cover no-repeat; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); cursor: pointer;
  transition: border-color 0.2s ease;
}
/* MapLibre ustawia markerom position:absolute i transform — nie nadpisujemy ich */
.pin:hover { border-color: var(--hellas-sky); }
.pin.island { --size: 52px; border-width: 3px; }
.pin.photo { --size: 38px; }
.pin .count {
  position: absolute; right: -6px; top: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--hellas); color: var(--on-hellas); font: 700 11px/22px var(--font-ui); text-align: center;
}
.pin .name {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: italic 18px var(--font-display); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}
.pin.lit { animation: lit 0.9s ease; }
.night-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(159, 211, 255, 0.3), 0 0 18px var(--hellas-2); }
.waypoint-dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; background: var(--aegean); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); padding: 0; }
.boat { width: 44px; height: 44px; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.boat svg { width: 100%; height: 100%; }

/* --- FAB --- */
.fab {
  position: fixed; z-index: 13; right: var(--gutter); bottom: calc(var(--peek-h) + var(--player-h) + var(--safe-bottom) + 22px);
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px; border: 0;
  background: #fff; color: var(--night); font-weight: 800; box-shadow: var(--shadow);
  transition: opacity 0.3s, transform 0.3s;
}
.fab svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.sheet[data-snap='half'] ~ .fab, .sheet[data-snap='full'] ~ .fab { opacity: 0; pointer-events: none; transform: translateY(20px); }
body.is-playing .fab, body.upload-pill-on .fab { opacity: 0; pointer-events: none; }

.maplibregl-popup-content { background: var(--glass-strong); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); }
.maplibregl-popup-tip { border-top-color: var(--glass-strong) !important; border-bottom-color: var(--glass-strong) !important; }
.maplibregl-popup-close-button { color: var(--ink); font-size: 20px; padding: 4px 8px; }

/* --- dialog uploadu --- */
.dialog { border: 0; padding: 0; background: none; color: var(--ink); width: min(560px, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto auto 0; }
.dialog::backdrop { background: rgba(4, 10, 20, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-inner {
  display: grid; gap: 16px; padding: 20px var(--gutter) calc(var(--safe-bottom) + 20px); max-height: 92dvh; overflow-y: auto;
  background: var(--night-2); border-radius: 26px 26px 0 0; border: 1px solid var(--glass-line);
}
@media (min-width: 600px) { .dialog { margin: auto; } .dialog-inner { border-radius: 26px; } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 34px; }
.dropzone {
  display: grid; gap: 6px; padding: 22px; border-radius: var(--radius); text-align: center; cursor: pointer;
  border: 1.5px dashed rgba(159, 211, 255, 0.6); background: rgba(13, 94, 175, 0.14);
}
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { font-size: 17px; }
.dropzone span { font-size: 13px; color: var(--ink-soft); }
.dropzone.over { background: rgba(13, 94, 175, 0.28); }
.hint { font-size: 13px; color: var(--ink-soft); }
.hint summary { cursor: pointer; color: var(--aegean); }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upload-list li { display: grid; gap: 3px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
/* nazwa i stan w osobnych wierszach — dlugi komunikat bledu nie wypycha nazwy pliku */
.upload-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-list .state { color: var(--ink-soft); }
.upload-list .ok .state { color: #7be0a4; }
.upload-list .err .state { color: var(--danger); }
.upload-list .skip .state { color: var(--hellas-sky); }
.progress { display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--p, 0%); background: var(--hellas-2); transition: width 0.3s; }
.upload-list .ok .progress i { background: #7be0a4; }
.upload-list .err .progress i { background: var(--danger); }
.upload-status { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--glass-line); }
.upload-status strong { font-size: 17px; }
.upload-status p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.upload-status[data-tone='ok'] { border-color: rgba(123, 224, 164, 0.5); background: rgba(123, 224, 164, 0.1); }
.upload-status[data-tone='partial'] { border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.08); }
.upload-status .progress.total { height: 6px; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.upload-actions .btn { min-height: 44px; }

/* pigulka wysylki w tle, nad odtwarzaczem */
.upload-pill {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--peek-h) + var(--player-h) + var(--safe-bottom) + 22px);
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--ink); font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.upload-pill[data-phase='finished'] .spinner { display: none; }
.upload-pill[data-phase='finished'][data-failed='false'] { background: #1f5a3c; }
.upload-pill[data-failed='true'] { background: #5a1f24; }
@media (min-width: 960px) {
  .upload-pill { left: calc(50% + 216px); bottom: 104px; }
  body.upload-pill-on .sheet[data-snap] ~ .fab { opacity: 0; pointer-events: none; }
}

/* --- lightbox --- */
.lightbox { position: fixed; inset: 0; height: 100dvh; z-index: 40; background: #000; touch-action: none; animation: fade 0.25s ease both; }
.lb-stage { position: absolute; inset: 0; display: flex; will-change: transform; }
/* zdjecie zawsze w calosci miedzy gornym a dolnym paskiem, niezaleznie od proporcji i paska Safari */
.lb-slide {
  flex: none; width: 100vw; height: 100%; box-sizing: border-box; overflow: hidden;
  padding: calc(var(--safe-top) + 56px) 8px calc(var(--safe-bottom) + 132px);
}
.lb-slide img, .lb-slide video {
  display: block; width: 100%; height: 100%; object-fit: contain;
  background: center / contain no-repeat; user-select: none; -webkit-user-drag: none;
}
.lb-slide video { background: #000; }
@media (orientation: landscape) and (max-height: 500px) {
  .lb-slide { padding: 8px 64px; }
  .lb-top, .lb-bottom { background: none; }
}
.lb-top, .lb-bottom {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter);
}
.lb-top { top: 0; padding-top: calc(var(--safe-top) + 12px); justify-content: space-between; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent); font-size: 13px; color: var(--ink-soft); }
.lb-bottom { bottom: 0; padding-bottom: calc(var(--safe-bottom) + 16px); justify-content: space-between; background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); flex-wrap: wrap; }
.lb-meta { display: grid; min-width: 0; }
.lb-meta strong { font: 26px var(--font-display); font-weight: 400; }
.lb-meta span { font-size: 13px; color: var(--ink-soft); }
.lb-actions { display: flex; gap: 10px; }
.lb-icon { width: 46px; height: 46px; background: rgba(255, 255, 255, 0.14); border: 1px solid var(--glass-line); color: var(--ink); }
.lb-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-icon:active { transform: scale(0.94); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; border: 0; background: rgba(255, 255, 255, 0.08); font-size: 36px; color: #fff; display: none; }
.lb-prev { left: 12px; border-radius: 0 12px 12px 0; }
.lb-next { right: 12px; border-radius: 12px 0 0 12px; }
@media (hover: hover) { .lb-nav { display: block; } }

/* --- ladowanie --- */
.loading { position: fixed; z-index: 35; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-radius: 999px; background: var(--glass-strong); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--hellas-sky); animation: spin 0.8s linear infinite; }

/* --- desktop: arkusz jako panel z lewej --- */
@media (min-width: 960px) {
  :root { --peek-h: 0px; }
  .sheet, .sheet[data-snap] {
    top: calc(var(--safe-top) + 84px); bottom: 16px; left: 16px; right: auto; width: 400px; height: auto;
    border-radius: 24px; border: 1px solid var(--glass-line); transform: none;
  }
  .sheet-grip { display: none; }
  .sheet-body { padding-bottom: 24px; }
  .player, .sheet[data-snap] ~ .player { left: 432px; right: 16px; bottom: 16px; opacity: 1; pointer-events: auto; max-width: 820px; margin: 0 auto; }
  .fab, .sheet[data-snap] ~ .fab { bottom: 104px; opacity: 1; pointer-events: auto; transform: none; }
  .toasts { left: 432px; bottom: 120px; }
  /* pasek tej samej szerokosci co panel galerii pod nim — mapa po prawej zostaje odslonieta */
  .topbar { left: 16px; right: auto; width: 400px; }
  .credits { left: auto; right: 16px; top: calc(var(--safe-top) + 88px); bottom: auto; }
  .credits p { left: auto; right: 0; bottom: auto; top: 28px; }
}

@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(42, 120, 208, 0.7); } 70% { box-shadow: 0 0 0 16px rgba(42, 120, 208, 0); } 100% { box-shadow: 0 0 0 0 rgba(42, 120, 208, 0); } }
@keyframes polaroid-in { from { opacity: 0; transform: translateY(40px) rotate(var(--rot, 0deg)) scale(0.8); } to { opacity: 1; transform: rotate(var(--rot, 0deg)); } }
@keyframes polaroid-out { to { opacity: 0; transform: translateY(-30px) rotate(var(--rot, 0deg)) scale(0.9); } }
@keyframes fade-in-out { 0% { opacity: 0; transform: translate(-50%, 8px); } 15%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
@keyframes lit { 0% { box-shadow: 0 0 0 0 rgba(159, 211, 255, 0.9); } 100% { box-shadow: 0 0 0 22px rgba(159, 211, 255, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.strip-btn { position: relative; padding: 0; border: 0; background: none; flex: none; }
.video-badge {
  position: absolute; right: 4px; top: 4px; padding: 1px 6px; border-radius: 99px; pointer-events: none;
  background: rgba(4, 10, 20, 0.7); color: #fff; font: 700 11px/18px var(--font-ui); font-variant-numeric: tabular-nums;
}
.loading { white-space: nowrap; }
.boat3d { width: 104px; height: 104px; pointer-events: none; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.45)); }

/* --- przyciski mapy --- */
.map-controls {
  position: fixed; z-index: 10; right: var(--gutter); top: calc(var(--safe-top) + 84px);
  display: grid; gap: 10px;
}
.map-ctl {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--glass-line); display: grid; place-items: center;
  background: var(--glass-strong); color: var(--ink); font: 800 13px var(--font-ui); letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.map-ctl:active { transform: scale(0.94); }
.map-ctl svg { width: 22px; height: 22px; }
#ctl-center svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#ctl-compass svg { transition: transform 0.15s linear; }
#ctl-compass .needle-n { fill: var(--hellas-sky); }
#ctl-compass .needle-s { fill: var(--ink-soft); }
body.is-playing .map-controls { opacity: 0.5; }
@media (min-width: 960px) { .map-controls { top: calc(var(--safe-top) + 120px); } }

/* --- filtr autorow --- */
/* margines boczny daje juz .sheet-body — filtr licuje z zakladkami Wyspy/Dni */
.author-filter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.author-filter::-webkit-scrollbar { display: none; }
.author-filter button {
  flex: none; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.06); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.author-filter button[aria-pressed='true'] { background: var(--hellas); border-color: var(--hellas); color: var(--on-hellas); }
.author-filter button span { opacity: 0.7; font-weight: 600; margin-left: 4px; }
