:root {
  --bg: #070707;
  --panel: rgba(22, 22, 22, 0.92);
  --panel-alt: rgba(31, 31, 31, 0.96);
  --line: rgba(255, 214, 10, 0.12);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #f5f1e6;
  --muted: #a8a08f;
  --yellow: #ffd60a;
  --yellow-strong: #ffca0a;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 10, 0.1), transparent 20%),
    radial-gradient(circle at 80% 20%, rgba(255, 214, 10, 0.05), transparent 28%),
    linear-gradient(180deg, #030303 0%, #090909 48%, #050505 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.mini-shell {
  width: 100%;
  height: 100vh;
  padding: 10px 12px;
}

.player-window {
  width: min(100%, 1200px);
  height: calc(100vh - 20px);
  margin: 0 auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 214, 10, 0.025), transparent 20%),
    rgba(10, 10, 10, 0.97);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.window-bar,
.player-main,
.transport-strip,
.action-row,
.inline-row,
.queue-header,
.dock-header {
  display: flex;
  align-items: center;
}

.window-bar,
.control-dock,
.queue-card {
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.window-bar {
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
}

.window-dots {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.window-dots span:first-child {
  background: rgba(255, 95, 86, 0.9);
}

.window-dots span:nth-child(2) {
  background: rgba(255, 189, 46, 0.9);
}

.window-dots span:nth-child(3) {
  background: rgba(39, 201, 63, 0.9);
}

.window-meta {
  flex: 1;
  min-width: 0;
}

.eyebrow,
.track-kicker {
  margin: 0 0 6px;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.window-meta h1,
.cover-notes h2,
.dock-header h3,
.queue-header h3 {
  margin: 0;
}

.window-meta h1 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.12);
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.status-pill.is-paused,
.status-pill.is-waiting {
  background: rgba(255, 214, 10, 0.08);
  color: #d9bb59;
}

.player-main {
  gap: 10px;
  align-items: stretch;
  min-height: 0;
}

.cover-panel,
.player-core,
.dock-card,
.queue-card {
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: var(--panel);
}

.cover-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 34%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

.cover-brand-banner,
.cover-track-row {
  min-width: 0;
}

.cover-brand-banner {
  display: grid;
  grid-template-columns: minmax(132px, 168px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 214, 10, 0.06);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 10, 0.05), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.brand-logo-frame {
  width: 100%;
  min-height: 74px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 214, 10, 0.06);
  background:
    radial-gradient(circle at top, rgba(255, 214, 10, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#brand-logo {
  width: 100%;
  height: auto;
  max-width: 190px;
  max-height: 54px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 16px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.2));
}

.brand-logo-fallback {
  text-align: center;
}

.brand-mark {
  display: block;
  color: var(--yellow);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-logo-fallback small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.brand-copy {
  min-width: 0;
  padding: 0 2px;
  text-align: left;
}

.brand-copy .eyebrow {
  margin-bottom: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  max-width: 20ch;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted);
  max-width: 26ch;
  font-size: 0.76rem;
  line-height: 1.24;
}

.cover-track-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  align-items: center;
}

.cover-art {
  position: relative;
  width: 128px;
  aspect-ratio: 1;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 214, 10, 0.26), transparent 45%),
    linear-gradient(145deg, #1a1a1a 0%, #0b0b0b 100%);
  overflow: hidden;
}

.cover-rings {
  position: absolute;
  inset: 13px;
  border-radius: 22px;
  border: 1px solid rgba(255, 214, 10, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 0 28px rgba(255, 214, 10, 0.07);
}

.cover-art.is-fallback .cover-rings {
  display: none;
}

.cover-core {
  position: absolute;
  inset: 22px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 214, 10, 0.12), rgba(255, 214, 10, 0.02)),
    rgba(15, 15, 15, 0.98);
  overflow: hidden;
}

.cover-core::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.38) 100%);
  pointer-events: none;
}

.cover-art.is-fallback .cover-core::after {
  background: linear-gradient(180deg, rgba(255, 214, 10, 0.03) 0%, rgba(0, 0, 0, 0.26) 100%);
}

.cover-core span {
  position: relative;
  z-index: 1;
  color: var(--yellow);
  font-size: 3rem;
  font-weight: 800;
}

.cover-art.is-fallback .cover-core {
  inset: 16px;
  border: 1px solid rgba(255, 214, 10, 0.14);
}

#cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-notes {
  min-width: 0;
}

