/* Ekrany gry: tablica prowadzącego i telefon ucznia */
*, *::before, *::after { box-sizing: border-box; }
.qz { min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: #fff; font-family: 'Nunito', system-ui, sans-serif;
      background: radial-gradient(ellipse 70% 55% at 10% -5%, rgba(139,92,246,.6), transparent 60%), radial-gradient(ellipse 55% 45% at 95% 5%, rgba(255,77,141,.4), transparent 60%), radial-gradient(ellipse 60% 50% at 50% 105%, rgba(34,211,238,.25), transparent 60%), linear-gradient(180deg, #110a2b 0%, #1a0f3f 100%); }
.qz a { color: #fff; }
.qz a.qbtn { color: #4c1fc2; text-decoration: none; }
.qz__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
/* Logo (to samo co na stronach, wariant jasny) */
.qz__home { text-decoration: none; display: block; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.5rem; letter-spacing: -.02em; color: #fff; line-height: 1; }
.logo__mark { width: 34px; height: 34px; border-radius: 11px 11px 11px 3px; background: linear-gradient(135deg, #ff4d8d, #ff9f43); color: #fff; display: grid; place-items: center; font-size: 1.25rem; box-shadow: 3px 3px 0 #ffb020; }
.logo__tld { color: #ffb020; font-size: .7em; align-self: flex-end; margin: 0 0 3px -6px; }
.qz__pill { background: rgba(255,255,255,.15); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.qz__pill strong { font-weight: 800; }
.qz__stage { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column;
             align-items: center; justify-content: safe center; gap: 20px; text-align: center; }
.qz__stage > * { flex-shrink: 0; }
.qz h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.8rem); line-height: 1.2; }
.qz p { margin: 0; font-size: 1.1rem; }
.qz .dim { opacity: .75; }

.bigpin { font-size: clamp(3rem, 12vw, 7rem); font-weight: 800; letter-spacing: .08em; background: #fff; color: #4c1fc2;
          padding: 4px 32px; border-radius: 24px; box-shadow: 0 8px 0 rgba(0,0,0,.25); }
/* Dołączanie: kod QR + PIN */
.join { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.join__qr { background: #fff; color: #4c1fc2; border-radius: 20px; padding: 14px 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px;
            font-weight: 800; box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.join__qr svg { display: block; width: min(240px, 60vw); height: auto; }
.join__or { font-weight: 800; opacity: .7; text-transform: uppercase; letter-spacing: .1em; }
.join__pin { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qz__qrbtn { border: 0; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.qz__qrbtn:hover { background: rgba(255,255,255,.28); }
.qroverlay { position: fixed; inset: 0; background: rgba(15,12,53,.85); display: grid; place-items: center; z-index: 50; padding: 16px; }
.qroverlay[hidden] { display: none; }
.qroverlay__card { background: #fff; color: #1c1b33; border-radius: 24px; padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 520px; }
.qroverlay__code svg { display: block; width: min(420px, 80vw, 62vh); height: auto; }
.qroverlay__card p { margin: 0; font-size: 1.05rem; }
.qroverlay__card .qbtn { background: #4c1fc2; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 900px; }
.chip { background: rgba(255,255,255,.16); padding: 8px 16px; border-radius: 999px; font-weight: 700; animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

.qbtn { background: #fff; color: #4c1fc2; border: 0; border-radius: 999px; padding: 14px 34px; font: inherit; font-weight: 800;
        font-size: 1.15rem; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.25); transition: transform .1s; }
.qbtn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.qbtn:disabled { opacity: .45; cursor: not-allowed; }
.qbtn--ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6); box-shadow: none; }

.meta { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; }
.timer { width: 80px; height: 80px; border-radius: 50%; background: #fff; color: #4c1fc2; display: grid; place-items: center;
         font-size: 2rem; font-weight: 800; flex: none; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.timer.is-low { background: #ef6b57; color: #fff; }
.qcard { background: #fff; color: #1c1b33; border-radius: 20px; padding: 24px; width: 100%; box-shadow: 0 8px 0 rgba(0,0,0,.2); }
.qcard h1 { color: #1c1b33; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.opt { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 0; color: #fff; text-align: left;
       font: inherit; font-weight: 800; font-size: clamp(1rem, 2.4vw, 1.5rem); box-shadow: 0 6px 0 rgba(0,0,0,.25); transition: opacity .3s, transform .1s; }
.opt__letter { width: 1.9em; height: 1.9em; flex: none; border-radius: 10px; background: rgba(255,255,255,.25); display: grid; place-items: center; }
.opt__count { margin-left: auto; background: rgba(0,0,0,.22); padding: 2px 12px; border-radius: 999px; }
.opt--0 { background: #6b5cff; } .opt--1 { background: #ef6b57; } .opt--2 { background: #e09a0c; } .opt--3 { background: #1fa58a; }
.opt.is-dim { opacity: .3; }
.opt.is-correct { outline: 4px solid #fff; }
button.opt { cursor: pointer; min-height: 110px; }
button.opt:active { transform: translateY(3px); }

.board { width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 8px; }
.board__row { display: flex; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.13); padding: 12px 18px;
              border-radius: 12px; font-weight: 700; font-size: 1.15rem; animation: pop .35s ease-out both; }
.board__row:first-child { background: #fff; color: #4c1fc2; }

.feedback { width: 100%; max-width: 480px; border-radius: 20px; padding: 28px 20px; display: flex; flex-direction: column; gap: 8px;
            box-shadow: 0 8px 0 rgba(0,0,0,.25); }
.feedback--ok { background: #1fa58a; } .feedback--bad { background: #ef6b57; } .feedback--none { background: rgba(255,255,255,.15); }
.feedback .big { font-size: 2.6rem; font-weight: 800; }

.joinform { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.joinform input { font: inherit; font-size: 1.3rem; font-weight: 800; text-align: center; padding: 14px; border-radius: 14px; border: 0; }
.joinform input:focus { outline: 4px solid #a9a2ff; }
.err { background: #ef6b57; border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.spinner { width: 44px; height: 44px; border: 5px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .options { grid-template-columns: 1fr; }
    .player .options { grid-template-columns: 1fr 1fr; }
    .player button.opt { min-height: 130px; flex-direction: column; justify-content: center; text-align: center; font-size: 1.05rem; }
    .timer { width: 64px; height: 64px; font-size: 1.6rem; }
}

/* Awatary graczy (arkusz 4 × 3) */
.av { display: inline-block; flex: none; width: 56px; height: 56px; border-radius: 50%; vertical-align: middle;
      background: #c9d3e0 url('avatars.webp') no-repeat; background-size: 400% 300%; box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.av--sm { width: 34px; height: 34px; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.av--lg { width: 96px; height: 96px; box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255,77,141,.5); }
.av--xs { width: 26px; height: 26px; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.av--md { width: 48px; height: 48px; box-shadow: 0 0 0 3px rgba(255,255,255,.85); }
.chips .chip { font-size: 1.15rem; }
.board__who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px 5px 5px; }
.qz__pill .av { margin: -3px 6px -3px -8px; }
/* 💵 Baksy: 10 za każdą dobrą odpowiedź (tylko w danej grze) */
.board__score { white-space: nowrap; }
.bucks { display: inline-block; font-weight: 800; color: #b8f5c9; margin-left: 6px; }
.board__row:first-child .bucks { color: #1b5e20; }
.bucks--won { margin: 2px 0 0; font-size: 1.25rem; color: #fff; background: rgba(0,0,0,.18); padding: 4px 14px; border-radius: 999px; animation: pop .35s ease-out; }
/* Wybór awatara przy dołączaniu */
.avpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; border: 0; padding: 0; margin: 0; }
.avpick legend { font-weight: 800; margin-bottom: 8px; text-align: center; width: 100%; }
.avpick label { position: relative; display: grid; place-items: center; cursor: pointer; }
.avpick input { position: absolute; opacity: 0; pointer-events: none; }
.avpick .av { width: 64px; height: 64px; box-shadow: 0 0 0 3px rgba(255,255,255,.25); transition: transform .15s, box-shadow .15s; }
.avpick input:checked + .av { box-shadow: 0 0 0 4px #ffd23f, 0 0 22px rgba(255,210,63,.7); transform: scale(1.08); }
.avpick input:focus-visible + .av { outline: 3px solid #22d3ee; outline-offset: 3px; }
.avpick label:hover .av { transform: scale(1.06); }
@media (max-width: 380px) { .avpick .av { width: 54px; height: 54px; } }

/* Neonowe akcenty na ekranach gry */
.qz { background-attachment: fixed; }
.qz__pill { border: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(8px); }
.bigpin { box-shadow: 0 8px 0 rgba(0,0,0,.35), 0 0 40px rgba(139,92,246,.6); }
.join__qr { box-shadow: 0 8px 0 rgba(0,0,0,.35), 0 0 30px rgba(34,211,238,.35); }
.qbtn { background: linear-gradient(135deg, #ff4d8d, #ff9f43); color: #fff; box-shadow: 0 6px 0 #a3204f, 0 0 24px rgba(255,77,141,.45); }
.qbtn:active { box-shadow: 0 3px 0 #a3204f; }
.qz a.qbtn { color: #fff; }
.qbtn--ghost { background: rgba(255,255,255,.06); color: #fff; border: 2px solid rgba(255,255,255,.5); box-shadow: none; }
.timer { box-shadow: 0 6px 0 rgba(0,0,0,.3), 0 0 24px rgba(255,255,255,.35); }
.board__row:first-child { background: linear-gradient(135deg, #ffd23f, #ff9f43); color: #2b1600; box-shadow: 0 0 24px rgba(255,210,63,.45); }
.joinform input { background: rgba(10,5,30,.6); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.joinform input::placeholder { color: rgba(220,210,255,.5); }
.joinform input:focus { outline: 3px solid #ff4d8d; }