/* =========================================================
   FoxTV — dizayn tokenlari
   Ranglar: qora fon + zarg'aldoq (#FF9A00) aksent, shisha effekti
   Shrift: Unbounded (sarlavha), Manrope (matn), Space Mono (label/raqam)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;800&family=Manrope:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg: #0a0a0c;
  --bg-elevated: #131318;
  --bg-elevated-2: #1b1b21;
  --fox: #ff9a00;
  --fox-dark: #c97600;
  --fox-glow: rgba(255, 154, 0, 0.35);
  --text: #f5f0e8;
  --text-muted: #a3a2ab;
  --border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-strong: rgba(255, 255, 255, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-glow: 0 8px 32px rgba(255, 154, 0, 0.18);
  --max-width: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(circle at 15% 0%, #1a1309 0%, var(--bg) 45%) fixed,
              var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: 'Unbounded', sans-serif;
  margin: 0 0 .5em;
  line-height: 1.15;
}

.eyebrow, .mono {
  font-family: 'Space Mono', monospace;
  letter-spacing: .04em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Glass component ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: var(--glass-bg-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: var(--radius-lg);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 10px var(--fox-glow)); }
.brand span { color: var(--fox); }

.nav-desktop {
  display: flex;
  gap: 6px;
  flex: 1;
}

.nav-desktop a {
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .92rem;
  transition: background .2s, color .2s;
  white-space: nowrap;
}

.nav-desktop a:hover, .nav-desktop a.active {
  background: var(--glass-bg-strong);
  color: var(--fox);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 340px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: .82rem;
  font-weight: 700;
  color: var(--fox);
}

.premium-pill {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--fox), #ffc866);
  color: #1a1200;
  letter-spacing: .05em;
}

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .92rem;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: 'Manrope', sans-serif;
}

.btn-fox {
  background: linear-gradient(120deg, var(--fox), #ffb733);
  color: #1a1200;
  box-shadow: var(--shadow-glow);
}
.btn-fox:hover { transform: translateY(-2px); box-shadow: 0 12px 40px var(--fox-glow); }

.btn-glass {
  background: var(--glass-bg-strong);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-glass:hover { background: rgba(255, 154, 0, 0.12); border-color: var(--fox-dark); }

.btn-outline {
  background: transparent;
  color: var(--fox);
  border: 1.5px solid var(--fox-dark);
}
.btn-outline:hover { background: rgba(255, 154, 0, .1); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.input-glass {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s, background .2s;
}
.input-glass::placeholder { color: var(--text-muted); }
.input-glass:focus { border-color: var(--fox); background: rgba(255, 154, 0, .06); }
.search-form .input-glass { padding: 10px 16px; }

/* visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--fox);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 70px 0 60px;
  border-bottom: 1px solid var(--border);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 40px;
}

.hero-eyebrow {
  color: var(--fox);
  font-size: .8rem;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: inline-block;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--fox);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin-bottom: 26px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-fox-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-fox-wrap img {
  width: min(320px, 80%);
  filter: drop-shadow(0 20px 60px var(--fox-glow));
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.hero-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--fox-glow), transparent 65%);
  filter: blur(10px);
  z-index: -1;
}

/* ---------- Section headers ---------- */
.section { padding: 48px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}
.section-head h2 { font-size: 1.5rem; }
.section-head .see-all { color: var(--fox); font-weight: 700; font-size: .88rem; white-space: nowrap; }

/* ---------- Genre chips ---------- */
.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  white-space: nowrap;
}
.chip.active, .chip:hover { color: var(--fox); border-color: var(--fox-dark); background: rgba(255,154,0,.08); }

/* ---------- Anime grid & card ---------- */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.anime-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: transform .25s ease;
}
.anime-card:hover { transform: translateY(-6px); }

.anime-card .poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.anime-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.anime-card:hover img { transform: scale(1.08); }

.anime-card .badge-premium {
  position: absolute;
  top: 8px; right: 8px;
  font-size: .62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--fox), #ffc866);
  color: #1a1200;
  letter-spacing: .04em;
  z-index: 2;
}

.anime-card .rating-badge {
  position: absolute;
  bottom: 8px; left: 8px;
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  color: var(--fox);
  z-index: 2;
}

.anime-card .gradient-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 45%);
  z-index: 1;
}

.anime-card .card-title {
  margin-top: 10px;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.3;
}
.anime-card .card-meta {
  color: var(--text-muted);
  font-size: .76rem;
  margin-top: 2px;
}

/* ---------- Detail page ---------- */
.detail-banner {
  position: relative;
  height: 320px;
  background-size: cover;
  background-position: center;
}
.detail-banner::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 5%, rgba(10,10,12,.35) 60%, rgba(10,10,12,.65));
}

.detail-header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  margin-top: -140px;
  position: relative;
  z-index: 2;
}

.detail-poster {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  aspect-ratio: 2/3;
}

.detail-info h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
  align-items: center;
}

