body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    background-color: #000; overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    user-select: none; -webkit-user-select: none;
    touch-action: none; -webkit-tap-highlight-color: transparent;
    position: fixed;
}

#game-container {
    position: relative; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    background: #111;
}

canvas { display: block; background: #000; }

#ui-layer {
    position: absolute; width: 1280px; height: 720px;
    pointer-events: none; z-index: 10;
    transform-origin: center center;
    display: flex; justify-content: center; align-items: center;
}

.ui-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; flex-direction: column;
    justify-content: center; align-items: center;
}

.ui-screen.active { display: flex; pointer-events: auto; }

.game-title {
    font-size: 80px; color: #FFD700; font-weight: 900;
    text-shadow: 4px 4px 0 #3E2723, -2px -2px 0 #FFF; line-height: 1.1; 
    margin-bottom: 40px; text-align: center; text-transform: uppercase;
}

.btn-main {
    background: linear-gradient(#66BB6A, #2E7D32);
    border: 5px solid #fff; padding: 20px 60px;
    font-size: 32px; color: white; border-radius: 60px;
    cursor: pointer; font-weight: bold; text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); transition: 0.1s;
    margin: 10px; pointer-events: auto;
}

.btn-main:active { transform: scale(0.95); }

.btn-inventory {
    background: linear-gradient(#FFB74D, #F57C00);
    border: 4px solid #fff; padding: 15px 40px;
    font-size: 22px; color: white; border-radius: 15px;
    cursor: pointer; font-weight: bold; text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4); margin-top: 15px;
    display: flex; align-items: center; gap: 10px; pointer-events: auto;
}

.hud-bar {
    position: absolute; top: 0; left: 0; width: 100%; height: 120px;
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 30px 40px; box-sizing: border-box;
}

.hud-left { display: flex; flex-direction: column; }
.hud-stats-total { color: #FFD700; font-weight: bold; font-size: 24px; text-shadow: 2px 2px 2px black; }
.hud-stats-current { color: #4FC3F7; font-weight: bold; font-size: 32px; text-shadow: 2px 2px 2px black; }
.hud-coins { color: #FFD700; font-size: 40px; font-weight: bold; text-shadow: 3px 3px 0 #000; display: flex; align-items: center; gap: 15px; }

#shop-modal {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 580px; height: 620px;
    background: #3E2723; border: 6px solid #8D6E63; border-radius: 30px;
    display: none; flex-direction: column; z-index: 100; color: white;
    box-shadow: 0 0 150px #000; pointer-events: auto;
}

.shop-header {
    padding: 20px; background: #281B17; text-align: center; 
    border-radius: 24px 24px 0 0; border-bottom: 3px solid #5D4037;
}

.shop-list { 
    flex: 1; overflow-y: auto; padding: 20px;
}

.shop-item {
    background: rgba(0,0,0,0.4); margin-bottom: 15px; padding: 15px;
    border-radius: 15px; display: flex; align-items: center; border: 2px solid #5D4037;
}

.buy-btn { background: #8BC34A; color: #111; border: none; padding: 12px 20px; border-radius: 10px; font-weight: bold; font-size: 18px; cursor: pointer; }
.buy-btn:disabled { background: #555; color: #888; cursor: not-allowed; }

.btn-close-shop { padding: 20px; background: #281B17; color: white; border: none; font-weight: bold; font-size: 20px; cursor: pointer; border-radius: 0 0 24px 24px; }

.overlay-box {
    background: rgba(20, 20, 20, 0.95); padding: 30px 40px; border-radius: 40px;
    border: 6px solid #FFD700; text-align: center; width: 620px;
}

/* ИСПРАВЛЕННЫЙ LOADING */
#loading { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); /* Центрируем точно по середине */
    color: #FFD700; 
    font-size: 40px; 
    z-index: 5; /* Ставим ниже UI (10) и рекламы SDK */
    font-family: sans-serif; 
    font-weight: 900;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    pointer-events: none; /* Чтобы нельзя было случайно нажать на надпись вместо кнопки рекламы */
}