:root {
  --bg: #fff9ef;
  --ink: #2d2a4a;
  --muted: #6e6a8c;
  --purple: #7b5cff;
  --pink: #ff5c9a;
  --yellow: #ffcc33;
  --green: #2ec4a6;
  --blue: #3fa9f5;
  --orange: #ff8a3d;
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 10% 20%, #ffffff55 0 40px, transparent 41px),
    radial-gradient(circle at 85% 30%, #ffffff44 0 60px, transparent 61px),
    radial-gradient(circle at 60% 90%, #ffffff33 0 30px, transparent 31px),
    linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  padding: 18px 24px 64px;
  text-align: center;
  border-radius: 0 0 48px 48px;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }
.logo { color: #fff; text-decoration: none; font-size: 1.6rem; font-weight: 800; }
.ui-lang { background: #ffffff33; border-radius: 999px; padding: 4px; }
.ui-lang button {
  border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
}
.ui-lang button.active { background: #fff; color: var(--purple); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 28px 0 0; line-height: 1.1; }
.hero .sub { font-size: 1.2rem; opacity: .95; margin: 8px auto 28px; max-width: 640px; }

.lang-picker { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.lang-btn {
  font-size: 1.15rem !important; padding: 10px 22px !important;
  background: #fff !important; color: var(--ink) !important;
  box-shadow: 0 6px 0 #0002;
}
.lang-btn .flag { font-size: 1.6rem; margin-right: 8px; vertical-align: -3px; }
.lang-btn.active { background: var(--yellow) !important; transform: translateY(-3px); box-shadow: 0 9px 0 #0003; }

/* ---------- Our show ---------- */
.show {
  background: linear-gradient(180deg, #fff 0%, #fff6d9 100%);
  border-radius: var(--radius); padding: 22px 24px 26px;
  box-shadow: 0 10px 30px #2d2a4a14; margin-bottom: 34px;
}
.show-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.show-head h2 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.3rem); color: var(--purple); line-height: 1.1; }
.show-head p { margin: 4px 0 0; color: var(--muted); font-weight: 600; font-size: 1.1rem; }
.subscribe {
  background: #ff0033; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem;
  padding: 10px 24px; border-radius: 999px; box-shadow: 0 6px 0 #a80022; transition: transform .15s;
}
.subscribe:hover { transform: translateY(-3px); }

.cast { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; margin: 20px 0 8px; }
.cast-card {
  --accent: var(--purple);
  margin: 0; background: #dff0fb; border-radius: var(--radius); overflow: hidden; text-align: center;
  border-bottom: 6px solid var(--accent); transition: transform .2s;
}
.cast-card:hover { transform: translateY(-6px) rotate(1deg); }
.cast-ru { --accent: #e63946; }
.cast-en { --accent: var(--yellow); }
.cast-it { --accent: #2a9d4b; }
.cast-fr { --accent: #2f5fd0; }
.cast-es { --accent: #f1bf00; }
.cast-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; display: block; }
.cast-card figcaption { background: #fff; padding: 8px 10px 10px; display: grid; gap: 0; }
.cast-card b { font-size: 1.35rem; }
.cast-card .flag { font-size: 1.3rem; }
.cast-card .word { color: var(--muted); font-weight: 700; }

.show-label { margin: 18px 0 12px; font-size: 1.3rem; }
.episode.soon .thumb { cursor: default; }
.soon-badge {
  position: absolute; right: 10px; bottom: 10px; background: var(--yellow); color: var(--ink);
  font-weight: 800; padding: 2px 12px; border-radius: 999px; box-shadow: 0 3px 8px #0003;
}
.section-title { margin: 0 4px 14px; font-size: 1.6rem; }

/* ---------- Filters ---------- */
main { max-width: 1200px; margin: -36px auto 0; padding: 0 20px 40px; }
.filters {
  background: #fff; border-radius: var(--radius); padding: 18px 22px;
  box-shadow: 0 10px 30px #2d2a4a14; display: grid; gap: 12px;
}
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-label { font-weight: 800; min-width: 90px; color: var(--purple); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 0; font: inherit; font-weight: 700; cursor: pointer;
  background: #f1edff; color: var(--ink); padding: 6px 16px; border-radius: 999px;
  transition: transform .15s, background .15s;
}
.chip:hover { transform: scale(1.06); }
.chip.active { background: var(--purple); color: #fff; }
.search {
  flex: 1; min-width: 200px; font: inherit; font-size: 1.05rem;
  border: 3px solid #f1edff; border-radius: 999px; padding: 8px 18px; outline: none;
}
.search:focus { border-color: var(--purple); }
.fav-toggle.active { background: var(--yellow); color: var(--ink); }

.count { color: var(--muted); font-weight: 700; margin: 22px 4px 10px; }
.empty { text-align: center; font-size: 1.4rem; color: var(--muted); padding: 40px; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card {
  --accent: var(--purple);
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border-bottom: 6px solid var(--accent);
  box-shadow: 0 8px 22px #2d2a4a12; transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-6px) rotate(-.5deg); box-shadow: 0 16px 30px #2d2a4a22; }
.topic-alphabet { --accent: var(--pink); }
.topic-numbers  { --accent: var(--blue); }
.topic-colors   { --accent: var(--yellow); }
.topic-shapes   { --accent: var(--orange); }
.topic-animals  { --accent: var(--green); }
.topic-body     { --accent: var(--purple); }
.topic-time     { --accent: #9b6bff; }
.topic-science  { --accent: #22a06b; }

.thumb { position: relative; aspect-ratio: 16 / 9; cursor: pointer; background: #eee; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  background: #fffe; color: var(--accent); font-size: 1.8rem; display: grid; place-items: center;
  padding-left: 5px; box-shadow: 0 6px 16px #0003; transition: transform .2s;
}
.thumb:hover .play { transform: scale(1.15); }
.badge { position: absolute; top: 10px; left: 10px; font-size: 1.6rem; filter: drop-shadow(0 2px 3px #0005); }

.card-body { padding: 12px 16px 14px; }
.card h3 {
  font-size: 1.05rem; line-height: 1.25; margin: 0 0 10px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag { background: #f6f4ff; border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.fav { margin-left: auto; border: 0; background: none; font-size: 1.5rem; color: #ddd; cursor: pointer; transition: transform .15s; }
.fav:hover { transform: scale(1.25); }
.fav.on { color: var(--yellow); }

/* ---------- Player ---------- */
dialog {
  border: 0; padding: 0; background: transparent; width: min(960px, 94vw); max-width: none;
}
dialog::backdrop { background: #2d2a4acc; backdrop-filter: blur(4px); }
.player-box { background: #fff; border-radius: var(--radius); overflow: hidden; position: relative; }
.frame-wrap { aspect-ratio: 16 / 9; background: #000; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-info { padding: 14px 22px 18px; }
.player-info h2 { margin: 0; font-size: 1.3rem; line-height: 1.25; }
.player-info p { margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--pink); color: #fff; font-size: 1.3rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 10px #0004;
}

footer { text-align: center; color: var(--muted); padding: 24px; font-weight: 600; }

@media (max-width: 600px) {
  .filter-label { min-width: 100%; }
  .cast { gap: 10px; }
  .cast-card b { font-size: 1.1rem; }
  .hero { padding-bottom: 56px; }
}

.show-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.friends-link {
  background: var(--yellow); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.15rem;
  padding: 10px 24px; border-radius: 999px; box-shadow: 0 6px 0 #d9a400; transition: transform .15s;
}
.friends-link:hover { transform: translateY(-3px); }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-img {
  width: 52px; height: 52px; border-radius: 50%; background: #fff;
  box-shadow: 0 4px 10px #0003; transition: transform .2s;
}
.logo:hover .logo-img { transform: rotate(-8deg) scale(1.05); }
