:root {
  color-scheme: dark;
  --ink: #f5f1e8;
  --muted: #aaa395;
  --soft: #d7d0c3;
  --black: #080a09;
  --panel: rgba(16, 18, 16, 0.88);
  --panel-strong: rgba(22, 24, 22, 0.96);
  --line: rgba(245, 241, 232, 0.14);
  --green: #c8ff4d;
  --rust: #c66337;
  --petrol: #19666a;
  --blue: #78c8c7;
  --shadow: 0 18px 48px 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;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(8, 10, 9, 0.72), rgba(8, 10, 9, 0.98)),
    #080a09;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(34px + env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 46px 1fr 44px;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark,
.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: rgba(12, 14, 13, 0.82);
}

.brand-mark {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 950;
}

.icon-button {
  cursor: pointer;
  color: var(--ink);
  font-size: 1.2rem;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: 1.46rem;
  line-height: 1.05;
}

.station,
.tuning-board,
.preview-board,
.history-board {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.station {
  overflow: hidden;
}

.genre-roulette {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 18%, rgba(200, 255, 77, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(25, 102, 106, 0.16), rgba(8, 10, 9, 0.1));
}

.roulette-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.roulette-head span {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.roulette-head strong {
  max-width: 190px;
  color: var(--ink);
  font-size: clamp(1rem, 5vw, 1.42rem);
  line-height: 1.02;
  text-align: right;
}

.wheel-stage {
  position: relative;
  display: grid;
  min-height: min(82vw, 354px);
  margin-top: 10px;
  place-items: center;
}

.genre-wheel {
  --wheel-rotation: 0deg;
  --segment-angle: 13.333deg;
  position: relative;
  width: min(82vw, 356px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(245, 241, 232, 0.22);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 10px rgba(8, 10, 9, 0.18),
    inset 0 0 34px rgba(8, 10, 9, 0.54),
    0 18px 46px rgba(0, 0, 0, 0.34);
  transform: rotate(var(--wheel-rotation));
  transition: transform 1.45s cubic-bezier(0.12, 0.82, 0.14, 1);
}

.genre-wheel::before,
.genre-wheel::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.genre-wheel::before {
  z-index: 1;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(8, 10, 9, 0.58) 32% 33%, transparent 34%),
    repeating-conic-gradient(
      from -90deg,
      rgba(245, 241, 232, 0.72) 0deg 0.72deg,
      transparent 0.72deg var(--segment-angle)
    );
}

.genre-wheel::after {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(8, 10, 9, 0.48),
    inset 0 0 90px rgba(8, 10, 9, 0.22);
}

.genre-wheel.is-spinning {
  filter: saturate(1.18) contrast(1.06);
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 24px;
  margin: -12px 0 0 -19px;
  place-items: center;
  transform: rotate(var(--angle)) translateY(clamp(-132px, -31vw, -102px)) rotate(var(--counter-angle));
  transform-origin: center;
}

.genre-symbol {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(245, 241, 232, 0.82);
  border-radius: 50%;
  color: #080a09;
  background: rgba(8, 10, 9, 0.82);
  background:
    radial-gradient(circle at 35% 28%, rgba(245, 241, 232, 0.98), rgba(215, 208, 195, 0.84) 58%, rgba(120, 200, 199, 0.68)),
    rgba(245, 241, 232, 0.88);
  font-size: 0.98rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.26);
}

.genre-symbol::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--genre-icon) center / contain no-repeat;
  mask: var(--genre-icon) center / contain no-repeat;
}

.wheel-label.is-active .genre-symbol {
  border-color: var(--green);
  color: #11140c;
  background: var(--green);
  box-shadow:
    0 0 0 3px rgba(200, 255, 77, 0.24),
    0 7px 14px rgba(0, 0, 0, 0.3);
}

.genre-wheel.is-spinning .genre-symbol {
  opacity: 0.68;
}

