.main-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; /* Изменено с 100% */
    height: 100%; /* Ограничение максимальной ширины */
    padding: 2rem;
    background: rgba(0,0,0,0.9);
    background-image: url("../textures/hypercubecompress.jpg");
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    display: flex; /* Добавлено */
    flex-direction: column; /* Вертикальное расположение */
    align-items: center; /* Центрирование по горизонтали */
    backdrop-filter: blur(5px); /* Увеличено значение blur */
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 30px rgba(0,255,255,0.3);
    z-index: 1000;
}

.title {
    border: 1px solid black;
    background-color: rgba(0,0,0,0.7);
    text-align: center;
    width: 50%;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 15px 0 30px orange;
}

.menu-buttons {
    width: 100%; /* Занимает всю ширину контейнера */
    max-width: 400px; /* Максимальная ширина кнопок */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-btn, .resetAndExit, .resume {
    margin-top: 1.5%;
    width: 100%; /* Кнопки занимают всю ширину контейнера */
    box-sizing: border-box; /* Учитывает padding в ширине */
    background: rgba(26,26,26,0.9);
    color: #fff;
    border: 2px solid #00ffff;
    padding: 1.2rem 2rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    backdrop-filter: blur(2px);
}

.btn-viewWF {
  margin-top: 1.5%;
  width: 75%;
  box-sizing: border-box;
  background-color: rgba(160,20,10, 0.8);
  color: #00ffff;
  border: 1px solid #00ffff;
  padding: 1.2rem 2rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 15px;
  text-align: center;
  text-decoration: none;
  backdrop-filter: blur(2px);
}

.menu-btn-accept {
    display: none;
    margin-top: 1.5%;
    width: 50%; /* Кнопки занимают всю ширину контейнера */
    box-sizing: border-box; /* Учитывает padding в ширине */
    background: rgba(26,26,26,0.9);
    color: #fff;
    border: 2px solid #00ffff;
    padding: 1.2rem 2rem;
    font-size: 0.89rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    backdrop-filter: blur(2px);
}

.menu-btn:hover, .resetAndExit:hover, .resume:hover, .menu-btn-accept:hover, .btn-viewWF:hover {
    background: rgba(0,255,255,0.9);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,255,255,0.4);
}

/* Modal Styles */
.modal, .modal_con {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1001;
    animation: fadeIn 0.3 ease
}

.modal_set {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #00ffff;
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem;
    background: #1a1a1a;
    border-radius: 15px;
    color: #fff;
    text-align: center;
}

.ui-element {
    position: fixed;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-radius: 5px;
    z-index: 999;
}

.close-btn, .close-btnWF {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #00ffff;
    transition: color 0.3s;
    z-index: 1001;
}

.close-btnWF {
  margin-top: 7rem;
  margin-right: 38rem;
}

.close-btn:hover, .close-btnWF:hover {
    color: #ff0000;
}

/* Стили для модальных окон */
.help-content {
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 1rem;
}

.control-group {
    margin: 1.5rem 0;
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
}

.control-group h3 {
    color: #00ffff;
    margin-bottom: 0.01rem;
}

.control-group ul {
    list-style-type: square;
    padding-left: 1.5rem;
}

.control-group li {
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* Стили для информации о создателе */
.creator-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-top: 1rem;
}

.creator-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #00ffff;
    object-fit: cover;
}

.creator-details {
    flex: 1;
    text-align: left;
}

.creator-details a {
    color: #00ffff;
    text-decoration: none;
}

.creator-details a:hover {
    text-decoration: underline;
}

#congrats, #pause {
    /* border: 1px solid red; */
    font-size: 35px;
}

#timesolve {
    font-size: 40px;
}

#maincontrol, #cube-control-title {
    text-align: center;
    font-size: 20px;
}

li {
    font-size: 17px;
}

#creator {
    font-size: 35px;
}

p {
    font-size: 20px;
}

#resetBtn{
    margin-top: 3%;
    width: 35%; /* Кнопки занимают всю ширину контейнера */
    box-sizing: border-box; /* Учитывает padding в ширине */
    background: rgba(26,26,26,0.9);
    background-image: url("../textures/refresh.svg");
    background-repeat: no-repeat;
    background-position: center;
    color: #fff;
    border: 2px solid #00ffff;
    padding: 1.2rem 2rem;
    font-size: 1.0rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    backdrop-filter: blur(2px);
}

#BackToMenuBtn {
    margin-top: 3%;
    width: 35%; /* Кнопки занимают всю ширину контейнера */
    box-sizing: border-box; /* Учитывает padding в ширине */
    background: rgba(26,26,26,0.9);
    color: #fff;
    border: 2px solid #00ffff;
    padding: 1.2rem 2rem;
    font-size: 1.0rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    backdrop-filter: blur(2px);
}

