/* Palette sampled from twitch.tv/pixelsmixel (2026-10-12): Twitch's dark UI
   plus the channel banner's night sky, nebula purples and star glow. */
:root {
  --bg: #0e0e10;
  --night: #080a25;
  --indigo: #222150;
  --nebula: #5f3592;
  --periwinkle: #4c519b;
  --surface: rgba(24, 24, 27, 0.9);
  --surface-hover: rgba(145, 71, 255, 0.16);
  --border: #323239;
  --input-border: #464649;
  --text: #efeff1;
  --muted: #adadb8;
  --accent: #9147ff;
  --accent-hover: #772ce8;
  --accent-soft: #bf94ff;
  --star: #d4e1ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* The sky lives on the root so the starfield (body::before, z-index -1) can
   sit between it and the page content. */
html {
  min-height: 100%;
  background:
    radial-gradient(ellipse 70% 50% at 88% -8%, rgba(95, 53, 146, 0.6), transparent 70%),
    radial-gradient(ellipse 55% 40% at 6% -4%, rgba(76, 81, 155, 0.38), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, #0c0e1a 50%, var(--bg) 100%) fixed;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 16px/1.5 Inter, Roobert, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 24px 36px, var(--star), transparent),
    radial-gradient(1px 1px at 150px 70px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 96px 180px, var(--accent-soft), transparent),
    radial-gradient(1px 1px at 230px 130px, var(--star), transparent),
    radial-gradient(1px 1px at 310px 260px, #fff, transparent),
    radial-gradient(2px 2px at 420px 70px, var(--star), transparent);
  background-size: 260px 260px, 260px 260px, 260px 260px, 370px 370px, 370px 370px, 530px 530px;
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(#000 0%, transparent 80%);
  mask-image: linear-gradient(#000 0%, transparent 80%);
}

a { color: var(--accent-soft); }
a:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

main {
  flex: 1;
  width: min(720px, 100% - 2rem);
  margin: 0 auto;
  padding-top: clamp(2rem, 9vh, 5.5rem);
}

/* --- Header --- */

header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.planet { width: 56px; height: 56px; grid-row: span 2; }

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h1 span {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent-soft);
}

.tagline { grid-column: 1 / -1; margin: 1rem 0 0; color: var(--muted); }

/* --- Search --- */

.search { position: relative; }

#q {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  font: inherit;
  font-size: 1.125rem;
  color: var(--text);
  background: rgba(24, 24, 27, 0.92)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23adadb8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")
    no-repeat 0.95rem center / 1.2rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

#q::placeholder { color: var(--muted); }
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.45); }
#q:disabled { opacity: 0.6; }

#suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 60vh;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  background: #18181b;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}

#suggestions li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

#suggestions li[aria-selected="true"],
#suggestions li:not(.empty):hover { background: var(--surface-hover); }

#suggestions .title,
#suggestions .artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#suggestions .title { font-weight: 600; }
#suggestions .artist { grid-column: 1; font-size: 0.875rem; color: var(--muted); }
#suggestions .plays {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#suggestions li.empty { color: var(--muted); cursor: default; }

.status { margin: 0.75rem 0 0 0.25rem; font-size: 0.875rem; color: var(--muted); }
html[data-state="error"] .status { color: #ff8280; }

/* --- Song --- */

#song {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#song h2 { margin: 0; font-size: 1.5rem; line-height: 1.25; }
#song .artist { margin: 0.15rem 0 0; color: var(--accent-soft); font-weight: 600; }
#song .stats { margin: 0.5rem 0 1rem; font-size: 0.875rem; color: var(--muted); }

.vods { margin: 0 -0.5rem; padding: 0; list-style: none; }

.vods a {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: center;
  column-gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}

.vods a:hover { background: var(--surface-hover); }
.vods a:focus-visible { outline-offset: -2px; }

.vods .date { font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vods .stream { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vods .time {
  padding: 0.2rem 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  white-space: nowrap;
  background: var(--accent);
  border-radius: 4px;
}

.vods a:hover .time { background: var(--accent-hover); }
.vods .time.unknown { font-weight: 400; color: var(--muted); background: none; }

.novod { margin: 0.75rem 0 0.5rem; color: var(--muted); font-size: 0.875rem; }
.novod summary { cursor: pointer; }
.novod p { margin: 0.5rem 0 0; font-size: 0.8125rem; line-height: 1.8; }

/* --- Footer --- */

footer {
  padding: 2rem 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

footer p { margin: 0.25rem 0; }

@media (max-width: 520px) {
  h1 { font-size: 1.6rem; }
  .planet { width: 44px; height: 44px; }
  .vods a {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date time" "stream time";
  }
  .vods .date { grid-area: date; }
  .vods .stream { grid-area: stream; }
  .vods .time { grid-area: time; }
}
