/* Wspólne style wszystkich stron. Wymaga tokens.css. */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { background: var(--bg-deep); }

body {
  min-height: 100vh;
  background: var(--gradient-page);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--font-base);
  font-weight: var(--fw-regular);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, input, select, textarea { font: inherit; }

::selection { background: rgb(240 180 68 / 0.4); }

/* --- Nagłówek z logo --- */
.site-header {
  position: relative;
  padding: 14px 40px;
  background: var(--gradient-header);
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
}
.site-header--left { text-align: left; }
.site-header a { text-decoration: none; }

/* Logo „Quizzy Quiz”: assets/logo-tv.png (z telewizorkiem, tam gdzie nie ma Quizzy) i assets/logo-napis.png (sam napis, obok Quizzy); źródła: nowe_logo2*.png */
.logo {
  display: inline-block;
  margin: 0;
  line-height: 0;
}
.logo__img {
  display: block;
  width: auto;
  height: 76px;
  filter: drop-shadow(0 4px 14px rgb(0 0 0 / 0.35));
}
.site-header:not(.site-header--left) .logo { margin: 0 auto; }

/* --- Przyciski --- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--white);
  font-weight: var(--fw-bold);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
html.mouse .btn:hover:not(:disabled) {
  /* Tylko kolor tła: skrót `background` kasował gradient złotych i zielonych przycisków, a ich napis jest ciemny. */
  background-color: var(--surface-strong);
  filter: brightness(1.08);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn:disabled { color: rgb(255 255 255 / 0.35); border-color: var(--border-soft); background: transparent; cursor: not-allowed; }
.btn--green { background: var(--gradient-green); border-color: transparent; color: var(--ink); }
.btn--red { background: var(--gradient-red); border-color: transparent; }

/* --- Stopka --- */
.site-footer {
  max-width: 1000px;
  margin: 24px auto 0;
  border-top: 1px solid var(--border-soft);
  padding: 22px var(--gap);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* --- Wspólne animacje --- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes glow-ring {
  0% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0.45); }
  100% { box-shadow: 0 0 0 26px rgb(255 255 255 / 0); }
}
@keyframes shine {
  from { transform: translateX(-120%) skewX(-18deg); }
  to { transform: translateX(260%) skewX(-18deg); }
}
@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-9px); opacity: 1; }
}

/* Kropki „czekaj” */
.dots { display: inline-flex; gap: 8px; }
.dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot-bounce 1.2s infinite ease-in-out;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.dots[hidden] { display: none; }
.site-header:not(.site-header--left) .logo__img { height: 112px; }

/* --- Animowane tło (wszystkie strony): dryfujące plamy w kolorach logo + przesuwające się „?” --- */
body { position: relative; z-index: 0; }
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
}
body::before {
  inset: -25%;
  background:
    radial-gradient(28% 32% at 20% 25%, rgb(22 130 203 / 0.55), transparent 70%),
    radial-gradient(24% 28% at 80% 20%, rgb(240 180 68 / 0.30), transparent 70%),
    radial-gradient(30% 30% at 70% 80%, rgb(104 226 247 / 0.28), transparent 70%),
    radial-gradient(26% 30% at 25% 85%, rgb(142 68 217 / 0.30), transparent 70%);
  filter: blur(30px);
  animation: bg-drift 26s ease-in-out infinite alternate;
}
body::after {
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Ctext x='18' y='62' font-family='Arial' font-weight='900' font-size='54' fill='white' transform='rotate(-12 40 50)'%3E%3F%3C/text%3E%3Ctext x='98' y='142' font-family='Arial' font-weight='900' font-size='38' fill='white' transform='rotate(14 110 130)'%3E%3F%3C/text%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: bg-pattern 40s linear infinite;
}
@keyframes bg-drift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(6%, -4%) rotate(8deg) scale(1.08); }
  100% { transform: translate(-5%, 5%) rotate(-6deg) scale(1.03); }
}
@keyframes bg-pattern {
  from { background-position: 0 0; }
  to { background-position: 320px -160px; }
}

