/* --- COMPACT ARCADE THEME --- */
body {
  margin: 0;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Black', sans-serif;
  background: #0f172a;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
}

h1 {
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.8rem;
  text-shadow: 2px 2px 0 #451a03;
  margin: 0 0 10px 0;
  text-align: center;
}

.dashboard {
  background: #1e293b;
  padding: 15px;
  border-radius: 15px;
  width: 100%;
  max-width: 700px;
  border: 4px solid #8b5cf6;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-box {
  background: #0f172a;
  padding: 8px;
  border-radius: 6px;
  color: #38bdf8;
  font-size: 0.9rem;
  font-weight: bold;
  border: 1px dashed #38bdf8;
  text-align: center;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  align-items: stretch;
}

.preview-container {
  background: #000;
  padding: 8px;
  border-radius: 10px;
  border: 3px solid #ef4444;
  display: flex;
  flex-direction: column;
}

.preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 5px;
  text-align: center;
}

.preview-box {
  flex-grow: 1;
  min-height: 120px;
  background: #333;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#previewImg { height: 100%; width: 100%; object-fit: cover; opacity: 0.7; }

#previewText {
  position: absolute;
  bottom: 5px;
  background: rgba(0,0,0,0.8);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 2px 2px 0 #000;
  border: 1px solid white;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.next-move-label {
  font-size: 0.9rem;
  font-weight: bold;
  color: #f97316;
  text-shadow: 1px 1px 0 black;
  text-align: center;
}

button {
  font-size: 1rem; 
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  width: 100%;
  transition: transform 0.1s;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

button:active { transform: translateY(2px); box-shadow: 0 0 0 transparent !important; }

.btn-launch { background: #8b5cf6; color: white; box-shadow: 0 4px 0 #5b21b6; }
.btn-move { background: #fbbf24; color: #451a03; box-shadow: 0 4px 0 #b45309; }
.btn-freeze { background: #0ea5e9; color: white; box-shadow: 0 4px 0 #0369a1; }
#btnPrev { box-shadow: 0 4px 0 #334155; }

.audio-controls {
  background: #334155;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #64748b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-top-row { display: flex; gap: 10px; align-items: center; }

#genreSelect {
  flex-grow: 1;
  padding: 8px;
  border-radius: 6px;
  background: #1e293b;
  color: #fbbf24;
  border: 1px solid #fbbf24;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.audio-buttons { display: flex; gap: 5px; }

.btn-audio { 
  font-size: 0.8rem; 
  padding: 8px 12px; 
  background: #475569; 
  color: white; 
  width: auto;
  opacity: 0.7;
}

.btn-audio.active {
  background: #22c55e;
  opacity: 1;
  box-shadow: 0 0 10px #22c55e;
  border: 1px solid white;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.label-small { min-width: 40px; font-weight: bold; color: #94a3b8; }

.time-display {
  font-family: monospace;
  font-size: 0.85rem;
  color: #fbbf24; 
  min-width: 45px;
  text-align: center;
}

#progressSlider { flex-grow: 1; accent-color: #fbbf24; height: 5px; cursor: pointer; }
#volSlider { flex-grow: 1; accent-color: #f0abfc; height: 5px; cursor: pointer; }

#volValue {
  background: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  color: #f0abfc;
  font-weight: bold;
  min-width: 35px;
  text-align: center;
}

.voice-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #0f172a;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid #475569;
}
.voice-toggle input { accent-color: #22c55e; width: 14px; height: 14px; }

details.custom-section {
  background: #334155;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  overflow: hidden;
  transition: 0.3s;
}

summary {
  padding: 10px;
  cursor: pointer;
  font-weight: bold;
  color: #94a3b8;
  list-style: none;
  text-align: center;
}

summary:hover { color: white; background: #475569; }

.custom-form {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #1e293b;
}

.custom-form input {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #64748b;
  background: #0f172a;
  color: white;
}

#btnAddCustom {
  background: #22c55e;
  color: #052e16;
  box-shadow: 0 4px 0 #14532d;
  margin-top: 5px;
}

.move-list-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 150px;
  overflow-y: auto;
}

.move-chip {
  background: #475569;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.move-chip:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #1e293b;
  padding: 30px;
  border-radius: 20px;
  border: 4px solid #fbbf24;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  color: white;
  max-height: 90vh; /* Prevents it from going off screen */
  overflow-y: auto; /* Allows scroll if instructions are long */
}

.modal-content h2 { margin-top: 0; color: #fbbf24; }
.steps p { margin: 10px 0; text-align: left; font-size: 1.1rem; }

.show-modal { display: flex; }

@media (max-width: 600px) {
  .main-grid { grid-template-columns: 1fr; }
  .preview-box { min-height: 150px; }
}