#helpbyCont {
    font-size: 30px;
}

#dls, #dls2, #dls3, #mcTextPhone {
    list-style-type: none;
}

.modal-content_set {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    max-width: 500px;
    width: 90%;
    margin: 0 auto;
    padding: 2.5rem 3rem;
    background: #1a1a1a;
    border-radius: 20px;
    border: 1px solid #00ffff;
    color: #fff;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

.select h3, .slider h3 {
    color: #00ffff;
    font-size: 18px;
    margin-bottom: 0.05rem;
    text-align: left;
}

/* === Выпадающие списки === */
.select select {
    width: 100%;
    padding: 0.4rem 1.2rem;
    font-size: 16px;
    border-radius: 10px;
    border: 2px solid #00ffff;
    background-color: #222;
    color: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2300ffff' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 12px;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    margin-bottom: 1.2rem;
}

.select select:hover,
.select select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.3);
}

.slider {
    margin-top: 2rem;    
    justify-items: center;
    text-align: left;    
}

.slider-wrapper {
    position: relative;
    /* border: 1px solid #00ffff; */
    margin: 0.6rem 0;
    width: 100%; /* Растягиваем на всю ширину родительского контейнера */
    box-sizing: border-box; /* Учитываем границы и отступы в общей ширине */    
}

.slider-wrapper .range {
    width: 100%;
    margin: 0;
}


.slider-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #00ffff;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s;
    opacity: 0;
}

.slider-wrapper:hover .slider-value {
    opacity: 1;
}

.range {
    height: 30px;    
    width: 330px;
    appearance: none;
    border-radius: 30px;
    box-shadow: 0 0 6px #ccc;
    overflow: hidden;
    outline: none;
}

.range-label {
    color: #00ffff;   
    font-size: 15px;
}

.range::-webkit-slider-thumb { 
    height: 50px; 
    width: 50px;
    background: #0f9000;
    appearance: none; 
    cursor: pointer;
    border-radius: 50px;
    box-shadow: -200 0 0 185px #9183f0;
    border: 0;
    z-index: 1001;
}

.range::-moz-range-thumb {
    height: 60px;
    width: 60px;
    appearance: none;
    background: #534b84;
}

.form-texture {
    display: block;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    align-content: center;
    align-items: center;
    border: 1px solid orange;
    
}

.sound_setting{
  font-size: 1.6rem;
  user-select: none;
}

@media (max-width: 1200px) {
  .sound_setting {
    font-size: 1.1rem;
  }
  
}

@media (max-width: 768px) {
    #cameraInfo {
        font-size: 12px;
        padding: 5px;
    }
    
    #progressBar {
        width: 80%;
    }
    
    .modal {
        width: 90%;
        max-width: 90%;
    }
    
    #mobile-controls {
        bottom: 10px;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }

    .sound_setting {
      font-size: 1rem;
    }
}

/* Улучшение для touch-устройств */
button, .control-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Предотвращение масштабирования при двойном тапе */
* {
    touch-action: manipulation;
}

/* Мобильные элементы управления */
#mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    z-index: 100;
}

.mobile-control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 50px;
    user-select: none;
    border: 2px solid #ecf0f1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.mobile-control-btn:active {
    background-color: rgba(41, 128, 185, 0.9);
    transform: scale(0.95);
}

#rotate-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rotate-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(231, 76, 60, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    user-select: none;
    border: 2px solid #ecf0f1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.rotate-btn:active {
    background-color: rgba(192, 57, 43, 0.9);
    transform: scale(0.95);
}

#mobile-menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(52, 73, 94, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    z-index: 100;
    border: 2px solid #ecf0f1;
}

#control-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    background-color: rgba(52, 73, 94, 0.8);
    border-radius: 10px;
    font-size: 14px;
    border: 2px solid #ecf0f1;
}

