/* ===== The Simpsons theme ===== */
:root {
  --simpsons-yellow: #ffd90f;
  --simpsons-yellow-deep: #f5c400;
  --sky: #69b8e8;
  --sky-deep: #3d8ec9;
  --sky-pale: #b8dff5;
  --navy: #1a2744;
  --ink: #1c1408;
  --card: #fffef8;
  --card-soft: #fff8e1;
  --muted: #5a5246;
  --border: rgba(28, 20, 8, 0.12);
  --outline: #1c1408;
  --shadow: 0 8px 0 rgba(28, 20, 8, 0.12);
  --shadow-soft: 0 10px 28px rgba(28, 20, 8, 0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Nunito", system-ui, sans-serif;
  --display: "Bangers", "Comic Sans MS", system-ui, sans-serif;
  --header-h: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 217, 15, 0.18), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(105, 184, 232, 0.25), transparent 30%),
    linear-gradient(180deg, #8ec8ee 0%, #c5e6f8 28%, #eef6fb 55%, #f7f3e8 100%);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}

/* ===== Sky / clouds / donuts ===== */
.site-sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.04));
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-a {
  width: 150px;
  height: 44px;
  top: 14%;
  left: 6%;
  animation: drift 32s linear infinite;
}
.cloud-a::before {
  width: 56px;
  height: 56px;
  top: -30px;
  left: 24px;
}
.cloud-a::after {
  width: 72px;
  height: 72px;
  top: -38px;
  left: 58px;
}

.cloud-b {
  width: 190px;
  height: 50px;
  top: 28%;
  right: 8%;
  animation: drift 40s linear infinite reverse;
}
.cloud-b::before {
  width: 64px;
  height: 64px;
  top: -34px;
  left: 36px;
}
.cloud-b::after {
  width: 84px;
  height: 84px;
  top: -42px;
  left: 78px;
}

.cloud-c {
  width: 120px;
  height: 38px;
  top: 62%;
  left: 48%;
  opacity: 0.5;
  animation: drift 48s linear infinite;
}
.cloud-c::before {
  width: 48px;
  height: 48px;
  top: -24px;
  left: 20px;
}
.cloud-c::after {
  width: 60px;
  height: 60px;
  top: -30px;
  left: 46px;
}

.donut-float {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 28%, #f4a0b5 29%, #f4a0b5 42%, #ffd90f 43%);
  border: 2px solid var(--outline);
  opacity: 0.35;
  animation: bob 6s ease-in-out infinite;
}

.donut-float.d1 {
  top: 18%;
  right: 18%;
}
.donut-float.d2 {
  bottom: 22%;
  left: 12%;
  animation-delay: -2s;
  transform: scale(0.85);
}

@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(36px);
  }
}

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

/* ===== Comic utilities ===== */
.comic-title {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--navy);
  line-height: 1.05;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(28, 20, 8, 0.12);
}

.comic-title.sm {
  font-size: 1.8rem;
}

.yellow-stroke {
  color: var(--simpsons-yellow);
  -webkit-text-stroke: 1px rgba(28, 20, 8, 0.15);
  text-shadow: 3px 3px 0 #1c1408;
}

.chalk-label {
  display: inline-block;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin-bottom: 8px;
}

.comic-box {
  border: 3px solid var(--outline);
  box-shadow: 4px 4px 0 var(--outline);
  border-radius: var(--radius);
  background: var(--card);
}

.btn-comic {
  border: 3px solid var(--outline) !important;
  box-shadow: 3px 3px 0 var(--outline) !important;
}

.btn-comic:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--outline) !important;
}

.btn-comic:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--outline) !important;
}

/* ===== Safe images ===== */
.img-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #69b8e8, #ffd90f);
  width: 100%;
  height: 100%;
}

.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.img-frame.is-loaded img {
  opacity: 1;
}

.img-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.15) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.img-frame.is-loaded .img-skeleton {
  display: none;
}

.img-frame.is-error {
  background: linear-gradient(145deg, #ffd90f, #69b8e8);
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 220, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--outline);
}

.simpsons-stripe {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--simpsons-yellow) 0 28px,
    #69b8e8 28px 56px,
    #f06040 56px 84px,
    #5c8fd6 84px 112px,
    #66bb6a 112px 140px
  );
}

