/*
GeoRankle Practice Mode 2.0

Mode selector and Practice-specific round actions.
*/

.game-mode-switch {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 5px;

    width: min(360px, 100%);
    margin: -10px auto 24px;
    padding: 5px;

    border: 1px solid #dbeafe;
    border-radius: 16px;

    background: #eef6ff;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 8px 18px rgba(15, 23, 42, 0.06);
}

.game-mode-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 9px 14px;

    border: 1px solid transparent;
    border-radius: 12px;

    appearance: none;
    -webkit-appearance: none;

    background: transparent;
    color: #64748b;

    font: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;

    cursor: pointer;

    transition:
        color 0.16s ease,
        background-color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease,
        opacity 0.16s ease;
}

.game-mode-button:hover:not(:disabled):not(.is-active) {
    color: #155e9b;
    background: rgba(255, 255, 255, 0.62);
}

.game-mode-button.is-active {
    border-color: #bfdbfe;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #e8f4ff
        );

    color: #155e9b;

    box-shadow:
        0 5px 13px rgba(37, 99, 235, 0.11),
        inset 0 1px 0 #ffffff;
}

.game-mode-button[data-game-mode="practice"].is-active {
    border-color: #fde68a;

    background:
        linear-gradient(
            180deg,
            #fffef2,
            #fff7c2
        );

    color: #8a5a00;

    box-shadow:
        0 5px 13px rgba(250, 204, 21, 0.18),
        inset 0 1px 0 #ffffff;
}

.game-mode-button:focus-visible {
    outline: 3px solid rgba(18, 146, 242, 0.3);
    outline-offset: 3px;
}

.game-mode-button:disabled {
    cursor: wait;
    opacity: 0.58;
}

/* --------------------------------------------------
   Continent selector
   -------------------------------------------------- */

.practice-region-panel {
    width: 100%;
    margin: -12px 0 20px;
    padding: 14px;

    border: 1px solid #fde68a;
    border-radius: 18px;

    background:
        radial-gradient(
            circle at 92% 0%,
            rgba(250, 204, 21, 0.18),
            transparent 38%
        ),
        linear-gradient(180deg, #fffef7, #fffbea);

    box-shadow:
        0 10px 24px rgba(161, 98, 7, 0.08),
        inset 0 1px 0 #ffffff;
}

.practice-region-panel[hidden] {
    display: none !important;
}

.practice-region-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 11px;
    color: #713f12;
}

.practice-region-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    font-size: 14px;
    font-weight: 900;
}

.practice-region-heading small {
    color: #a16207;

    font-size: 11px;
    font-weight: 900;
    text-align: right;
}

.practice-region-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.practice-region-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-width: 0;
    min-height: 38px;
    margin: 0;
    padding: 7px 8px;

    border: 1px solid #f4df9f;
    border-radius: 11px;

    appearance: none;
    -webkit-appearance: none;

    background: rgba(255, 255, 255, 0.78);
    color: #785416;

    font: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;

    cursor: pointer;

    box-shadow: inset 0 1px 0 #ffffff;

    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease,
        opacity 0.16s ease;
}

.practice-region-button:first-child {
    grid-column: span 2;
}

.practice-region-button:hover:not(:disabled):not(.is-active) {
    border-color: #f5c933;
    background: #ffffff;
    color: #92400e;
    transform: translateY(-1px);
}

.practice-region-button.is-active {
    border-color: #eab308;

    background:
        linear-gradient(180deg, #fff6a5, #facc15);

    color: #573900;

    box-shadow:
        0 5px 12px rgba(202, 138, 4, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.practice-region-button:focus-visible {
    outline: 3px solid rgba(234, 179, 8, 0.28);
    outline-offset: 2px;
}

.practice-region-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.game-card.is-practice-mode
    .game-badge {
    border-color: #fde68a;

    background:
        linear-gradient(
            180deg,
            #fffef4,
            #fff6bf
        );

    box-shadow:
        0 16px 38px rgba(250, 204, 21, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.game-card.is-practice-mode
    .game-badge #gameNumber {
    color: #a16207;
}

.popup-next.is-practice-next {
    border-color: #fde68a;

    background:
        linear-gradient(
            180deg,
            #fffef2,
            #fff8cf
        );
}

.popup-next.is-practice-next
    .popup-next-label {
    color: #8a5a00;
}

.popup-practice-icon {
    margin: 5px 0 4px;

    font-size: 28px;
    line-height: 1;
}

.popup-play-again::before {
    content: "↻";

    margin-right: 7px;

    font-size: 19px;
    line-height: 1;
}

.popup-practice-share.is-copied,
.popup-practice-share.is-success {
    border-color: #22c55e;
    background: #dcfce7;
    color: #166534;
}

.popup-practice-share.has-error,
.popup-practice-share.is-error {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 700px) {
    .game-mode-switch {
        width: 100%;
        margin-top: -7px;
        margin-bottom: 20px;
    }

    .practice-region-panel {
        margin-top: -9px;
    }

    .practice-region-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-region-button:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 420px) {
    .game-mode-button {
        min-height: 40px;
        padding: 8px 10px;

        font-size: 13px;
    }

    .practice-region-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .practice-region-heading small {
        padding-left: 25px;
        text-align: left;
    }

    .practice-region-button {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-mode-button,
    .practice-region-button {
        transition: none;
    }
}
