* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Hidden education text */
.education-text {
  position: absolute;
  opacity: 0;
  font-size: 1px;
  color: transparent;
  pointer-events: none;
  user-select: none;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

#lobby-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.lobby-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.6s ease;
}

.game-title {
  font-size: 56px;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.game-subtitle {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 300;
}

/* Isometric Content Section */
.isometric-content-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 35px 40px;
  border-radius: 20px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.6s ease 0.15s backwards;
}

.isometric-content-section h2 {
  font-size: 28px;
  color: #333;
  margin-bottom: 25px;
  font-weight: 700;
  text-align: center;
}

.isometric-content-section p {
  font-size: 15px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 18px;
  text-align: justify;
}

.isometric-content-section p:last-child {
  margin-bottom: 0;
}

/* Player Setup */
.player-setup {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 20px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.6s ease 0.2s backwards;
}

.player-name-section {
  margin-bottom: 25px;
}

.player-name-section label,
.player-color-section label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

#player-name {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#player-name:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.color-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hex-color-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 2px solid #eaeaea;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.02);
}

.hex-color-preview {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.hex-color-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hex-prefix {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 800;
  color: #333;
  opacity: 0.9;
}

.hex-byte {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hex-byte-label {
  font-size: 12px;
  font-weight: 800;
  color: #555;
  width: 14px;
  text-align: center;
}

#hex-r,
#hex-g,
#hex-b {
  width: 52px;
  padding: 10px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#hex-r:focus,
#hex-g:focus,
#hex-b:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

#hex-r.invalid,
#hex-g.invalid,
#hex-b.invalid {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12);
}

.hex-color-help {
  font-size: 12px;
  color: #666;
  font-weight: 600;
  margin-left: auto;
  text-align: right;
}

.color-option {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid transparent;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px #667eea, 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.15);
}

/* Game Modes Section */
.game-modes-section {
  margin-bottom: 40px;
  animation: fadeIn 0.6s ease 0.4s backwards;
}

.game-modes-section h2 {
  font-size: 32px;
  color: #fff;
  margin-bottom: 25px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.game-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.game-mode-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.game-mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.game-mode-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.game-mode-card:hover::before {
  opacity: 1;
}

.game-mode-card.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.game-mode-card.selected h3,
.game-mode-card.selected p {
  color: #fff;
}

.mode-icon {
  font-size: 48px;
  margin-bottom: 15px;
  filter: grayscale(0.3);
  transition: filter 0.3s;
}

.game-mode-card:hover .mode-icon,
.game-mode-card.selected .mode-icon {
  filter: grayscale(0);
}

.game-mode-card h3 {
  font-size: 24px;
  color: #333;
  margin-bottom: 12px;
  font-weight: 700;
}

.game-mode-card p {
  font-size: 15px;
  color: #666;
  margin-bottom: 18px;
  line-height: 1.5;
}

.mode-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.player-count {
  font-size: 14px;
  color: #667eea;
  font-weight: 600;
}

.game-mode-card.selected .player-count {
  color: rgba(255, 255, 255, 0.9);
}

.mode-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.tag-casual {
  background: #4ECDC4;
  color: #fff;
}

.tag-action {
  background: #FF6B6B;
  color: #fff;
}

.tag-competitive {
  background: #FFD93D;
  color: #333;
}

.tag-infection {
  background: #FF5F1F;
  color: #fff;
}

/* Rooms Section */
.rooms-section {
  animation: fadeIn 0.6s ease 0.6s backwards;
}

.rooms-section h2 {
  font-size: 32px;
  color: #fff;
  margin-bottom: 25px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.no-rooms {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  color: #666;
  font-size: 16px;
  grid-column: 1 / -1;
}

.room-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.room-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.room-name {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.room-mode {
  font-size: 14px;
  color: #667eea;
  font-weight: 600;
  text-transform: capitalize;
}

.room-players {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.join-room-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.join-room-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.join-room-btn:active {
  transform: translateY(0);
}

/* Selected Mode Panel */
.selected-mode-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
  z-index: 100;
}

.selected-mode-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.selected-mode-text {
  flex: 1;
  min-width: 220px;
}

.selected-mode-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.weapon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
}

.weapon-row label {
  font-size: 14px;
  opacity: 0.95;
}

#weapon-select,
#stomp-duration-select,
#koth-duration-select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  outline: none;
  font-weight: 600;
}

#weapon-select option,
#stomp-duration-select option,
#koth-duration-select option {
  color: #111;
}

.selected-mode-content h3 {
  font-size: 28px;
  color: #fff;
  margin-bottom: 8px;
}

.selected-mode-content p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.action-buttons {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #fff;
  color: #667eea;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-cancel {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}

.btn-cancel:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .game-title {
    font-size: 42px;
  }
  
  .game-modes-grid {
    grid-template-columns: 1fr;
  }
  
  .rooms-list {
    grid-template-columns: 1fr;
  }
  
  .selected-mode-content {
    flex-direction: column;
    align-items: stretch;
  }

  .selected-mode-controls {
    justify-content: flex-start;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}
