:root {
  --bg: #0f0f0f;
  --bg-soft: #111111;
  --panel: rgba(26, 26, 26, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --panel-elevated: rgba(17, 17, 17, 0.98);
  --text: #ffffff;
  --muted: #9c9c9c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --accent: #e8ff00;
  --accent-rgb: 232, 255, 0;
  --accent-soft: rgba(232, 255, 0, 0.14);
  --accent-line: rgba(232, 255, 0, 0.28);
  --success: #d4ff1d;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(232, 255, 0, 0.06), transparent 22%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.9);
  outline-offset: 3px;
}

.noise {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 15, 15, 0.96), rgba(15, 15, 15, 0.9));
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.logo-img {
  height: 72px;
  width: auto;
  max-width: 140px;
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.brand-block h1 {
  margin: 2px 0 0;
  font-size: 1.72rem;
  line-height: 0.95;
}

.release-panel {
  display: grid;
  gap: 7px;
  padding: 14px;
  margin-bottom: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-line);
  background:
    linear-gradient(135deg, rgba(232, 255, 0, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.18);
}

.release-panel strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.25;
}

.release-panel span {
  color: #d8ddb9;
  font-size: 0.82rem;
  line-height: 1.45;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #aaaaaa;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.nav-pill.active {
  background: var(--accent);
  color: #000000;
  font-weight: 600;
}

.nav-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: currentColor;
  font-size: 0.82rem;
}

.rail-panel {
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}

.account-panel {
  display: grid;
  gap: 14px;
}

.account-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.account-head strong {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
}

