#menu_info {
	position:absolute;
    top: 10px;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 2.5px;
    font-family: 'Times New Roman', Times, serif;
    pointer-events: none;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Monospace;
}

body.page-error {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
}

body.control-mouse-move {
  cursor: url('../textures/grab50.png') 25 25, auto;
}

body.control-mouse-move.dragging {
  cursor: url('../textures/grabbing50.png') 25 25, auto;
}

canvas {
  outline: none;
}

/* more space for the Stats.js button name */
.dg .cr.function .property-name {
  width: 100% !important;
}

.page-title {
  position: fixed;
  top: 0.75rem;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
}
.page-title span {
  color: #99ff4e;
}

.view-source-button {
  display: block;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 10;
  padding: 0.75rem;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.view-source-button:hover {
  background-color: #f3f3f3;
}
.view-source-button img {
  display: block;
  width: 1.5rem;
  opacity: 0.8;
}

#menu_settings {
 position: absolute;
 left: 90px;
 top: 20px;
 color: white;
 font-size: 25px;
}

#OrbitCon {
 position: absolute;
 left: 90px;
 top: 35px;
 color: white;
 font-size: 20px;
 pointer-events: none;
}

#PosCAM {
  position: absolute;
  right: 230px;
  top: 70px;
  color: white;
  font-size: 20px;
  pointer-events: none;
}

#cameraInfo {
  position: absolute;
  top: 160px;
  left: 10px;
  color: white;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 5px 10px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  z-index: 100;
}

/* селектор */

#languageSliderContainer {
  /* Сброс и установка желаемых стилей */
  background-color: transparent; /* или любой другой цвет */
  border: none; /* или border: 1px solid #ccc; */
  border-radius: 0; /* или нужный радиус */
  margin-bottom: 25px;
  padding: 5px; /* или нужный отступ */
  cursor: pointer;
  /* Унаследовать шрифт от родителя, если нужно */
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  /* Убрать стандартный outline при фокусе, если нужно */
  outline: none;
}

#languageSlider {
 display: flex;
 align-items: center;
 justify-content: center;
 position: relative;
 height: 40px; /* Высота слайдера */
}

#sliderPrev {
 background: blue;
 border: 1px solid #ccc;
 border-radius: 50%;
 width: 30px;
 height: 30px;
 cursor: pointer;
 position: absolute;
 left: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 20px;
 padding: 0;
}

#sliderNext {
 background: blue;
 border: 1px solid #ccc;
 border-radius: 50%;
 width: 30px;
 height: 30px;
 cursor: pointer;
 position: absolute;
 right: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 20px;
 padding: 0;
}

#sliderFlags {
 background-color: rgba(0, 0, 0, 0.6);
 border-radius: 40%;
 display: flex;
 align-items: center;
 justify-content: center;
 gap: 10px; /* Расстояние между флагами */
 overflow: hidden; /* Скрываем неактивные флаги */
 width: 100%;
 padding: 0 40px; /* Отступы для кнопок */
 box-sizing: border-box;
}

#sliderFlags button{
 background-image: url();
}

.lang-flag-btn {
 border: none;
 margin-top: 1rem;
 background: none;
 padding: 0;
 cursor: pointer;
 opacity: 0.5;
 transition: opacity 0.3s transform 0.3s;
 width: 64px;
 height: 64px;
 display: flex;
 align-items: center;
 justify-content: center;
}

.lang-flag-name {
 font-size: 8px; /* Меньший размер шрифта для названия */
 color: #00ffff; /* Цвет текста */
 text-align: center;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 max-width: 64px; /* Ширина, соответствующая ширине кнопки */
 padding: 0 2px; /* Небольшой внутренний отступ */
 box-sizing: border-box;
}

.lang-flag-btn.hover {
 opacity: 0.8;
}

.lang-flag-btn.active {
 opacity: 1;
 color: red;
}

.lang-flag-img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 border: 0.5px solid yellow;
 border-radius: 100px;
}

