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

body {
  background: #111;
  color: #eee;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

#viewport {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Drop zone */
#drop-zone {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

#drop-zone[hidden] { display: none; }

#drop-zone.drag-over {
  background: #1a2a3a;
}

.drop-content {
  text-align: center;
  padding: 60px;
  border: 2px dashed #555;
  border-radius: 20px;
  max-width: 500px;
}

.drop-content h1 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: #8cf;
}

.drop-content p { margin: 8px 0; color: #aaa; }
.drop-content .sub { color: #666; font-size: 0.85rem; }
.drop-content .hint { color: #666; font-size: 0.75rem; margin-top: 16px; }

#file-btn {
  margin-top: 12px;
  padding: 10px 28px;
  background: #2a6aaa;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
#file-btn:hover { background: #3a8ada; }

/* Loading */
#loading {
  position: fixed; inset: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
}

#loading[hidden] { display: none; }

.spinner {
  width: 48px; height: 48px;
  border: 4px solid #333;
  border-top-color: #8cf;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Controls panel */
#controls {
  position: fixed;
  top: 12px; right: 12px;
  width: 260px;
  background: rgba(20, 24, 32, 0.92);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 14px;
  z-index: 10;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.control-group {
  margin-bottom: 12px;
}

.control-group label {
  display: block;
  font-size: 0.75rem;
  color: #8af;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-group label span {
  color: #ccc;
  float: right;
  text-transform: none;
  letter-spacing: 0;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #333;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: #8cf;
  border-radius: 50%;
  cursor: pointer;
}

.dual-slider {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.btn-row button, .control-group > button {
  flex: 1;
  padding: 5px 6px;
  background: #2a2e38;
  color: #bbb;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 0;
}

.btn-row button:hover, .control-group > button:hover {
  background: #3a3e48;
  color: #fff;
}

.btn-row button.active {
  background: #2a6aaa;
  color: #fff;
  border-color: #4a8aca;
}

.anim-group button.playing {
  background: #a44;
  border-color: #c66;
  color: #fff;
}

#btn-reset {
  background: #333;
  flex: 1;
}

#btn-new {
  background: #333;
  flex: 1;
}

/* Info bar */
#info-bar {
  position: fixed;
  bottom: 12px; left: 12px;
  background: rgba(20, 24, 32, 0.85);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #8af;
  z-index: 10;
  display: flex;
  gap: 16px;
}
#info-version {
  opacity: 0.5;
}
