/* ============================================================
   Szprociarze — BitterSweet Festival 2026
   Metafora: tablica odjazdow. Sceny to linie (znak literowy +
   kolor + pasek przy krawedzi), czasy sa monospace'owe i tabularne,
   odliczanie czyta sie jak "za 12 min".
   ============================================================ */

/* ── 1. Tokeny ─────────────────────────────────────────────── */
:root {
  /* Grunt: granatowy atrament, nie czern. Czysta czern na OLED
     przy jasnym tekscie smuzy podczas przewijania. */
  --ink-900: #0b1020;
  --ink-850: #0f152a;
  --ink-800: #131a30;
  --ink-750: #18203a;
  --ink-700: #1e2745;
  --line:    #2a3559;

  --paper:  #eef1f8;
  --muted:  #9aa7c7;
  --faint:  #6c7899;

  /* Linie scen. Kolor nigdy nie niesie informacji sam — zawsze
     towarzyszy mu znak literowy i pelna nazwa sceny. */
  --stage-bittersweet: #ffb020;
  --stage-enea:        #4cc9f0;
  --stage-next:        #f45d9e;
  --stage-pko:         #b69cff;

  --live: #4ade80;

  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;

  --tabbar-h: 58px;
  --topbar-h: 52px;

  --bg: var(--ink-900);
  --surface: var(--ink-800);
  --surface-raised: var(--ink-750);
}

/* Wariant jasny — dla kogos, kto otworzy to w slonecu w drodze na festiwal. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f4fa;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --ink-700: #dde3f0;
    --ink-750: #ffffff;
    --ink-850: #e8ecf6;
    --line: #ccd5e8;
    --paper: #131a30;
    --muted: #566180;
    --faint: #7c87a5;
    --stage-bittersweet: #a35c00;
    --stage-enea:        #0a6f92;
    --stage-next:        #b8175d;
    --stage-pko:         #5b3fc4;
    --live: #12813f;
  }
}

/* ── 2. Reset i baza ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* Elementy z display innym niz block (grid/flex) zignorowalyby atrybut hidden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--stage-enea);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: -9999px; top: var(--sp-2);
  background: var(--surface); color: var(--paper);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); z-index: 100;
}
.skip-link:focus { left: var(--sp-2); }

/* ── 3. Pasek gorny ────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  height: var(--topbar-h);
  padding: 0 var(--sp-4);
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }

.topbar__mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border-radius: var(--r-sm);
  background: var(--paper); color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}

.topbar__names { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar__names strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.topbar__sub {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}

.topbar__clock { display: flex; align-items: center; gap: var(--sp-2); flex: none; }

.topbar__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}

.clock {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── 4. Uklad widokow ──────────────────────────────────────── */
main { max-width: 720px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) var(--sp-6); }
.view[hidden] { display: none; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint);
  margin-bottom: var(--sp-3);
}
.eyebrow--spaced { margin-top: var(--sp-6); }

.stack { display: flex; flex-direction: column; gap: var(--sp-3); }

.note {
  font-size: 12.5px; color: var(--faint); line-height: 1.5;
  margin: var(--sp-3) 0;
}

.empty {
  border: 1px dashed var(--line); border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-4);
  text-align: center; color: var(--muted); font-size: 14px;
}
.empty strong { display: block; color: var(--paper); margin-bottom: var(--sp-1); font-size: 15px; }

/* ── 5. Znak linii (sceny) ─────────────────────────────────── */
.mark {
  display: grid; place-items: center;
  width: 24px; height: 24px; flex: none;
  border-radius: var(--r-sm);
  background: var(--stage);
  color: #0b1020;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
}

/* min-width:0 jest tu konieczne: element jest dzieckiem flexa, a domyslne
   min-width:auto nie pozwala mu zwezic sie ponizej szerokosci tekstu —
   dluga nazwa sceny wypycha wtedy sasiadow poza ekran zamiast dostac wielokropek. */
