[hidden] {
    display: none !important;
}

.board-stage {
    position: relative;
}

/* Posledných 10 sekúnd */

.turn-countdown {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;
    color: rgba(238, 58, 78, 0.44);
    font-size: clamp(100px, 38vw, 190px);
    font-weight: 900;
    line-height: 1;
    transform: translate(-50%, -50%);
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 28px rgba(238, 58, 78, 0.38);
    pointer-events: none;
}

.turn-progress--urgent .turn-progress-value {
    background: linear-gradient(90deg, #ff8b65, #ed354f);
    box-shadow: 0 0 10px rgba(238, 53, 79, 0.62);
}

/* Aktívny hráč */

.player-card {
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.player-card:not(.player-card--active) {
    opacity: 0.82;
}

/* Neplatný ťah */

.game-cell--invalid {
    animation: invalid-cell 0.32s ease;
}

.game-board--invalid {
    animation: invalid-board 0.25s ease;
}

@keyframes invalid-cell {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
        border-color: rgba(238, 53, 79, 0.9);
        background: rgba(255, 195, 204, 0.9);
    }

    75% {
        transform: translateX(-3px);
    }
}

@keyframes invalid-board {
    0%,
    100% {
        transform: translateX(0);
    }

    33% {
        transform: translateX(-3px);
    }

    66% {
        transform: translateX(3px);
    }
}

/* Modálne okná */

.game-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.game-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 37, 83, 0.52);
    backdrop-filter: blur(5px);
}

.game-modal-window {
    width: min(100%, 330px);
    position: relative;
    z-index: 1;
    padding: 22px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(244, 248, 255, 0.98), rgba(213, 223, 255, 0.98));
    box-shadow:
        0 22px 55px rgba(27, 39, 91, 0.32),
        inset 0 1px 4px rgba(255, 255, 255, 0.9);
    animation: modal-open 0.18s ease-out;
}

.game-modal-window--small {
    width: min(100%, 300px);
}

.game-modal-window--result {
    text-align: center;
}

.game-modal-window h2 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: 24px;
    text-align: center;
}

.game-modal-window p {
    margin: -7px 0 20px;
    color: rgba(24, 50, 113, 0.75);
    font-size: 16px;
    font-weight: 700;
}

@keyframes modal-open {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-actions {
    display: grid;
    gap: 9px;
}

.modal-button {
    min-height: 45px;
    padding: 9px 14px;
    border: 1px solid rgba(95, 118, 190, 0.25);
    border-radius: 13px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 4px 8px rgba(44, 63, 126, 0.12);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.modal-button:active {
    transform: scale(0.97);
}

.modal-button--primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #20c0f4, #1678de);
}

.modal-button--danger {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #ff7280, #d93851);
}

.confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* Nastavenia v pauze */

.pause-settings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(79, 101, 171, 0.18);
}

.setting-row {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 4px;
    color: var(--text);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.setting-switch {
    width: 38px;
    height: 21px;
    position: relative;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(83, 100, 161, 0.25);
    transition: background 0.2s ease;
}

.setting-switch::after {
    content: "";
    width: 17px;
    height: 17px;
    position: absolute;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(35, 49, 100, 0.25);
    transition: transform 0.2s ease;
}

.setting-row--active .setting-switch {
    background: var(--blue);
}

.setting-row--active .setting-switch::after {
    transform: translateX(17px);
}

/* Výsledok */

.result-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #ffe071, #ef9b27);
    box-shadow: 0 0 22px rgba(240, 169, 43, 0.42);
    font-size: 38px;
}