/* ══════════════════════════════════════════════════
   Mascot — yt-kids.css
   YouTube Kids — Video Grid Browser
══════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --bg:            #1A1035;
  --bg2:           #241848;
  --pink:          #FF8FAB;
  --pink-soft:     #FFD6E7;
  --mint:          #52D9A4;
  --yellow:        #FFCF47;
  --lavender:      #9C7AF5;
  --lavender-soft: #C8B6FF;
  --teal:          #68D8D6;
  --peach:         #FFB347;
  --white:         #FFFFFF;

  --card-border-1: var(--pink);
  --card-border-2: var(--mint);
  --card-border-3: var(--yellow);
  --card-border-4: var(--lavender);
  --card-border-5: var(--teal);
  --card-border-6: var(--peach);

  --r-sm:   0.6rem;
  --r-md:   1rem;
  --r-lg:   1.6rem;
  --r-xl:   2.2rem;
  --r-full: 100vmax;

  --font-display: 'Baloo 2', cursive;
  --font-body:    'Nunito', sans-serif;
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: radial-gradient(ellipse at 30% 0%, #2D1B6B 0%, #1A1035 55%, #0F0825 100%);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  animation: pageIn 0.28s ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.page-exit {
  animation: pageOut 0.2s ease forwards;
}
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* ── STARFIELD ── */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.star-dot {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.1; scale: 1; }
  50%       { opacity: 0.8; scale: 1.4; }
}

/* ── AMBIENT FLOATS ── */
.ambient-floats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.amb {
  position: absolute;
  left: var(--x, 50%);
  bottom: -60px;
  font-size: 1.5rem;
  opacity: 0.5;
  animation: ambFloat var(--dur, 7s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes ambFloat {
  0%   { translate: 0 0;       opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.5; }
  100% { translate: 0 -105vh;  opacity: 0; }
}

/* ══════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════ */
.yt-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 2rem;
  background: rgba(26, 16, 53, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(156, 122, 245, 0.28);
}

.yt-back-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1.1rem;
  background: rgba(255, 143, 171, 0.14);
  border: 2px solid var(--pink);
  border-radius: var(--r-full);
  color: var(--pink);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  transition: scale 0.2s var(--ease-bounce), background 0.2s;
  flex-shrink: 0;
}
.yt-back-btn:hover { scale: 1.07; background: rgba(255, 143, 171, 0.26); }

.yt-header-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
}
.yt-header-logo span:first-child { font-size: 1.5rem; }
.yt-logo-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.yt-header-tag {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.9rem;
  background: rgba(82, 217, 164, 0.12);
  border: 1.5px solid rgba(82, 217, 164, 0.35);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--mint);
}

/* ══════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════ */
.yt-main {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* ── SECTION HEADING ── */
.yt-section-head {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: slideDown 0.7s var(--ease-bounce) both;
}
@keyframes slideDown {
  from { translate: 0 -30px; opacity: 0; }
  to   { translate: 0 0;      opacity: 1; }
}
.yt-section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 4px 20px rgba(255, 207, 71, 0.4);
}
.yt-section-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.4rem;
  font-weight: 700;
}

/* ── THEME NAV PILLS ── */
.yt-theme-nav {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 1rem 1.5rem;
  margin: 0 -2rem 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.yt-theme-nav::-webkit-scrollbar { display: none; }

.yt-theme-pill {
  flex-shrink: 0;
  scroll-snap-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-full);
  padding: 0.6rem 1.4rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  cursor: pointer;
  transition: all 0.25s var(--ease-bounce);
  outline: none;
}
.yt-theme-pill:hover,
.yt-theme-pill:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  scale: 1.05;
}
.yt-theme-pill.active {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--bg);
  box-shadow: 0 4px 16px rgba(255, 143, 171, 0.5);
  scale: 1.08;
}

/* ══════════════════════════════════════════════════
   LOADING STATE
══════════════════════════════════════════════════ */
.yt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 4rem 0;
}
.yt-loading[hidden] { display: none; }

.yt-spinner {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
}
.spin-ball {
  font-size: 2.6rem;
  display: block;
  animation: spinBounce 0.8s ease-in-out infinite;
  filter: drop-shadow(0 6px 16px rgba(255, 207, 71, 0.5));
}
.spin-ball.b2 { animation-delay: 0.18s; }
.spin-ball.b3 { animation-delay: 0.36s; }

