body {
  font-family: system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background: #111;
  color: #eee;
}

h2 {
  color: #ff8c00;
  margin-bottom: 10px;
  font-size: 2rem;
}

p {
  margin-bottom: 30px;
  color: #ccc;
  font-size: 1.1rem;
}

#battle-container {
  display: flex;
  gap: 40px;
  margin-bottom: 30px;
}

.melody-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 20px;
  background: #222;
  min-width: 400px;
}

.melody-section h3 {
  margin: 0 0 10px 0;
  color: #ff8c00;
  font-size: 1.3rem;
}

.melody-info {
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: #ccc;
}

.visual-container {
  margin-bottom: 15px;
  border: 2px solid #ff8c00;
  border-radius: 8px;
  background: #333;
  transition: all 0.3s ease;
}

.visual-container.playing {
  background: #444;
  border-color: #ff4444;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
  animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 20px rgba(255, 68, 68, 0.3); }
  to { box-shadow: 0 0 30px rgba(255, 68, 68, 0.6); }
}

.play-btn {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: #ff8c00;
  color: #000;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.play-btn:hover {
  background: #ffa733;
  transform: translateY(-2px);
}

.vote-btn {
  padding: 15px 30px;
  font-size: 18px;
  border: none;
  border-radius: 12px;
  background: #28a745;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  margin-top: 10px;
}

.vote-btn:hover {
  background: #34ce57;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.vote-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.vote-btn.voted {
  background: #ffc107;
  color: #000;
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

#controls-top {
  margin-bottom: 20px;
  text-align: center;
}

#controls-top label {
  margin-right: 10px;
  font-weight: bold;
}

#speed-slider {
  width: 200px;
  margin: 0 10px;
}

#speed-display {
  color: #ff8c00;
  font-weight: bold;
}

#controls {
  margin-top: 20px;
}

.undecided-btn {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: #6c757d;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.undecided-btn:hover {
  background: #5a6268;
}


.evolution-btn {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: #e74c3c;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 10px;
}

.evolution-btn:hover {
  background: #c0392b;
}

.evolution-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.stats-btn {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: #2ecc71;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 10px;
}

.stats-btn:hover {
  background: #27ae60;
}

.stats-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

#llm-controls {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #3a3a3a;
}

.llm-btn {
  padding: 10px 20px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: #8e44ad;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  margin: 5px;
}

.llm-btn:hover {
  background: #9b59b6;
  transform: translateY(-1px);
}

.llm-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

#auto-evolution {
  margin-top: 20px;
  padding: 20px;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  background: #1a1a1a;
}

#auto-evolution h3 {
  margin: 0 0 15px 0;
  color: #ff8c00;
  font-size: 1.2rem;
}

#auto-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

#auto-controls label {
  color: #ccc;
  font-weight: bold;
}

#batch-size {
  padding: 8px 12px;
  border: 2px solid #444;
  border-radius: 6px;
  background: #333;
  color: #eee;
  font-size: 14px;
}

.auto-btn {
  padding: 10px 20px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: #27ae60;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
}

.auto-btn:hover {
  background: #2ecc71;
  transform: translateY(-1px);
}

.auto-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.results-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 800px;
  max-height: 70vh;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 20px;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.results-panel h3 {
  margin: 0 0 20px 0;
  color: #ff8c00;
  font-size: 1.4rem;
  border-bottom: 2px solid #444;
  padding-bottom: 10px;
}

.results-panel .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.results-panel .close-btn:hover {
  background: #c0392b;
}

#llm-results-content,
#llm-suggestions-content,
#island-stats-content {
  color: #ddd;
  line-height: 1.6;
  font-family: monospace;
  white-space: pre-wrap;
}

.llm-result-item {
  margin-bottom: 15px;
  padding: 15px;
  background: #2a2a2a;
  border-radius: 8px;
  border-left: 4px solid #8e44ad;
}

.llm-name {
  font-weight: bold;
  color: #9b59b6;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.llm-winner {
  color: #2ecc71;
  font-weight: bold;
}

.llm-confidence {
  color: #f39c12;
}

.llm-reasoning {
  color: #bdc3c7;
  margin-top: 8px;
  font-style: italic;
}

.island-stat-item {
  display: inline-block;
  margin: 10px;
  padding: 12px 20px;
  background: #2a2a2a;
  border-radius: 8px;
  border: 2px solid #444;
}

.island-name {
  font-weight: bold;
  color: #3498db;
  font-size: 1.1rem;
}

.island-info {
  color: #95a5a6;
  margin-top: 5px;
}

.auto-btn.stop-btn {
  background: #e74c3c;
}

#llm-log-container {
  margin: 20px auto;
  padding: 15px;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 12px;
  max-height: 400px;
  max-width: 900px;
  position: relative;
}

#llm-log-container h3 {
  margin: 0 0 10px 0;
  color: #ff8c00;
  font-size: 1.2rem;
  padding-right: 200px; /* Space for buttons */
}

#llm-log-controls {
  position: absolute;
  top: 12px;
  right: 15px;
  display: flex;
  gap: 10px;
}

.log-btn {
  padding: 5px 12px;
  font-size: 12px;
  background: #444;
  color: #ddd;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.log-btn:hover {
  background: #555;
}

#llm-log-content {
  height: 320px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 13px;
  color: #ddd;
  padding: 10px;
  background: #0a0a0a;
  border-radius: 6px;
  margin-top: 10px;
}

.log-entry {
  margin-bottom: 15px;
  padding: 10px;
  background: #222;
  border-left: 3px solid #666;
  border-radius: 4px;
}

.log-entry.battle {
  border-left-color: #9b59b6;
}

.log-entry.suggestion {
  border-left-color: #3498db;
}

.log-entry.evolution {
  border-left-color: #2ecc71;
}

.log-timestamp {
  color: #888;
  font-size: 11px;
  margin-bottom: 5px;
}

.log-content {
  line-height: 1.4;
}

.log-llm-name {
  color: #f39c12;
  font-weight: bold;
}

.log-winner {
  color: #2ecc71;
  font-weight: bold;
}

#llm-log-container.minimized #llm-log-content {
  display: none;
}

#llm-log-container.minimized {
  max-height: auto;
}

.auto-btn.stop-btn:hover {
  background: #c0392b;
}

.progress-bar {
  width: 300px;
  height: 20px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

#progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8c00, #ffa733);
  width: 0%;
  transition: width 0.3s ease;
}

#progress-text {
  color: #ff8c00;
  font-weight: bold;
}

.llm-votes {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
}

.llm-vote-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.3s ease;
  padding: 4px;
  margin: 3px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid transparent;
}

.llm-vote-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(0);
}

.llm-vote-icon.openai {
  background: rgba(255, 255, 255, 0.95);
  border-color: #10a37f;
}

.llm-vote-icon.anthropic {
  background: rgba(255, 255, 255, 0.95);
  border-color: #d4a574;
}

.llm-vote-icon.deepseek {
  background: rgba(255, 255, 255, 0.95);
  border-color: #6b8dd6;
}

.llm-vote-icon.voted {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
  border-width: 3px;
}

.llm-thinking {
  color: #ff8c00;
  font-style: italic;
  font-size: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}