html {
    height: 100%;
    width: 100%;
}
body {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.87);
    background: url('main-bg.jpg');
    height: 100%;
}
#app {
    width: 100%;
    /* max-height: 500px; */
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    /* Предотвращаем коллапс размеров для WebGL */
    min-width: 1px;
    min-height: 1px;
}
#app canvas {
    border: 1px solid rgb(147, 77, 20);
    /* Предотвращаем проблемы с WebGL при скрытии */
    min-width: 1px;
    min-height: 1px;
}

/* Класс для безопасного скрытия игры */
.phaser-hidden {
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    /* НЕ используем display: none - это вызывает WebGL ошибки */
}

/* Медиа запросы для предотвращения нулевых размеров */
@media (max-width: 1px), (max-height: 1px) {
    #app {
        width: 320px;
        height: 480px;
    }
}