.tag {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .78rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.stars { color: var(--fox); letter-spacing: 2px; }

.detail-desc { color: var(--text-muted); max-width: 70ch; line-height: 1.7; }

.detail-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* Episodes list */
.episode-list { display: flex; flex-direction: column; gap: 10px; }
.episode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
}
.episode-row .ep-thumb {
  width: 96px; height: 60px; border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0; background: var(--bg-elevated);
}
.episode-row .ep-num {
  font-family: 'Space Mono', monospace;
  color: var(--fox);
  font-weight: 700;
  min-width: 34px;
}
.episode-row .ep-title { font-weight: 600; flex: 1; }
.episode-row .ep-lock { color: var(--fox); flex-shrink: 0; }

/* Rating widget */
.rate-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.star-btns { display: flex; gap: 4px; }
.star-btns button {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--border); transition: color .15s;
}
.star-btns button.filled, .star-btns button:hover, .star-btns button:hover ~ button { color: var(--fox); }

/* Comments */
.comment-card { padding: 16px; margin-bottom: 12px; }
.comment-head { display: flex; justify-content: space-between; font-size: .82rem; color: var(--text-muted); margin-bottom: 6px; }
.comment-head strong { color: var(--fox); }

/* ---------- Watch page ---------- */
.watch-player {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.watch-player video, .watch-player iframe { width: 100%; height: 100%; border: none; }

.lock-screen {
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 30px;
}
.lock-screen img { width: 64px; opacity: .85; }

/* ---------- Forms / auth pages ---------- */
.auth-wrap {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card p.sub { color: var(--text-muted); margin-bottom: 24px; font-size: .9rem; }
.auth-field { text-align: left; margin-bottom: 14px; }
.auth-field label { font-size: .82rem; color: var(--text-muted); display: block; margin-bottom: 6px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border-radius: 999px;
  background: #fff; color: #1f1f1f; font-weight: 700; font-size: .9rem;
}
.google-btn img { width: 18px; height: 18px; }
.auth-foot { margin-top: 18px; font-size: .85rem; color: var(--text-muted); }
.auth-foot a { color: var(--fox); font-weight: 700; }
.errorlist { color: #ff6b6b; font-size: .78rem; margin: 4px 0 0; padding: 0; list-style: none; }

/* ---------- Profile ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-card { padding: 26px; text-align: center; }
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 14px; border: 2px solid var(--fox);
}
.balance-figure {
  font-family: 'Space Mono', monospace;
  font-size: 1.7rem; font-weight: 700; color: var(--fox); margin: 6px 0;
}
.transaction-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: .88rem;
}
.transaction-row:last-child { border-bottom: none; }
.tx-positive { color: #6dd48a; }
.tx-negative { color: #ff8a6b; }

/* ---------- Plans ---------- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.plan-card {
  padding: 30px 24px;
  text-align: center;
  position: relative;
  transition: transform .2s ease;
}
.plan-card:hover { transform: translateY(-6px); }
.plan-card.popular { border-color: var(--fox-dark); box-shadow: var(--shadow-glow); }
.plan-card .plan-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(120deg, var(--fox), #ffc866);
  color: #1a1200; font-size: .7rem; font-weight: 700; padding: 4px 14px; border-radius: 999px;
}
.plan-card h3 { font-size: 1.1rem; color: var(--text-muted); font-weight: 600; }
.plan-price { font-family: 'Space Mono', monospace; font-size: 2rem; font-weight: 700; color: var(--fox); margin: 10px 0 0; }
.plan-price small { font-size: .9rem; color: var(--text-muted); font-family: 'Manrope', sans-serif; }
.plan-old-price { color: var(--text-muted); text-decoration: line-through; font-size: .85rem; }
.plan-desc { color: var(--text-muted); font-size: .85rem; margin: 12px 0 20px; min-height: 2.4em; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-muted);
  font-size: .85rem;
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ---------- Messages ---------- */
.messages { position: fixed; top: 84px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.message {
  padding: 12px 16px; border-radius: var(--radius-md); font-size: .86rem;
  border-left: 3px solid var(--fox);
}
.message.error { border-left-color: #ff5b5b; }
.message.warning { border-left-color: #ffd15b; }

/* ---------- Mobile bottom nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(10,10,12,.85);
  backdrop-filter: blur(20px);
}
.bottom-nav .container { display: flex; justify-content: space-around; padding: 0; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-muted); font-size: .68rem; font-weight: 600;
}
.bottom-nav a.active { color: var(--fox); }
.bottom-nav svg { width: 22px; height: 22px; }

/* =========================================================
   Responsive breakpoints
   ========================================================= */
@media (max-width: 900px) {
  .plans-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .detail-header { grid-template-columns: 140px 1fr; margin-top: -100px; }
}

@media (max-width: 760px) {
  .nav-desktop, .search-form { display: none; }
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-fox-wrap { order: -1; }
  .hero-fox-wrap img { width: 180px; }
  body { padding-bottom: 74px; }
  .bottom-nav { display: block; }
  .site-footer { padding-bottom: 90px; }
  .messages { top: auto; bottom: 90px; right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 620px) {
  .detail-header { grid-template-columns: 1fr; text-align: center; margin-top: -70px; }
  .detail-poster { width: 150px; margin: 0 auto; }
  .meta-row { justify-content: center; }
  .detail-actions { justify-content: center; }
  .anime-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
  .episode-row .ep-thumb { width: 72px; height: 46px; }
  .site-header .container { height: 62px; }
  .brand span.brand-text { display: none; }
}
