#game-wrap[aria-busy="true"] #game { visibility: hidden; }
#game-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    border-radius: 12px;
    background: #f4faff;
    color: #24405b;
    text-align: center;
    font: 600 20px/1.5 system-ui, sans-serif;
}
#game-loading[hidden], #game-loading-retry[hidden], #math-cross-fullscreen[hidden] { display: none; }
.math-cross-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #d4e7f5;
    border-top-color: #1873b9;
    border-radius: 50%;
    animation: math-cross-spin 1s linear infinite;
}
#game-loading[data-failed] .math-cross-spinner { display: none; }
@keyframes math-cross-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .math-cross-spinner { animation: none; } }
#game-loading-retry { padding: 10px 20px; border: 1px solid #1873b9; border-radius: 8px; background: white; color: #24405b; font: inherit; }
#math-cross-fullscreen {
    position: fixed;
    top: 8px;
    right: 16px;
    z-index: 1101;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #b7d6e9;
    border-radius: 10px;
    background: #f4faff;
    color: #24405b;
    cursor: pointer;
    touch-action: manipulation;
}
#math-cross-fullscreen .fullscreen-exit { display: none; }
#math-cross-fullscreen[aria-pressed="true"] .fullscreen-enter { display: none; }
#math-cross-fullscreen[aria-pressed="true"] .fullscreen-exit { display: block; }
.math-cross-mobile #math-cross-fullscreen { top: 2px; right: max(64px, calc(env(safe-area-inset-right) + 58px)); }
.math-cross-landscape #math-cross-fullscreen { top: calc(max(4px, env(safe-area-inset-top)) + 4px); }
body.math-cross-expanded { overflow: hidden; }
body.math-cross-expanded #footer { display: none; }