.account-badge {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.login-form input {
  width: 100%;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
}

.login-actions {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 8px;
}

.mini-button {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.mini-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mini-primary {
  border-color: transparent;
  background: var(--accent);
  color: #000000;
}

.account-summary {
  display: grid;
  gap: 6px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.account-summary strong {
  font-size: 0.88rem;
  line-height: 1.25;
}

.account-summary span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.search-field {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-stats div {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.mini-stats strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.84rem;
}

.content {
  padding: 24px;
}

.hero {
  position: relative;
  min-height: 68vh;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 15, 15, 0.08), rgba(15, 15, 15, 0.45) 48%, rgba(15, 15, 15, 0.94) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: end;
  min-height: 100%;
  padding: 36px 40px;
}

.hero-copy {
  max-width: 760px;
}

.hero-copy h2 {
  margin: 12px 0 10px;
  font-size: clamp(2.7rem, 4vw, 5rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.05em;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-copy p {
  margin: 0;
  max-width: 680px;
  color: #d0d0d0;
  font-size: 1rem;
  line-height: 1.6;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.55);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 18px;
}

.meta-pill {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.34);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.action-button:hover {
  transform: translateY(-1px);
}

.action-primary {
  background: var(--accent);
  color: #000000;
}

.action-primary:hover {
  background: #ffffff;
  color: #000000;
}

.action-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.action-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hero-spot {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: flex;
}

.spot-card {
  width: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.48) 72%, rgba(0, 0, 0, 0.76) 100%),
    var(--card-backdrop);
  box-shadow: inset 0 -50px 120px rgba(0, 0, 0, 0.24);
}

.spot-card h3 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.spot-card p {
  margin: 0;
  color: #d0d0d0;
  line-height: 1.5;
}

.shelves {
  display: grid;
  gap: 34px;
  margin-top: 32px;
}

.shelf {
  display: grid;
  gap: 16px;
}

.shelf-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.shelf-head h3 {
  margin: 6px 0 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.shelf-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card-row.is-video {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.card-row.is-audio {
  grid-template-columns: 1fr;
}

.card-row.is-reading {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.content-card {
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 460ms ease forwards;
}

.content-card:nth-child(2) { animation-delay: 30ms; }
.content-card:nth-child(3) { animation-delay: 60ms; }
.content-card:nth-child(4) { animation-delay: 90ms; }
.content-card:nth-child(5) { animation-delay: 120ms; }

.card-button {
  display: block;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1a1a1a;
  color: inherit;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-button:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.layout-video .card-button {
  background: #080808;
}

.layout-video .card-poster {
  height: auto;
  aspect-ratio: 16 / 9;
}

.layout-video .card-title {
  font-size: 1.12rem;
}

.layout-audio .card-button {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.layout-audio .card-poster {
  height: 100%;
  min-height: 132px;
}

.layout-audio .card-info {
  border-top: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.layout-audio .card-copy {
  min-height: 0;
  margin-bottom: 12px;
}

.audio-wave {
  position: absolute;
  inset: 22px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.audio-wave span {
  width: 5px;
  min-height: 16%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, var(--accent));
  opacity: 0.86;
}

.layout-reading .card-button {
  min-height: 100%;
  border: 1px solid rgba(232, 255, 0, 0.16);
  background:
    linear-gradient(180deg, rgba(232, 255, 0, 0.08), rgba(255, 255, 255, 0.025)),
    #12120f;
}

.layout-reading .card-poster {
  display: none;
}

.layout-reading .card-info {
  display: grid;
  min-height: 260px;
  padding: 24px;
  border-top: 0;
  background: transparent;
}

.layout-reading .card-title {
  margin-top: 18px;
  font-size: 1.45rem;
  line-height: 1.08;
}

.layout-reading .card-copy {
  min-height: 0;
  color: #e7e7d8;
  font-size: 0.98rem;
}

.layout-reading .card-topline {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-poster {
  position: relative;
  height: 220px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.18) 52%, rgba(0, 0, 0, 0.62) 100%),
    var(--card-backdrop);
}

.card-info {
  padding: 14px 15px 16px;
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.96), rgba(17, 17, 17, 0.98));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-topline,
.card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-format,
.card-runtime,
.bookmark-flag {
  color: var(--muted);
  font-size: 0.78rem;
}

.card-format {
  color: var(--accent);
  font-weight: 600;
}

.card-title {
  margin: 10px 0 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.card-copy {
  margin: 0 0 14px;
  color: #c2c2c2;
  font-size: 0.9rem;
  line-height: 1.55;
  min-height: 64px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.genre-chip {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d3d3d3;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
}

.detail-drawer .genre-chip {
  padding: 5px 10px;
  font-size: 0.76rem;
}

.card-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.card-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.82) 0%, var(--accent) 100%);
}

.bookmark-flag {
  color: var(--success);
  opacity: 0;
  transition: opacity 180ms ease;
}

.progress-flag {
  color: rgba(255, 255, 255, 0.76);
  opacity: 1;
}

.content-card.is-bookmarked .bookmark-flag {
  opacity: 1;
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.drawer-backdrop,
.player-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: stretch end;
  padding: 24px;
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(16px);
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 18, 0.96);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  animation: toastIn 220ms ease;
}

.toast.is-success {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, rgba(18, 20, 12, 0.98), rgba(13, 14, 10, 0.98));
}

.detail-drawer,
.player-modal {
  width: min(640px, 100%);
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.98), rgba(12, 12, 12, 0.98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.52);
}

.detail-stage,
.player-stage {
  min-height: 280px;
  background: var(--card-backdrop, linear-gradient(135deg, #1a1a1a, #0f0f0f));
}

.close-button {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(15, 15, 15, 0.74);
  color: var(--text);
}

.detail-content,
.player-panel {
  padding: 28px 32px 34px;
}

.detail-content h2,
.player-panel h3 {
  margin: 10px 0 12px;
  font-size: 2rem;
}

.detail-tagline,
.player-meta {
  margin: 0 0 14px;
  color: #d0d0d0;
  line-height: 1.6;
}

.detail-description {
  color: #e0e0e0;
  line-height: 1.72;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.player-progress-wrap {
  margin: 22px 0;
}

.player-progress-wrap input {
  width: 100%;
  accent-color: var(--accent);
}

.player-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-spot {
    max-width: 340px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .content,
  .rail,
  .hero-inner,
  .detail-content,
  .player-panel {
    padding: 18px;
  }

  .hero {
    min-height: 460px;
  }

  .hero-copy h2 {
    font-size: 2.2rem;
  }

  .card-row {
    grid-template-columns: 1fr;
  }

  .layout-audio .card-button {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .layout-audio .card-poster {
    min-height: 148px;
  }

  .drawer-backdrop,
  .player-backdrop {
    padding: 12px;
  }

  .shelf-head {
    flex-direction: column;
    align-items: start;
  }
}