@keyframes spinBounce {
  0%, 100% { translate: 0 0;     scale: 1; }
  45%       { translate: 0 -22px; scale: 1.1; }
}

.yt-loading-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ══════════════════════════════════════════════════
   ERROR / OFFLINE BANNER
══════════════════════════════════════════════════ */
.yt-error-banner {
  text-align: center;
  padding: 1rem 1.5rem;
  border-radius: var(--r-lg);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.yt-error-banner[hidden] { display: none; }
.yt-error-banner.warn {
  background: rgba(246, 173, 85, 0.15);
  border: 2px solid rgba(246, 173, 85, 0.45);
  color: #F6AD55;
}
.yt-error-banner.err {
  background: rgba(255, 143, 171, 0.1);
  border: 2px solid rgba(255, 143, 171, 0.35);
  color: var(--pink);
}

/* ══════════════════════════════════════════════════
   VIDEO GRID
══════════════════════════════════════════════════ */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
}

/* ── LOAD MORE ── */
.yt-load-more-wrap {
  text-align: center;
  margin-top: 3.5rem;
}
.yt-load-more {
  background: linear-gradient(135deg, var(--yellow), var(--peach));
  border: 4px solid var(--white);
  border-radius: var(--r-full);
  padding: 1rem 3rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 207, 71, 0.4);
  transition: all 0.3s var(--ease-bounce);
  animation: floatBounce 2.5s ease-in-out infinite;
  outline: none;
}
.yt-load-more[hidden] { display: none; }
.yt-load-more:hover,
.yt-load-more:focus-visible {
  scale: 1.1;
  box-shadow: 0 16px 40px rgba(255, 207, 71, 0.6);
}
.yt-load-more:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  animation: none;
  scale: 1;
}
@keyframes floatBounce {
  0%, 100% { translate: 0 0; }
  50%       { translate: 0 -8px; }
}

/* ── VIDEO CARD ── */
.yt-card {
  position: relative;
  border-radius: var(--r-xl);
  border: 4px solid var(--card-color, var(--pink));
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  overflow: hidden;
  outline: none;
  transition:
    scale 0.28s var(--ease-bounce),
    box-shadow 0.28s ease,
    translate 0.28s var(--ease-bounce);
  animation: cardIn 0.45s var(--ease-bounce) both;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 0 0 0 var(--card-color, var(--pink));
}
@keyframes cardIn {
  from { opacity: 0; translate: 0 28px; scale: 0.92; }
  to   { opacity: 1; translate: 0 0;    scale: 1; }
}

.yt-card:hover,
.yt-card:focus-visible {
  scale: 1.04;
  translate: 0 -6px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 40px 6px var(--card-color, var(--pink));
}
.yt-card:active { scale: 0.97; }

.yt-card:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

/* Rotating rainbow border on hover */
.yt-card::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--angle, 0deg),
    var(--pink), var(--yellow), var(--mint), var(--lavender), var(--teal), var(--pink)
  );
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}
.yt-card:hover::before {
  opacity: 1;
  animation: rotateBorder 2s linear infinite;
}
@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes rotateBorder {
  to { --angle: 360deg; }
}

/* THUMBNAIL */
.yt-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, #2D1B6B, #1A1035);
}
.yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: scale 0.4s ease;
}
.yt-card:hover .yt-thumb { scale: 1.06; }

/* Play badge overlay */
.yt-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 21, 0.48);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.yt-card:hover .yt-play-overlay,
.yt-card:focus-visible .yt-play-overlay { opacity: 1; }

.yt-play-btn-inner {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 30px rgba(255, 207, 71, 0.5);
  animation: playPulse 2s ease-in-out infinite;
  color: var(--card-color, var(--pink));
}
@keyframes playPulse {
  0%, 100% { scale: 1; box-shadow: 0 8px 30px rgba(255, 207, 71, 0.4); }
  50%       { scale: 1.1; box-shadow: 0 12px 40px rgba(255, 207, 71, 0.7); }
}

/* CARD BODY */
.yt-card-body {
  padding: 1rem 1.1rem 1.2rem;
}
.yt-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
}
.yt-card-channel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}
.yt-card-channel::before {
  content: '📺';
  font-size: 0.9rem;
}