.header-inner {
  min-height: calc(var(--header-h) - 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--outline);
  overflow: hidden;
  box-shadow: 2px 2px 0 var(--outline);
  background: var(--simpsons-yellow);
  flex-shrink: 0;
}

.logo-ring.sm {
  width: 32px;
  height: 32px;
  border-width: 2px;
}

.logo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.logo-sub {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--muted);
  border: 2px solid transparent;
  transition: 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 217, 15, 0.35);
}

.nav-link.active {
  background: var(--simpsons-yellow);
  color: var(--ink);
  border-color: var(--outline);
  box-shadow: 2px 2px 0 var(--outline);
}

.header-stats {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

.hs-item strong {
  color: var(--ink);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--outline);
  border-radius: 2px;
}

/* ===== Live badge ===== */
.live-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 14px;
  border: 3px solid var(--outline);
  box-shadow: 3px 3px 0 var(--outline);
}

.metrika-badge {
  padding: 6px 8px;
  line-height: 0;
}

.metrika-link img {
  display: block;
  border-radius: 4px;
}

.metrika-setup {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sky-deep);
  white-space: nowrap;
}

.header-stats {
  min-height: 31px;
  display: flex;
  align-items: center;
}

/* ===== Page shell ===== */
main,
.page-main {
  position: relative;
  z-index: 1;
}

.page-main {
  padding-bottom: 48px;
}

.page-top {
  padding: 28px 0 18px;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.page-title-row .comic-title,
.page-top > .comic-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.page-lead {
  margin-top: 8px;
  max-width: 54ch;
  color: var(--muted);
  font-weight: 600;
}

.section {
  padding: 40px 0;
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head .comic-title {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-primary {
  background: var(--simpsons-yellow);
  color: var(--ink);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-color: var(--border);
}

.btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.link-btn {
  font-weight: 800;
  color: var(--sky-deep);
}

.link-btn:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ===== Hero ===== */
.hero-band {
  position: relative;
  min-height: 460px;
  padding: 36px 0 48px;
  overflow: hidden;
  color: #fff;
  border-bottom: 3px solid var(--outline);
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.68) 48%, rgba(15, 23, 42, 0.4) 100%),
    linear-gradient(0deg, #8ec8ee 0%, transparent 24%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
}

.hero-band .chalk-label {
  color: var(--simpsons-yellow);
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5rem);
  margin-bottom: 12px;
  text-shadow: none;
  color: #fff;
}

.hero-lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.86);
  max-width: 44ch;
  margin-bottom: 20px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  padding: 10px 14px;
  min-width: 90px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.stat.comic-box {
  background: rgba(255, 248, 220, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}

.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--simpsons-yellow);
  letter-spacing: 0.03em;
  font-weight: 400;
  line-height: 1;
}

.stat span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.7);
}

.hero-poster-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-poster-frame {
  width: min(230px, 68vw);
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  border: 4px solid var(--outline);
  box-shadow: 6px 6px 0 var(--outline);
}

.speech-bubble {
  position: relative;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--outline);
  border-radius: 18px;
  padding: 12px 16px;
  max-width: 280px;
  text-align: center;
  box-shadow: 3px 3px 0 var(--outline);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 28px;
  top: -12px;
  border: 8px solid transparent;
  border-bottom-color: var(--outline);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: 30px;
  top: -7px;
  border: 6px solid transparent;
  border-bottom-color: #fff;
  z-index: 1;
}

.speech-bubble p {
  font-weight: 800;
  font-size: 0.95rem;
}

.speech-bubble span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

/* ===== Family strip ===== */
.section-family {
  background: rgba(255, 248, 220, 0.55);
  border-bottom: 3px solid var(--outline);
}

.family-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.family-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--outline);
  transition: 0.15s ease;
  font-weight: 800;
  color: var(--navy);
}

.family-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--outline);
  background: var(--simpsons-yellow);
}

.family-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid var(--outline);
}