.lang-flag-emoji {
 width: 50px;               /* Фиксированная ширина для флагов */
 height: 50px;              /* Фиксированная высота */
 font-size: 20px;           /* Размер эмодзи = размер контейнера */
 line-height: 1;
 display: flex;
 align-items: center;
 justify-content: center;   /* ✅ ВЫРАВНИВАЕТ ЭМОДЗИ ВНУТРИ САМОГО SPAN */
 border-radius: 50%;        /* ✅ Круглые флаги — красиво! */
 border-color: #0f0;
 border: 0.5px ridge white;  /* Опционально: для отладки */
 font-family: 
     "Noto Color Emoji",    /* Android, Linux, ChromeOS */
     "Segoe UI Emoji",      /* Windows 10+ */
     "Apple Color Emoji",   /* macOS, iOS */
     "EmojiOne",            /* Резервный шрифт (если установлен) */
     "Twemoji Mozilla",     /* Дополнительный fallback для Firefox/Linux */
     "Android Emoji",       /* Для старых Android */
     "EmojiSymbols",        /* Редкий, но иногда используется */
     sans-serif;             /* Обязательный последний fallback */

 /* Чтобы эмодзи не растягивались */
 overflow: hidden;
 text-align: center;
}

/* конец селектора */

#uiOverlay {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 100;
}

#progressBarContainer {
  top: 60px;
  position: relative;
  width: 400px;
  height: 40px;
  margin: 0 10px;
}

#progressBar {
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid #00ffff;
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
  overflow: hidden;
  position: relative;
}

#progressFill {
  height: 100%;
  width: 0%;
  background-color: #1caf5f;
  border: 1px solid #00ffff;
  border-radius: 15px;
  transition: width 0.6s ease;
}

#progtext {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  color: greenyellow;
  z-index: 2;
  pointer-events: none;
}

#helpM, #mainMenu_g, #sound_setting {
    position: absolute;
    top: 60px;
    width: 40px;
    height: 40px;
    background-color: lightgray;
    border: 1px solid black;
    border-radius: 5px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
}

#helpM {
    left: calc(50% + 210px); /* 200px - половина ширины прогрессбара + 10px отступ */
    background-image: url("../textures/question-sign.svg");
}

#mainMenu_g {
    right: calc(50% + 210px); /* 200px - половина ширины прогрессбара + 50px отступ */
    background-image: url("../textures/home-page-100.svg");
}

#sound_setting {
  left: calc(50% + 255px);
}

#FaceCanvas {
  position: absolute;
  border: none;
  top: 200px;
  left: 5px;
}

#eMessage {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ff4444;
  color: white;
  padding: 25px;
  border-radius: 5px;
  z-index: 1000;
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 25px;
  max-width: 100%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#matrix-view {
  position: absolute;
  top: 200px;
  left: 10px;
  z-index: 10;
  color: orange;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px;
  border: 1px solid #00ffff;
}

#matrix-table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

/* Контейнер для крестообразного расположения */
.cross-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cross-row {
  /* border: 1px solid #00f; */
  display: flex;
  /* justify-content: center; */
  min-width: 240px;
  gap: 0;
  margin-bottom: 0;
}


/* Сетка для каждой грани 3x3 */
.face-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.1px;
}

/* Стили для ячеек */
.matrix-cell {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1px solid #555;
  box-sizing: border-box;
  overflow: hidden;
  white-space: pre;
}

