/* game.css - ПОЛНОСТЬЮ ОБНОВЛЕННЫЕ СТИЛИ */

/* Базовые стили */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Основной контейнер игры */
#gameContainer {
    display: none;
    width: 760px;
    height: 610px;
    position: relative;
    overflow: hidden;
}

/* Верхний фон игры */
.game-top-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 291px;
    background-image: url('/assets/game-background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Верхняя панель */
.top-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 100;
    border-bottom: 1px solid #333;
}

/* Контейнер вкладок */
.tabs-container {
    display: flex;
    align-items: center;
    gap: 25px;
}

.tab {
    color: #888;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 0;
}

.tab:hover {
    color: #ccc;
}

.tab.active {
    color: #fff;
    font-weight: 600;
}

.tab-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0.7);
    transition: filter 0.3s;
}

.tab-icon.active img {
    filter: brightness(1);
}

.tab-icon:hover img {
    filter: brightness(0.9);
}

/* Контейнер информации */
.info-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    padding: 6px 12px;
}

.currency-icon {
    width: 32px;
    height: 32px;
}

.currency-value {
    font-size: 18px;
    font-weight: 700;
}

/* Кнопка полноэкранного режима */
.fullscreen-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.3s;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fullscreen-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0.8);
}

.fullscreen-btn:hover img {
    filter: brightness(1);
}

/* Контент вкладок */
.tab-content {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    overflow: hidden;
    z-index: 10;
}

.tab-pane {
    display: none;
    width: 100%;
    height: 100%;
    background: transparent;
}

.tab-pane.active {
    display: block;
}

/* Контейнер для машины */
.car-display-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 150px;
    background: transparent !important;
}

.game-car-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent !important;
}

.car-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-color: transparent !important;
}

.car-down {
    z-index: 1;
}

.car-body {
    z-index: 2;
    mix-blend-mode: normal;
}

.car-light {
    z-index: 3;
}

/* Фоновая картинка внизу */
.bottom-background {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 319px;
    background-image: url('/assets/bg-footer.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Кастомный загрузчик */
#customSplash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* АДАПТИВНОСТЬ */

/* Планшеты и маленькие десктопы */
@media (max-width: 768px) {
    #gameContainer {
        width: 100vw;
        height: calc(100vw * 610 / 760);
        max-width: 760px;
        max-height: 610px;
    }
    
    .top-panel {
        padding: 0 15px;
        height: 50px;
    }
    
    .tabs-container {
        gap: 15px;
    }
    
    .tab {
        font-size: 14px;
    }
    
    .info-container {
        gap: 10px;
    }
    
    .currency-info {
        gap: 10px;
    }
    
    .currency-icon {
        width: 28px;
        height: 28px;
    }
    
    .currency-value {
        font-size: 16px;
    }
    
    .currency-item {
        padding: 5px 10px;
    }
    
    .fullscreen-btn img {
        width: 16px;
        height: 16px;
    }
    
    .tab-content {
        top: 50px;
    }
    
    .car-display-container {
        width: 250px;
        height: 125px;
    }
    
    .game-top-background {
        height: calc(100% * 291 / 610);
    }
    
    .bottom-background {
        height: calc(100% * 319 / 610);
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    #gameContainer {
        width: 100vw;
        height: calc(100vw * 610 / 760);
    }
    
    .top-panel {
        padding: 0 10px;
        height: 45px;
    }
    
    .tabs-container {
        gap: 10px;
    }
    
    .tab {
        font-size: 12px;
    }
    
    .tab-icon img {
        width: 18px;
        height: 18px;
    }
    
    .currency-info {
        gap: 8px;
    }
    
    .currency-icon {
        width: 24px;
        height: 24px;
    }
    
    .currency-value {
        font-size: 14px;
    }
    
    .currency-item {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .tab-content {
        top: 45px;
    }
    
    .car-display-container {
        width: 200px;
        height: 100px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 320px) {
    .tabs-container {
        gap: 8px;
    }
    
    .tab {
        font-size: 10px;
    }
    
    .currency-info {
        gap: 5px;
    }
    
    .currency-icon {
        width: 20px;
        height: 20px;
    }
    
    .currency-value {
        font-size: 12px;
    }
    
    .currency-item {
        padding: 3px 6px;
        gap: 4px;
    }
    
    .car-display-container {
        width: 180px;
        height: 90px;
    }
}

/* Портретная ориентация на мобильных */
@media (max-height: 700px) and (orientation: portrait) {
    #gameContainer {
        height: 100vh;
        width: calc(100vh * 760 / 610);
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 400px) and (orientation: landscape) {
    #gameContainer {
        height: 100vh;
        width: calc(100vh * 760 / 610);
    }
    
    .top-panel {
        height: 35px;
    }
    
    .tab {
        font-size: 11px;
    }
    
    .tab-content {
        top: 35px;
    }
    
    .car-display-container {
        width: 150px;
        height: 75px;
    }
}

/* Поддержка полноэкранного режима */
/* game.css - ОБНОВЛЕННЫЙ ПОЛНОЭКРАННЫЙ РЕЖИМ */

/* Поддержка полноэкранного режима */
:fullscreen #gameContainer {
    width: calc(100vh * 760 / 610);
    height: 100vh;
    max-width: 100vw;
}

:-webkit-full-screen #gameContainer {
    width: calc(100vh * 760 / 610);
    height: 100vh;
    max-width: 100vw;
}

:-moz-full-screen #gameContainer {
    width: calc(100vh * 760 / 610);
    height: 100vh;
    max-width: 100vw;
}

/* Центрирование в полноэкранном режиме */
:fullscreen body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

:-webkit-full-screen body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

:-moz-full-screen body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* Адаптация фонов в полноэкранном режиме */
:fullscreen .game-top-background {
    height: calc(100% * 291 / 610);
}

:fullscreen .bottom-background {
    height: calc(100% * 319 / 610);
}

:-webkit-full-screen .game-top-background {
    height: calc(100% * 291 / 610);
}

:-webkit-full-screen .bottom-background {
    height: calc(100% * 319 / 610);
}

:-moz-full-screen .game-top-background {
    height: calc(100% * 291 / 610);
}

:-moz-full-screen .bottom-background {
    height: calc(100% * 319 / 610);
}