.stage-name {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--stage);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 6. Kafelek sceny w widoku TERAZ ───────────────────────── */
.stagecard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  padding-left: var(--sp-5);
  overflow: hidden;
}

/* Pasek linii przy krawedzi — element rozpoznawczy calego interfejsu. */
.stagecard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; background: var(--stage);
}

.stagecard__head {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.stagecard__live {
  margin-left: auto; flex: none;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--live);
  border: 1px solid color-mix(in srgb, var(--live) 45%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
}

.stagecard__act {
  font-size: 25px; font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.1;
  overflow-wrap: break-word;
}
.stagecard__act a { color: inherit; text-decoration: none; }
.stagecard__act a:hover { text-decoration: underline; text-underline-offset: 3px; }

.stagecard__meta {
  display: flex; align-items: baseline; gap: var(--sp-2);
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--muted);
}
.stagecard__meta b { color: var(--paper); font-weight: 600; }

.stagecard__idle {
  font-size: 15px; font-weight: 600; color: var(--muted);
}

.stagecard__next {
  display: flex; align-items: baseline; gap: var(--sp-2);
  margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.stagecard__next-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); flex: none;
}
.stagecard__next-act {
  color: var(--paper); font-weight: 600;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stagecard__next-time {
  margin-left: auto; flex: none;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── 7. Tablica odjazdow (ZARAZ / lista) ───────────────────── */
.board {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

.row {
  display: grid;
  grid-template-columns: 52px 24px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--stage, transparent);
  background: none;
  width: 100%;
  text-align: left;
}
.row:last-child { border-bottom: 0; }
.row--plain { grid-template-columns: 52px 24px 1fr; }

.row__time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600;
  color: var(--paper);
}

.row__body { min-width: 0; }

.row__act {
  display: block;
  font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.row__stage {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.row__count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px; color: var(--muted);
  text-align: right; flex: none;
}
.row__count--soon { color: var(--live); font-weight: 600; }

.row--live .row__time { color: var(--live); }

/* ── 8. Program: dni, filtr, lista ─────────────────────────── */
.daybar {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 15;
  display: flex; align-items: center; gap: var(--sp-2);
  margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.daybar__tabs { display: flex; gap: var(--sp-2); flex: 1; min-width: 0; }

.daytab {
  flex: 1;
  padding: var(--sp-2) var(--sp-1);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
}
.daytab[aria-selected="true"] {
  background: var(--paper); color: var(--bg); border-color: var(--paper);
}

.daybar__filter {
  flex: none;
  min-height: 38px; padding: 0 var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  cursor: pointer;
}
.daybar__filter[aria-expanded="true"] { color: var(--paper); border-color: var(--paper); }

.filter {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-3); margin-bottom: var(--sp-4);
  background: var(--surface);
}
.filter__hint { font-size: 12px; color: var(--faint); margin-bottom: var(--sp-3); }
.filter__list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 36px; padding: 0 var(--sp-3);
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 13px; cursor: pointer;
}
.chip[aria-pressed="true"] {
  color: var(--paper);
  border-color: var(--stage);
  background: color-mix(in srgb, var(--stage) 14%, transparent);
}
.chip__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--stage); flex: none; }

.hourgroup { margin-bottom: var(--sp-5); }
.hourgroup__label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--faint);
  padding-bottom: var(--sp-2); margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}

/* Karta koncertu w programie i na mojej liscie */
.act {
  display: grid;
  grid-template-columns: 54px 1fr 44px;
  align-items: start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--stage);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
}
.act--live { border-color: color-mix(in srgb, var(--live) 55%, var(--line)); border-left-color: var(--stage); }
.act--past { opacity: 0.5; }

.act__time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600; padding-top: 1px;
}
.act--live .act__time { color: var(--live); }

.act__body { min-width: 0; }
.act__name { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: break-word; }
.act__name a { color: inherit; text-decoration: none; }
.act__name a:hover { text-decoration: underline; text-underline-offset: 3px; }

