/* Strona startowa — styl „neon party”: tło assets/bg-1.jpg, półprzezroczyste szklane przyciski
   z neonową poświatą w kolorze przycisku (--c), START w gradiencie pomarańcz → magenta.
   Obsługa pilotem TV: wszystko na JEDNYM ekranie bez przewijania; wymiary w vh/vw, żeby skalowały się z ekranem.
   Lewa kolumna = tryb, rundy i START; prawa = zestawy pytań. */

/* Tła ekranów (assets/bg-<n>.jpg, atrybut data-bg) — css/base.css. */
body.start { --neon-text: 0 0 6px rgb(255 255 255 / 0.35); }

.start { height: 100vh; overflow: hidden; }
.menu-screen {
  height: 100vh; max-width: 1800px; margin: 0 auto; padding: 2.2vh 3vw 4vh;
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr); grid-template-rows: auto auto;
  gap: 1.6vh 3vw; align-items: start; align-content: start;
}
.menu-screen__logo { grid-column: 1 / -1; justify-self: center; height: 15vh; filter: drop-shadow(0 0 24px rgb(180 107 255 / 0.45)) drop-shadow(0 6px 18px rgb(0 0 0 / 0.5)); }
.menu-side { display: flex; flex-direction: column; align-items: center; gap: 2vh; min-height: 0; }
.menu-packs { display: flex; flex-direction: column; gap: 1.4vh; min-height: 0; }

/* Nagłówki sekcji: biały, wersaliki, fioletowa kropka-neon */
.menu-row { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 1.1vh; }
.menu-row[hidden] { display: none; }
.menu-row__label {
  display: flex; align-items: center; gap: 0.7vw; margin: 0;
  font-size: 2.1vh; font-weight: var(--fw-black); color: #F2ECFF; text-transform: uppercase; letter-spacing: 0.08em;
}
.menu-row__label::before { content: ""; width: 1.1vh; height: 1.1vh; border-radius: 50%; background: #B46BFF; box-shadow: 0 0 8px #B46BFF, 0 0 16px #B46BFF; }
.menu-row__info { color: #FFC247; text-transform: none; letter-spacing: 0; }
.menu-packs .menu-row__label { align-self: flex-start; }

/* --- Neonowy przycisk (wspólny) --- */
.tiles { display: flex; flex-wrap: wrap; gap: 1.4vh; }
.tile {
  --c: #B46BFF;
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0.8vw;
  min-width: 0; padding: 1.2vh 1.2vw; border-radius: 18px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, rgb(22 12 46 / 0.78)), rgb(14 8 32 / 0.82));
  color: #FFFFFF; font-size: 2.4vh; font-weight: var(--fw-black); text-shadow: var(--neon-text);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 35%, transparent), inset 0 0 14px color-mix(in srgb, var(--c) 14%, transparent);
  backdrop-filter: blur(6px);
  transition: transform 0.15s var(--ease-pop), box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}
.tile__icon { flex: none; font-size: 3.6vh; line-height: 1; }
.tile__name { line-height: 1.12; }
.tile small { font-size: 1.6vh; font-weight: var(--fw-bold); color: rgb(235 228 255 / 0.75); text-shadow: none; }

/* Zaznaczony: pełny neon + znaczek ✓ w rogu */
.tile[aria-pressed="true"] {
  border-color: var(--c);
  box-shadow:
    0 0 6px var(--c), 0 0 18px color-mix(in srgb, var(--c) 70%, transparent), 0 0 36px color-mix(in srgb, var(--c) 35%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--c) 30%, transparent);
}
.tile[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 0.7vh; right: 0.6vw; display: grid; place-items: center;
  width: 2.4vh; height: 2.4vh; border-radius: 50%; font-size: 1.5vh; font-weight: var(--fw-black);
  background: var(--c); color: #12082A; text-shadow: none; box-shadow: 0 0 10px var(--c);
}
/* Niezaznaczony: przygaszony */
/* Niezaznaczony: też świeci, ale słabiej (cieńsza poświata, lekko przygaszony) */
.tile[aria-pressed="false"] {
  opacity: 0.82; filter: saturate(0.85);
  border-color: color-mix(in srgb, var(--c) 75%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--c) 70%, transparent), 0 0 18px color-mix(in srgb, var(--c) 30%, transparent),
    inset 0 0 12px color-mix(in srgb, var(--c) 16%, transparent);
}
.tile[aria-pressed="false"] .tile__icon { filter: grayscale(0.3); }