/* --- Tło ekranów: ilustracje assets/bg-<n>.jpg (bez rozmycia) + przyciemnienie i fioletowe światła.
       Które tło — atrybut data-bg na <body>: 1 start, 2 lobby, 3–5 gra (zmienia się co rundę), 6 wyniki. --- */
body { background: var(--bg-deep); }
body::before {
  inset: 0; filter: none; animation: none;
  background: url("../assets/bg-1.jpg") center / cover no-repeat, var(--bg-deep);
  transition: background-image 0.8s ease;
}
body[data-bg="2"]::before { background-image: url("../assets/bg-2.jpg"); }
body[data-bg="3"]::before { background-image: url("../assets/bg-3.jpg"); }
body[data-bg="5"]::before { background-image: url("../assets/bg-5.jpg"); }
body[data-bg="6"]::before { background-image: url("../assets/bg-6.jpg"); }
body::after {
  inset: 0; opacity: 1; animation: none; background-size: auto;
  background:
    radial-gradient(60% 50% at 12% 8%, rgb(150 70 255 / 0.22), transparent 70%),
    radial-gradient(50% 45% at 92% 18%, rgb(255 80 200 / 0.12), transparent 70%),
    linear-gradient(180deg, rgb(8 4 22 / 0.28), rgb(8 4 22 / 0.62));
}