.act__sub {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-top: 3px;
}

.act__badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }

.badge {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid currentColor;
}
.badge--live { color: var(--live); }
.badge--clash { color: var(--stage-bittersweet); }

.star {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  color: var(--faint); font-size: 19px; line-height: 1;
  border-radius: var(--r-sm);
  transition: transform 0.12s ease, color 0.12s ease;
}
.star[aria-pressed="true"] { color: var(--stage-bittersweet); }
.star:active { transform: scale(0.88); }

/* ── 9. Os czasu ───────────────────────────────────────────── */
.timeline {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 calc(var(--sp-4) * -1);
  padding: 0 var(--sp-4) var(--sp-4);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.tl { position: relative; }

.tl__ruler {
  position: relative; height: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-2);
}
.tl__tick {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px solid var(--line);
  padding-left: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--faint);
  white-space: nowrap;
}

.tl__lane {
  position: relative;
  height: 74px;
  margin-bottom: var(--sp-2);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--stage) 7%, transparent);
}

/* Etykieta jedzie z przewijaniem po pustym pasku nad blokami. Gdyby siedziala
   na tej samej wysokosci co bloki, zaslanialaby godziny startu. */
.tl__lane-label {
  position: sticky; left: 0; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px 0 3px;
  background: var(--bg);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--stage);
}
.tl__lane-label .mark { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }

.tl__block {
  position: absolute; top: 28px; bottom: 5px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--stage) 55%, transparent);
  background: color-mix(in srgb, var(--stage) 20%, var(--surface));
  padding: 3px 6px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  display: block;
}
.tl__block:hover { background: color-mix(in srgb, var(--stage) 32%, var(--surface)); }
.tl__block[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--stage-bittersweet); }

.tl__block-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px; color: color-mix(in srgb, var(--paper) 75%, transparent);
  display: block;
}
.tl__block-name {
  font-size: 12px; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}

.tl__now {
  position: absolute; top: 0; bottom: 0; z-index: 2;
  width: 2px; background: var(--live);
  pointer-events: none;
}
.tl__now::before {
  content: "TERAZ";
  position: absolute; top: -2px; left: 4px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--bg); background: var(--live);
  padding: 1px 4px; border-radius: 3px;
}

/* ── 10. Baner fazy festiwalu ──────────────────────────────── */
.banner {
  border: 1px solid var(--line);
  border-left: 4px solid var(--stage-bittersweet);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.banner__label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); margin-bottom: var(--sp-2);
}
.banner__big {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.05;
}
.banner__sub { margin-top: var(--sp-2); font-size: 13.5px; color: var(--muted); }

/* ── 11. Moje: akcje ───────────────────────────────────────── */
.myactions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-5); }

.btn {
  min-height: 44px; padding: 0 var(--sp-4);
  border: 1px solid var(--paper); border-radius: var(--r-sm);
  background: var(--paper); color: var(--bg);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--line); }

/* ── 12. Pasek zakladek ────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: 0; background: none; cursor: pointer;
  color: var(--faint);
}
.tab__icon { font-size: 15px; line-height: 1; }
.tab__label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
}
.tab[aria-current="page"] { color: var(--paper); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%;
  height: 2px; background: var(--paper); border-radius: 0 0 2px 2px;
}

.tab__count {
  position: absolute; top: 6px; right: 50%; translate: 20px 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--stage-bittersweet); color: #0b1020;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
}

/* ── 13. Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; translate: -50% 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 40;
  background: var(--paper); color: var(--bg);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
}

/* ── 14. Wieksze ekrany ────────────────────────────────────── */
@media (min-width: 560px) {
  .stagecard__act { font-size: 29px; }
  .banner__big { font-size: 38px; }
}

@media (min-width: 720px) {
  .tabbar {
    max-width: 720px; margin: 0 auto;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  }
  #now-stages { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
}

/* ── 15. Ograniczenie ruchu ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
