body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #121212;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.scene {
    width: 200px;
    height: 200px;
    perspective: 1000px;
    margin-bottom: 80px;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.3, 1);
    transform: rotateX(-30deg) rotateY(45deg);
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: 900;
    color: white;
    border-radius: 15px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
    /* Делаем грани менее прозрачными, чтобы цифры не сливались */
    backface-visibility: visible;
    touch-action: none; /* Предотвращает стандартное поведение браузера при таче */
    /* Убирает выделение текста */
    user-select: none; 
    -webkit-user-select: none; /* Для Safari и мобильных браузеров */
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Дополнительно предотвращает вызов контекстного меню на мобилках */
    -webkit-touch-callout: none; 
}

/* Раскрашиваем каждую грань индивидуально */
.front  { transform: rotateY(0deg) translateZ(100px); background: rgba(231, 76, 60, 0.9); }  /* Красный */
.back   { transform: rotateY(180deg) translateZ(100px); background: rgba(46, 204, 113, 0.9); } /* Зеленый */
.right  { transform: rotateY(90deg) translateZ(100px); background: rgba(52, 152, 219, 0.9); } /* Синий */
.left   { transform: rotateY(-90deg) translateZ(100px); background: rgba(241, 196, 15, 0.9); } /* Желтый */
.top    { transform: rotateX(90deg) translateZ(100px); background: rgba(155, 89, 182, 0.9); } /* Фиолетовый */
.bottom { transform: rotateX(-90deg) translateZ(100px); background: rgba(230, 126, 34, 0.9); } /* Оранжевый */

button {
    padding: 18px 40px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    background: #ffffff;
    color: #1a1a1a;
    border: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    z-index:99;
}

/* Убираем "залипание" красного цвета после клика */
/* Сбрасываем любые фокусные эффекты, чтобы не залипало */
button:focus {
    background: #ffffff;
    color: #1a1a1a;
}


/* Красный цвет ТОЛЬКО для компьютеров с мышью */
@media (hover: hover) {
    button:hover {
        background: #e74c3c;
        color: white;
        transform: translateY(-3px);
    }
}

/* Эффект при нажатии (и для мыши, и для тача) */
button:active {
    background: #c0392b !important;
    color: white !important;
    transform: scale(0.95);
}
button:disabled {
    opacity: 0.5;
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
}