/* --- Neonowe przyciski (wszystkie ekrany): ciemne szkło + obwódka i poświata w kolorze --c --- */
.btn {
  --c: var(--neon);
  border: 2px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, rgb(22 12 46 / 0.85)), rgb(14 8 32 / 0.88));
  color: var(--white); text-shadow: 0 0 6px rgb(255 255 255 / 0.25);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 55%, transparent), 0 0 22px color-mix(in srgb, var(--c) 22%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--c) 18%, transparent);
}
html.mouse .btn:hover:not(:disabled) {
  background-color: transparent; filter: brightness(1.12); border-color: var(--c);
  box-shadow: 0 0 12px var(--c), 0 0 32px color-mix(in srgb, var(--c) 45%, transparent), inset 0 0 18px color-mix(in srgb, var(--c) 28%, transparent);
}
.btn:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.btn:disabled { opacity: 0.45; box-shadow: none; filter: saturate(0.4); color: var(--white); }
.btn--green { --c: #2EE6A0; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 45%, rgb(14 8 32)), color-mix(in srgb, var(--c) 18%, rgb(14 8 32))); color: var(--white); }
.btn--red { --c: #FF5A6E; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 45%, rgb(14 8 32)), color-mix(in srgb, var(--c) 18%, rgb(14 8 32))); }
.btn--ghost { --c: rgb(200 160 255); background: transparent; box-shadow: none; }
/* Główny przycisk (jak START): gradient pomarańcz → magenta, złota obwódka */
.btn--gold {
  --c: #FFC247;
  background: linear-gradient(100deg, #FFB020 0%, #FF7A1A 38%, #E8458C 72%, #9B3DFF 100%); color: var(--white);
  border-color: #FFD36B; text-shadow: 0 2px 0 rgb(120 30 40 / 0.35);
  box-shadow: 0 0 12px #FFC247, 0 0 30px rgb(255 160 40 / 0.45), inset 0 0 14px rgb(255 255 255 / 0.2);
}
html.mouse .btn--gold:hover:not(:disabled) { background: linear-gradient(100deg, #FFB020 0%, #FF7A1A 38%, #E8458C 72%, #9B3DFF 100%); }

/* Ikonki gry (assets/ikony/) w miejscu emoji — skalują się z rozmiarem tekstu */
.ico { display: inline-block; height: 1.25em; width: auto; vertical-align: -0.28em; object-fit: contain; }

/* Tryb lekki (js/common/lite.js): bez rozmycia pod kafelkami i bez ciągłych animacji poświat — mniej pracy dla słabego
   procesora (Chromecast, TV), więcej dla dźwięku. Quizzy, liczniki i animacje wyników działają dalej. */
.lite *, .lite *::before, .lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.lite .play-btn, .lite .lobby__lights span, .lite .lobby__title, .lite .lobby__logo, .lite .tv-start__logo,
.lite .qr-frame, .lite .qr-frame::before, .lite .lobby__code span, .lite .ready__fill::after, .lite .chip--ghost,
.lite .tv-start__text, .lite body::before, .lite body::after { animation: none !important; }
.lite .lobby__lights { display: none; }

/* hover-gate: klasę html.mouse ustawia js/common/lite.js tylko przy prawdziwej myszy */

/* --- Okienko (popup) zamiast systemowych komunikatów: zakup zestawu, logowanie --- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgb(8 4 22 / 0.72); backdrop-filter: blur(6px); animation: modal-in 0.18s ease-out;
}
.modal--out { animation: modal-out 0.18s ease-in forwards; }
.modal__box {
  width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 20px 20px;
  text-align: center; border-radius: 24px; background: linear-gradient(180deg, #24124F, #140A30);
  border: 2px solid #B46BFF; box-shadow: 0 0 18px rgb(180 107 255 / 0.55), 0 0 44px rgb(180 107 255 / 0.25);
  animation: modal-pop 0.22s cubic-bezier(.2,1.4,.4,1);
}
.modal__icon { font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 14px rgb(0 0 0 / 0.4)); }
.modal__icon img { width: 64px; height: 64px; }
.modal__title { margin: 0; font-size: 1.35rem; font-weight: var(--fw-black); color: #fff; }
.modal__body { color: rgb(235 228 255 / 0.85); font-size: 0.98rem; line-height: 1.45; }
.modal__body p { margin: 0 0 6px; }
.modal__body b { color: #FFE7A8; }
.modal__price { display: inline-block; margin-top: 4px; padding: 4px 14px; border-radius: 999px; font-weight: var(--fw-black); color: #1d1200; background: var(--gradient-gold); }
.modal__err { color: #FF8A9A; font-weight: var(--fw-bold); }
/* Zgoda przy zakupie treści cyfrowej (Premium) */
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-align: left;
  font-size: 0.82rem; line-height: 1.4; color: var(--muted); background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.15); cursor: pointer; }
.consent a { color: #D9C8FF; }
.consent__box { flex-shrink: 0; width: 22px; height: 22px; margin: 0; accent-color: #FFC247; cursor: pointer; }
.consent--need { border-color: #FF8A9A; background: rgb(255 90 110 / 0.12); color: var(--white); animation: consent-shake 0.35s; }
@keyframes consent-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.modal__actions { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.modal__actions .btn { width: 100%; padding: 14px 18px; font-size: 1.02rem; font-weight: var(--fw-black); border-radius: 16px; }
.modal__btn--gold { background: var(--gradient-gold); color: #1d1200; border-color: transparent; box-shadow: 0 4px 0 var(--gold-deep); }
.modal__btn--danger { --c: #FF5A6E; background: #D7263D; color: #fff; border-color: transparent; }
.modal__btn--google { background: #fff; color: #1f1f1f; border-color: #fff; }
.modal__actions .btn.modal__btn--ghost { box-shadow: none; padding: 8px; }
.modal__btn--ghost { background: none; border-color: transparent; color: #D9C8FF; text-decoration: underline; font-weight: var(--fw-bold) !important; }
@keyframes modal-in { from { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; } }
@keyframes modal-pop { from { transform: scale(0.85); opacity: 0; } }

/* Plakietka reCAPTCHA (App Check, Premium) zasłaniałaby przyciski — informacja o reCAPTCHA jest w polityce prywatności. */
.grecaptcha-badge { visibility: hidden !important; }