/* Адаптация для маленьких экранов */
@media (max-width: 480px) {
    .mobile-control-btn {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    .rotate-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    #mobile-menu-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .main-menu {
      width: 100%;
      max-width: unset;
      padding: 1.5rem;
    }
    
    .title {
      font-size: 2rem;
      width: 80%;
    }
    
    .menu-buttons {
      max-width: 100%;
    }
    
    .menu-btn, .resetAndExit, .resume {
      padding: 1rem 1.5rem;
      font-size: 1.1rem;
    }
    
    .menu-btn-accept {
      width: 70%;
      padding: 1rem 1.5rem;
      font-size: 0.8rem;
    }
    
    .modal-content {
      width: 90%;
      max-width: unset;
      padding: 1.5rem;
    }
    
    .modal-content_set {
      width: 85%;
      padding: 1.5rem 2rem;
    }
    
    .creator-info {
      flex-direction: column;
      gap: 1rem;
    }
    
    .creator-avatar {
      width: 100px;
      height: 100px;
    }
    
    #creator {
      font-size: 28px;
    }
    
    p {
      font-size: 16px;
    }
    
    .control-group h3 {
      font-size: 18px;
    }
    
    .control-group li {
      font-size: 14px;
    }
    
    /* Настройки */
    .select select {
      font-size: 14px;
      padding: 0.3rem 1rem;
    }
    
    .range {
      width: 250px;
    }
    
    .range-label {
      font-size: 14px;
    }
  }
  
  @media (max-width: 480px) {
    .main-menu {
      padding: 1rem;
    }
    
    .title {
      font-size: 1.8rem;
      width: 90%;
    }
    
    .menu-btn, .resetAndExit, .resume {
      padding: 0.8rem 1rem;
      font-size: 1rem;
    }
    
    .modal-content {
      padding: 1rem;
    }
    
    .modal-content_set {
      padding: 1rem 1.5rem;
    }
    
    #resetBtn, #BackToMenuBtn {
      width: 80%;
      margin-top: 1rem;
    }
    
    .range {
      width: 200px;
    }
    
    .select h3, .slider h3 {
      font-size: 16px;
    }
    .wheel {
      width: 15rem;
      height: 15rem;
    }
  }

  /* Горизонтальная ориентация для модальных окон */
@media (max-height: 500px) and (orientation: landscape) {
    .main-menu {
      padding: 1rem;
      overflow-y: auto;
      max-height: 100%;
    }
    
    .title {
      font-size: 1.5rem;
      margin-bottom: 1rem;
    }
    
    .menu-buttons {
      gap: 0.5rem;
    }
    
    .menu-btn, .resetAndExit, .resume {
      padding: 0.7rem 1rem;
      font-size: 1rem;
    }
    
    .modal-content {
      padding: 1rem;
      max-height: 90vh;
      overflow-y: auto;
    }
    
    .modal-content_set {
      padding: 1rem;
      max-height: 90vh;
      overflow-y: auto;
    }
    
    .creator-info {
      gap: 0.5rem;
    }
    
    .creator-avatar {
      width: 80px;
      height: 80px;
    }
    
    #creator {
      font-size: 24px;
    }
    
    p {
      font-size: 14px;
    }
    
    .control-group {
      margin: 0.5rem 0;
      padding: 0.5rem;
    }
    
    .control-group h3 {
      font-size: 16px;
    }
    
    .control-group li {
      font-size: 12px;
    }
    
    /* Настройки в горизонтальной ориентации */
    .select select {
      font-size: 12px;
      padding: 0.2rem 0.8rem;
    }
    
    .range {
      width: 200px;
    }
    
    .range-label {
      font-size: 12px;
    }
  }
  
  /* Очень маленькая высота для модальных окон */
  @media (max-height: 400px) and (orientation: landscape) {
    .main-menu {
      padding: 0.5rem;
    }
    
    .title {
      font-size: 1.2rem;
    }
    
    .menu-btn, .resetAndExit, .resume {
      padding: 0.5rem 0.8rem;
      font-size: 0.9rem;
    }
    
    #creator {
      font-size: 20px;
    }
    
    p {
      font-size: 12px;
    }
    
    /* Упрощаем интерфейс настроек */
    .select h3, .slider h3 {
      margin-bottom: 0.2rem;
    }
    
    .range {
      width: 150px;
    }
    .wheel {
      width: 15rem;
      height: 15rem;
    }
  }


/* стиль очистки */
/* Стили для кнопок управления данными */
.data-management-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 10px;
}

.menu-btn.danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: 1px solid #c0392b;
}

.menu-btn.danger:hover {
  background: linear-gradient(135deg, #ff6b6b 0%, #e74c3c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.menu-btn.danger:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.confirmation-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 25px;
  border-radius: 12px;
  z-index: 10001;
  color: white;
  text-align: center;
  min-width: 150px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid #ff6b6b;
}

.confirmation-dialog h3 {
  color: #ff6b6b;
  margin-bottom: 15px;
}

.confirmation-dialog p {
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirmation-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.confirm-yes {
  background: #e74c3c;
  color: white;
}

.confirm-yes:hover {
  background: #ff6b6b;
}

.confirm-no {
  background: #34495e;
  color: white;
}

.confirm-no:hover {
  background: #4a6582;
}  