/* ===== ПОСЛЕДНИЙ МАЯК — СТИЛИ ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    height: 100%;
    background: #0a0a1a;
    overflow: hidden;
    border: 0;
}

body {
    background: #0a0a1a;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    /* Отключаем выделение текста на мобильных */
    -webkit-user-select: none;
    user-select: none;
    /* Отключаем контекстное меню при долгом тапе */
    -webkit-touch-callout: none;
    border: 0;
    outline: none;
}

#game {
    display: block;
    background: #0d1b2a;
    /* Smooth rendering for sharp text */
    /* Убираем синюю подсветку при тапе на мобильных */
    -webkit-tap-highlight-color: transparent;
    cursor: default;
    border: 0;
    outline: none;
    box-shadow: none;
}

#game:focus,
#game:focus-visible {
    outline: none;
}

#cg-banner-slot {
    display: none;
    position: fixed;
    right: calc(40px + env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: 320px;
    height: 50px;
    z-index: 6;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#cg-banner-slot.active {
    display: flex;
}

@media (orientation: landscape) and (pointer: coarse) {
    #cg-banner-slot {
        display: none !important;
    }
}

/* Экран "поверните устройство" при портретной ориентации на мобильных */
#rotate-prompt {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #0a0a1a;
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    font-family: monospace;
    font-size: 18px;
    text-align: center;
    padding: 20px;
}
#rotate-prompt .rotate-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: rotateAnim 2s ease-in-out infinite;
}
@keyframes rotateAnim {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

@media (max-width: 900px) and (orientation: portrait) and (pointer: coarse) {
    #rotate-prompt { display: flex !important; }
    #game { display: none !important; }
}

/* Мобильные контролы */
#mobile-controls {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    pointer-events: none;
}
#mobile-controls.active {
    display: block;
}
#pause-btn {
    position: absolute;
    right: 20px;
    bottom: 96px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
}

@media (orientation: landscape) and (pointer: coarse) {
    #pause-btn {
        right: calc(18px + env(safe-area-inset-right));
        bottom: calc(96px + env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
    }
    #ability-btn {
        right: calc(18px + env(safe-area-inset-right));
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
}
#pause-btn span {
    display: block;
    width: 4px;
    height: 16px;
    background: #fff;
    border-radius: 1px;
}
#ability-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,140,0,0.3);
    border: 2px solid rgba(255,140,0,0.6);
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ff8c00;
    font-size: 24px;
    -webkit-tap-highlight-color: transparent;
}
