*{
    margin: 0;
    padding:0;
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */
body{
    background-image: url("../img/clouds.jpg");
    background-size: cover;
    background-position: center;
}

.adminwindow{
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content{
    display: none;
}

/* ===== НАВИГАЦИЯ И КНОПКИ ===== */
.nav {
    display: flex !important;
    flex-direction: column;
    flex-wrap: wrap;
    width: 100%;
    height: 100%;
}

/* Кнопки */
.button1{
    width: 75px !important;
    margin-left: 1%;
    margin-top: 1%;
    flex: 1;
    min-width: 60px;
    justify-content: center;
    display: flex;
}

.button1 button{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 75px !important;
    cursor: pointer !important;
}

.button1 img{
    width: 30px;  
    margin: auto;
}
.button1 p{
    margin: auto;
}

.button2{
    width: 75px !important;
    margin-left: 1%;
    margin-top: 1%;
    flex: 1;
    min-width: 55px;
    justify-content: center;
    display: flex;
}

.button2 button{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    width: 75px !important;
}

.button2 img{
    width: 30px;
    margin: auto;
}

.button2 p{
    width: 55px !important;
    font-size: 11px;
    margin: auto;
}

/* ===== ОКНА ===== */
.window, .about {
    position: fixed !important;
    z-index: 1;
    transition: none !important;
}

.window1{
    width: 50% !important;
    min-width: 400px;
    margin-left: 2.5% !important;
    margin-top: 3% !important;
    margin-right: 2.5% !important;
}

.about{
    width: 50% !important;
    min-width: 500px;
    margin-left: 2.5 !important;
    margin-top: 3% !important;
    margin-right: 2.5 !important;
}

/* Контент окон */
.gameimg{
    width: 100%;
    max-width: 300px;
    height: auto;
}

.gametext p{
    font-size: 14px;
    margin-top: 2%;
    margin-bottom: 2%;
}

.title{
    font-weight: bold;
    font-size: 18px;
    display: block;
    text-align: center;
    margin-top: 2%;
    margin-bottom: 2%;
}

/* ===== ФУТЕР ===== */
.foot{
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff;
    height: 25px;
    display: flex;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
}

.footbut{
    width: 80px;
}

.footbut button{
    min-height: 15px !important;
    min-width: 35px !important;
    width: 50px !important;
    height: 18px !important;
    margin-top: 4% !important;
    margin-left: 5%;
    padding: 0 !important;
    display: flex;
}

.footbut img{
    width: 15px;
    height: 15px;
    padding-top: 2%;
    padding-left: 10%;
}

.footbut p{
    padding-top: 5%;
    font-weight: bold;
    font-size: 11px;
    padding-left: 5%;
}

.time{
    display: flex;
    width: 45px;
    margin-left: auto !important;
    height: 20px !important;
    padding-top: 0.1% !important;
    text-align: center;
    font-size: 11px;
    margin-right: 0.2% !important;
}

/* ===== SCREENSAVER ===== */
#inactivityOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

#inactivityOverlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== МОБИЛЬНЫЕ УСТРОЙСТВА ===== */

/* Планшеты и маленькие десктопы */
@media (max-width: 768px) {
    .window1 {
        width: 90% !important;
        min-width: unset;
        margin-left: 5% !important;
        margin-right: 5% !important;
    }
    
    .about {
        width: 90% !important;
        min-width: unset;
    }
}

/* Улучшения для touch-устройств */
@media (max-width: 768px) {
    .toggleButton {
        cursor: pointer;
    }
    
    .toggleButton button {
        min-height: 60px !important;
    }
    
    .window, .about {
        position: fixed !important;
        z-index: 1;
    }
    
    .window1 {
        width: 95% !important;
        min-width: unset;
        left: 2.5% !important;
        right: 2.5% !important;
    }
    
    .about {
        width: 95% !important;
        min-width: unset;
    }
    
    .button1, .button2 {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Уменьшаем отступ слева для окон на мобильных */
    .window, .about {
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
    }
    
    .window1, .about {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 480px) {
    .about {
        width: 96% !important;
        min-width: unset;
    }
    
    .window{
        width: 96% !important;
        margin-left: 0% !important;
        margin-right: 2% !important;
    }
    
    .button1, .button2 {
        margin-left: 3%;
        margin-right: 3%;
    }
    
    .gameimg{
        max-width: 250px;
    }
    
    .gametext p{
        font-size: 13px;
    }
    
    .title{
        font-size: 16px;
    }
    
    /* Еще меньше отступ для очень маленьких экранов */
    .window, .about {
        left: 5px !important;
        right: 5px !important;
        width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
    }
}

/* Очень маленькие устройства */
@media (max-width: 360px) {
    .button1, .button2 {
        width: 50px !important;
        margin-left: 2%;
        margin-right: 2%;
    }
    
    .button1 img, .button2 img {
        width: 25px;
    }
    
    .footbut{
        width: 70px;
    }
    
    .time{
        width: 40px;
        font-size: 10px;
    }
}

/* Ландшафтная ориентация */
@media (max-height: 500px) and (orientation: landscape) {
    .adminwindow{
        min-height: 150vh;
    }
    
    .foot{
        position: relative;
    }
}

/* ===== УЛУЧШЕНИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ===== */
.mobile-device .toggleButton {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    tap-highlight-color: rgba(0,0,0,0.1);
}



.mobile-device .toggleButton:active button {
    border-color: #000 !important;
}

/* Убедимся, что окна правильно отображаются на мобильных */
@media (max-width: 768px) {
    .window, .about {
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
    
    .field-border {
        flex-direction: column !important;
    }
    
    .gameimg {
        max-width: 100% !important;
        margin-bottom: 15px;
    }
}

/* ===== ВСПОМОГАТЕЛЬНЫЕ СТИЛИ ===== */

/* Предотвращаем выделение текста при тапе */
.button1, .button2 {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.card-text{
    margin-top: 2% !important;
    margin-bottom: 2% !important;
}

hr{
    margin-top: 3% !important;
    margin-bottom: 3% !important;
    display: block;
}

.nav2{
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
}