:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(9, 14, 27, 0.92);
  --panel-2: rgba(16, 24, 40, 0.84);
  --border: rgba(148, 163, 184, 0.14);
  --text: #f8fafc;
  --muted: #94a3b8;
  --red-1: #dc2626;
  --red-2: #7f1d1d;
  --green-1: #16a34a;
  --green-2: #14532d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.18), transparent 28%),
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.12), transparent 24%),
    linear-gradient(180deg, #030712 0%, #0f172a 50%, #020617 100%);
}

button,
input {
  font: inherit;
}

.landing-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.landing-shell {
  width: min(840px, 100%);
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: rgba(5, 10, 22, 0.82);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.landing-eyebrow,
.landing-title,
.landing-subtitle {
  margin: 0;
}

.landing-eyebrow {
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-title {
  margin-top: 12px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.landing-subtitle {
  max-width: 700px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.landing-section-label {
  margin: 26px 0 0;
  color: #fca5a5;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.iptv-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.auth-card {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.75);
}

.auth-title,
.auth-status,
.auth-notice,
.subscriptions-title,
.subscriptions-status,
.subscriptions-empty,
.subscription-card-title,
.subscription-card-meta {
  margin: 0;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.auth-status {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.auth-notice {
  margin-top: 14px;
  color: #86efac;
  font-weight: 700;
}

.runtime-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.runtime-footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.landing-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.landing-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.landing-button-primary {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.landing-button-secondary {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.landing-button-muted {
  background: linear-gradient(135deg, #475569, #334155);
}

.page-shell {
  min-height: 100vh;
  padding-bottom: 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(3, 7, 18, 0.86);
  border-bottom: 1px solid rgba(127, 29, 29, 0.18);
}

.topbar-stripe {
  height: 2px;
  background: linear-gradient(90deg, #dc2626, #9333ea, #16a34a);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-button,
.back-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand-button {
  padding: 0;
  text-align: left;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-text {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ef4444, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
}

.back-button {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(31, 41, 55, 0.88);
  font-weight: 700;
}

.watch-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.watch-layout {
  display: grid;
  gap: 20px;
}

.watch-card {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 15, 27, 0.94), rgba(5, 10, 19, 0.98));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

.watch-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

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

.watch-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.watch-canvas,
.watch-overlay {
  position: absolute;
  inset: 0;
}

.watch-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.watch-overlay {
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.78) 100%);
}

.controls-bar {
  width: 100%;
  padding: 18px;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 180ms ease;
}

.controls-bar.controls-hidden {
  opacity: 0;
  pointer-events: none;
}

.progress-wrap {
  margin-bottom: 14px;
}

.progress-range,
.volume-range {
  width: 100%;
  margin: 0;
  accent-color: #ef4444;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.controls-left {
  max-width: min(100%, 720px);
}

.volume-range {
  width: min(160px, 24vw);
}

.control-button {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.control-button-play {
  min-width: 88px;
}

.time-text {
  font-variant-numeric: tabular-nums;
  color: #e2e8f0;
}

.page-title-block {
  padding: 20px 18px 22px;
}

.page-title,
.page-subtitle {
  margin: 0;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.page-subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.subscriptions-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.subscriptions-title {
  font-size: 2rem;
  font-weight: 800;
}

.subscriptions-status,
.subscriptions-empty {
  margin-top: 10px;
  color: var(--muted);
}

.subscriptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.subscription-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  background: rgba(10, 15, 27, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.subscription-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0f172a;
}

.subscription-card-title {
  padding: 14px 14px 6px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
}

.subscription-card-meta {
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .landing-shell {
    padding: 28px;
  }

  .topbar-inner {
    padding: 12px 14px;
  }

  .brand-text {
    font-size: 1.4rem;
  }

  .watch-page {
    padding: 18px 12px 28px;
  }

  .subscriptions-page {
    padding: 18px 12px 28px;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-left,
  .controls-right {
    justify-content: flex-start;
  }

  .volume-range {
    width: min(140px, 40vw);
  }
}