/* Цвета */
.red { background-color: #f00; color: white; }
.green { background-color: #0f0; color: white; }
.blue { background-color: #00f; color: white; }
.white { background-color: #fff; color: black; }
.yellow { background-color: #ff0; color: black; }
.orange { background-color: #ffa500; color: black; }
.unknown { background-color: #777; color: white; }

/* Заголовки граней */
.face h4 {
  text-align: center;
  margin: 5px 0;
  color: #00ffff;
  font-size: 14px;
}

/* Убираем внешние отступы у граней */
.face {
  margin: 0;
}

.debugCheckbtn {
  display: none;
  position: absolute;
  border: 0.5px solid lightblue;
  top: 60px;
  right: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color:springgreen;
  cursor: pointer;
  min-width: 150px;
  border-radius: 15px;
  color: purple;
  z-index: 9;
}

.debugCheckbtn:hover {
  background-color: green;
  color: burlywood;
}

#pause-menu {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  right: 50%;
  top: 50%;
  border: 1px solid #00ffff;
  max-width: 850px;
  min-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 15px;
  color: #fff;
  text-align: center;
  z-index: 1001;
}

#blurmenu {
  position: fixed;
  height: 100%;
  width: 100%;
  backdrop-filter: blur(5px);
  z-index: 1000;
  pointer-events: auto;
}

#theme-select, #theme-select_2 {
  /* position: relative; */
  /* top: -15px; */
  color: #99ff4e;
  /* font-size: 16px; */
}

/* #theme-select_2 {
  top: 15px; 
}  */

#settings-info {
  color: #00ffff;
  font-size: 32px;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

#name_textures {
  position: relative;
  top: -15px;
  color: #0f0;
  font-size: 25px;
}

/* #name_mode {
  position: relative;
  text-align: center;
  font-size: 25px;
  color: #0f0;
  top: 15px;
} */

#name_sound {
  /* position: relative;
  text-align: center;
  font-size: 25px; */
  color: #0f0;
  /* top: 15px; */
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  #menu_info {
    font-size: 14px;
    padding: 5px;
    top: 5px;
  }
  
  #menu_settings {
    left: 10px;
    top: 10px;
    font-size: 18px;
  }
  
  #OrbitCon {
    left: 10px;
    top: 30px;
    font-size: 14px;
  }
  
  #cameraInfo {
    font-size: 12px;
    top: 70px;
    left: 5px;
    padding: 3px 6px;
  }
  
  #uiOverlay {
    top: 10px;
  }
  
  #progressBarContainer {
    width: 300px;
    height: 30px;
  }
  
  #progtext {
    font-size: 18px;
  }
  
  #helpM, #mainMenu_g, #sound_setting {
    width: 35px;
    height: 35px;
    top: 45px;
  }
  
  #helpM {
    left: calc(50% + 160px);
  }
  
  #mainMenu_g {
    right: calc(50% + 160px);
  }
  
  #sound_setting {
    left: calc(50% + 200px);
  }
  
  .debugCheckbtn {
    top: 45px;
    min-width: 120px;
    font-size: 12px;
    padding: 5px;
  }
  
  #pause-menu {
    width: 90%;
    min-width: unset;
    padding: 1rem;
  }
  
  /* #theme-select, #theme-select_2 {
    font-size: 14px;
  } */
  
  #settings-info {
    font-size: 24px;
  }
  
  #name_textures, #name_sound {
    font-size: 18px;
  }
  
  /* Адаптация для мобильных кнопок */
  #mobile-controls {
    bottom: 10px;
    padding: 5px;
  }
  
  .mobile-control-btn {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  #progressBarContainer {
    width: 250px;
  }
  
  #helpM, #mainMenu_g, #sound_setting {
    width: 30px;
    height: 30px;
  }
  
  #helpM {
    left: calc(50% + 130px);
  }
  
  #mainMenu_g {
    right: calc(50% + 130px);
  }
  
  #sound_setting {
    left: calc(50% + 160px);
  }
  
  .mobile-control-btn {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  #pause-menu {
    padding: 0.8rem;
  }
  
  #congrats, #pause {
    font-size: 28px;
  }
  
  #timesolve {
    font-size: 32px;
  }
  
  #resetBtn, #BackToMenuBtn {
    width: 45%;
    padding: 0.8rem 1rem;
    font-size: 14px;
  }
}

