:root {
  --bg-primary: #07070b;
  --surface-card: #0e0e12;
  --border-subtle: #231d2b;
  --text-primary: #ffffff;
  --text-secondary: #acabac;
  --accent-red: #f14423;
  --grad-start: #f04524;
  --grad-mid: #a42f1a;
  --grad-end: #3e120d;
  --gold: #e8b923;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100%;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}
.screen.active { display: flex; }

/* ---------- Landing screen ---------- */
.video-preview {
  position: relative;
  height: 46vh;
  min-height: 320px;
  max-height: 460px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-mid) 55%, var(--grad-end));
  overflow: hidden;
}
.video-preview video,
.video-preview img.poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-preview .scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 55%;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.85));
  pointer-events: none;
}
.wordmark {
  position: absolute;
  top: 20px; left: 20px;
  font-weight: 700;
  font-size: 20px;
  z-index: 2;
}
.play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 1.5px solid #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.play-btn svg { margin-left: 4px; }
.episode-pill {
  position: absolute;
  left: 20px; bottom: 20px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
}

.info-section {
  padding: 20px 20px 0;
}
.drama-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}
.meta-row {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 54px;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.btn-primary {
  background: linear-gradient(90deg, var(--grad-start), var(--grad-mid), var(--grad-end));
}
.btn-secondary {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
}
.btn-hero-primary, .btn-hero-secondary, .btn-fallback-cta { width: auto; margin-bottom: 0; }
.btn-hero-primary { padding: 0 26px; }
.btn-hero-secondary { padding: 0 20px; }
.btn-fallback-cta { padding: 0 30px; }
.helper-text {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 20px;
}

.footer {
  margin-top: auto;
  padding: 16px 20px 28px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}
.footer p { margin: 2px 0; font-size: 11px; color: var(--text-secondary); }
.footer .domain { font-size: 10px; }

/* ---------- Redirecting screen ---------- */
.centered {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
  text-align: center;
}
.spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(241,68,35,0.25);
  border-top-color: var(--accent-red);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-text { font-size: 13px; color: var(--text-secondary); margin: 0; }
.sub-text { font-size: 11px; color: var(--text-secondary); max-width: 280px; margin: 0; }

/* ---------- Fallback / install screen ---------- */
.app-icon {
  width: 88px; height: 88px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 34px;
}
.fallback-heading { font-size: 19px; font-weight: 700; margin: 0; max-width: 320px; }
.fallback-body {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.6;
  margin: 0;
}
.store-note { font-size: 10.5px; color: var(--gold); margin: 0; }

.error-box {
  margin: 40px 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   Marketing site (home, legal pages, contact, 404)
   ============================================================ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 64px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: rgba(7, 7, 11, 0.85);
  backdrop-filter: blur(10px);
  z-index: 50;
}
.site-header .wordmark { position: static; font-size: 20px; }
.site-header .wordmark a { color: inherit; text-decoration: none; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}
.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
}
.site-nav a.active,
.site-nav a:hover { color: var(--text-primary); }
.header-cta { padding: 10px 20px;
  border-radius: 22px;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px; line-height: 0; }
.nav-toggle svg { width: 22px; height: 22px; display: block; }

/* Generic icon sizing: any element that receives an SVG via data-icon */
.icon-circle svg { width: 1em; height: 1em; }
.btn-icon { display: inline-flex; font-size: 15px; }
.btn .btn-icon svg, .btn-secondary .btn-icon svg { width: 1em; height: 1em; }

@media (max-width: 860px) {
  .site-header { padding: 18px 20px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 24px;
    gap: 20px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { font-size: 16px; }
}

.site-main { max-width: 1440px; margin: 0 auto; }

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 64px 80px;
  display: flex;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
}
.hero-copy { max-width: 560px; flex: 1 1 420px; }
.kicker {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 { font-size: 48px; font-weight: 700; line-height: 1.18; margin: 0 0 20px; }
.hero p.lead {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 30px;
}
.hero-cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.phone-mock {
  flex: 0 0 300px;
  width: 300px; height: 620px;
  border-radius: 36px;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-mid) 55%, var(--grad-end));
  border: 6px solid var(--border-subtle);
  position: relative;
}
.phone-mock .play-btn { top: 50%; left: 50%; }

