:root {
  --bg: #0a0c14;
  --bg-surface: #111520;
  --bg-raised: #181d2a;
  --border: #1e2436;
  --border-light: #2a3148;
  --text: #c8cdd8;
  --text-dim: #6b7490;
  --text-muted: #3d4560;
  --green: #00e87a;
  --green-dim: #00b861;
  --green-bg: rgba(0, 232, 122, 0.06);
  --amber: #f0a030;
  --red: #f04040;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 6px;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */

.header {
  width: 100%;
  max-width: 900px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--green);
}

.header .subtitle {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* ---- Hero ---- */

.hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-raised));
  border: 1px solid var(--border);
  border-left: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.hero-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.hero-close:hover {
  color: var(--text);
  border-color: var(--green-dim);
  background: var(--green-bg);
}

.hero-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--green);
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.hero-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.hero-body:last-child { margin-bottom: 0; }

.hero-body code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text);
}

.hero-body strong {
  color: var(--text);
  font-weight: 600;
}

.hero-link {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dotted var(--green-dim);
}

.hero-link:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ---- Main Container ---- */

.container {
  width: 100%;
  max-width: 900px;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- File Selection ---- */

.file-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.file-section.loaded {
  padding: 16px 24px;
}

.file-section.loaded .drop-zone {
  display: none;
}


.section-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--green-dim);
  background: var(--green-bg);
}

.drop-zone p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.drop-zone .hint {
  font-size: 12px;
  color: var(--text-muted);
}

.error-msg {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--red);
  background: rgba(240, 64, 64, 0.06);
  border: 1px solid rgba(240, 64, 64, 0.2);
  border-radius: var(--radius);
  padding: 10px 14px;
}

/* Track name (shown when loaded) */
.track-info {
  display: none;
}

.file-section.loaded .track-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.track-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.new-btn {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.new-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ---- Player ---- */

#player {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.screen-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

#screen {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 300 / 216;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Controls */
.controls {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green-dim);
  border-radius: var(--radius);
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.play-btn:hover {
  background: var(--green-bg);
}

.seek-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  cursor: pointer;
}

.time-display {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 90px;
  text-align: right;
}

/* ---- Footer links ---- */

.footer-links {
  width: 100%;
  max-width: 900px;
  margin-top: auto;
  padding: 24px 24px 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--green);
}


/* ---- Responsive ---- */

@media (max-width: 600px) {
  .header { padding: 16px; }
  .container { padding: 0 16px 32px; }
  .file-section { padding: 16px; }
  .file-inputs { flex-direction: column; }
  .controls { padding: 12px 16px; }
}
