body {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.87);
    background-color: #0f0f0f;
}

#app {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* iOS Safari: the visible area, not behind the address bar */
    box-sizing: border-box;
    /* Keep the game clear of the iPhone notch / home indicator (viewport-fit=cover). */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Phaser's FIT scale mode sizes the canvas to this element. */
#game-container {
    width: 100%;
    height: 100%;
}

/* The game is landscape-only: any touch device held upright gets the rotate overlay. */
#rotate-hint {
    display: none;
}

@media (orientation: portrait) and (pointer: coarse) {
    #rotate-hint {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 10;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        background: rgba(5, 7, 13, 0.94);
        color: #ffd98a;
        font-family: "Chakra Petch", system-ui, sans-serif;
        font-size: 18px;
        text-align: center;
        padding: 24px;
    }

    #rotate-hint p {
        margin: 0;
    }

    #rotate-hint .en {
        color: #b8b2a0;
        font-size: 14px;
    }

    #rotate-hint .phone {
        width: 44px;
        height: 76px;
        border: 3px solid #ffd98a;
        border-radius: 8px;
        margin-bottom: 18px;
        animation: rotate-phone 2.2s ease-in-out infinite;
    }
}

@keyframes rotate-phone {
    0%, 20% { transform: rotate(0deg); }
    50%, 80% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}
