:root {
  --bg: #0d1220;
  --panel: #171f33;
  --panel-2: #202c45;
  --text: #f4f7ff;
  --muted: #aab6d3;
  --accent: #4fd1c5;
  --accent-2: #2c7be5;
  --danger: #ff6b6b;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans Thai", "Prompt", sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at -5% -20%, #23416e 0%, transparent 55%),
    radial-gradient(900px 450px at 120% 120%, #163f39 0%, transparent 60%),
    var(--bg);
}

.app {
  width: min(820px, 92vw);
  margin: 28px auto;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.subtitle {
  margin: 8px 0 20px;
  color: var(--muted);
}

.panel {
  background: linear-gradient(145deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid #2a3a59;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input[type="text"] {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid #34496f;
  border-radius: 10px;
  padding: 11px 12px;
  background: #121a2c;
  color: var(--text);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--accent-2);
}

input[type="range"] {
  width: 100%;
  margin-bottom: 14px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #041427;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  background: #6f7b97;
  color: #d8deef;
  cursor: not-allowed;
}

#stop-btn:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.now-playing {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  align-items: center;
}

.now-playing img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #314160;
  background: #0b1222;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.now-playing h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.timeline {
  margin-top: 10px;
}

.timeline input[type="range"] {
  margin-bottom: 8px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden-player {
  position: absolute;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: -9999px;
  pointer-events: none;
}

@media (max-width: 640px) {
  .now-playing {
    grid-template-columns: 1fr;
  }
}