.wheel-hub {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 10px solid rgba(245, 241, 232, 0.92);
  border-radius: 50%;
  color: var(--green);
  background:
    radial-gradient(circle, rgba(200, 255, 77, 0.22), rgba(8, 10, 9, 0.92) 64%),
    #0b0d0c;
  box-shadow:
    0 0 0 1px rgba(8, 10, 9, 0.42),
    0 0 32px rgba(200, 255, 77, 0.14);
}

.wheel-hub span {
  margin-top: 7px;
  font-size: 1.05rem;
  font-weight: 920;
  line-height: 1;
}

.wheel-hub small {
  margin-top: -16px;
  color: var(--soft);
  font-size: 0.56rem;
  font-weight: 850;
  text-transform: uppercase;
}

.wheel-pointer {
  position: absolute;
  top: 2px;
  left: 50%;
  z-index: 5;
  width: 34px;
  height: 42px;
  background:
    linear-gradient(180deg, rgba(245, 241, 232, 0.95), rgba(200, 255, 77, 0.72)),
    var(--green);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.44));
  transform: translateX(-50%);
}

.wheel-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.wheel-meta span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(200, 255, 77, 0.24);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(8, 10, 9, 0.46);
  font-size: 0.78rem;
  font-weight: 820;
}

.wheel-meta span:last-child {
  color: var(--green);
  text-align: right;
  text-transform: uppercase;
}

.signal {
  position: relative;
  min-height: 248px;
  border-bottom: 1px solid var(--line);
  background: #101210;
}

.signal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.86;
}

.signal::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(8, 10, 9, 0.12), rgba(8, 10, 9, 0.78)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 5px);
}

.signal-readout {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.signal-readout span {
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(200, 255, 77, 0.44);
  border-radius: 999px;
  color: var(--green);
  background: rgba(8, 10, 9, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-readout a {
  width: fit-content;
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(1.75rem, 10vw, 3.35rem);
  font-weight: 900;
  line-height: 0.95;
  text-wrap: balance;
}

.signal-readout a:not(.is-empty)::after {
  margin-left: 0.18em;
  color: var(--green);
  content: "↗";
  font-size: 0.42em;
  vertical-align: top;
}

.manual-anchor {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 9, 0.42);
}

.manual-anchor label {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.manual-anchor div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.manual-anchor input {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(245, 241, 232, 0.08);
  outline: none;
}

.manual-anchor input:focus {
  border-color: rgba(200, 255, 77, 0.66);
  box-shadow: 0 0 0 3px rgba(200, 255, 77, 0.12);
}

.manual-anchor button {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  color: #12140d;
  background: var(--green);
  cursor: pointer;
  font-weight: 850;
}

.station-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 10px;
  padding: 12px;
}

.primary-action,
.secondary-action,
.spotify-action,
.artist-card button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.primary-action,
.spotify-action {
  color: #12140d;
  background: var(--green);
}

.provider-action--youtube {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(198, 99, 55, 0.92), rgba(200, 255, 77, 0.72));
}

.spotify-logo {
  display: inline-block;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("/assets/brand/spotify.svg") center / contain no-repeat;
  mask: url("/assets/brand/spotify.svg") center / contain no-repeat;
}

.spotify-logo--button {
  width: 24px;
  height: 24px;
}

.spotify-logo--source {
  width: 14px;
  height: 14px;
}

.secondary-action,
.artist-card button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(245, 241, 232, 0.08);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 780;
}

.status.error {
  color: #ffd6c9;
  border: 1px solid rgba(198, 99, 55, 0.48);
  background: rgba(198, 99, 55, 0.18);
}

.status.success {
  color: var(--green);
  border: 1px solid rgba(200, 255, 77, 0.4);
  background: rgba(70, 90, 24, 0.24);
}

.artist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.artist-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 182px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 102, 106, 0.24), rgba(198, 99, 55, 0.12)),
    var(--panel-strong);
}

.card-index {
  color: var(--rust);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 900;
}

.artist-card h2 {
  font-size: 1.3rem;
  line-height: 1.1;
}

.artist-card p {
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.42;
}

.artist-card button {
  align-self: end;
  width: 100%;
}

.artist-actions {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 8px;
  align-self: end;
}

