/* css/layout.css — ТОЛЬКО МОБИЛЬНЫЙ ВИД */

/* === ГЛАВНЫЙ КОНТЕЙНЕР === */
.game-container {
    display: flex;
    flex-direction: column; /* Всегда вертикально */
    width: 100%;
    height: 100%;
    
    /* Ограничиваем ширину, чтобы на ПК выглядело как телефон */
    max-width: 480px; 
    margin: 0 auto; /* Центрируем на экране ПК */
    
    padding: 15px;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    transition: opacity 0.5s;
    opacity: 1;
    overflow: hidden; /* Чтобы ничего не вылезало */
}

.game-container.loading { opacity: 0; pointer-events: none; }

/* === ПОРЯДОК ЭЛЕМЕНТОВ (Сверху вниз) === */
.ui-sidebar { display: contents; } /* Игнорируем этот контейнер, чтобы элементы встали в поток */

.top-info { 
    order: 1; 
    width: 100%; 
    text-align: center; 
    pointer-events: none; 
    z-index: 10;
    margin-bottom: 10px;
}

.click-area { 
    order: 2; 
    flex-grow: 1; /* Занимает всё свободное место в центре */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    position: relative; 
    z-index: 5; 
    min-height: 0; 
}

.energy-group { 
    order: 3; 
    width: 100%; 
    margin: 10px 0; /* Отступы сверху и снизу */
    z-index: 20; 
}

.bottom-menu { 
    order: 4; 
    width: 100%; 
    z-index: 20; 
    margin-bottom: constant(safe-area-inset-bottom); /* Для iPhone */
    margin-bottom: env(safe-area-inset-bottom); 
}

/* === СЧЕТ И ВЕРХНЯЯ ПАНЕЛЬ === */
.score-container {
    display: flex; align-items: center; justify-content: center;
    font-size: clamp(32px, 6vh, 48px); /* Адаптивный размер шрифта */
    font-weight: 800; margin-bottom: 5px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.coin-icon { width: 36px; height: 36px; margin-right: 10px; pointer-events: none; }

.level-wrapper { display: flex; flex-direction: column; align-items: center; width: 100%; }
.level-info { font-weight: bold; margin-bottom: 3px; font-size: 14px; }

.level-progress-container { width: 100%; max-width: 280px; }
.level-bar-bg { 
    position: relative; width: 100%; 
    background: rgba(0,0,0,0.15); height: 16px; 
    border-radius: 8px; overflow: hidden; 
}
.level-bar-fill { height: 100%; width: 0%; background: var(--progress-gradient); transition: width 0.3s ease-out; }
.level-remains-text { 
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 10px; font-weight: bold; color: #fff; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); 
}

/* === БЛОК ЭНЕРГИИ === */
.energy-status {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 15px; background: var(--glass-bg); border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); pointer-events: auto;
}
.energy-left { display: flex; align-items: center; font-weight: bold; font-size: 14px; }
.energy-icon { width: 22px; margin-right: 6px; pointer-events: none; }

.energy-boost-btn {
    background: linear-gradient(180deg, #fff176 0%, #fdd835 100%);
    padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: bold;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    white-space: nowrap; transition: all 0.2s; pointer-events: auto;
}
.energy-boost-btn:active { transform: scale(0.95); }
.energy-boost-btn.disabled { background: #cfd8dc !important; color: #78909c; cursor: not-allowed; transform: none !important; box-shadow: none; }

/* === НИЖНЕЕ МЕНЮ === */
.bottom-menu {
    display: flex; justify-content: space-around; 
    background: #fff; padding: 10px; border-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1); pointer-events: auto;
}
.menu-btn { 
    background: none; border: none; 
    display: flex; flex-direction: column; align-items: center; 
    font-size: 10px; font-weight: 600; color: #555; 
    cursor: pointer; flex: 1; pointer-events: auto; 
    -webkit-tap-highlight-color: transparent;
}
.menu-btn img { width: 28px; height: 28px; margin-bottom: 2px; object-fit: contain; pointer-events: none; }
.menu-btn:active { transform: scale(0.95); opacity: 0.7; }

/* === КОТ (КЛИКАБЕЛЬНАЯ ЗОНА) === */
.cat-clicker {
    width: 100%;
    /* Кот теперь занимает 65% высоты, но не больше доступного места */
    height: 60vh; 
    max-height: 600px;
    
    background-position: center;
    background-size: contain; 
    background-repeat: no-repeat;
    
    transition: transform 0.05s;
    pointer-events: none; /* Пропускаем клик сквозь картинку на .click-area */
    touch-action: none;
    
    /* Улучшение качества картинки */
    image-rendering: -webkit-optimize-contrast;
}

/* === УВЕДОМЛЕНИЯ === */
.notification { 
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%); 
    background: rgba(0, 0, 0, 0.9); color: white; 
    padding: 8px 16px; border-radius: 20px; 
    font-size: 13px; font-weight: bold; z-index: 6000; 
    transition: opacity 0.3s, transform 0.3s; 
    pointer-events: none; opacity: 1; width: max-content; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
/* === СТИЛИ РУЛЕТКИ 2.0 === */

/* Контейнер колеса */
.wheel-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 20px auto; /* Центрируем */
}

/* Стрелка */
.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 50px;
    z-index: 15;
    color: #ff3d00;
    text-shadow: 0 4px 5px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Обёртка для свечения */
.wheel-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 5px;
    background: #444; /* Цвет ободка */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

/* Картинка */
#wheel-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 4s cubic-bezier(0.15, 0.85, 0.35, 1.05); /* Плавная остановка */
}

