body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1a1a1a;
  color: #ffffff;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background-image: url(fon.webp);
  background-size: cover;
}

.hidden { display: none !important; }

/* --- ПАНЕЛЬ НАСТРОЕК --- */
#settings-bar {
  width: 100%;
  background-color: #252525;
  padding: 10px 20px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #444;
  flex-wrap: wrap; 
}

.select-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.select-group label {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 2px;
}

select {
  padding: 8px;
  background: #333;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  max-width: 150px;
}

/* Разделитель в меню */
.separator {
  width: 1px;
  height: 30px;
  background-color: #555;
  margin: 0 5px;
}

/* Кнопки и инструменты */
button {
  padding: 10px 20px;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.1s;
}
button:hover { opacity: 0.9; }
button:active { transform: scale(0.98); }

#mute-btn {
  font-weight: bold;
  margin-top: 14px; /* Выравнивание */
}
#mute-btn.muted { background-color: #d32f2f; }
#mute-btn.unmuted { background-color: #388e3c; }

/* Инструменты рисования */
#toggle-draw-btn {
  background-color: #9c27b0; /* Фиолетовый */
  margin-top: 14px;
}
#toggle-draw-btn.active {
  background-color: #7b1fa2;
  border: 2px solid #fff; /* Выделяем, когда включено */
}

#draw-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #333;
  padding: 5px 10px;
  border-radius: 5px;
  margin-top: 14px;
}

input[type="color"] {
  width: 35px;
  height: 35px;
  border: none;
  background: none;
  cursor: pointer;
}

#clear-draw-btn {
  background-color: #f44336;
  padding: 8px 12px;
}

/* --- ЭКРАН ВХОДА --- */
#login-screen {
  background: #2d2d2d;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  max-width: 90%;
}
input[type="text"] {
  padding: 12px;
  background: #333;
  border: 1px solid #444;
  color: white;
  margin-bottom: 10px;
  width: 250px;
  font-size: 16px;
  border-radius: 5px;
}
#join-btn {
  width: 100%;
  background-color: #1976d2;
  margin-top: 10px;
}

/* Превью */
#preview-container {
  margin-top: 20px;
  border-top: 1px solid #444;
  padding-top: 20px;
  position: relative;
}
#preview-container video, 
#preview-container canvas {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  border: 2px solid #555;
}

/* --- ИГРОВОЙ ЭКРАН --- */
#game-container {
  width: 100%;
  max-width: 1200px;
  padding: 20px;
  text-align: center;
}

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #333;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

#my-number-display {
  font-size: 1.2em;
  font-weight: bold;
  color: #ff9800; 
}

/* --- ПАНЕЛЬ ВЕДУЩЕГО --- */
#host-panel {
  background: #2c2c2c;
  border: 2px solid #ffd700;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
}
.host-settings { margin-bottom: 15px; }
.phase-buttons button {
  margin: 5px;
  padding: 8px 15px;
  color: white;
}
#start-game-btn {
  background-color: #d32f2f;
}

/* --- СЕТКА ВИДЕО --- */
#video-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.video-card {
  position: relative;
  background: #000;
  border: 2px solid #444;
  border-radius: 8px;
  overflow: hidden;
  width: 300px;
  display: flex;
  flex-direction: column;
}

video, canvas {
  width: 100%;
  height: auto;
  object-fit: cover;
  transform: scaleX(-1); /* Зеркалим видео */
  transition: opacity 0.5s ease;
}

.video-hidden { opacity: 0; }

.player-number-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  background-color: #ff9800;
  color: #000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 18px;
  z-index: 10;
  border: 2px solid white;
}

.name-tag {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px;
  font-weight: bold;
}

/* КУРСОР РИСОВАНИЯ */
.drawing-mode {
  cursor: crosshair !important; /* Крестик */
}

/* Роли */
.role-mafia { color: #e57373; font-weight: bold; }
.role-don { color: #b71c1c; font-weight: bold; text-decoration: underline; }
.role-sheriff { color: #64b5f6; font-weight: bold; }
.role-doctor { color: #81c784; font-weight: bold; }



#toggle-draw-btn {
  background-color: #9c27b0;
  margin-top: 14px;
  
  /* Новые строки для выравнивания картинки и текста: */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* Расстояние между картинкой и текстом */
}

/* Настройки самой картинки внутри кнопки */
.btn-icon {
  width: 30px;  /* Ширина картинки */
  object-fit: contain; /* Чтобы картинка не сплющивалась */
  pointer-events: none; /* Чтобы клики по картинке засчитывались кнопке */
  margin: -5px;
}