.cover-notes h2 {
  font-size: clamp(1.24rem, 1.7vw, 1.7rem);
  line-height: 0.98;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.track-meta,
.sync-note,
.queue-item-meta,
.dock-header p,
.queue-header p {
  color: var(--muted);
}

.track-meta,
.sync-note {
  margin: 7px 0 0;
  line-height: 1.28;
}

.track-meta {
  font-size: 0.88rem;
}

.sync-note {
  font-size: 0.84rem;
}

.player-core {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

.transport-strip {
  justify-content: center;
  gap: 14px;
}

.round-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #1a1a1a;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.round-button.primary {
  width: 64px;
  height: 64px;
  background: linear-gradient(180deg, #ffe46a 0%, var(--yellow-strong) 100%);
  border-color: rgba(255, 214, 10, 0.55);
  color: #090909;
  font-size: 1.45rem;
}

.round-button.ghost:hover,
.chip-button:hover,
.accent-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.progress-card {
  padding: 10px 12px;
  border-radius: 20px;
  background: var(--panel-alt);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.progress-rail {
  width: 100%;
  height: 10px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff0a8 0%, var(--yellow) 55%, #c99900 100%);
  box-shadow: 0 0 18px rgba(255, 214, 10, 0.24);
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.player-stats article {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--panel-alt);
}

.player-stats span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.player-stats strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
  word-break: break-word;
}

.action-row {
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.chip-button,
.accent-button,
.ghost-button,
input,
select {
  min-height: 42px;
  border-radius: 999px;
}

.chip-button,
.accent-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 20px;
  cursor: pointer;
  white-space: nowrap;
}

.chip-button {
  background: #1c1c1c;
  color: var(--text);
}

.accent-button {
  background: linear-gradient(180deg, #ffe46a 0%, var(--yellow-strong) 100%);
  color: #070707;
  font-weight: 800;
}

.ghost-button {
  background: transparent;
  color: var(--text);
}

.control-dock {
  padding: 10px 12px;
  min-height: 0;
}

.dock-header,
.queue-header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.dock-header p,
.queue-header p {
  margin: 0;
  font-size: 0.88rem;
}

.dock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.95fr) minmax(300px, 0.95fr);
  gap: 12px;
  align-items: stretch;
}

.dock-card {
  min-width: 0;
  padding: 12px 14px;
}

.dock-card > label,
.settings-grid label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dock-title {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dock-card form,
.dock-card > input,
.dock-card > select,
.dock-card > button,
.dock-card > .ghost-button,
.dock-card > .accent-button {
  margin-top: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.settings-grid label {
  min-width: 0;
}

.inline-row {
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.inline-row.compact {
  justify-content: flex-start;
  margin-top: 0;
}

.seed-card button,
.add-card .accent-button {
  flex: 0 0 auto;
}

.seed-card .ghost-button {
  margin-top: 0;
}

.search-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.search-tip {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.add-card,
.settings-card,
.seed-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #161616;
  color: var(--text);
  padding: 0 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:hover,
select:hover,
.chip-button:hover,
.ghost-button:hover {
  border-color: rgba(255, 214, 10, 0.14);
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 214, 10, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.07);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #d8cc9a 50%),
    linear-gradient(135deg, #d8cc9a 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.checkbox input {
  width: auto;
  min-height: auto;
}

.queue-card {
  min-height: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.queue-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.queue-scroll::-webkit-scrollbar {
  width: 8px;
}

.queue-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.queue-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgba(10, 10, 10, 0.92);
  background: linear-gradient(180deg, rgba(255, 214, 10, 0.68), rgba(181, 136, 0, 0.82));
}

#queue-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    var(--panel-alt);
}

.queue-item.is-fresh {
  border-color: rgba(255, 214, 10, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 10, 0.08);
}

.queue-item-main {
  min-width: 0;
}

.queue-item-header,
.queue-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-item-header strong {
  flex: 1;
  min-width: 0;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.queue-item-header span {
  flex: 0 0 auto;
  color: #d3c6a0;
  font-size: 0.82rem;
}

.queue-item-meta {
  margin: 7px 0 0;
  color: #a69d89;
  font-size: 0.84rem;
  line-height: 1.3;
}

.queue-item-actions {
  margin-top: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-item-actions button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #181818;
  color: var(--text);
  font-size: 0.84rem;
}

.queue-item-actions button:hover {
  border-color: rgba(255, 214, 10, 0.22);
  background: #1c1c1c;
}

#queue-empty {
  margin: 0;
  color: var(--muted);
}

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .mini-shell,
  .player-window {
    height: auto;
  }

  .player-main {
    flex-direction: column;
  }

  .cover-brand-banner {
    grid-template-columns: 1fr;
  }

  .dock-grid {
    grid-template-columns: 1fr;
  }

  #queue-list,
  .player-stats,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #queue-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .mini-shell {
    height: auto;
    padding: 10px;
  }

  .player-window {
    height: auto;
  }

  .cover-brand-banner,
  .cover-track-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cover-art {
    width: 100%;
    max-width: 220px;
  }

  #queue-list,
  .player-stats,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .window-bar,
  .transport-strip,
  .action-row,
  .inline-row,
  .search-meta-row,
  .queue-item-header,
  .queue-item-actions,
  .dock-header,
  .queue-header {
    flex-wrap: wrap;
  }

  .search-bar-row,
  .queue-item {
    grid-template-columns: 1fr;
  }
}