/* Podświetlenie: najechanie myszą. Pilot / klawiatura — dopiero gdy ktoś użyje strzałek (klasa .remote-active
   z js/common/remote.js), więc samo wejście na stronę nie podświetla żadnego przycisku. */
.tile:focus, .play-btn:focus { outline: none; }
.remote-active .tile:focus {
  opacity: 1; filter: none; transform: scale(1.05); z-index: 1;
  box-shadow: 0 0 0 3px #FFFFFF, 0 0 24px var(--c), 0 0 48px color-mix(in srgb, var(--c) 60%, transparent);
}
/* Najechanie: tylko prawdziwa mysz. Na TV (pilot, wskaźnik pilota, dotyk) bez stanu „hover” — pierwsze OK od razu klika. */
@media (hover: hover) and (pointer: fine) {
  html:not(.lite) .tile:hover {
    opacity: 1; filter: none; transform: scale(1.05); z-index: 1;
    box-shadow: 0 0 0 3px #FFFFFF, 0 0 24px var(--c), 0 0 48px color-mix(in srgb, var(--c) 60%, transparent);
  }
}

/* --- Tryb gry: duże karty z ikoną i opisem --- */
.tiles--mode { display: grid; grid-template-columns: 1fr 1fr; }
.tile--mode { justify-content: flex-start; gap: 1.2vw; min-height: 12vh; padding: 1.6vh 1.4vw; text-align: left; }
.tile--mode .tile__icon { font-size: 6vh; }
.tile__body { display: flex; flex-direction: column; gap: 0.5vh; }
.tile--mode .tile__name { font-size: 2.9vh; }
.tile__desc { font-size: 1.6vh; font-weight: var(--fw-bold); line-height: 1.3; color: rgb(235 228 255 / 0.78); text-shadow: none; }

/* --- Ile drużyn: okrągłe neonowe cyfry --- */
.tiles--small { justify-content: center; gap: 2vw; }
.tile--count { width: 9vh; height: 9vh; padding: 0; border-radius: 50%; font-size: 4.4vh; }
.tile--count[aria-pressed="true"] { color: var(--c); text-shadow: 0 0 10px var(--c); }
.tile--count[aria-pressed="true"]::after { display: none; }

/* --- Rundy: siatka 3 × 2 --- */
.tiles--rounds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2vh 0.8vw; }
.tile--round { justify-content: flex-start; min-height: 7.4vh; padding: 0.9vh 0.8vw; font-size: 2vh; text-align: left; }
.tile--round .tile__icon { font-size: 3.2vh; }