/* SAFE STAMP */
.yt-safe-stamp {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 0.22rem 0.55rem;
  background: rgba(82, 217, 164, 0.88);
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 900;
  color: #0F2A1E;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════
   SKELETON LOADER CARDS
══════════════════════════════════════════════════ */
.yt-skeleton {
  border-radius: var(--r-xl);
  border: 4px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: cardIn 0.4s var(--ease-bounce) both;
}
.skel-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.1)  50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
.skel-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.skel-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.1)  50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
.skel-line.long  { width: 88%; }
.skel-line.med   { width: 65%; }
.skel-line.short { width: 45%; }
@keyframes shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════════
   VIDEO PLAYER MODAL
══════════════════════════════════════════════════ */
/* ═══ MODAL OVERLAY — Flexbox perfect centering ═══ */
.yt-modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9000;
  box-sizing: border-box;
  padding: 16px;                               /* mobile safe margins */
  background: rgba(10, 5, 21, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: modalFade 0.28s ease both;
}
.yt-modal[hidden] { display: none; }
@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══ MODAL CARD — responsive, never exceeds screen ═══ */
.yt-modal-inner {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;                            /* scroll if content too tall */
  background: linear-gradient(160deg, #1E1240 0%, #150D32 100%);
  border: 3px solid rgba(156, 122, 245, 0.35);
  border-radius: 2rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 60px rgba(156, 122, 245, 0.2);
  animation: modalSlide 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
@keyframes modalSlide {
  from { opacity: 0; scale: 0.92; }
  to   { opacity: 1; scale: 1; }
}

/* Modal header */
.yt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 2px solid rgba(156, 122, 245, 0.15);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}
.yt-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
  flex: 1;
}
.yt-modal-title-icon { font-size: 1.6rem; flex-shrink: 0; }
.yt-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--yellow);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.yt-modal-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 143, 171, 0.45);
  background: rgba(255, 143, 171, 0.12);
  color: var(--pink);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: scale 0.2s var(--ease-bounce), background 0.2s;
}
.yt-modal-close:hover { scale: 1.15; background: rgba(255, 143, 171, 0.28); }

/* ═══ IFRAME CONTAINER — aspect-ratio based ═══ */
.yt-iframe-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  flex-grow: 1;
  flex-shrink: 1;
  min-height: 0;
  background: #000;
}
.yt-iframe-wrap iframe,
.yt-iframe-wrap > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── KID-FRIENDLY EMBED ERROR FALLBACK ── */
.yt-embed-error {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #2D1B6B 0%, #1A1035 80%);
  border-radius: inherit;
}
.yt-embed-error[hidden] { display: none; }

.yt-embed-error-inner {
  text-align: center;
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
}

.yt-embed-error-emoji {
  font-size: 4.5rem;
  animation: errorBounce 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  filter: drop-shadow(0 8px 20px rgba(156, 122, 245, 0.5));
}
@keyframes errorBounce {
  0%, 100% { translate: 0 0;     }
  45%       { translate: 0 -14px; }
}

.yt-embed-error-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 4px 20px rgba(255, 207, 71, 0.4);
  margin: 0;
}

.yt-embed-error-msg {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.55;
}

.yt-embed-error-btn {
  margin-top: 0.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--lavender), #6D45D9);
  border: none;
  border-radius: var(--r-full);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(109, 69, 217, 0.55);
  transition: scale 0.22s var(--ease-bounce), box-shadow 0.22s ease;
  animation: btnPulse 2s ease-in-out infinite;
}
.yt-embed-error-btn:hover {
  scale: 1.1;
  box-shadow: 0 14px 40px rgba(109, 69, 217, 0.75);
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(109, 69, 217, 0.55); }
  50%       { box-shadow: 0 12px 40px rgba(109, 69, 217, 0.85); }
}

/* Modal footer */
.yt-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.yt-modal-channel {
  font-size: 0.85rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.yt-modal-channel::before { content: '📺'; }
.yt-safe-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--mint);
  background: rgba(82, 217, 164, 0.1);
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(82, 217, 164, 0.3);
}