/* ===== CTA ===== */
.section-cta {
  padding-top: 8px;
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 24px 28px;
  background: linear-gradient(120deg, var(--simpsons-yellow), #ffe66d 50%, #8ec8ee);
}

.cta-banner p {
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

/* ===== Watch ===== */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 18px;
  align-items: start;
}

.player-box {
  overflow: hidden;
  background: #142033;
  color: #fff;
  border-color: var(--outline);
}

.mirror-bar {
  background: #0b1220;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
}

.mirror-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mirror-title {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 800;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mirror-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mirror-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.mirror-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mirror-btn.active {
  background: var(--simpsons-yellow);
  color: var(--ink);
  border-color: var(--outline);
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0f1a;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.video-wrap iframe.is-active {
  opacity: 1;
  pointer-events: auto;
}

.video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.video-empty[hidden] {
  display: none !important;
}

.player-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-header-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.player-info h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  font-weight: 400;
  color: #fff;
}

.player-info .muted {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
}

.episode-detail {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.episode-detail p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--simpsons-yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--outline);
}

.tag-soft {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.player-tip {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.ep-nav-controls {
  display: flex;
  gap: 8px;
}

.watch-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-h) + 12px);
}

.aside-card {
  padding: 14px;
}

.aside-card h3 {
  font-family: var(--display);
  letter-spacing: 0.03em;
  font-weight: 400;
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--navy);
}

.now-playing-thumb {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--outline);
  margin-bottom: 10px;
  background: linear-gradient(135deg, #69b8e8, #ffd90f);
}

.now-img {
  width: 100%;
  height: 100%;
}

.now-playing-title {
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--navy);
}

.favorites-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: var(--card-soft);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--navy);
  transition: 0.15s ease;
}

.fav-item:hover {
  background: var(--simpsons-yellow);
  border-color: var(--outline);
}

.fav-thumb {
  width: 48px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.empty-fav {
  font-size: 0.85rem;
}

/* ===== Collections ===== */
.section-collections,
.section-featured {
  position: relative;
  z-index: 1;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.collections-grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.collection-card {
  display: block;
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--outline);
  transition: 0.15s ease;
  color: inherit;
}

.collection-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--outline);
}

.collection-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #3d5a80, #1a2744);
}

.collection-img {
  position: absolute;
  inset: 0;
}

.collection-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(10, 15, 30, 0.78));
  pointer-events: none;
}

.collection-count {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 1;
  background: var(--accent, var(--simpsons-yellow));
  color: var(--ink);
  font-weight: 800;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--outline);
}

.collection-body {
  padding: 14px 16px 16px;
}

.collection-body h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.collection-body p {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}

/* ===== Episode cards ===== */
.episode-row,
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.ep-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 3px 3px 0 var(--outline);
  transition: 0.15s ease;
  color: inherit;
}

.ep-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--outline);
  background: #fffef0;
}

.ep-card.active {
  outline: 3px solid var(--simpsons-yellow);
  outline-offset: 2px;
}

.ep-thumb {
  /* Превью занимает основную площадь карточки */
  aspect-ratio: 16 / 10;
  height: auto;
  min-height: 168px;
  background: linear-gradient(135deg, var(--thumb-a, #5ba3e0), var(--thumb-b, #ffd90f));
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px;
  overflow: hidden;
  flex: 1 1 auto;
}

.ep-thumb-frame {
  position: absolute;
  inset: 0;
}

.ep-thumb.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.ep-badge,
.ep-rating {
  position: relative;
  z-index: 1;
}

.ep-badge {
  background: rgba(20, 32, 51, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ep-rating {
  background: var(--simpsons-yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 2px solid var(--outline);
}

.ep-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
}

.ep-body-compact {
  min-height: 0;
}

.ep-body h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-body p {
  display: none; /* описания убраны — место под превью */
}

.ep-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

@media (min-width: 1100px) {
  .episodes-grid,
  .episode-row {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
  .ep-thumb {
    min-height: 200px;
  }
}

.ep-meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

/* ===== Catalog toolbar ===== */
.sticky-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: rgba(255, 254, 248, 0.95);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-wrap-sm {
  min-width: 180px;
  max-width: 260px;
  flex: 0 1 260px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: 999px;
  border: 2px solid var(--outline);
  background: #fff;
  outline: none;
  font-weight: 700;
}

.search-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(255, 217, 15, 0.45);
}

.toolbar-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.select-wrap select {
  appearance: none;
  padding: 11px 34px 11px 14px;
  border-radius: 999px;
  border: 2px solid var(--outline);
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231c1408' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  max-width: 190px;
}

.count-badge {
  background: var(--simpsons-yellow);
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--outline);
}

.season-rail-wrap {
  margin-bottom: 18px;
}

.season-chips,
.char-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.chip {
  border: 2px solid var(--outline);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 2px 2px 0 transparent;
}

.chip:hover {
  background: #fff8dc;
}

.chip.active {
  background: var(--simpsons-yellow);
  box-shadow: 2px 2px 0 var(--outline);
}

.chip-season {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
}

.chip-poster {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--outline);
  overflow: hidden;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  border: 2px dashed var(--outline);
  color: var(--muted);
  font-weight: 800;
  margin-top: 16px;
}

/* ===== Characters ===== */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.char-card {
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--outline);
  display: flex;
  flex-direction: column;
  transition: 0.15s ease;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.char-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--outline);
}

