:root {
  --bg: #020617;
  --bg-elevated: rgba(9, 13, 34, 0.96);
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --text-main: #f5f5f5;
  --text-muted: #9ca3af;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.65);
  --shadow-subtle: 0 10px 25px rgba(0, 0, 0, 0.45);
  --transition-med: 0.22s ease-out;
}

* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text-main);

  background-color: var(--bg);
  background-image: url("/data/nb-bg-main.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -15%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
      circle at 22% 30%,
      rgba(56, 189, 248, 0.35),
      transparent 58%
    ),
    radial-gradient(
      circle at 78% 80%,
      rgba(59, 130, 246, 0.22),
      transparent 60%
    );
  mix-blend-mode: screen;
  opacity: 0.4;
  filter: blur(16px);
  transform-origin: center;
  animation: nbNebulaDrift 40s ease-in-out infinite alternate;
}

@keyframes nbNebulaDrift {
  0% {
    transform: translate3d(-40px, -20px, 0) scale(1);
    opacity: 0.35;
  }
  50% {
    transform: translate3d(10px, 10px, 0) scale(1.04);
    opacity: 0.5;
  }
  100% {
    transform: translate3d(40px, -30px, 0) scale(1.02);
    opacity: 0.38;
  }
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  width: 100%;
  max-width: 1100px;
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.97),
    rgba(15, 23, 42, 0.92)
  );
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 20px 20px 26px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 4px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
}
.brand-text span {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #e5e7eb;
  background: radial-gradient(
    circle at 20% 0%,
    rgba(96, 165, 250, 0.25),
    rgba(15, 23, 42, 0.92)
  );
  box-shadow: var(--shadow-subtle);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  white-space: nowrap;
}
.btn-home:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(96, 165, 250, 0.35);
}

.badge {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #dbeafe;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.panel {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 22px 22px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  top: -42px;
  height: 118px;
  background: linear-gradient(
    120deg,
    rgba(96, 165, 250, 0.16),
    rgba(59, 130, 246, 0.14)
  );
  opacity: 0.55;
  transform: skewY(-6deg);
  pointer-events: none;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}
.hero p {
  margin: 0;
  color: #cbd5f5;
  line-height: 1.6;
  font-size: 0.92rem;
  max-width: 52rem;
  position: relative;
  z-index: 1;
}

.episodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.episode-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 14px 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #020617, #030712);
  border: 1px solid rgba(148, 163, 184, 0.5);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  position: relative;
  overflow: hidden;
}
.episode-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at 0 0,
    rgba(96, 165, 250, 0.18),
    transparent 55%
  );
  opacity: 0.5;
  pointer-events: none;
}
.episode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}
.episode-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.episode-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.episode-id {
  font-size: 0.72rem;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.episode-title {
  position: relative;
  z-index: 1;
  margin: 8px 0 4px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.episode-sub {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #cbd5f5;
  line-height: 1.55;
}
.episode-meta {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.episode-pill {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.9);
}

.error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
  font-size: 0.88rem;
  line-height: 1.5;
  display: none;
}

footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 880px) {
  body {
    padding: 18px 10px;
    background-attachment: scroll;
    background-position: center top;
  }
  .page {
    padding: 18px 14px 22px;
    border-radius: 20px;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .brand-mark {
    width: 70px;
  }
}

@media (max-width: 540px) {
  body {
    padding: 14px 8px;
  }
  header {
    align-items: center;
    text-align: center;
  }
  .brand {
    flex-direction: column;
    align-items: center;
  }
  .brand-text h1 {
    font-size: 1.3rem;
  }
  .brand-text span {
    letter-spacing: 0.14em;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-home {
    justify-content: center;
    width: 100%;
  }
  .badge {
    justify-content: center;
  }
  .brand-mark {
    width: 64px;
  }
  .hero h2 {
    font-size: 1.35rem;
  }
  .hero p {
    font-size: 0.86rem;
  }
}