/* ---- Feature cards ---- */
.section { padding: 60px 64px; }
.section h2 { text-align: center; font-size: 30px; font-weight: 700; margin: 0 0 40px; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1312px;
  margin: 0 auto;
}
.feature-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 26px 24px;
}
.feature-card .icon-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(241,68,35,0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 18px;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.feature-card p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* ---- Show strip ---- */
.show-strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 0 12px;
  max-width: 1312px;
  margin: 0 auto;
}
.show-card {
  flex: 0 0 190px;
  height: 320px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--grad-start), var(--grad-end));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.show-card span { font-size: 12.5px; font-weight: 500; }

/* ---- Stats row ---- */
.stats-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 32px;
  padding: 40px 64px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.stat { text-align: center; }
.stat .big { font-size: 30px; font-weight: 700; display: block; }
.stat .small { font-size: 12px; color: var(--text-secondary); }
.stat.gold .big { color: var(--gold); }

/* ---- CTA banner ---- */
.cta-banner {
  max-width: 1200px;
  margin: 60px auto;
  padding: 50px 40px;
  border-radius: 28px;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-mid), var(--grad-end));
  text-align: center;
}
.cta-banner h2 { margin: 0 0 20px; font-size: 26px; }
.cta-banner .btn { max-width: 260px; margin: 0 auto; background: rgba(0,0,0,0.55); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 56px 64px 32px;
}
.footer-cols {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1312px;
  margin: 0 auto 32px;
}
.footer-brand { max-width: 320px; }
.footer-brand .wordmark { position: static; margin-bottom: 10px; }
.footer-brand p { font-size: 12px; color: var(--text-secondary); }
.footer-col h4 { font-size: 12.5px; font-weight: 600; margin: 0 0 12px; }
.footer-col a {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 10px;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-copy { text-align: center; font-size: 11px; color: var(--text-secondary); }

/* ---- Legal / content pages ---- */
.legal-body { max-width: 760px; margin: 0 auto; padding: 64px 24px 80px; }
.legal-body h1 { font-size: 32px; font-weight: 700; margin: 0 0 8px; }
.legal-body .updated { font-size: 12px; color: var(--text-secondary); margin: 0 0 18px; }
.legal-body h2 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; }
.legal-body p { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin: 0 0 4px; }
.legal-body a { color: var(--gold); }

.steps-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 18px 0;
}
.steps-card h3 { font-size: 15px; margin: 0 0 12px; }
.steps-card p { margin: 0 0 8px; }