/* Горизонтальная ориентация (высота меньше 500px) */
@media (max-height: 500px) and (orientation: landscape) {
  #menu_info {
    font-size: 12px;
    top: 5px;
    padding: 2px;
  }
  
  #menu_settings {
    top: 5px;
    left: 5px;
    font-size: 16px;
  }
  
  #OrbitCon {
    top: 25px;
    left: 5px;
    font-size: 12px;
  }
  
  #cameraInfo {
    top: 50px;
    font-size: 10px;
    padding: 2px 4px;
  }
  
  #uiOverlay {
    top: 5px;
  }
  
  #progressBarContainer {
    width: 250px;
    height: 25px;
    top: 40px;
  }
  
  #progtext {
    font-size: 16px;
  }
  
  #helpM, #mainMenu_g, #sound_setting {
    width: 30px;
    height: 30px;
    top: 35px;
  }
  
  #helpM {
    left: calc(50% + 130px);
  }
  
  #mainMenu_g {
    right: calc(50% + 130px);
  }
  
  #sound_setting {
    left: calc(50% + 160px);
  }
  
  .debugCheckbtn {
    top: 35px;
    min-width: 100px;
    font-size: 10px;
    padding: 3px;
  }
  
  /* Мобильные кнопки в горизонтальной ориентации */
  #mobile-controls {
    bottom: 5px;
    padding: 3px;
  }
  
  .mobile-control-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Очень маленькая высота (менее 400px) */
@media (max-height: 400px) and (orientation: landscape) {
  #progressBarContainer {
    width: 200px;
    height: 20px;
  }
  
  #progtext {
    font-size: 14px;
  }
  
  #helpM, #mainMenu_g, #sound_setting {
    width: 25px;
    height: 25px;
  }
  
  .mobile-control-btn {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  /* Скрываем менее важные элементы при очень маленькой высоте */
  #cameraInfo {
    display: none;
  }
}

/* компакт меню */
/* Компактные настройки */
.modal-content_set.compact {
  max-width: 400px;
  padding: 20px;
}

/* Вкладки */
.settings-tabs {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 5px;
}

.tab-btn {
  flex: 1;
  padding: 8px 5px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: white;
  background: rgba(52, 152, 219, 0.1);
}

.tab-btn.active {
  color: #3498db;
  border-bottom-color: #3498db;
  font-weight: bold;
}

/* Контент вкладок */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Компактные опции */
.compact-option {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.2s;
}

.compact-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.compact-label {
  min-width: 80px;
  font-size: 14px;
  color: #3498db;
  margin-right: 10px;
}

.compact-select {
  flex: 1;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  font-size: 13px;
}

/* Превью темы */
.compact-preview {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.preview-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.compact-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.wheel-btn {
  font-size: 35px;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
}

.apply-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
}

.danger-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  font-size: 12px;
}

/* Слайдеры */
.slider-group {
  flex-direction: column;
  align-items: flex-start;
}

.slider-compact {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  margin-top: 5px;
}

.compact-slider {
  flex: 1;
  height: 4px;
  background: #555;
  border-radius: 2px;
  outline: none;
  /* -webkit-appearance: none; */
}

.compact-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #3498db;
  border-radius: 50%;
  cursor: pointer;
}

.volume-icon {
  font-size: 16px;
}

.volume-value {
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  color: #3498db;
}

/* Быстрые пресеты звука */
.sound-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.sound-preset {
  padding: 6px 4px;
  background: rgba(52, 152, 219, 0.2);
  border: 1px solid #3498db;
  border-radius: 4px;
  color: #3498db;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.sound-preset:hover {
  background: rgba(52, 152, 219, 0.4);
}

/* Информация */
.compact-info, .data-stats, .data-info {
  font-size: 12px;
  color: #aaa;
  margin: 10px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

/* Действия с данными */
.data-actions {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

/* Быстрые действия (нижняя панель) */
.quick-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #444;
}

.quick-btn {
  padding: 6px 12px;
  background: rgba(52, 152, 219, 0.2);
  border: 1px solid #3498db;
  border-radius: 4px;
  color: #3498db;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-btn:hover {
  background: rgba(52, 152, 219, 0.4);
}

.sound-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
}

/* Адаптивность */
@media (max-width: 480px) {
  .modal-content_set.compact {
      max-width: 95%;
      padding: 15px;
  }
  
  .tab-btn {
      font-size: 11px;
      padding: 6px 3px;
  }
  
  .compact-label {
      min-width: 70px;
      font-size: 13px;
  }
  
  .compact-select {
      font-size: 12px;
      padding: 5px 8px;
  }
  
  .data-actions {
      flex-direction: column;
  }
}