:root {
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #05040a;
    font-family: 'Cinzel', Georgia, serif;
    -webkit-tap-highlight-color: transparent;
    /* kill browser gestures that steal touches: pull-to-refresh,
       long-press text selection / callout, rubber-band scrolling */
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

body {
    /* iOS Safari ignores overflow:hidden for rubber-banding; fixed doesn't */
    position: fixed;
    inset: 0;
    width: 100%;
}

input {
    -webkit-user-select: text;
    user-select: text;
}

#root,
#app,
#game-container {
    width: 100%;
    height: 100%;
}

#app {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background:
        radial-gradient(120% 80% at 50% 0%, #1a0c1e 0%, #05040a 60%),
        #05040a;
}

canvas {
    display: block;
    touch-action: none;
}

#rotate-hint {
    display: none;
}

@media (orientation: portrait) and (max-width: 900px) {
    #rotate-hint {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 2rem;
        background:
            radial-gradient(120% 80% at 50% 30%, #1a0c1e 0%, #05040a 65%),
            #05040a;
        color: #f3e9da;
    }

    .rotate-glyph {
        font-size: 3.4rem;
        color: #ff8a3c;
        animation: rotate-sway 2.2s ease-in-out infinite;
    }

    #rotate-hint p {
        margin: 0.8rem 0 0.3rem;
        font-size: 1.25rem;
        letter-spacing: 0.04em;
    }

    #rotate-hint span {
        color: #8a8190;
        font-size: 0.85rem;
    }

    #root {
        display: none;
    }
}

@keyframes rotate-sway {
    0%, 100% { transform: rotate(-18deg); }
    50% { transform: rotate(18deg); }
}