.data-row {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.data-row .label { flex: 0 0 220px; color: var(--accent-red); font-weight: 600; font-size: 13px; }
.data-row .desc { flex: 1 1 300px; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }

/* ---- Contact page ---- */
.contact-body { text-align: center; padding: 80px 24px 100px; }
.contact-body h1 { font-size: 32px; font-weight: 700; margin: 0 0 12px; }
.contact-body > p { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 40px; }
.contact-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.contact-card {
  width: 260px;
  padding: 28px 20px;
  border-radius: 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
}
.contact-card .icon-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(241,68,35,0.15);
  color: var(--gold);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.contact-card h3 { font-size: 14px; margin: 0 0 6px; }
.contact-card a { font-size: 12.5px; color: var(--text-secondary); text-decoration: none; }

/* ---- 404 page ---- */
.notfound-body {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 40px 20px;
}
.notfound-body .code {
  font-size: 80px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.notfound-body h1 { font-size: 18px; margin: 0; }
.notfound-body p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.notfound-body .btn { width: 180px; margin-top: 10px; }

/* ============================================================
   Responsive — tablet (≤900px)
   ============================================================ */
@media (max-width: 900px) {
  .hero { padding: 72px 32px 56px; gap: 40px; }
  .hero-copy { flex-basis: 320px; }
  .phone-mock {
    flex: 0 1 220px;
    width: 220px;
    height: 455px;
    margin: 0 auto;
  }
}

/* ============================================================
   Responsive — phone (≤700px)
   ============================================================ */
@media (max-width: 700px) {
  .site-main, .hero, .section { overflow-x: hidden; }

  /* Hero */
  .hero { padding: 48px 20px 44px; flex-direction: column; text-align: center; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: 30px; }
  .hero p.lead { font-size: 14.5px; margin: 0 auto 26px; }
  .kicker { margin-left: auto; margin-right: auto; }
  .hero-cta-row { flex-direction: column; width: 100%; }
  .btn-hero-primary, .btn-hero-secondary { width: 100%; padding: 0; }
  .phone-mock { flex: 0 0 auto; width: 170px; height: 352px; border-width: 4px; margin-top: 8px; }

  /* Sections & headings */
  .section { padding: 40px 20px; }
  .section h2 { font-size: 22px; margin-bottom: 28px; }

  /* Feature cards */
  .cards-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .feature-card { padding: 20px 16px; }
  .feature-card h3 { font-size: 14.5px; }
  .feature-card p { font-size: 12px; }

  /* Show strip / catalog */
  .show-strip .show-card,
  .show-strip .drama-card { flex-basis: 140px; }
  .show-strip .drama-poster { width: 140px; }
  .show-card { flex: 0 0 140px; height: 240px; }
  .catalog-grid:not(.show-strip) {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .catalog-note { padding: 0 8px; }

  /* Stats row */
  .stats-row { padding: 28px 20px; gap: 20px 12px; }
  .stat { flex: 0 0 42%; }
  .stat .big { font-size: 24px; }

  /* CTA banner */
  .cta-banner { margin: 40px 16px; padding: 36px 22px; border-radius: 22px; }
  .cta-banner h2 { font-size: 20px; margin-bottom: 18px; }

  /* Footer */
  .site-footer { padding: 36px 20px 24px; }
  .footer-cols { flex-direction: column; gap: 28px; text-align: center; }
  .footer-brand { max-width: 100%; }
  .footer-col a { text-align: center; }

  /* Legal pages */
  .legal-body { padding: 40px 20px 56px; }
  .legal-body h1 { font-size: 24px; }
  .steps-card { padding: 18px; }
  .data-row { flex-direction: column; gap: 6px; padding: 14px 0; }
  .data-row .label { flex-basis: auto; }

  /* Contact */
  .contact-body { padding: 48px 20px 64px; }
  .contact-body h1 { font-size: 24px; }
  .contact-cards { flex-direction: column; align-items: center; }
  .contact-card { width: 100%; max-width: 340px; }

  /* 404 */
  .notfound-body .code { font-size: 60px; }
  .notfound-body h1 { font-size: 16px; padding: 0 12px; }
}

/* ============================================================
   Responsive — small phone (≤420px)
   ============================================================ */
@media (max-width: 420px) {
  .hero h1 { font-size: 26px; }
  .phone-mock { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .stat { flex-basis: 45%; }
  .catalog-grid:not(.show-strip) { grid-template-columns: 1fr 1fr; }
}

/* ---- Live catalog (real Supabase data, display-only) ---- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
  max-width: 1312px;
  margin: 0 auto;
}
.show-strip .catalog-grid,
.show-strip.catalog-grid {
  display: flex;
  overflow-x: auto;
  gap: 20px;
}
.drama-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.drama-card:hover, .drama-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--gold);
  outline: none;
}
.drama-card:active { transform: translateY(0); }
.drama-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  flex: 0 0 auto;
}
.show-strip .drama-poster { width: 190px; }
.drama-poster img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.drama-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.drama-open-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.drama-open-hint .btn-icon { font-size: 14px; }
.drama-card:hover .drama-open-hint,
.drama-card:focus-visible .drama-open-hint { opacity: 1; }
@media (hover: none) {
  /* No hover on touch devices — show a small always-on badge instead so
     it's clear the card is tappable without needing a hover state. */
  .drama-open-hint {
    inset: auto 8px 8px auto;
    left: auto;
    width: auto;
    height: auto;
    padding: 4px 9px;
    border-radius: 10px;
    opacity: 1;
  }
}
.drama-info { padding: 12px 14px 16px; }
.drama-info h3 {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drama-meta { font-size: 11px; color: var(--text-secondary); margin: 0 0 3px; }
.catalog-empty { text-align: center; color: var(--text-secondary); font-size: 13px; grid-column: 1 / -1; }
.catalog-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 18px auto 0;
  max-width: 480px;
}

/* Small toast used by the catalog when tapping a card can't hand off to
   an app (iOS: no app exists yet) */
.dokdok-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  max-width: min(90vw, 360px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.dokdok-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