.char-avatar {
  aspect-ratio: 1 / 1;
  height: auto;
  background: #fffef8;
  border-bottom: 3px solid var(--outline);
  overflow: hidden;
}

.char-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #fff 0%, #fff8e1 100%);
}

/* Единый кроп: персонаж целиком, по центру снизу */
.char-img img {
  object-fit: contain !important;
  object-position: center bottom !important;
  padding: 10px 10px 0;
}

.family-img {
  background: #fff;
}

.family-img img {
  object-fit: contain !important;
  object-position: center bottom !important;
  padding: 6px;
}

.char-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.char-body h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
}

.char-role {
  display: inline-flex;
  align-self: flex-start;
  background: var(--simpsons-yellow);
  border: 2px solid var(--outline);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.char-body p {
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
  font-weight: 600;
}

.char-fact {
  padding-top: 10px;
  border-top: 2px dashed var(--border);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--navy);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: start;
}

.about-card {
  padding: 24px;
}

.about-card > p {
  color: var(--muted);
  margin: 10px 0 14px;
  font-weight: 600;
}

.about-list {
  margin: 0 0 16px 18px;
  font-weight: 700;
}

.about-list li {
  margin-bottom: 6px;
}

.notice {
  padding: 12px 14px;
  background: rgba(255, 217, 15, 0.35);
  font-weight: 700;
  font-size: 0.9rem;
}

.about-family {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.about-family-item {
  background: var(--card);
  border: 3px solid var(--outline);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 3px 3px 0 var(--outline);
  text-align: center;
}

.about-family-img {
  aspect-ratio: 1;
  border-bottom: 2px solid var(--outline);
}

.about-family-item figcaption {
  padding: 8px;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--navy);
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  border-top: 3px solid var(--outline);
  background: rgba(255, 248, 220, 0.9);
  padding: 0 0 32px;
}

.footer-couch {
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    #6b4f3a 0 20px,
    #8b6b52 20px 40px
  );
  border-bottom: 3px solid var(--outline);
}

.footer-inner {
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand strong {
  display: block;
  font-family: var(--display);
  letter-spacing: 0.04em;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--navy);
}

.footer-brand .muted {
  font-size: 0.78rem;
  font-weight: 700;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-weight: 800;
  color: var(--muted);
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-legal {
  font-size: 0.82rem;
  max-width: 62ch;
}

/* ===== Global floating chat (always on top) ===== */
.global-chat {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 2147483000 !important;
  font-family: var(--font);
  pointer-events: none;
}

.global-chat-fab,
.global-chat-panel {
  pointer-events: auto;
}

.global-chat-fab {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 3px solid #1c1408 !important;
  background: #ffd90f !important;
  color: #1c1408 !important;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1c1408;
  min-height: 52px;
  position: relative;
  margin: 0;
}

.global-chat-fab[hidden] {
  display: none !important;
}

.fab-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1c1408;
}

.global-chat-panel {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 20px));
  height: min(560px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  background: #fffef8 !important;
  padding: 0;
  overflow: hidden;
  box-shadow: 6px 6px 0 #1c1408;
  border: 3px solid #1c1408 !important;
  border-radius: 16px;
  z-index: 2147483001 !important;
}

.global-chat-panel[hidden] {
  display: none !important;
}

.global-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(28, 20, 8, 0.12);
  background: #ffe566;
  flex-shrink: 0;
}

.global-chat-head-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.global-chat-title {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.03em;
  font-size: 1.35rem;
  color: #1a2744;
}

.global-chat-sub {
  font-size: 0.75rem;
  font-weight: 800;
  color: #5a5246;
}

.global-chat-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid #1c1408;
  background: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 700;
}

.chat-watching {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(28, 20, 8, 0.1);
  flex-shrink: 0;
  max-height: 56px;
  overflow: auto;
  background: #fff;
}