.artist-actions a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 255, 77, 0.28);
  border-radius: 8px;
  color: var(--green);
  background: rgba(200, 255, 77, 0.07);
  font-size: 0.86rem;
  font-weight: 850;
}

.artist-actions button {
  width: 100%;
}

.tuning-board,
.preview-board,
.history-board {
  padding: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--green);
}

.section-heading span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 1rem;
}

.tuning-board label {
  display: grid;
  grid-template-columns: 104px 1fr 34px;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  color: var(--muted);
}

.tuning-board span {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.tuning-board b {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.track-target {
  grid-template-columns: 104px 1fr !important;
  margin-top: 8px;
}

.track-target select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(245, 241, 232, 0.08);
  text-align: center;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-strip div {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 241, 232, 0.06);
}

.metric-strip span {
  display: block;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.42rem;
  font-weight: 900;
}

.metric-strip p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
}

.lane-bars {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid rgba(120, 200, 199, 0.22);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(25, 102, 106, 0.12);
  font-size: 0.66rem;
  font-weight: 860;
  text-transform: uppercase;
}

.source-chip b {
  font: inherit;
}

.source-chip--spotify {
  color: var(--green);
  border-color: rgba(200, 255, 77, 0.24);
  background: rgba(200, 255, 77, 0.08);
}

.source-chip--youtube {
  color: #ffd6c9;
  border-color: rgba(198, 99, 55, 0.34);
  background: rgba(198, 99, 55, 0.12);
}

.session-warning {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(198, 99, 55, 0.32);
  border-radius: 8px;
  color: #ffd6c9;
  background: rgba(198, 99, 55, 0.13);
  font-size: 0.78rem;
  line-height: 1.35;
}

.lane-row {
  display: grid;
  grid-template-columns: 92px 1fr 30px;
  gap: 8px;
  align-items: center;
  min-height: 24px;
}

.lane-row span,
.lane-row b {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
}

.lane-row div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(245, 241, 232, 0.09);
}

.lane-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--petrol), var(--green));
}

.spotify-action {
  width: 100%;
  margin-top: 16px;
}

.highlight-board {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(200, 255, 77, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(200, 255, 77, 0.09), rgba(25, 102, 106, 0.14)),
    rgba(245, 241, 232, 0.04);
}

.highlight-board .section-heading {
  margin-bottom: 10px;
}

.highlight-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
  margin-bottom: 10px;
}

.highlight-form input {
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(245, 241, 232, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(8, 10, 9, 0.42);
  font-size: 0.82rem;
  outline: none;
}

.highlight-form input:focus {
  border-color: rgba(200, 255, 77, 0.52);
  box-shadow: 0 0 0 3px rgba(200, 255, 77, 0.12);
}

.highlight-form button {
  min-height: 42px;
  border-radius: 8px;
  color: #11140c;
  background: var(--green);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.highlight-list {
  display: grid;
  gap: 8px;
}

.highlight-list div {
  padding: 8px 10px;
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 8px;
  background: rgba(8, 10, 9, 0.32);
}

.highlight-list strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-list p,
.highlight-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.highlight-list p {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.track-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 241, 232, 0.05);
}

.track-row.is-highlighted {
  border-color: rgba(200, 255, 77, 0.38);
  background:
    linear-gradient(135deg, rgba(200, 255, 77, 0.09), rgba(25, 102, 106, 0.12)),
    rgba(245, 241, 232, 0.05);
}

.track-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.track-link span {
  color: var(--rust);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.track-link strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-link p {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-link em {
  max-width: 88px;
  overflow: hidden;
  color: var(--blue);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.highlight-action {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(245, 241, 232, 0.06);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.highlight-action.is-active {
  color: #11140c;
  border-color: rgba(200, 255, 77, 0.56);
  background: var(--green);
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-list a {
  display: grid;
  grid-template-columns: 1fr 22px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 102, 106, 0.16);
}

.history-list strong {
  display: block;
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list p,
.empty-state {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-signal {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
}

.footer-signal span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(200, 255, 77, 0.78);
}

.is-hidden {
  display: none;
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 28px;
  }

  .artist-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .artist-card {
    min-height: 244px;
  }
}