/* --- START: gradient pomarańcz → magenta, złota neonowa ramka, pulsuje --- */
.play-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.4vh; margin-top: 0.6vh;
  width: min(100%, 30vw); padding: 1.6vh 2vw; border-radius: 22px; cursor: pointer;
  border: 3px solid #FFD36B;
  background: linear-gradient(100deg, #FFB020 0%, #FF7A1A 38%, #E8458C 72%, #9B3DFF 100%);
  color: #FFFFFF; box-shadow: 0 0 12px #FFC247, 0 0 34px rgb(255 160 40 / 0.6), 0 0 70px rgb(200 70 255 / 0.35), inset 0 0 18px rgb(255 255 255 / 0.25);
  transition: transform 0.15s var(--ease-pop), box-shadow 0.2s ease;
}
.play-btn__text { font-size: 6.4vh; line-height: 1; font-weight: var(--fw-black); letter-spacing: 0.04em; text-shadow: 0 3px 0 rgb(120 30 40 / 0.45), 0 0 18px rgb(255 255 255 / 0.4); }
.play-btn__sub { font-size: 1.9vh; font-weight: var(--fw-black); letter-spacing: 0.06em; text-transform: uppercase; color: #FFF4D6; }
.play-btn:not(:disabled) { animation: neon-pulse 1.8s ease-in-out infinite; }
.remote-active .play-btn:focus { transform: scale(1.04); box-shadow: 0 0 0 4px #FFFFFF, 0 0 24px #FFC247, 0 0 60px rgb(255 160 40 / 0.8), 0 0 90px rgb(200 70 255 / 0.5); }
@media (hover: hover) and (pointer: fine) { html:not(.lite) .play-btn:not(:disabled):hover { transform: scale(1.04); box-shadow: 0 0 0 4px #FFFFFF, 0 0 24px #FFC247, 0 0 60px rgb(255 160 40 / 0.8), 0 0 90px rgb(200 70 255 / 0.5); } }
.play-btn:active { transform: scale(0.98); }
.play-btn:disabled { opacity: 0.6; cursor: progress; animation: none; }
.play-btn:disabled .play-btn__sub { display: none; }
.play-btn:disabled .play-btn__text { font-size: 3.6vh; }
@keyframes neon-pulse {
  0%, 100% { box-shadow: 0 0 12px #FFC247, 0 0 34px rgb(255 160 40 / 0.6), 0 0 70px rgb(200 70 255 / 0.35), inset 0 0 18px rgb(255 255 255 / 0.25); }
  50% { box-shadow: 0 0 18px #FFD36B, 0 0 50px rgb(255 160 40 / 0.8), 0 0 100px rgb(200 70 255 / 0.5), inset 0 0 22px rgb(255 255 255 / 0.35); }
}

.menu-hint { color: rgb(235 228 255 / 0.7); font-size: 2.2vh; }
.menu-error { margin: 0; color: #FF8A9A; font-weight: var(--fw-black); font-size: 2.2vh; text-align: center; }
.menu-error[hidden] { display: none; }

/* --- Zestawy pytań: siatka 3 kolumn; ikona po lewej, nazwa i liczba pytań po prawej --- */
#packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 10vh; gap: 1.3vh 1vw; align-content: start; }
#packs.packs--many { grid-auto-rows: 9vh; }
.tile--pack {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center;
  column-gap: 0.8vw; row-gap: 0.3vh; height: 100%; padding: 0.8vh 1vw; text-align: left; font-size: 2vh;
}
.tile--pack .tile__icon { grid-row: 1 / 3; font-size: 4vh; }
.tile--pack .tile__name { align-self: end; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile--pack small { align-self: start; }
.tile--pack[aria-pressed="true"] small { color: color-mix(in srgb, var(--c) 55%, #FFFFFF); }
.tile--pack { padding-right: 2.2vw; }
.tile--pack[aria-pressed="true"]::after { top: 0.6vh; right: 0.5vw; } /* ✓ w rogu zaznaczonego zestawu */

/* Stopka: wersja gry małym fontem */
.menu-version {
  position: fixed; left: 0; right: 0; bottom: 0.8vh; text-align: center;
  font-size: max(11px, 1.3vh); color: rgb(235 228 255 / 0.6); pointer-events: none;
}

/* Gdy widać „Ile drużyn?” — niższe karty trybu, żeby wszystko zmieściło się na ekranie */
.menu-side:has(#teams-row:not([hidden])) { gap: 1.4vh; }
.menu-side:has(#teams-row:not([hidden])) .tile--mode { min-height: 9vh; padding: 1vh 1.2vw; }
.menu-side:has(#teams-row:not([hidden])) .tile--mode .tile__icon { font-size: 4.4vh; }
.menu-side:has(#teams-row:not([hidden])) .tile__desc { display: none; }
.menu-side:has(#teams-row:not([hidden])) .tile--count { width: 7vh; height: 7vh; font-size: 3.4vh; }

/* Wąski ekran (telefon w pionie) — jedna kolumna, wtedy wolno przewijać */
@media (max-aspect-ratio: 1/1) {
  .start { height: auto; overflow: auto; }
  .menu-screen { height: auto; min-height: 100vh; grid-template-columns: 1fr; }
  #packs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 9vh; }
  .play-btn { width: 100%; }
  .menu-version { position: static; padding: 2vh 0; }
}

/* Miejsce na znaczek ✓ w prawym górnym rogu — tekst go nie zasłania */
.tile--round, .tile--mode { padding-right: 2.2vw; }

/* --- Premium: konto gospodarza (prawy górny róg) i zablokowane zestawy --- */
.acc-chip {
  position: fixed; top: 2vh; right: 2vw; z-index: 5; padding: 1vh 1.4vw; border-radius: 999px;
  font-size: 1.8vh; font-weight: var(--fw-black); color: #FFE7A8; text-decoration: none; white-space: nowrap;
  background: rgb(18 10 44 / 0.8); border: 2px solid #FFC247; box-shadow: 0 0 10px rgb(255 194 71 / 0.55), 0 0 22px rgb(255 194 71 / 0.25);
}
.acc-chip::before { content: "👤 "; }
html.mouse .acc-chip:hover, .remote-active .acc-chip:focus { background: rgb(255 194 71 / 0.18); outline: none; }
/* Zestawy, których konto nie ma: wyszarzone (bez kolorowego neonu), z kłódką i ceną */
.tile.tile--locked { --c: #8C8699; opacity: 0.5; filter: grayscale(1); box-shadow: none; border-color: rgb(255 255 255 / 0.18); }
.tile--locked small { color: rgb(235 228 255 / 0.85) !important; font-weight: var(--fw-black); }
html.mouse .tile.tile--locked:hover, .remote-active .tile.tile--locked:focus { opacity: 0.75; border-color: rgb(255 255 255 / 0.45); }

/* Ekran logowania od razu po wejściu (gdy nikt nie jest zalogowany) */
.gate { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 3vh 4vw; background: rgb(8 4 22 / 0.72); backdrop-filter: blur(8px); }
.gate[hidden] { display: none; }
.gate__box {
  width: min(560px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 2vh; padding: 4vh 3vw; text-align: center;
  border-radius: 26px; background: rgb(18 10 44 / 0.9); border: 2px solid #B46BFF;
  box-shadow: 0 0 18px rgb(180 107 255 / 0.6), 0 0 44px rgb(180 107 255 / 0.3), inset 0 0 22px rgb(180 107 255 / 0.15);
}
.gate__logo { height: 14vh; filter: drop-shadow(0 6px 18px rgb(0 0 0 / 0.5)); }
.gate h1 { margin: 0; font-size: 3.4vh; }
.gate p { margin: 0; color: var(--muted); font-size: 2vh; line-height: 1.45; }
.gate p b { color: var(--white); }
.gate__btns { width: 100%; display: flex; flex-direction: column; gap: 1.2vh; }
.gate__google { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: #1f1f1f; border-color: #fff; font-size: 2.2vh; }
.gate__google svg { width: 3vh; height: 3vh; }
.gate__guest { background: none; border: 0; color: #D9C8FF; font: inherit; font-size: 1.8vh; text-decoration: underline; cursor: pointer; padding: 0.6vh; }
.gate__err { color: #FF8A8A !important; }

/* --- Trzy tryby (Każdy na siebie / Drużyny / Z botami) i wybór przeciwników-botów --- */
.tiles--mode { grid-template-columns: repeat(3, 1fr); }
.tile--mode { flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 0.6vh; padding: 1.4vh 0.8vw; }
.tile--mode .tile__icon { font-size: 5vh; }
.tile--mode .tile__name { font-size: 2.5vh; }
.tile--mode .tile__desc { font-size: 1.45vh; }
.tiles--bots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.8vw; }
.tile--bot { flex-direction: column; gap: 0.4vh; padding: 1vh 0.4vw; min-height: 9vh; }
.tile--bot .tile__icon { font-size: 3.6vh; }
.tile--bot .tile__name { font-size: 1.5vh; }
.menu-side:has(#bots-row:not([hidden])) { gap: 1.4vh; }
.menu-side:has(#bots-row:not([hidden])) .tile__desc { display: none; }
#bot-count .tile--count { width: 7vh; height: 7vh; font-size: 3.4vh; }

/* dblclick-guard: bez powiększania / zaznaczania tekstu przy szybkim podwójnym naciśnięciu */
button, .tile, .play-btn { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }

/* --- 3.0: ekran startowy — gra tworzy się sama, potem lobby z kodem QR --- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; }
.boot__logo { height: 34vh; filter: drop-shadow(0 0 22px rgb(180 107 255 / 0.45)); }
.boot__status { margin: 0; font-size: 3.4vh; font-weight: var(--fw-black); color: var(--white); text-align: center; }
.boot__retry[hidden] { display: none; }
