html, body {
    margin: 0;
    min-height: 100%;
    background: #080808;
    color: #eee;
    font: 16px/1.5 system-ui, sans-serif;
}

#play-page {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

#play-page, #client-page, body#play-body, body#client-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

/* The original loader clears body.className and injects body overflow:visible.
   Stable IDs preserve containment without changing the original engine. */
body#play-body, body#client-body, #game-viewport {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
}

#game-viewport {
    overflow: hidden;
    touch-action: none;
}

#game-frame {
    position: absolute;
    left: 0;
    top: 0;
    border: 0;
    padding: 0;
    margin: 0;
    transform-origin: 0 0;
}

#canvas {
    border: 0;
    padding: 0;
    outline: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#status, #viewport-status {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    margin: 0;
    padding: .75rem 1rem;
    background: #161616;
    text-align: center;
}

#status a {
    color: inherit;
}

[hidden], #bfx_install_button, #bfx_a2hs, #bfx_banner {
    display: none !important;
}
