/* ---------------------------------------------------------------------
   MOTYW PORTALU — przeniesiony z lyrics-hub (backend/public/style.css),
   żeby oba projekty były jedną rodziną wizualną. Tu żyją: fonty (Sora +
   Space Grotesk, self-hosted), tokeny koloru, tło (rozmyta okładka + aura
   + grain) i prymitywy scen. Layouty konkretnych stron są w style.css.
   Zmienna --accent jest DYNAMICZNA — ustawia ją JS z próbki koloru okładki
   aktualnie granego utworu (accent.js), tak samo jak w lyrics-hub.
--------------------------------------------------------------------- */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/sora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/sora-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF;
}

:root {
  --stage: #0b0b0e;
  --paper: #f6f3ec;
  --ink-dim: rgb(246 243 236 / 34%);
  --ink-faint: rgb(246 243 236 / 15%);
  --ink-soft: rgb(246 243 236 / 62%);

  --accent-fallback: 109 123 209; /* r g b — spokojne indygo, świadomie nie bursztyn */
  --accent: var(--accent-fallback);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-line: 420ms;
  --dur-scene: 1100ms;

  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

/* Atrybut [hidden] musi wygrywać z regułami display (np. .screen{display:flex}),
   inaczej przełączanie sekcji przez JS (.hidden = true) nic nie chowa. */
[hidden] { display: none !important; }

body {
  background: var(--stage);
  color: var(--paper);
  font-family: 'Sora', ui-sans-serif, system-ui, sans-serif;
}

.mono {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
}

/* --------------------------------------------------------------------- Tło --------------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: -8%;
  z-index: -3;
  background-size: cover;
  background-position: center;
  /* brightness 0.28 jak w lyrics-hub: jasne okładki po blurze robiły mleczną
     mgłę za treścią — ciemniejsze tło = ostrzejszy tekst */
  filter: blur(60px) saturate(1.15) brightness(0.28);
  opacity: 0;
  transition: opacity var(--dur-scene) var(--ease-out);
  will-change: opacity;
}
.backdrop.is-visible { opacity: 1; }

.aura {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  /* plama przy dolnej krawędzi i ściszona (jak w lyrics-hub) — jasna mgła
     na środku ekranu odbierała treści ostrość */
  background: radial-gradient(
    ellipse 70% 40% at 50% 100%,
    rgb(var(--accent) / 24%),
    rgb(var(--accent) / 0%) 70%
  );
  mix-blend-mode: screen;
  animation: breathe 7s ease-in-out infinite;
  transition: background 900ms var(--ease-out);
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.06); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------- Wspólne prymitywy --------------------------------------------------------------------- */
.eyebrow {
  margin: 0;
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.card {
  background: rgb(246 243 236 / 4%);
  border: 1px solid rgb(246 243 236 / 8%);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

/* Przyciski akcji — akcent (dynamiczny kolor utworu) jako wypełnienie. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  text-decoration: none; /* .btn bywa też linkiem (Jam) */
  font-family: 'Sora', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--paper);
  background: rgb(246 243 236 / 8%);
  border: 1px solid rgb(246 243 236 / 14%);
  border-radius: 999px;
  padding: 0.85em 1.4em;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background 200ms, border-color 200ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgb(246 243 236 / 14%); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn--accent {
  background: rgb(var(--accent) / 88%);
  border-color: rgb(var(--accent) / 90%);
  color: #0b0b0e;
  font-weight: 700;
}
.btn--accent:hover { background: rgb(var(--accent) / 100%); }

.btn--ghost { background: transparent; }

/* Wjazd sekcji przy przełączaniu ekranów — czysty slide (transform, bez
   opacity/fade, jak sceny w lyrics-hub). Animacja odpala się od nowa przy
   każdym zdjęciu [hidden], bo element wraca wtedy do layoutu. */
.screen { animation: rise 560ms var(--ease-out) both; }
@keyframes rise {
  from { transform: translateY(26px); }
  to { transform: none; }
}

/* Pełnoekranowa nakładka (zawody) — push od dołu, wzorzec scen z lyrics-hub. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(11 11 14 / 82%);
  backdrop-filter: blur(24px);
  visibility: hidden;
  transform: translateY(102%);
  transition: transform var(--dur-scene) var(--ease-out), visibility 0s var(--dur-scene);
}
.overlay.is-active {
  visibility: visible;
  transform: none;
  transition: transform var(--dur-scene) var(--ease-out);
}
.overlay-inner {
  width: min(92vw, 34rem);
  max-height: 92dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  align-items: center;
}
.overlay-inner .guest-list { justify-content: center; }
.overlay-inner .rank { width: 100%; text-align: left; }

/* Odliczanie 3-2-1 */
.count-num {
  margin: 0;
  font-weight: 800;
  font-size: clamp(6rem, 30vh, 14rem);
  line-height: 1;
  color: rgb(var(--accent));
}

/* Wielki przycisk mety */
.go-btn {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: 0.02em;
  color: #0b0b0e;
  background: rgb(var(--accent));
  border: none;
  border-radius: 50%;
  width: min(72vw, 40vh, 22rem);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease-out);
  box-shadow: 0 30px 90px -20px rgb(var(--accent) / 60%);
}
.go-btn:active { transform: scale(0.94); }
.go-btn span { font-size: 1.4em; }

.my-time { margin: 0; font-size: 1.4rem; color: rgb(var(--accent)); }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .overlay { transition-duration: 120ms; }
}

@media (prefers-reduced-motion: reduce) {
  .aura { animation: none; opacity: 0.8; }
  .backdrop { transition-duration: 120ms; }
}
