:root {
  --bg: #0b0b0f;
  --bg-elev: #14141b;
  --bg-card: #1a1a24;
  --bg-card-hover: #222230;
  --text: #f2f2f5;
  --muted: #9a9aad;
  --accent: #e50914;
  --accent-soft: #ff4d55;
  --border: #2a2a38;
  --radius: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #1c1220 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 0%, #12182a 0%, transparent 50%), var(--bg);
  color: var(--text);
}

body {
  padding-bottom: 4rem;
}

.hidden {
  display: none !important;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  background: rgba(11, 11, 15, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.search-wrap {
  flex: 1;
  max-width: 42rem;
}

#search {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  outline: none;
}

#search:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
}

.browse {
  padding: 1.5rem;
}

.status {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.library {
  margin-bottom: 2.5rem;
}

.library h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(160deg, var(--bg-card), #12121a);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow);
  text-align: left;
  color: inherit;
  font: inherit;
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px) scale(1.01);
  background: var(--bg-card-hover);
  border-color: #3a3a4d;
  outline: none;
}

.card .title {
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.player-view {
  padding: 1rem 1.5rem 2rem;
}

.back {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  margin-bottom: 1rem;
}

.back:hover {
  border-color: var(--accent-soft);
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .player-layout {
    grid-template-columns: 1fr;
  }
}

#player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.now-playing {
  margin: 0.85rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 28rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.playlist li button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font: inherit;
}

.playlist li:last-child button {
  border-bottom: 0;
}

.playlist li button:hover,
.playlist li button.active {
  background: rgba(229, 9, 20, 0.12);
}

.transcript-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 16rem;
  max-height: calc(100vh - 8rem);
  overflow: auto;
}

.transcript-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.transcript {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #d7d7e2;
}

.empty {
  color: var(--muted);
  padding: 2rem 0;
}


.transcript.cues {
  white-space: normal;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cue {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #c8c8d6;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cue:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cue.active {
  background: rgba(229, 9, 20, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
