﻿:root {
    --popup-backdrop: #37552c99;
    --popup-shadow: rgba(0,0,0,0.7);
    --popup-dark: #161d19;
    --popup-light: #242c27;
    --popup-button: #7ee944;
    --popup-button-light: #b1ffad;
    --chess-title: #afd0af;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.popup-backdrop {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    background-color: var(--popup-backdrop);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    /* prevent any scroll‐chaining or rubber‐banding on iOS */
    overscroll-behavior: contain;
    /* disable any default touch-driven scrolling */
    touch-action: none;

    opacity: 0;
    animation: fadeIn 0.2s ease-in forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.9);
    }

    60% {
        transform: scale(1.05);
    }
    /* overshoot */
    100% {
        transform: scale(1);
    }
    /* settle */
}

.popup-dialog {
    width: 540px;
    max-width: 90%;
    background-color: var(--popup-light);
    border-radius: 10px;
    border: 5px solid var(--popup-dark);
    box-shadow: 0 6px 18px var(--popup-shadow);
    z-index: 1001;
    transform-origin: center;
    overscroll-behavior-y: contain;
    touch-action: none;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.popup-content {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    max-height: 85dvh;
    overflow: hidden;
}

.popup-header {
    width: 100%;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    background-color: var(--popup-dark);
    padding: 0.75rem 0;
}

.popup-body {
    padding: 1.1rem;
    font-weight: 300;
    flex: 1 1 auto;
    overflow-y: auto;
    /* Prevents scroll chaining, so that scrolling when you reach the bottom of the popup doesn't start scrolling the main body instead. */
    overscroll-behavior-y: contain;
}

@media (max-width: 540px)
{
    .popup-body {
        font-size: 1.2rem;
    }
}

.popup-subject {
    font-size: 1.25rem;
    font-weight: 500;
    padding: 0.35rem 0 0;
}

.popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    color: var(--popup-button);
    cursor: pointer;
}

    .popup-close:hover {
        color: var(--popup-button-light);
    }

.help-players {
    text-align: center;
}

.help-players .roles {
    width: auto;
}

.help-players .help-img {
    width: 60%;
}

.players-holder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
}

    .players-holder .players-row {
        display: flex;
        flex-direction: row;
        justify-content: center;
    }

@media (max-width: 540px) {
    .players-holder .players-row {
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 0 auto;
    }
}

    .players-holder .player {
        position: relative;
        padding: 2px 4px;
    }

    .players-holder img {
        max-width: 100%;
        height: auto;
    }

    .players-holder .player-title {
        position: absolute;
        top: 3px;
        left: 9px;
        right: 9px;
        display: flex;
        /*        justify-content: space-between;*/
        justify-content: flex-start;
        font-weight: bold;
    }

    .player-title .role {
        margin-right: 5px;
    }

    .player-title .chess {
        color: var(--chess-title);
    }