:root {
  color-scheme: dark;
  --bg: #101820;
  --panel: #182430;
  --panel-2: #22313f;
  --text: #f7f3e8;
  --muted: #b4c0bd;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #f2b84b;
  --accent-2: #55c3a5;
  --danger: #ff7b72;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(140deg, rgba(85, 195, 165, 0.18), transparent 36%),
    linear-gradient(310deg, rgba(242, 184, 75, 0.15), transparent 42%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 420px);
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  align-items: center;
}

.player-stage {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.art-panel,
.video-frame,
.controls,
.queue-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 36, 48, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.art-panel {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
}

.art-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.55));
}

.art-fallback {
  position: absolute;
  color: var(--muted);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0;
}

.video-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-frame.is-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
}

#player,
#player iframe {
  width: 100%;
  height: 100%;
}

.controls,
.queue-panel {
  padding: 18px;
}

.now {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

#status {
  min-height: 48px;
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.load-form {
  display: grid;
  gap: 8px;
}

.load-form label {
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
}

input[type="url"] {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

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

.transport {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.primary {
  background: var(--accent);
  color: #1a1710;
  font-weight: 900;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.toggles label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.queue-panel {
  grid-column: 2;
  align-self: start;
  max-height: min(68vh, 680px);
  overflow: hidden;
}

.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.queue-head button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--danger);
}

.queue {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  max-height: calc(min(68vh, 680px) - 74px);
}

.queue li {
  display: grid;
  grid-template-columns: 72px 1fr 44px;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.queue li.active {
  border-color: var(--accent);
}

.queue img {
  width: 72px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
}

.queue strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .queue-panel {
    grid-column: 1;
    max-height: none;
  }

  .queue {
    max-height: 360px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0 18px;
  }

  .controls,
  .queue-panel {
    padding: 14px;
  }

  h1 {
    font-size: 28px;
  }

  .transport {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
  }
}