.chat-watching[hidden] {
  display: none !important;
}

.watching-pill {
  display: inline-flex;
  background: #ffd90f;
  border: 2px solid #1c1408;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #f3efe3;
  -webkit-overflow-scrolling: touch;
}

.chat-msg {
  position: relative;
  background: #fff;
  border: 2px solid rgba(28, 20, 8, 0.12);
  border-radius: 12px;
  padding: 8px 10px 20px;
  max-width: 100%;
}

.chat-msg-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 4px;
}

.chat-msg-nick {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1a2744;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
  min-width: 0;
}

.watch-tag {
  flex-shrink: 0;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  color: #1565c0;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.chat-msg-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c1408;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0;
  line-height: 1.35;
  padding-right: 36px;
}

.chat-msg-time {
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #8a8276;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.global-chat-panel .chat-form {
  flex-shrink: 0;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid rgba(28, 20, 8, 0.12);
  background: #fffef8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.chat-form,
.comments-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-nick {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #1c1408;
  font-weight: 700;
  font-size: 16px;
  box-sizing: border-box;
}

.chat-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.chat-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #1c1408;
  font-weight: 600;
  font-size: 16px;
  box-sizing: border-box;
}

.chat-send {
  flex-shrink: 0;
  width: 48px;
  border-radius: 10px;
  border: 2px solid #1c1408;
  background: #ffd90f;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 2px 2px 0 #1c1408;
}