/* Текст статуса */
#roulette-msg {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin: 15px 0;
    min-height: 40px; /* Чтобы текст не прыгал */
}

/* === ГЛАВНАЯ КНОПКА (ОРАНЖЕВАЯ 3D) === */
#spin-btn {
    display: block;
    width: 80%;
    margin: 0 auto 20px auto; /* Строго по центру */
    padding: 18px;
    
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    letter-spacing: 1px;
    
    background: linear-gradient(to bottom, #ffca28, #ff6f00);
    border: none;
    border-radius: 50px;
    
    box-shadow: 0 6px 0 #e65100, 0 10px 20px rgba(0,0,0,0.2); /* 3D тень */
    transition: all 0.1s;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

#spin-btn:active {
    transform: translateY(6px); /* Эффект нажатия */
    box-shadow: 0 0 0 #e65100, 0 4px 10px rgba(0,0,0,0.2);
}

#spin-btn:disabled {
    background: #b0bec5;
    box-shadow: none;
    color: #eceff1;
    transform: translateY(6px);
    cursor: not-allowed;
}
.notification.hidden { opacity: 0; transform: translateX(-50%) translateY(-20px); }
/* === СТИЛЬ ПОЛЯ ВВОДА ИМЕНИ === */
#player-name-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 12px;
    outline: none;
    background: white;
    color: #333;
    font-weight: bold;
    transition: all 0.3s;
}

#player-name-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

#player-name-input::placeholder {
    color: #bbb;
    font-weight: normal;
}
/* === ВСТАВИТЬ В КОНЕЦ css/Layout.css (Заменяет прошлые настройки ника) === */

/* 1. Настраиваем САМ ЭКРАН (темный фон), чтобы он центрировал окно */
#nickname-modal {
    /* Гарантируем, что фон на весь экран */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    /* Если фон не затемнен, раскомментируй строку ниже */
    /* background: rgba(0, 0, 0, 0.7); */

    /* МАГИЯ ЦЕНТРИРОВАНИЯ */
    display: flex;
    justify-content: center; /* Центр по горизонтали */
    align-items: center;     /* Центр по вертикали (чтобы не прилипало к низу) */
    padding: 0; /* Убираем возможные отступы у фона */
}

/* 2. Настраиваем БЕЛОЕ (или темное) ОКНО внутри */
#nickname-modal .modal-content {
    /* Ограничиваем ширину */
    max-width: 300px;
    width: 90%;

    /* ВЫСОТА: Автоматическая! Окно сожмется по высоте контента */
    height: auto;

    /* Убираем лишние внешние отступы, чтобы центрирование работало точно */
    margin: 0;

    /* Внутренние отступы: Снизу чуть меньше (15px), чтобы было компактнее */
    padding: 25px 20px 15px 20px;

    border-radius: 15px; /* Закругленные углы */
    /* Если нужно задать фон окна явно: */
    /* background: #222; border: 2px solid gold; */
}

/* Поле ввода чуть компактнее */
#player-name-input {
    width: 85%;
    font-size: 16px;
    margin: 15px 0; /* Отступы сверху и снизу до кнопок */
}
#player-greeting {
    color: #000000 !important;   /* Красим текст в чисто ЧЕРНЫЙ */
    font-weight: 900;            /* Делаем очень жирным */
    font-size: 16px;             /* Чуть крупнее */
    
    /* Добавляем белую обводку, чтобы черный текст читался на любом фоне */
    text-shadow: 
        -1px -1px 0 #ffffff,  
        1px -1px 0 #ffffff,
        -1px 1px 0 #ffffff,
        1px 1px 0 #ffffff;
        
}

