/* Mobile start / game-over panels — keep play button reachable on small screens */
@media (max-width: 820px) {
    .overlay {
        align-items: flex-start;
        justify-content: flex-start;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top, 0px));
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    }

    .panel-shell {
        grid-template-columns: 1fr;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }

    #startOverlay .panel-cover {
        aspect-ratio: 16 / 9;
        max-height: 34vh;
        min-height: 0;
    }

    .panel-shell .panel,
    .overlay > .panel {
        padding: 16px 14px 18px;
    }

    .panel-logo {
        max-width: 110px;
        width: 55%;
        margin-bottom: 8px;
    }

    .panel h1 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .panel .subtitle {
        font-size: 0.88rem;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .panel .instructions {
        padding: 10px 12px;
        margin-bottom: 12px;
        font-size: 0.82rem;
        line-height: 1.45;
        max-height: 32vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .panel .instructions li {
        margin-bottom: 3px;
        margin-left: 16px;
    }

    .kingdom-game-strip {
        padding: 10px 12px;
        margin-bottom: 12px;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .kingdom-game-strip-signed {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .kingdom-game-actions {
        flex-direction: column;
        gap: 6px;
        margin-top: 8px;
    }

    .kingdom-game-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 9px 12px;
        font-size: 0.82rem;
    }

    .btn-play {
        display: flex;
        width: 100%;
        padding: 14px 18px;
        font-size: 1rem;
        position: sticky;
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
        z-index: 2;
        margin-top: 4px;
    }

    .game-over-actions .btn-play {
        position: static;
        width: 100%;
    }

    .final-score {
        font-size: 2rem;
        margin: 8px 0;
    }
}

@media (max-width: 420px) {
    #startOverlay .panel-cover {
        max-height: 26vh;
    }

    #startOverlay .panel-logo {
        display: none;
    }

    .panel h1 {
        font-size: 1.15rem;
    }
}