.chat-hint {
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .global-chat {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .global-chat-panel {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    height: min(75dvh, 620px);
    max-height: calc(100dvh - 16px);
  }

  .global-chat-fab .fab-label {
    /* keep label on mobile so it's obvious */
    display: inline;
  }

  .global-chat-fab {
    min-height: 52px;
    padding: 12px 16px;
    font-size: 1.05rem;
  }
}

.comments-box {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.comment-item {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.comment-head time {
  color: var(--muted);
  font-weight: 700;
}

.comment-item p {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.comments-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--outline);
  font-weight: 600;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.comments-form .btn {
  align-self: flex-start;
}

/* Episode cards: image-first layout */
.ep-card {
  min-height: 0;
}

.ep-card .ep-thumb {
  flex: 1 1 auto;
}

@media (max-width: 720px) {
  .chat-messages {
    height: 180px;
  }
}

/* ===== Adsterra slots ===== */
/* Скрыто, пока реклама не подтверждена (.ad-visible) */
.ad-wrap {
  margin: 16px auto;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ad-wrap.has-ads {
  display: flex;
}

.ad-wrap-top {
  margin-top: 12px;
  margin-bottom: 8px;
}

.ad-wrap-bottom {
  margin: 28px auto 12px;
}

.ad-wrap-mid {
  margin: 22px auto 8px;
}

.ad-wrap-mid:not(:has(.ad-visible)) {
  display: none;
  margin: 0;
}

.ad-slot-box,
[data-ad] {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  width: 100%;
  max-width: 760px;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
}

[data-ad].ad-pending,
[data-ad].ad-empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  min-height: 0 !important;
  overflow: hidden;
}

[data-ad].ad-visible {
  display: flex !important;
  padding: 10px 12px 12px;
  background: rgba(255, 254, 248, 0.92);
  border: 3px solid var(--outline);
  box-shadow: 4px 4px 0 var(--outline);
  border-radius: var(--radius);
  min-height: 0;
}

.ad-slot-center {
  margin-inline: auto;
}

.ad-aside {
  max-width: 100%;
}

.ad-aside-sky {
  display: none !important;
}

@media (min-width: 1100px) {
  .ad-aside-sky.ad-visible {
    display: flex !important;
  }
}

.ad-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  align-self: flex-start;
}

.ad-iframe {
  display: block;
  margin: 0 auto;
  background: transparent;
}

.ad-native {
  width: 100%;
}

.ad-smartlink {
  text-align: center;
  gap: 8px;
}

.ad-smart-btn {
  width: 100%;
  max-width: 280px;
}

.ad-smart-hint {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}

.ad-disclaimer {
  font-size: 0.75rem !important;
  opacity: 0.85;
}

/* ===== Responsive ===== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
iframe {
  max-width: 100%;
}

@media (max-width: 980px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-lead {
    margin-inline: auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .hero-poster-wrap {
    order: -1;
  }

  .hero-poster-frame {
    width: min(160px, 42vw);
  }

  .watch-layout {
    grid-template-columns: 1fr;
  }

  .watch-aside {
    position: static;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .family-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .collections-grid,
  .collections-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 64px;
  }

  .container {
    width: min(100% - 20px, 1180px);
  }

  .burger {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(255, 248, 220, 0.98);
    border-bottom: 3px solid var(--outline);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    gap: 4px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    z-index: 99;
  }

  .nav.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 14px 16px;
    font-size: 1rem;
    min-height: 44px;
  }

  .header-inner {
    gap: 8px;
    padding: 6px 0;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .logo-sub {
    display: none;
  }

  .logo-ring {
    width: 36px;
    height: 36px;
  }

  .header-stats {
    display: none;
  }

  /* Hero */
  .hero-band {
    min-height: 0;
    padding: 20px 0 28px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .hero-lead {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .hero-stats {
    width: 100%;
  }

  .stat {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
  }

  .speech-bubble {
    max-width: 100%;
  }

  /* Sections */
  .section {
    padding: 28px 0;
  }

  .page-main {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .page-top {
    padding: 18px 0 12px;
  }

  .page-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-title-row .comic-title,
  .page-top > .comic-title {
    font-size: 1.75rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ep-nav-controls {
    width: 100%;
  }

  .ep-nav-controls .btn {
    flex: 1;
    min-height: 44px;
  }

  /* Player */
  .player-box {
    border-width: 2px;
    border-radius: 12px;
  }

  .mirror-bar {
    padding: 8px 10px;
  }

  .mirror-bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .mirror-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .mirror-btn {
    text-align: center;
    padding: 10px 6px;
    font-size: 0.75rem;
    min-height: 42px;
  }

  .player-info {
    padding: 12px;
  }

  .player-info h2 {
    font-size: 1.2rem;
  }

  .player-header-row {
    flex-direction: column;
    gap: 10px;
  }

  .player-header-row .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Catalog toolbar */
  .sticky-toolbar {
    top: var(--header-h);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 8px;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  .search-wrap input {
    min-height: 46px;
    font-size: 16px; /* no iOS zoom */
  }

  .toolbar-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .select-wrap,
  .select-wrap select {
    width: 100%;
    max-width: none;
  }

  .select-wrap select {
    min-height: 46px;
    font-size: 16px;
  }

  .season-chips,
  .char-filters {
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .chip {
    padding: 10px 12px;
    min-height: 40px;
  }

  /* Grids: image-first, 2 cols */
  .episode-row,
  .episodes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ep-thumb {
    min-height: 110px;
    aspect-ratio: 16 / 11;
  }

  .ep-body {
    padding: 8px 9px 10px;
  }

  .ep-body h3 {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }

  .ep-meta {
    font-size: 0.65rem;
  }

  .ep-meta span:last-child {
    display: none;
  }

  .collections-grid,
  .collections-grid-lg {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .family-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .characters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .char-avatar {
    aspect-ratio: 4 / 3;
  }

  .cta-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 16px;
    text-align: center;
  }

  .cta-banner .btn {
    width: 100%;
    min-height: 48px;
  }

  /* Chat */
  .chat-messages {
    height: 200px;
  }

  .chat-nick,
  .chat-row input,
  .comments-form textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .comments-form .btn {
    width: 100%;
    min-height: 48px;
  }

  .live-badge {
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    font-size: 0.72rem;
    max-width: calc(100vw - 16px);
  }

  /* SEO text */
  .seo-block {
    padding: 16px !important;
  }

  .seo-block h2 {
    font-size: 1.35rem;
  }

  body {
    overflow-x: hidden;
  }
}

@media (max-width: 380px) {
  .episode-row,
  .episodes-grid {
    grid-template-columns: 1fr;
  }

  .mirror-btns {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats {
    flex-direction: column;
  }
}

/* SEO content */
.seo-block {
  padding: 22px 24px;
  margin-top: 8px;
}

.seo-block h2 {
  margin-bottom: 10px;
}

.seo-block p {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
  max-width: 75ch;
}

.seo-block ul {
  margin: 0 0 0 18px;
  font-weight: 700;
  color: var(--ink);
}

.seo-block li {
  margin-bottom: 6px;
}

.seo-block a {
  color: var(--sky-deep);
  text-decoration: underline;
  font-weight: 800;
}
