/*
 * Plansze quizu. Scena ma stały rozmiar 1920x1080 (projekty 3840x2160 w skali 1:2)
 * i jest skalowana do okna w quiz.js - wszystkie wymiary poniżej są w pikselach sceny.
 */

@font-face {
    font-family: 'Circular';
    src: url('../fonts/subset-CircularXX-Book.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Circular';
    src: url('../fonts/subset-CircularXX-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Circular';
    src: url('../fonts/subset-CircularXX-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Circular';
    src: url('../fonts/subset-CircularXX-Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
}

.icon-defs {
    position: absolute;
    width: 0;
    height: 0;
}

/* ---------- scena i motywy kategorii ---------- */

.stage {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    transform: translate(-50%, -50%);
    font-family: 'Circular', Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--fg);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.theme-tradycyjny {
    --fg: #4b2a0d;
    --tile-bg: linear-gradient(90deg, rgba(236, 226, 218, 0.85), rgba(224, 211, 201, 0.85));
    --tile-border: #a8917f;
    --zone-true-bg: linear-gradient(180deg, #74d172, #5fbd60);
    --zone-true-border: #22b422;
    --zone-false-bg: linear-gradient(180deg, #cf7676, #d68282);
    --zone-false-border: #d43030;
}

.theme-nowoczesny {
    --fg: #0a0a0a;
    --tile-bg: linear-gradient(90deg, rgba(240, 226, 212, 0.7), rgba(214, 180, 160, 0.7));
    --tile-border: #7b665d;
    --zone-true-bg: linear-gradient(180deg, #6fc763, #63bd5c);
    --zone-true-border: #22b422;
    --zone-false-bg: linear-gradient(180deg, #8a4846, #b05e5a);
    --zone-false-border: #d43030;
}

.theme-jtigo {
    --fg: #fff;
    --tile-bg: linear-gradient(90deg, rgba(112, 28, 176, 0.9), rgba(128, 48, 196, 0.85) 65%, rgba(176, 30, 222, 0.9));
    --tile-border: #fff;
    --zone-true-bg: linear-gradient(180deg, rgba(36, 44, 62, 0.9), rgba(30, 112, 62, 0.9));
    --zone-true-border: #22b422;
    --zone-false-bg: linear-gradient(180deg, rgba(122, 72, 112, 0.9), rgba(152, 30, 100, 0.9));
    --zone-false-border: #d43030;
}

.theme-end {
    --fg: #0a0a0a;
}

.bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.4s;
}

.bg-tradycyjny {
    background-image: url('../img/tlo-1.png');
}

.bg-jtigo {
    background-image: url('../img/tlo-2.png');
}

.bg-nowoczesny {
    background-image: url('../img/tlo-3.png');
}

.bg-end {
    background-image: url('../img/koniec.png');
}

.theme-tradycyjny .bg-tradycyjny,
.theme-nowoczesny .bg-nowoczesny,
.theme-jtigo .bg-jtigo,
.theme-end .bg-end {
    opacity: 1;
}

.screen {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    /* znikająca plansza nie może przechwytywać dotknięć przeznaczonych dla nowej */
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.stage[data-screen="pin"] .screen-pin,
.stage[data-screen="start"] .screen-start,
.stage[data-screen="question"] .screen-question,
.stage[data-screen="end"] .screen-end {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

button {
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
    cursor: pointer;
}

/* ---------- PIN ---------- */

.screen-pin {
    padding-top: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.screen-pin h1 {
    margin: 0;
    font-size: 68px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.05em;
}

.pin-dots {
    margin-top: 56px;
    display: flex;
    gap: 36px;
}

.pin-dots span {
    width: 44px;
    height: 44px;
    border: 4px solid var(--fg);
    border-radius: 50%;
    transition: background 0.15s;
}

.pin-dots span.is-filled {
    background: var(--fg);
}

.pin-error {
    height: 44px;
    margin: 28px 0 0;
    color: #b3261e;
    font-size: 32px;
    font-weight: 700;
    line-height: 44px;
}

.pin-keys {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, 200px);
    gap: 22px;
    transition: opacity 0.2s;
}

.pin-keys .tile {
    height: 104px;
    padding: 0;
    font-size: 52px;
    letter-spacing: 0;
}

.pin-keys .tile:active {
    transform: scale(0.95);
}

.pin-keys .pin-key-0 {
    grid-column: 2;
}

/* trwa sprawdzanie PIN-u */
.pin-keys.is-busy {
    opacity: 0.5;
    pointer-events: none;
}

/* ---------- START ---------- */

.screen-start {
    padding: 100px 126px 0;
    font-size: 29px;
    line-height: 34px;
}

.screen-start h2 {
    margin: 36px 0 14px;
    font-size: 44px;
    font-weight: 700;
    line-height: 50px;
    letter-spacing: 0.07em;
}

.screen-start h2:first-child {
    margin-top: 0;
}

.screen-start p,
.screen-start ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.screen-start li::before {
    content: '\2022';
    margin-right: 12px;
}

.screen-start strong {
    font-weight: 700;
}

.screen-start .start-lifelines-title {
    margin-top: 44px;
    font-size: 46px;
}

.start-lifelines {
    display: flex;
    margin: 22px 0 6px;
}

.start-lifeline {
    display: flex;
    align-items: center;
    gap: 24px;
}

.start-lifeline:nth-child(1) {
    width: 652px;
}

.start-lifeline:nth-child(2) {
    width: 563px;
}

.start-lifeline svg {
    width: 103px;
    height: 96px;
    fill: currentColor;
}

.screen-start .start-player {
    position: absolute;
    left: 126px;
    bottom: 55px;
    font-size: 26px;
    line-height: 67px;
}

.start-buttons {
    position: absolute;
    right: 125px;
    bottom: 55px;
    display: flex;
    gap: 27px;
}

.btn {
    width: 288px;
    height: 67px;
    border: 3px solid var(--tile-border);
    border-radius: 14px;
    background: var(--tile-bg);
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.btn-primary {
    border-color: var(--fg);
    background: var(--fg);
    color: #fff;
}

.btn:disabled {
    opacity: 0.6;
}

/* ---------- PYTANIE: nagłówek ---------- */

.q-number {
    position: absolute;
    left: 103px;
    top: 42px;
    font-size: 86px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.q-category {
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    font-size: 30px;
    line-height: 40px;
    text-align: center;
}

.q-lives {
    position: absolute;
    right: 283px;
    top: 53px;
    display: flex;
    gap: 13px;
}

.q-lives svg {
    width: 67px;
    height: 67px;
    fill: currentColor;
}

.q-timer {
    position: absolute;
    right: 106px;
    top: 25px;
    width: 122px;
    height: 122px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.q-timer svg {
    position: absolute;
    inset: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 3.5;
}

.q-timer-track {
    opacity: 0.35;
}

.q-timer-progress {
    /* łuk pozostałego czasu kurczy się zgodnie z ruchem wskazówek, zaczynając od godz. 12 */
    transform: rotate(-90deg) scaleY(-1);
    transform-origin: center;
    transform-box: fill-box;
    stroke-dasharray: 364.43;
}

.q-title {
    position: absolute;
    left: 104px;
    right: 104px;
    top: 152px;
    height: 150px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 68px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.05em;
    text-align: center;
}

.q-title span {
    display: block;
}

/* ---------- PYTANIE: odpowiedzi ---------- */

.answers {
    position: absolute;
    left: 104px;
    top: 315px;
    width: 1712px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tile {
    height: 100px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--tile-border);
    border-radius: 14px;
    background: var(--tile-bg);
    color: var(--fg);
    font-size: 43px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-align: center;
    transition: transform 0.25s, left 0.25s, top 0.25s, opacity 0.3s, box-shadow 0.2s;
}

.tile span {
    display: block;
}

.tile.is-selected {
    box-shadow: 0 0 0 5px var(--tile-border);
}

.tile.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.draggable {
    cursor: grab;
    touch-action: none;
}

.draggable.is-dragging {
    z-index: 10;
    cursor: grabbing;
    transition: none;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

/* PF: zdania między strefami PRAWDA / FAŁSZ */

.statements {
    left: 295px;
    width: 1330px;
}

.statements .tile {
    font-size: 36px;
}

/* zdanie puszczone za progiem odlatuje do strefy; czas = PF_FLY_MS w quiz.js */
.statements .tile.flown-true,
.statements .tile.flown-false {
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease-in, opacity 0.35s ease-in;
}

.statements .tile.flown-true {
    transform: translateX(-900px);
}

.statements .tile.flown-false {
    transform: translateX(900px);
}

.zone {
    position: absolute;
    top: 315px;
    width: 180px;
    height: 490px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid;
    color: #fff;
    font-size: 60px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: filter 0.15s, box-shadow 0.15s;
}

.zone span {
    white-space: nowrap;
}

.zone-true {
    left: 0;
    border-left: 0;
    border-color: var(--zone-true-border);
    border-radius: 0 14px 14px 0;
    background: var(--zone-true-bg);
}

.zone-true span {
    transform: rotate(-90deg);
}

.zone-false {
    right: 0;
    border-right: 0;
    border-color: var(--zone-false-border);
    border-radius: 14px 0 0 14px;
    background: var(--zone-false-bg);
}

.zone-false span {
    transform: rotate(90deg);
}

.zone.is-over {
    filter: brightness(1.15);
    box-shadow: 0 0 40px currentColor;
}

/* DOPASUJ: etykiety u góry, pod spodem obrazy z miejscem na etykietę */

.match-label {
    position: absolute;
    top: 315px;
    font-size: 36px;
}

.slot {
    position: absolute;
    top: 425px;
    height: 425px;
}

.slot img {
    position: absolute;
    left: 0;
    top: 12px;
    width: 100%;
    height: 300px;
    object-fit: contain;
    pointer-events: none;
    transition: opacity 0.3s;
}

.slot-drop {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100px;
    border: 3px dashed var(--tile-border);
    border-radius: 14px;
    opacity: 0.55;
    transition: opacity 0.3s;
}

.slot.is-hidden img {
    opacity: 0.12;
}

.slot.is-hidden .slot-drop {
    opacity: 0;
}

/* ---------- PYTANIE: koła ratunkowe ---------- */

.lifelines {
    position: absolute;
    left: 0;
    right: 0;
    top: 872px;
    display: flex;
    justify-content: center;
    gap: 100px;
}

.lifeline {
    width: 103px;
    height: 96px;
    padding: 0;
    border: 0;
    background: none;
    transition: opacity 0.3s, transform 0.15s;
}

.lifeline svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.lifeline:active {
    transform: scale(0.93);
}

.lifeline:disabled {
    opacity: 0.22;
    cursor: default;
}

.lifelines-hint {
    position: absolute;
    left: 0;
    right: 0;
    top: 994px;
    margin: 0;
    font-size: 29px;
    line-height: 40px;
    text-align: center;
}

.lifelines-hint strong {
    font-weight: 700;
}

/* ---------- KONIEC ---------- */

.screen-end {
    padding-top: 328px;
    text-align: center;
}

.screen-end h1 {
    margin: 0;
    font-size: 104px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.screen-end p {
    margin: 0;
}

.end-score-label {
    padding-top: 81px;
    font-size: 62px;
    line-height: 1;
}

.end-score {
    padding: 18px 0 19px;
    font-size: 66px;
    line-height: 1;
    text-transform: uppercase;
}

.end-rank {
    width: 708px;
    margin: 0 auto !important;
    padding-top: 22px;
    border-top: 3px solid #7a655c;
    font-size: 36px;
    line-height: 1.1;
}

.end-accent {
    color: #c8873a;
}

/* ---------- komunikat o błędzie ---------- */

.stage-message {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 1200px;
    padding: 40px 60px;
    transform: translate(-50%, -50%);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 36px;
    line-height: 1.3;
    text-align: center;
}