/* ══════════════════════════════════════════════════
   CARD CLICK BOUNCE ANIMATION
══════════════════════════════════════════════════ */
.yt-card.clicked {
  animation: cardClick 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes cardClick {
  0%   { scale: 1; }
  35%  { scale: 0.93; }
  70%  { scale: 1.06; }
  100% { scale: 1; }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */

/* ── Tablet ── */
@media (max-width: 900px) {
  .yt-main { padding: 2rem 1.5rem 4rem; }
  .yt-grid { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
}

/* ── Small phone ── */
@media (max-width: 600px) {
  .yt-main   { padding: 1.2rem 0.85rem 3.5rem; }
  .yt-grid   { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }

  /* Header */
  .yt-header     { padding: 0.55rem 0.85rem; gap: 0.5rem; }
  .yt-logo-text  { display: none; }
  .yt-header-tag { display: none; }
  .yt-back-btn   { padding: 0.4rem 0.85rem; font-size: 0.82rem; }

  /* Section heading */
  .yt-section-title { font-size: 2rem; }
  .yt-section-sub   { font-size: 0.9rem; }

  /* Theme nav pills — allow horizontal scroll on mobile */
  .yt-theme-nav { margin: 0 -0.85rem 1.2rem; padding: 0.4rem 0.85rem 1.2rem; gap: 0.6rem; }
  .yt-theme-pill { font-size: 0.95rem; padding: 0.5rem 1.1rem; }

  /* Cards */
  .yt-card-title { font-size: 0.88rem; }
  .yt-card-body  { padding: 0.7rem 0.8rem 0.85rem; }
  .yt-play-btn-inner { width: 50px; height: 50px; font-size: 1.4rem; }

  /* Load more */
  .yt-load-more  { font-size: 1.2rem; padding: 0.85rem 2.2rem; }

  /* Modal */
  .yt-modal       { padding: 0.5rem; }
  .yt-modal-inner { border-radius: 1.2rem; }
  .yt-modal-title { font-size: 0.92rem; }
  .yt-modal-header { padding: 0.75rem 1rem; }
  .yt-modal-footer { padding: 0.6rem 1rem; }
  .yt-embed-error-title { font-size: 1.6rem; }
  .yt-embed-error-inner { padding: 1.5rem 1.5rem; }
}

/* ── Single column (≤ 480px) ── */
@media (max-width: 480px) {
  .yt-grid        { grid-template-columns: 1fr; gap: 1rem; }
  .yt-section-title { font-size: 1.8rem; }
}

/* ── Extra small (≤ 380px) ── */
@media (max-width: 380px) {
  .yt-header  { padding: 0.45rem 0.65rem; }
  .yt-main    { padding: 1rem 0.6rem 3rem; }
  .yt-theme-nav { margin: 0 -0.6rem 1rem; padding: 0.3rem 0.6rem 1rem; }
}

/* ════════════════════════════════════════════════════
   MOBILE PERFORMANCE OPTIMIZATIONS
   Disabling GPU-heavy effects on low-end mobile devices
════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hide the starfield — hundreds of animated elements */
  #starfield,
  .starfield,
  .ambient-floats {
    display: none !important;
  }

  /* Remove backdrop-filter blur — major GPU drain on mobile */
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Make header fully opaque since blur is gone */
  .yt-header {
    background: rgba(26, 16, 53, 0.98) !important;
  }

  /* ── MODAL: Opaque background on mobile ── */
  .yt-modal {
    background: rgba(10, 5, 21, 0.98) !important;
  }

  /* Larger close button tap target */
  .yt-modal-close {
    min-width: 44px !important;
    min-height: 44px !important;
    font-size: 1.3rem !important;
  }

  /* ── VIDEO GRID: 2 columns on mobile ── */
  .yt-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Card background opaque without blur */
  .yt-card {
    background: rgba(40, 28, 90, 0.95) !important;
  }

  /* Theme pills — horizontal scroll, no wrap */
  .yt-theme-nav {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .yt-theme-nav::-webkit-scrollbar { display: none; }

  /* Stop non-essential animations */
  .yt-load-more,
  .yt-card:hover::before {
    animation: none !important;
  }
}

@media (max-width: 380px) {
  .yt-grid {
    grid-template-columns: 1fr !important;
  }
}

