:root {
  --bg: #0a0a0a;
  --surface: #121212;
  --text: #f0f0f0;
  --muted: #b0b0b0;
  --accent: #ff6600;
  --accent-hover: #ff8533;
  --card: #1a1a1a;
  --card-hover: #252525;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 106.25%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 3vw;
  flex-shrink: 0;
  /* Full-bleed gradient: cancel `.hero` horizontal padding */
  margin-left: calc(-1 * 3vw);
  margin-right: calc(-1 * 3vw);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 85%, transparent) 0%,
    transparent 100%
  );
}

.brand {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  padding: 0.5rem 0;
}

.brand img {
  display: block;
  height: 2.35rem;
  width: auto;
  max-width: min(52vw, 14rem);
  object-fit: contain;
}

.meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: #9ca3af;
}

.hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  padding: 0 3vw 3rem;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  outline: none;
  box-shadow: none;
  z-index: 0;
  pointer-events: none;
}

.hero-video.hero-video--empty {
  opacity: 0;
  visibility: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(10, 10, 10, 0.45) 0%,
      transparent 35%,
      rgba(10, 10, 10, 0.75) 100%
    ),
    radial-gradient(
      ellipse at 18% 18%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 58%
    ),
    radial-gradient(
      ellipse at 88% 8%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 45%
    ),
    linear-gradient(180deg, rgba(17, 17, 17, 0.55) 0%, var(--bg) 100%);
}

.hero-mute-btn {
  position: absolute;
  top: calc(
    0.65rem + 0.5rem + 2.35rem + 0.5rem + 0.65rem + 0.375rem
  );
  right: 3vw;
  z-index: 25;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.hero-mute-btn:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: scale(1.05);
}

.hero-mute-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero-mute-btn__icon {
  position: absolute;
}

.hero-mute-btn__icon--unmuted {
  opacity: 0;
  pointer-events: none;
}

.hero-mute-btn.hero-mute-btn--sound-on .hero-mute-btn__icon--muted {
  opacity: 0;
  pointer-events: none;
}

.hero-mute-btn.hero-mute-btn--sound-on .hero-mute-btn__icon--unmuted {
  opacity: 1;
  pointer-events: auto;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin-top: auto;
  padding-top: 2rem;
}

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

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
}

.hero-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 1rem;
}

.login-gate {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
  max-width: 420px;
}

.login-gate__hint {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.login-gate__hint a {
  color: var(--accent);
}

.login-gate__hint code {
  font-size: 0.85em;
}

.login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.login-form__input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.login-form__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-gate__err {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #f87171;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}

.btn.primary {
  color: #ffffff;
  background: linear-gradient(
    135deg,
    #1d4ed8 0%,
    #2563eb 38%,
    #38bdf8 100%
  );
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.42);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.btn.primary:hover {
  background: linear-gradient(
    135deg,
    #2563eb 0%,
    #3b82f6 42%,
    #7dd3fc 100%
  );
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.38);
  filter: brightness(1.06);
}

#hero-play.btn.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  font-size: calc(0.95rem * 2);
  font-weight: 500;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 4px 16px rgba(37, 99, 235, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

#hero-play.btn.primary:hover {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 22px rgba(56, 189, 248, 0.42),
    0 14px 34px rgba(0, 0, 0, 0.34);
}

#hero-play .hero-play__icon {
  display: block;
  width: 1.35em;
  height: 1.35em;
  flex-shrink: 0;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rows {
  padding: 0 3vw 4rem;
}

.season-block {
  margin-bottom: 2rem;
}

.season-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.rail-wrap {
  position: relative;
  margin: 0 calc(-1 * 3vw);
  padding: 0 3vw;
}

.rail {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(4.75rem, 22vw);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.rail-fade--start {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(10, 10, 10, 0) 100%);
}

.rail-fade--end {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 0%, rgba(10, 10, 10, 0) 100%);
}

.rail-fade:not(.rail-fade--inactive) {
  opacity: 1;
}

.rail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  transition: background 0.15s ease, transform 0.15s ease;
}

/* Beat `.rail-nav { display: flex }` so the HTML `hidden` attribute actually hides controls. */
.rail-nav[hidden] {
  display: none !important;
}

.rail-nav:hover {
  background: rgba(0, 0, 0, 0.78);
  transform: translateY(-50%) scale(1.06);
}

.rail-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rail-nav--prev {
  left: max(0.35rem, env(safe-area-inset-left, 0px));
}

.rail-nav--next {
  right: max(0.35rem, env(safe-area-inset-right, 0px));
}

.rail-nav svg {
  display: block;
  flex-shrink: 0;
}

.card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #2a2a2a;
  transition: transform 0.15s ease, background 0.15s ease;
}

.card:hover {
  transform: scale(1.04);
  background: var(--card-hover);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a2a2a, #111);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: #444;
  overflow: hidden;
}

.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.5rem 0.6rem 0.65rem;
}

.card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.modal-panel {
  position: relative;
  width: min(960px, 94vw);
  background: #000;
  border-radius: var(--radius);
  border: 1px solid #333;
  padding: 0.75rem;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
}

.modal-panel video {
  width: 100%;
  max-height: min(70vh, 720px);
  background: #000;
  border-radius: calc(var(--radius) - 2px);
}

.icon-btn.close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.now {
  flex: 1;
  font-size: 0.85rem;
  color: var(--muted);
}

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

/* —— Admin —— */
.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 3vw 3rem;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 12rem;
}

.admin-header a {
  color: var(--accent);
  text-decoration: none;
}

.admin-header a:hover {
  color: var(--accent-hover);
}

.admin-login {
  background: var(--card);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 28rem;
}

.admin-login label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.admin-login input[type="password"],
.admin-login input[type="text"],
.admin-field input,
.admin-field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid #444;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #111;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.admin-btn:hover {
  background: var(--accent-hover);
}

.admin-btn--secondary {
  background: #333;
  color: var(--text);
}

.admin-btn--secondary:hover {
  background: #444;
}

.admin-error {
  color: #f87171;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

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

.admin-table-wrap {
  overflow: auto;
  border: 1px solid #333;
  border-radius: var(--radius);
  max-height: min(70vh, 560px);
  background: var(--card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #2a2a2a;
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  color: var(--muted);
  font-weight: 600;
}

.admin-table tbody tr {
  cursor: pointer;
}

.admin-table tbody tr:hover {
  background: var(--card-hover);
}

.admin-table tbody tr.admin-row--active {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.admin-editor {
  background: var(--card);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 0.5rem;
}

.admin-editor h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.admin-field {
  margin-bottom: 0.85rem;
}

.admin-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.admin-stories {
  margin-top: 0.5rem;
}

.admin-story-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: start;
}

@media (max-width: 700px) {
  .admin-story-row {
    grid-template-columns: 1fr;
  }
}

.admin-muted {
  color: var(--muted);
  font-size: 0.85rem;
}
