:root {
  --bg: #fff7fb;
  --surface: #ffffff;
  --surface-alt: #fff0f6;
  --text: #1f172a;
  --muted: #6b5b75;
  --primary: #d946ef;
  --primary-dark: #a21caf;
  --secondary: #fb7185;
  --border: #f1d4e6;
  --shadow: 0 18px 48px rgba(217, 70, 239, 0.12);
  --radius: 20px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: radial-gradient(circle at top, #ffe5f4 0%, var(--bg) 45%, #fff 100%); color: var(--text); }
body.app-body {
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top, rgba(255, 213, 232, 0.72) 0%, rgba(255, 250, 252, 0) 34%),
    linear-gradient(180deg, #fffafc 0%, #fff1f5 52%, #fff8fb 100%);
}
body.app-watch-body {
  background: #07040a;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(255, 247, 251, 0.88); border-bottom: 1px solid rgba(217, 70, 239, 0.08); }
.site-header-app { background: rgba(255, 250, 252, 0.76); border-bottom-color: rgba(116, 39, 73, 0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-badge { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-weight: 800; }
.brand strong { display: block; }
.brand small { color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { padding: 10px 14px; border-radius: 999px; color: var(--muted); }
.nav-links a.is-active, .nav-links a:hover { background: rgba(217, 70, 239, 0.08); color: var(--text); }
body.app-body .brand-badge { background: linear-gradient(135deg, #1f101a, #a33d6d 58%, #f09ab7); }
body.app-body .brand strong { letter-spacing: 0.03em; }
body.app-body .nav-links a { color: #6f4b5f; }
body.app-body .nav-links a.is-active,
body.app-body .nav-links a:hover { background: rgba(163, 61, 109, 0.1); color: #2f1826; }

.hero { padding: 56px 0 24px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: center; }
.eyebrow { display: inline-flex; margin-bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(217, 70, 239, 0.12); color: var(--primary-dark); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.hero h1 { margin: 0 0 14px; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.04; }
.hero-copy { color: var(--muted); font-size: 1.05rem; max-width: 680px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pill { padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.hero-card, .admin-card, .course-card, .watch-card, .video-card, .empty-card, .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: 28px; }
.hero-kicker { color: var(--secondary); font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.08em; }

.section { padding: 18px 0 40px; }
.section-alt { background: linear-gradient(180deg, transparent 0%, rgba(251, 113, 133, 0.06) 100%); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h1, .section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 600px; }
.spaced-top { margin-top: 32px; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.video-card img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px 20px 0 0; }
.video-card-body { padding: 18px; }
.video-card h3 { margin: 12px 0 10px; }
.video-card p { color: var(--muted); min-height: 52px; }
.tag { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.tag-free { background: rgba(217, 70, 239, 0.12); color: var(--primary-dark); }
.tag-paid { background: rgba(251, 113, 133, 0.16); color: #be123c; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px; border-radius: 999px; border: none; cursor: pointer; font-weight: 800; transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 14px 28px rgba(217, 70, 239, 0.22); }
.btn-secondary { background: #fff; color: var(--primary-dark); border: 1px solid var(--border); }
.btn-danger { background: #f43f5e; color: #fff; }
.btn-small { min-height: 44px; padding: 10px 16px; }
.btn-locked { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 20px; border-radius: 999px; background: #f8d7e3; color: #8a4064; font-weight: 800; }

.site-footer { padding: 34px 0 48px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; }
.footer-inner p { color: var(--muted); }
.footer-card { padding: 20px; border-radius: 20px; border: 1px solid var(--border); background: rgba(255,255,255,0.8); }

.course-grid, .watch-grid, .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.course-card, .watch-card, .admin-card { padding: 24px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 8px; font-weight: 700; }
.stack-form input, .stack-form textarea, .stack-form select, .inline-form input, .inline-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}
.field-inline { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.checkbox { display: flex !important; align-items: center; gap: 10px; }
.checkbox input { width: auto; }
.notice { padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; font-weight: 700; }
.notice.success { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.notice.error { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.muted { color: var(--muted); }

.watch-shell { padding: 18px 0 32px; }
.watch-mobile { max-width: 820px; }
.watch-topbar { margin-bottom: 12px; }
.watch-title { margin: 0 0 14px; font-size: clamp(1.15rem, 4vw, 1.7rem); line-height: 1.3; }
.video-launcher, .video-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.video-launcher-thumb-wrap, .video-thumb-link { position: relative; display: block; background: #120915; }
.video-launcher-thumb, .video-thumb-link img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-play-button, .video-thumb-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 24, 0.78);
  color: #fff;
  box-shadow: 0 18px 36px rgba(0,0,0,0.28);
  cursor: pointer;
}
.video-play-icon, .video-thumb-play { font-size: 1.6rem; line-height: 1; }
.video-player-shell { background: #000; }
.player-frame { width: 100%; min-height: min(62vh, 720px); border: 0; }
.video-grid-mobile { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.video-tile-title { margin: 0; padding: 14px 14px 16px; font-size: 0.96rem; line-height: 1.4; }
.app-feed-shell .section-head { margin-bottom: 12px; }
.premium-app-shell { padding-top: 10px; padding-bottom: 56px; }
.app-eyebrow { background: rgba(255, 255, 255, 0.72); color: #7c2d52; }
.app-spotlight {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  margin-bottom: 14px;
}
.video-tile-featured {
  border: 1px solid rgba(163, 61, 109, 0.1);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(74, 20, 48, 0.16);
}
.video-tile-body { padding: 16px 18px 20px; }
.video-tile-body .video-tile-title { padding: 0; }
.video-chip {
  position: absolute;
  left: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 9, 21, 0.8);
  color: #fff;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.video-chip-locked { background: linear-gradient(135deg, rgba(123, 28, 70, 0.92), rgba(42, 12, 27, 0.92)); }
.app-video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.app-video-card {
  border: 1px solid rgba(163, 61, 109, 0.09);
  box-shadow: 0 20px 52px rgba(74, 20, 48, 0.12);
}
.bullet-list { margin: 0; padding-left: 18px; color: var(--muted); }
.bullet-list li + li { margin-top: 8px; }

.ad-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(16, 10, 24, 0.78); backdrop-filter: blur(10px); z-index: 40; }
.ad-overlay.is-visible { display: flex; }
.ad-panel { width: min(520px, calc(100% - 32px)); padding: 28px; border-radius: 24px; background: linear-gradient(135deg, #140c1a, #2b1630); color: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); text-align: center; }
.ad-panel-fullscreen { width: calc(100% - 18px); height: calc(100% - 18px); padding: 12px; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; }
.ad-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ad-badge { display: inline-flex; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,0.1); color: #fff; font-weight: 800; font-size: 0.82rem; }
.ad-frame-wrap { overflow: hidden; border-radius: 18px; background: #fff; }
.ad-frame { width: 100%; height: 100%; min-height: 60vh; border: 0; background: #fff; }
.ad-actions { display: flex; justify-content: flex-end; }

.admin-body { background: #fff8fc; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 24px 0; }
.admin-main { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats-grid-admin { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-card { padding: 20px; }
.stat-card strong { display: block; font-size: 2rem; }
.stat-card span { color: var(--muted); }
.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.admin-tab {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.admin-tab.is-active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 14px 28px rgba(217, 70, 239, 0.22);
}
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.admin-overview-grid { margin-top: 8px; }
.section-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.search-results { display: grid; gap: 14px; }
.search-card { display: grid; grid-template-columns: 160px 1fr; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface-alt); }
.search-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; }

.admin-login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); padding: 28px; border-radius: 24px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }

body.app-watch-body .watch-shell {
  padding: 10px 0 18px;
}
body.app-watch-body .watch-mobile {
  max-width: 100%;
}
body.app-watch-body .watch-title {
  color: #fff6fb;
  padding: 0 6px;
}
body.app-watch-body .watch-topbar {
  padding: 0 6px;
}
body.app-watch-body .video-launcher {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}
body.app-watch-body .player-frame {
  min-height: min(78vh, 960px);
}

@media (max-width: 980px) {
  .hero-grid, .video-grid, .course-grid, .watch-grid, .admin-grid, .footer-inner, .stats-grid { grid-template-columns: 1fr; }
  .section-row, .header-inner, .admin-topbar { align-items: start; flex-direction: column; }
  .nav-links { flex-wrap: wrap; }
  .field-inline { grid-template-columns: 1fr; }
  .admin-tabs { padding: 6px; }
  .video-grid-mobile { grid-template-columns: 1fr 1fr; }
  .app-video-grid { grid-template-columns: 1fr 1fr; }
  .video-play-button, .video-thumb-play { width: 64px; height: 64px; }
  .ad-panel-fullscreen { width: 100%; height: 100%; border-radius: 0; padding: 10px; }
  .ad-frame { min-height: 68vh; }
  body.app-watch-body .player-frame { min-height: 62vh; }
}

@media (max-width: 640px) {
  .site-header { position: static; }
  .container { width: min(100%, calc(100% - 20px)); }
  .nav-links { gap: 8px; }
  .nav-links a { padding: 8px 10px; font-size: 0.88rem; }
  .video-grid-mobile { grid-template-columns: 1fr; gap: 12px; }
  .premium-app-shell { padding-top: 14px; }
  .app-video-grid { grid-template-columns: 1fr; }
  .video-tile-title { font-size: 0.92rem; padding: 12px 12px 14px; }
  .watch-shell { padding-top: 12px; }
  .player-frame { min-height: 240px; }
  .video-play-button, .video-thumb-play { width: 58px; height: 58px; }
  .video-play-icon, .video-thumb-play { font-size: 1.35rem; }
  .ad-topbar { flex-direction: column; align-items: stretch; }
  .ad-actions { justify-content: stretch; }
  .ad-actions .btn { width: 100%; }
}
