/* ==========================================================
   StarQuest — Mario-themed Classic Television Galaxy
   ========================================================== */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Mario-inspired colour palette */
  --bg-dark:      #0a0a12;
  --bg-card:      #12121e;
  --bg-card-h:    #1c1c2e;
  --bg-nav:       rgba(10, 10, 18, 0.97);
  --accent:       #e52222;      /* Mario red */
  --accent-dim:   #b21a1a;
  --accent2:      #0046ad;      /* Nintendo blue */
  --gold:         #ffd700;      /* Coin gold */
  --green:        #00a020;      /* Pipe green */
  --text-primary: #f0f0ff;
  --text-muted:   #8888b0;
  --border:       rgba(255,255,255,.08);
  --radius:       8px;
  --transition:   .2s ease;
  --hero-h:       520px;
  --nav-h:        64px;
  --z-cosmo-popin: 25;   /* above player chrome/pop-ins without outranking modal layers */
  --pixel-font:   'Press Start 2P', monospace;
  --body-font:    'Nunito', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--accent2); border-radius: 3px; }

/* ── Screen-reader only ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 32px;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel-font);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 2px 2px 0 var(--accent), -1px -1px 0 rgba(0,0,0,.5);
}
.nav__logo span { color: var(--text-primary); }

.nav__links {
  display: flex;
  gap: 24px;
  font-size: .9rem;
  font-weight: 500;
}
.nav__links a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav__links a:hover,
.nav__links a.active { color: var(--text-primary); }

.nav__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav__search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  gap: 8px;
  transition: border-color var(--transition), background var(--transition);
}
.nav__search:focus-within {
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
}
.nav__search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: .88rem;
  width: 180px;
}
.nav__search input::placeholder { color: var(--text-muted); }


/* ── Secondary Search & Tools Bar ── */
.starquest-tools {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 99;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 16px;
  background: rgba(8, 11, 34, .97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.starquest-tools__catalog-search { flex: 1 1 360px; max-width: 620px; }
.starquest-tools__catalog-search input { width: 100%; min-width: 0; }
.starquest-tools__button { flex: 0 0 auto; white-space: nowrap; }
.hero { margin-top: calc(var(--nav-h) + 54px); }

@media (max-width: 600px) {
  .starquest-tools { justify-content: stretch; gap: 6px; padding: 6px 8px; }
  .starquest-tools .nav__search { display: flex; min-width: 0; padding: 6px 9px; }
  .starquest-tools__catalog-search { flex: 1 1 auto; }
  .starquest-tools__button.source-search-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 40px;
    padding: 0 10px;
    font-size: .74rem;
  }
}

@media (max-width: 390px) {
  .starquest-tools__catalog-search input { font-size: .78rem; }
  .starquest-tools__button.source-search-open { width: 42px; padding: 0; font-size: 0; }
  .starquest-tools__button.source-search-open::first-letter { font-size: 1rem; }
}

/* ── Hero Banner ── */
.hero {
  position: relative;
  height: var(--hero-h);
  margin-top: var(--nav-h);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0d0d1a 100%);
  overflow: hidden;
}

.hero__bg-art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(8,11,34,.98) 0%, rgba(8,11,34,.82) 38%, rgba(8,11,34,.18) 76%, rgba(8,11,34,.48) 100%),
    var(--hero-image, radial-gradient(ellipse 60% 60% at 70% 40%, rgba(0,70,173,.3), transparent 70%));
  background-size: cover;
  background-position: center 24%;
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.02);
  transition: background-image .35s ease, opacity .35s ease;
}

.hero__static-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-dark) 0%, rgba(10,10,15,.6) 40%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 56px 52px;
  max-width: 700px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 14px;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.hero__meta .score { color: var(--gold); font-weight: 700; }
.hero__meta .rating-badge {
  border: 1px solid var(--text-muted);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: .75rem;
}

.hero__desc {
  font-size: .95rem;
  line-height: 1.6;
  color: #b8b8d0;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-shuffle {
  color: #dbe8ff;
  background: rgba(10,17,49,.66);
  border: 1px solid rgba(120,174,255,.42);
  backdrop-filter: blur(8px);
}
.hero-shuffle:hover { background: rgba(0,70,173,.72); transform: translateY(-2px); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255,255,255,.12);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}
.btn-secondary:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }

/* ── Content Rows ── */
.content-section { padding: 12px 0 28px; }
.content-section + .content-section { margin-top: 4px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px 14px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: opacity var(--transition);
}
.section-more:hover { opacity: .8; }

/* ── Card Row (horizontal scroll) ── */
.card-row-wrap {
  position: relative;
}

.card-row {
  display: flex;
  gap: 12px;
  padding: 4px 56px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: 56px;
  overscroll-behavior-inline: contain;
}
.card-row::-webkit-scrollbar { display: none; }

.scroll-btn {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 64px;
  transform: translateY(-50%);
  border-radius: 0 18px 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5,7,18,.9);
  border: 1px solid rgba(255,255,255,.18);
  z-index: 5;
  opacity: .9;
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
}
.scroll-btn.right { right: 0; border-radius: 18px 0 0 18px; background: rgba(5,7,18,.9); }
.card-row-wrap:hover .scroll-btn,
.card-row-wrap:focus-within .scroll-btn { opacity: 1; }
@media (hover: none) { .scroll-btn { opacity: 0.7; } }
.scroll-btn:hover { opacity: 1 !important; }
.scroll-btn:disabled { opacity: .18 !important; pointer-events: none; }
.scroll-btn:not(:disabled):active { transform: translateY(-50%) scale(.92); }

/* ── Show Card ── */
.show-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  position: relative;
}

.show-card:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(229,9,20,.2);
  z-index: 10;
}

.show-card__thumb {
  position: relative;
  aspect-ratio: 16/10;
  background: #1a1a2e;
  overflow: hidden;
}

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

.show-card__thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 78% 18%, rgba(192,132,252,.32), transparent 34%),
    linear-gradient(145deg, #10182d 0%, #29164c 58%, #0b0f1d 100%);
  font-size: .7rem;
  color: #fff;
  text-align: center;
  padding: 8px;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.12);
}

.fallback-kicker {
  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .16em;
  color: #c4b5fd;
}

.fallback-title {
  max-width: 92%;
  font-size: 1rem;
  line-height: 1.08;
  font-weight: 900;
  text-wrap: balance;
  text-shadow: 0 3px 16px rgba(0,0,0,.65);
}

.fallback-subtitle {
  max-width: 90%;
  font-size: .62rem;
  line-height: 1.2;
  color: rgba(255,255,255,.72);
}

.show-card__play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity var(--transition);
}
.show-card:hover .show-card__play-overlay { opacity: 1; }

.play-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

.show-card__info {
  padding: 10px 12px 12px;
}

.show-card__title {
  display: flex;
  align-items: center;
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.show-card__title .editable-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-avatar-marker {
  flex: 0 0 auto; width: 30px; height: 30px; margin-left: 7px; border-radius: 50%;
  color: #fff3a3; background: rgba(250,204,21,.2); border: 1px solid rgba(250,204,21,.62);
  box-shadow: 0 0 0 2px rgba(250,204,21,.1), 0 0 14px rgba(250,204,21,.22);
  font-size: 1rem; line-height: 1;
}
.card-avatar-marker:hover, .card-avatar-marker:focus-visible { background: rgba(250,204,21,.34); transform: scale(1.08); }

.show-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  color: var(--text-muted);
}

.show-card__score { color: var(--gold); font-weight: 700; }
.show-card__genre { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 3px; }

/* ── Modal / Show Detail ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: #121220;
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  overflow: hidden;
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.modal__close:hover { background: rgba(229,9,20,.7); }

.modal__hero {
  position: relative;
  height: 240px;
  background: linear-gradient(135deg, #0a0a1e, #1e1a3a);
  overflow: hidden;
}
.modal__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;
}
.modal__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #121220, rgba(18,18,32,.4));
}

.modal__body { padding: 0 32px 32px; }

.modal__title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.modal__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.modal__meta .score { color: var(--gold); font-weight: 700; }
.modal__meta .rating-badge {
  border: 1px solid var(--text-muted);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: .75rem;
}
.modal__meta .genre-tag {
  background: rgba(229,9,20,.15);
  color: #ff6b6b;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .75rem;
}

.modal__desc {
  font-size: .93rem;
  line-height: 1.65;
  color: #b0b0cc;
  margin-bottom: 24px;
}

.modal__section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

/* ── Episode List ── */
.episode-list { display: flex; flex-direction: column; gap: 8px; }

.episode-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.episode-item:hover {
  background: rgba(229,9,20,.08);
  border-color: rgba(229,9,20,.2);
}

.episode-num {
  font-size: .8rem;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
}

.episode-thumb {
  width: 80px;
  height: 50px;
  border-radius: 5px;
  background: #1a1a2e;
  overflow: hidden;
  flex-shrink: 0;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }

.episode-info { flex: 1; min-width: 0; }
.episode-title { font-size: .9rem; font-weight: 600; margin-bottom: 3px; }
.episode-desc {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-duration {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.episode-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
  transition: transform var(--transition), background var(--transition);
}
.episode-item:hover .episode-play { transform: scale(1.1); background: var(--accent-dim); }

/* ── Player Page ── */
.player-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  flex-direction: column;
}
.player-page.open { display: flex; }

.player-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,.9), transparent);
}

.player-back {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 600;
  color: #fff;
  padding: 6px 14px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius);
  transition: background var(--transition);
}
.player-back:hover { background: rgba(255,255,255,.2); }

.player-ep-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}

.player-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.player-video {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
}

.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}
.player-error__icon { font-size: 3rem; }
.player-error__msg { font-size: 1rem; color: rgba(255,255,255,.7); max-width: 340px; }

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 16px;
  pointer-events: none;
}

.player-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.player-loading-text { font-size: .9rem; }

/* ── Search Results ── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg-dark);
  overflow-y: auto;
  padding-top: var(--nav-h);
}
.search-overlay.open { display: block; }

.search-results {
  padding: 32px 56px;
}

.search-results-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.search-results-title strong { color: var(--text-primary); }

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

/* ── Genre Filter Bar ── */
.genre-bar {
  display: flex;
  gap: 10px;
  padding: 20px 56px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.genre-bar::-webkit-scrollbar { display: none; }

.genre-pill {
  flex-shrink: 0;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  background: rgba(255,255,255,.07);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.genre-pill:hover,
.genre-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Footer ── */
.footer {
  padding: 40px 56px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .82rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.footer__col h4 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer__col ul { display: flex; flex-direction: column; gap: 8px; }
.footer__col a { color: var(--text-muted); transition: color var(--transition); }
.footer__col a:hover { color: var(--text-primary); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__logo {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent);
}
.footer__logo span { color: var(--text-primary); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav { padding: 0 16px; gap: 16px; }
  .hero__content { padding: 0 24px 40px; }
  .section-header { padding: 0 24px 12px; }
  .card-row { padding: 4px 24px 14px; }
  .genre-bar { padding: 16px 24px 8px; }
  .search-results { padding: 24px; }
  .modal__body { padding: 0 20px 24px; }
  .footer { padding: 32px 24px 24px; }
}

@media (max-width: 600px) {
  :root { --hero-h: 400px; }
  .nav__links { display: none; }
  .nav__search input { width: 120px; }
  .hero__title { font-size: 1.8rem; }
  .hero__btns .btn { padding: 9px 18px; font-size: .85rem; }
  .show-card { flex: 0 0 min(78vw, 300px); }
  .card-row { padding: 4px 16px 18px; gap: 14px; }
  .show-card__title { font-size: 1rem; }
  .show-card__meta { font-size: .8rem; }
  .modal { border-radius: 0; }
  .modal__hero { height: 180px; }
  .search-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Episode Season Badge (on card thumbnail) ── */
.ep-season-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: .4px;
  pointer-events: none;
}

.movie-badge {
  background: rgba(229,9,20,.85);
  letter-spacing: .6px;
}

/* ── Rent/Buy badge & dimmed card ── */
.pay-badge {
  background: rgba(120,80,0,.92);
  color: #ffd27f;
  letter-spacing: .5px;
}

/* Slightly desaturate and dim pay-to-watch cards so free content stands out */
.show-card--pay {
  opacity: .72;
  filter: grayscale(30%);
}
.show-card--pay:hover,
.show-card--pay:focus-within {
  opacity: .9;
  filter: grayscale(10%);
}

/* Pay-to-watch episode row inside modal */
.episode-item--pay {
  opacity: .7;
}
.episode-item--pay:hover,
.episode-item--pay:focus-within {
  opacity: .9;
}

/* ── All-Episodes Modal ── */
.all-eps-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  padding: 24px 16px 40px;
}
.all-eps-backdrop.open { display: block; }

.all-eps-modal {
  max-width: 960px;
  margin: 0 auto;
  background: #121220;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  animation: modalIn .25s ease;
}

.all-eps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.all-eps-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.all-eps-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.all-eps-close:hover { background: rgba(229,9,20,.6); }

.all-eps-season-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 28px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.all-eps-season-tabs::-webkit-scrollbar { display: none; }

.season-tab {
  flex-shrink: 0;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  background: rgba(255,255,255,.07);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.season-tab:hover,
.season-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.all-eps-list {
  padding: 16px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Spotlight section styling ── */
.content-section--spotlight .section-title {
  font-size: 1.25rem;
}

.section-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Utility ── */
.hidden { display: none !important; }


/* ================================================================
   STARQUEST NEW COMPONENTS
   Splash · Auth · Hamburger · Sidebar · AI Companion · Wallet · Player updates
   ================================================================ */

/* ── Mario Button ── */
.btn-mario {
  background: var(--accent) !important;
  color: #fff !important;
  font-family: var(--pixel-font) !important;
  font-size: .65rem !important;
  letter-spacing: 1px;
  box-shadow: 0 4px 0 var(--accent-dim), 0 6px 12px rgba(229,34,34,.35);
  transition: transform .1s, box-shadow .1s;
}
.btn-mario:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--accent-dim), 0 10px 18px rgba(229,34,34,.4);
}
.btn-mario:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--accent-dim);
}

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: .9rem;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: color var(--transition);
  font-family: var(--body-font);
}
.btn-ghost:hover { color: var(--text-primary); }

/* ── Splash Screen ── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1a0a2e 0%, #0a0a12 70%);
  overflow: hidden;
}

.splash__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.star-particle {
  position: absolute;
  font-size: 1.5rem;
  animation: floatStar 6s ease-in-out infinite;
  opacity: 0;
}
.star-particle:nth-child(1) { left: 8%;  top: 20%; animation-delay: 0s;    animation-duration: 5s; }
.star-particle:nth-child(2) { left: 20%; top: 70%; animation-delay: 0.8s;  animation-duration: 7s; }
.star-particle:nth-child(3) { left: 35%; top: 15%; animation-delay: 1.5s;  animation-duration: 6s; }
.star-particle:nth-child(4) { left: 55%; top: 80%; animation-delay: 0.3s;  animation-duration: 8s; }
.star-particle:nth-child(5) { left: 70%; top: 25%; animation-delay: 2s;    animation-duration: 5.5s; }
.star-particle:nth-child(6) { left: 80%; top: 60%; animation-delay: 1.2s;  animation-duration: 6.5s; }
.star-particle:nth-child(7) { left: 90%; top: 40%; animation-delay: 0.5s;  animation-duration: 7.5s; }
.star-particle:nth-child(8) { left: 45%; top: 50%; animation-delay: 3s;    animation-duration: 6s; }

@keyframes floatStar {
  0%   { opacity: 0; transform: translateY(20px) scale(.8); }
  20%  { opacity: .8; }
  80%  { opacity: .6; }
  100% { opacity: 0; transform: translateY(-60px) scale(1.2); }
}

.splash__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 480px;
  padding: 40px 24px;
}

.splash__logo { margin-bottom: 32px; }

.splash__star-icon {
  font-size: 5rem;
  animation: starPulse 2s ease-in-out infinite;
  display: block;
  margin-bottom: 16px;
}
@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15) rotate(10deg); }
}

.splash__title {
  font-family: var(--pixel-font);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--accent), -1px -1px 0 rgba(0,0,0,.6);
  margin-bottom: 8px;
  line-height: 1.4;
}

.splash__tagline {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
}

.splash__features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.splash__feature {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .85rem;
  font-weight: 600;
}

.splash__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.splash__actions .btn { min-width: 200px; font-size: .9rem; }

.splash__sub {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── Auth Modal ── */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(6px);
}
.auth-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.auth-modal {
  background: #16162a;
  border: 1px solid rgba(255,215,0,.2);
  border-radius: 16px;
  padding: 36px 32px;
  width: min(420px, 94vw);
  position: relative;
  box-shadow: 0 0 40px rgba(229,34,34,.2), 0 20px 60px rgba(0,0,0,.6);
}

.auth-logo {
  font-family: var(--pixel-font);
  font-size: .9rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 24px;
  text-shadow: 2px 2px 0 var(--accent);
}
.auth-logo span { color: var(--text-primary); }

.auth-title {
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 24px;
}

.auth-error {
  background: rgba(229,34,34,.15);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .85rem;
  color: #ff8080;
  margin-bottom: 16px;
}

.auth-field {
  margin-bottom: 16px;
}
.auth-field label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.auth-field input {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: .95rem;
  font-family: var(--body-font);
  transition: border-color var(--transition);
  outline: none;
}
.auth-field input:focus { border-color: var(--gold); }

.auth-submit { width: 100%; margin-bottom: 16px; padding: 12px; }

.auth-switch {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
}
.auth-link {
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
}

.auth-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.auth-close:hover { background: var(--accent); color: #fff; }

/* ── Hamburger Button ── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 10px;
  border-radius: 11px;
  background: #118536;
  border: 1px solid #53dd77;
  transition: background var(--transition);
}
.hamburger:hover,.hamburger:focus-visible { background: #0c6f2b; outline: 2px solid #9affb4; outline-offset: 2px; }
.hamburger:active { background: #095923; }
.hamburger span {
  display: block;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav Wallet ── */
.nav-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  font-size: 1.25rem;
  background: linear-gradient(145deg, #2b1d55, #11182d);
  border: 2px solid rgba(255,215,0,.62);
  box-shadow: 0 0 0 3px rgba(124,58,237,.16), 0 6px 20px rgba(0,0,0,.35);
}
.nav-profile-avatar:hover,
.nav-profile-avatar:focus-visible { border-color: #facc15; transform: translateY(-1px); }

/* User-selectable VHS account avatar */
.vhs-avatar {
  --vhs-shell: linear-gradient(145deg, #6847c7, #211448 72%);
  --vhs-edge: #a78bfa;
  --vhs-label: #f8fafc;
  position: relative;
  display: inline-block;
  width: 30px;
  height: 20px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid var(--vhs-edge);
  border-radius: 4px;
  background: var(--vhs-shell);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.28), 0 2px 7px rgba(0,0,0,.35);
}
.vhs-avatar::before {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 4px;
  height: 7px;
  border-radius: 2px;
  background: rgba(248,250,252,.9);
}
.vhs-avatar__label {
  position: absolute;
  z-index: 2;
  top: 4px; left: 0; right: 0;
  overflow: hidden;
  color: #111827;
  font: 800 5px/7px var(--pixel-font);
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.vhs-avatar__reels {
  position: absolute;
  left: 6px; right: 6px; bottom: 2px;
  display: flex;
  justify-content: space-between;
}
.vhs-avatar__reels i {
  width: 5px; height: 5px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  background: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.vhs-avatar--blue { --vhs-shell: linear-gradient(145deg, #38bdf8, #164e63 72%); --vhs-edge: #7dd3fc; }
.vhs-avatar--gold { --vhs-shell: linear-gradient(145deg, #facc15, #92400e 72%); --vhs-edge: #fde68a; }
.vhs-avatar--red { --vhs-shell: linear-gradient(145deg, #fb7185, #7f1d1d 72%); --vhs-edge: #fda4af; }
.nav__brand { display: flex; align-items: flex-start; flex: 0 0 auto; }
.design-star {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 4px;
  color: #facc15; background: transparent; border: 0; border-radius: 50%;
  font-size: 1.15rem; line-height: 1; vertical-align: super; opacity: .82;
}
.design-star:hover, .design-star:focus-visible { opacity: 1; background: rgba(250,204,21,.14); transform: rotate(18deg) scale(1.1); }
.section-title .design-star { position: relative; top: -.35em; }
.nav__wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--pixel-font);
  font-size: .65rem;
  color: var(--gold);
  background: rgba(255,215,0,.1);
  border: 1px solid rgba(255,215,0,.25);
  border-radius: 20px;
  padding: 5px 12px;
  white-space: nowrap;
  animation: coinGlow 3s ease-in-out infinite;
}
@keyframes coinGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,.2); }
  50%       { box-shadow: 0 0 16px rgba(255,215,0,.5); }
}

/* ── Sidebar Backdrop ── */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  z-index: 400;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background: #0e0e1e;
  border-left: 1px solid rgba(255,215,0,.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0,0,0,.5);
}
.sidebar.open { transform: translateX(0); }

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,70,173,.12);
}

.sidebar__logo {
  font-family: var(--pixel-font);
  font-size: .75rem;
  color: var(--gold);
  text-shadow: 1px 1px 0 var(--accent);
}
.sidebar__logo span { color: var(--text-primary); }

.sidebar-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.sidebar-close:hover { background: var(--accent); color: #fff; }

/* ── Sidebar User Profile ── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-user__avatar {
  font-size: 2.2rem;
  background: rgba(255,215,0,.1);
  border: 2px solid rgba(255,215,0,.3);
  border-radius: 50%;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  padding: 0;
  overflow: hidden;
}
.sidebar-user__avatar .vhs-avatar { width: 38px; height: 25px; }
.sidebar-user__avatar .vhs-avatar::before { left: 5px; right: 5px; top: 5px; height: 8px; }
.sidebar-user__avatar .vhs-avatar__label { top: 5px; font-size: 6px; line-height: 8px; }
.sidebar-user__avatar .vhs-avatar__reels { left: 8px; right: 8px; bottom: 3px; }

/* ── Star ID / avatar portal ── */
.profile-portal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4,6,15,.84);
  backdrop-filter: blur(14px);
}
.profile-portal-backdrop.open { display: flex; }
.profile-portal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(880px, calc(100dvh - 30px));
  overflow-y: auto;
  padding: 30px;
  border-radius: 24px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 88% 5%, rgba(124,58,237,.3), transparent 30%),
    radial-gradient(circle at 4% 70%, rgba(229,9,20,.14), transparent 34%),
    linear-gradient(155deg, #11182d, #090b16 65%);
  border: 1px solid rgba(196,181,253,.24);
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
}
.profile-portal__eyebrow { color: #facc15; font: 700 .64rem/1 var(--pixel-font); letter-spacing: .12em; }
.profile-portal h2 { margin: 10px 0 6px; font-size: clamp(1.55rem, 5vw, 2.25rem); }
.profile-portal__intro { color: var(--text-muted); line-height: 1.5; margin-bottom: 22px; }
.profile-edit-context { margin: -10px 0 20px; color: #c4b5fd; font-size: .78rem; }
.account-avatar-settings {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(14,165,233,.12), rgba(124,58,237,.12));
}
.account-avatar-settings__preview {
  width: 108px; height: 108px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(250,204,21,.55);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #334155, #080b16 68%);
  box-shadow: 0 0 0 5px rgba(124,58,237,.14), inset 0 0 28px rgba(56,189,248,.13);
}
.account-avatar-settings__preview .vhs-avatar { width: 74px; height: 48px; border-width: 3px; border-radius: 7px; }
.account-avatar-settings__preview .vhs-avatar::before { left: 10px; right: 10px; top: 9px; height: 15px; }
.account-avatar-settings__preview .vhs-avatar__label { top: 9px; font-size: 8px; line-height: 15px; }
.account-avatar-settings__preview .vhs-avatar__reels { left: 15px; right: 15px; bottom: 6px; }
.account-avatar-settings__preview .vhs-avatar__reels i { width: 11px; height: 11px; border-width: 2px; }
.account-avatar-settings__controls h3 { margin: 5px 0; }
.account-avatar-settings__controls p { margin: 0 0 12px; color: var(--text-muted); font-size: .76rem; line-height: 1.4; }
.vhs-style-options { display: flex; flex-wrap: wrap; gap: 7px; }
.vhs-style-options button {
  padding: 7px 11px;
  color: #e2e8f0;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  font-size: .7rem;
}
.vhs-style-options button.selected { color: #111827; background: #facc15; border-color: #facc15; }
.vhs-label-field { display: block; margin-top: 12px; color: var(--text-muted); font-size: .7rem; }
.vhs-label-field input {
  display: block;
  width: min(150px, 100%);
  margin-top: 5px;
  padding: 9px 11px;
  color: #fff;
  text-transform: uppercase;
  background: #111827;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
}
.vhs-label-field + small { display: block; margin-top: 5px; color: #94a3b8; font-size: .65rem; }
.coin-map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0; }
.coin-map article { min-width: 0; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1); }
.coin-map span, .coin-map small { display: block; color: var(--text-muted); font-size: .67rem; line-height: 1.3; }
.coin-map strong { display: block; margin: 7px 0; color: #facc15; font-size: 1.4rem; }
.profile-portal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.profile-save-message { min-height: 1.2em; margin-top: 12px; color: #86efac; font-size: .8rem; }
.design-controls { margin: 22px 0 4px; padding: 18px; border-radius: 16px; background: rgba(124,58,237,.1); border: 1px solid rgba(196,181,253,.18); }
.element-editor { position: sticky; top: -30px; z-index: 2; padding: 18px; border-radius: 16px; background: #171527; border: 2px solid rgba(250,204,21,.55); box-shadow: 0 12px 35px rgba(0,0,0,.38); }
.element-editor h3 { margin: 0 0 10px; }
.element-editor label { color: var(--text-muted); font-size: .72rem; }
.element-editor input { display: block; width: 100%; margin-top: 6px; padding: 12px; border-radius: 10px; color: #fff; background: #111827; border: 1px solid rgba(255,255,255,.16); font-size: 1rem; }
.element-editor__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.element-editor__actions span { color: #93c5fd; font-size: .72rem; }
.element-editor > p { margin: 10px 0 0; color: var(--text-muted); font-size: .7rem; }
.design-controls h3 { margin: 0 0 5px; }
.design-controls > p { color: var(--text-muted); font-size: .78rem; margin: 0 0 14px; }
.design-fields { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.design-fields label { color: var(--text-muted); font-size: .69rem; }
.design-fields input, .design-fields select { display: block; width: 100%; margin-top: 5px; padding: 10px; border-radius: 10px; color: #fff; background: #111827; border: 1px solid rgba(255,255,255,.15); }
.adaptive-design-toggle { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; font-size: .78rem; line-height: 1.4; }
.adaptive-design-toggle input { margin-top: 3px; accent-color: #facc15; }
.avatar-adapt-reason { margin: 7px 0 0 25px; color: #93c5fd; font-size: .7rem; }
.design-option-row { display: flex; flex-wrap: wrap; gap: 8px; }
.design-option-row button { padding: 9px 13px; border-radius: 999px; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.design-option-row button.selected { color: #111827; background: #facc15; border-color: #facc15; }
.design-range { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 16px; font-size: .78rem; }
.design-range input { width: 100%; accent-color: #facc15; }
.design-network-note { margin-top: 16px; color: #c4b5fd; font-size: .72rem; line-height: 1.45; }
html[data-user-theme="midnight"] body { --bg-primary: #020617; --bg-secondary: #07101f; --accent: #2563eb; }
html[data-user-theme="golden"] body { --bg-primary: #140f05; --bg-secondary: #211807; --accent: #b45309; --accent-2: #facc15; }
html[data-card-size="0"] .show-card { width: 175px; flex-basis: 175px; }
html[data-card-size="2"] .show-card { width: 260px; flex-basis: 260px; }

@media (max-width: 700px) {
  .profile-portal-backdrop { align-items: flex-end; padding: 0; }
  .profile-portal { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
  .coin-map { grid-template-columns: repeat(2, 1fr); }
  .nav-profile-avatar { width: 38px; height: 38px; }
  .nav__wallet { padding: 5px 8px; }
  .design-fields { grid-template-columns: 1fr; }
  .element-editor { top: -24px; }
  .account-avatar-settings { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .account-avatar-settings__preview { width: 76px; height: 76px; }
  .account-avatar-settings__preview .vhs-avatar { width: 54px; height: 35px; }
  .account-avatar-settings__preview .vhs-avatar::before { left: 8px; right: 8px; top: 7px; height: 11px; }
  .account-avatar-settings__preview .vhs-avatar__label { top: 7px; font-size: 6px; line-height: 11px; }
  .account-avatar-settings__preview .vhs-avatar__reels { left: 12px; right: 12px; bottom: 4px; }
  .account-avatar-settings__preview .vhs-avatar__reels i { width: 8px; height: 8px; border-width: 1px; }
  .card-row { scroll-padding-inline: calc((100vw - min(78vw, 300px)) / 2); padding-left: calc((100vw - min(78vw, 300px)) / 2); padding-right: calc((100vw - min(78vw, 300px)) / 2); }
  .show-card { scroll-snap-align: center; }
  .scroll-btn { width: 44px; height: 58px; opacity: .92; }
}

@media (max-width: 520px) {
  .nav {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: 7px;
    padding-right: 7px;
    gap: 3px;
  }
  .nav__brand {
    min-width: 0;
    align-items: center;
  }
  .nav__logo {
    min-width: 0;
    gap: 6px;
    font-size: 1rem;
    letter-spacing: 1px;
  }
  .nav__logo span {
    display: inline;
    overflow: visible;
    font-size: 1rem;
    text-overflow: clip;
  }
  .nav__brand > .design-star {
    flex: 0 0 38px;
    width: 38px;
    height: 44px;
    margin-left: 0;
    touch-action: manipulation;
    pointer-events: auto;
    position: relative;
    z-index: 3;
  }
  .nav__right {
    min-width: 0;
    margin-left: 0;
    justify-content: flex-end;
    gap: 2px;
  }
  .nav__search { display: none; }
  .nav-profile-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 42px;
    touch-action: manipulation;
    pointer-events: auto;
    position: relative;
    z-index: 3;
  }
  .nav__wallet {
    min-width: 0;
    gap: 0;
    padding: 5px 5px;
    font-size: .54rem;
    border-radius: 12px;
  }
  .nav__wallet-balance,
  .nav__wallet-divider,
  .nav__wallet-progress small {
    display: none;
  }
  .nav__wallet-progress strong {
    font-size: .54rem;
  }
  .hamburger {
    flex: 0 0 42px;
    width: 42px;
    height: 44px;
    touch-action: manipulation;
    pointer-events: auto;
    position: relative;
    z-index: 3;
  }
}

@media (max-width: 360px) {
  :root { --nav-h: 108px; }
  .nav {
    grid-template-columns: 1fr;
    grid-template-rows: 54px 48px;
    height: var(--nav-h);
    align-content: center;
  }
  .nav__brand {
    width: 100%;
    justify-content: flex-start;
  }
  .nav__right {
    width: 100%;
    justify-content: flex-end;
  }
}

.sidebar-user__name {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.sidebar-wallet {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--pixel-font);
  font-size: .6rem;
  color: var(--gold);
}

/* ── Sidebar Nav ── */
.sidebar-nav { padding: 8px 0; border-bottom: 1px solid var(--border); }

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body-font);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}
.sidebar-nav__item:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-primary);
}
.sidebar-nav__ext {
  margin-left: auto;
  font-size: .75rem;
  opacity: .5;
}

/* ── Sidebar Sections ── */
.sidebar-section {
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 8px;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.sidebar-clear {
  margin-left: auto;
  font-size: .85rem;
  opacity: .5;
  transition: opacity var(--transition);
  cursor: pointer;
}
.sidebar-clear:hover { opacity: 1; }

/* ── Watch History List ── */
.history-list, .ledger-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 0 0 4px;
}

.history-empty, #ledger-empty {
  padding: 12px 20px;
  font-size: .82rem;
  color: var(--text-muted);
  font-style: italic;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: 0;
}
.history-item:hover { background: rgba(255,255,255,.05); }

.history-item__thumb {
  width: 48px; height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.history-item__info { overflow: hidden; flex: 1; }
.history-item__show { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item__ep   { font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item__progress { height: 3px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: rgba(148,163,184,.25); }
.history-item__progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #60a5fa, #facc15); }

.history-item__time {
  font-size: .7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Ledger Items ── */
.ledger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  font-size: .78rem;
}
.ledger-item__amount { color: var(--gold); font-weight: 800; min-width: 40px; }
.ledger-item__reason { color: var(--text-muted); flex: 1; }
.ledger-item__balance { color: var(--text-muted); font-size: .7rem; }

/* ── Sidebar Earn Info ── */
.sidebar-earn {
  padding: 16px 20px;
  margin-top: auto;
}
.sidebar-earn__title {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 8px;
}
.sidebar-earn__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-earn__list li {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Player updates ── */
.player-topbar__right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.player-share-btn {
  background: linear-gradient(145deg, rgba(90,72,170,.32), rgba(20,150,190,.2));
  border: 1px solid rgba(140,200,255,.38);
  color: #e7f4ff;
  border-radius: 16px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 800;
  font-family: var(--body-font);
  min-width: 104px;
  min-height: 36px;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 16px rgba(124,92,255,.12), 0 4px 14px rgba(0,0,0,.2);
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.player-pip-btn {
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid rgba(126,231,255,.45);
  background: rgba(5,30,54,.78);
  color: #dff9ff;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  touch-action: manipulation;
}
.player-pip-btn:hover,
.player-pip-btn--active {
  border-color: #8ff5ff;
  background: linear-gradient(145deg, #0a6680, #3846a8);
  box-shadow: 0 0 18px rgba(91,224,255,.35);
}
.player-pip-btn:disabled { opacity: .45; cursor: not-allowed; }
.player-share-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(145deg, rgba(110,88,205,.42), rgba(26,175,215,.28));
  border-color: rgba(180,224,255,.62);
}
.player-share-btn--minted {
  color: #1b1400;
  border-color: #ffe680;
  background: linear-gradient(135deg, #fff0a6, #f7b919);
  animation: shareStarMint .7s ease both;
}
@keyframes shareStarMint {
  0% { transform: scale(.92); box-shadow: 0 0 0 rgba(255,220,70,0); }
  55% { transform: scale(1.08); box-shadow: 0 0 28px rgba(255,220,70,.75); }
  100% { transform: scale(1); box-shadow: 0 6px 20px rgba(255,190,30,.3); }
}

.player-token-notif {
  font-family: var(--pixel-font);
  font-size: .6rem;
  color: var(--gold);
  animation: tokenPop .5s ease;
  white-space: nowrap;
}
@keyframes tokenPop {
  0%   { transform: scale(0) translateY(8px); opacity: 0; }
  60%  { transform: scale(1.2) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}

/* ── AI Companion FAB ── */
.ai-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 500;
  width: 54px;
  height: 62px;
  min-width: 0;
  background: linear-gradient(155deg, rgba(17,35,64,.96), rgba(48,27,83,.97));
  color: #fff;
  border: none;
  border-radius: 22px 22px 18px 18px;
  padding: 5px;
  font-size: .9rem;
  font-weight: 700;
  font-family: var(--body-font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 34px rgba(0,0,0,.46), 0 0 0 1px rgba(125,184,255,.28), 0 0 28px rgba(64,102,255,.2);
  transition: transform .2s, box-shadow .2s;
}
.ai-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 28px rgba(0,70,173,.65);
}
.cosmo-alien { position:relative; display:block; width:38px; height:49px; filter:drop-shadow(0 0 9px rgba(117,255,214,.35)); }
.cosmo-alien__antenna { position:absolute; width:2px; height:9px; left:18px; top:0; background:#9ef9df; border-radius:2px; }
.cosmo-alien__antenna::before { content:""; position:absolute; width:5px; height:5px; left:-1.5px; top:-2px; border-radius:50%; background:#ffe878; box-shadow:0 0 8px #ffe878; }
.cosmo-alien__head { position:absolute; left:5px; top:7px; width:28px; height:23px; border-radius:48% 48% 44% 44%; background:linear-gradient(145deg,#b9ffe7,#62d8c1); border:1px solid rgba(255,255,255,.55); }
.cosmo-alien__head i { position:absolute; top:8px; width:7px; height:9px; border-radius:70% 35%; background:#07192c; box-shadow:inset 0 0 0 1px #59b9ff; }
.cosmo-alien__head i:first-child { left:5px; transform:rotate(12deg); }
.cosmo-alien__head i:last-child { right:5px; transform:rotate(-12deg); }
.cosmo-alien__body { position:absolute; left:10px; top:28px; width:18px; height:16px; border-radius:7px 7px 10px 10px; background:linear-gradient(#66d9c2,#347f91); }
.cosmo-alien__body::after { content:""; position:absolute; left:3px; bottom:-5px; width:4px; height:7px; border-left:4px solid #4aa8a5; border-right:4px solid #4aa8a5; }
.cosmo-alien__body i { position:absolute; top:2px; width:9px; height:3px; border-radius:4px; background:#66d9c2; }
.cosmo-alien__body i:first-child { left:-7px; transform:rotate(24deg); }
.cosmo-alien__body i:last-child { right:-7px; transform:rotate(-24deg); }
.ai-fab__label { position:absolute; right:62px; padding:4px 7px; border-radius:7px; background:rgba(7,11,28,.92); color:#d9fff4; font-size:.67rem; opacity:0; pointer-events:none; transform:translateX(5px); transition:opacity .18s,transform .18s; }
.ai-fab:hover .ai-fab__label,.ai-fab:focus-visible .ai-fab__label { opacity:1; transform:translateX(0); }

/* ── AI Panel ── */
.ai-panel {
  position: fixed;
  bottom: 86px;
  right: 28px;
  z-index: 500;
  width: 430px;
  max-width: calc(100vw - 40px);
  background: #12122a;
  border: 1px solid rgba(0,70,173,.4);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: panelSlideIn .25s ease;
}
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 16px 12px;
  background: linear-gradient(135deg, rgba(0,70,173,.3), rgba(108,43,217,.25));
  border-bottom: 1px solid var(--border);
}

.ai-panel__title {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-primary);
}
.ai-panel__subtitle {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ai-panel__close {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.ai-panel__close:hover { background: var(--accent); color: #fff; }
.ai-panel__header-actions { display: flex; align-items: center; gap: 7px; }
.ai-panel__control {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.ai-panel__control:hover { background: var(--accent2); color: #fff; }

.cosmo-engine-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: rgba(0,0,0,.23); border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: .68rem;
}
.cosmo-engine-strip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cosmo-engine-strip button {
  flex-shrink: 0; padding: 5px 9px; border-radius: 12px;
  background: rgba(0,70,173,.28); color: #fff; border: 1px solid rgba(69,151,255,.55);
  font-size: .65rem; font-weight: 700;
}
.cosmo-engine-strip button:disabled { opacity: .65; cursor: default; }
.cosmo-ledger-strip {
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  background:rgba(255,215,0,.07); border-bottom:1px solid rgba(255,215,0,.18);
  color:#dce6ff; font-size:.65rem; line-height:1.35;
}
.cosmo-controls {
  padding: 10px 13px; border-bottom: 1px solid var(--border);
  background: #0d0d20; color: var(--text-muted); font-size: .72rem;
}
.cosmo-controls[hidden] { display: none; }
.cosmo-controls label { display: flex; align-items: center; gap: 8px; margin: 7px 0; color: var(--text-primary); }
.cosmo-controls input { accent-color: var(--accent2); }
.cosmo-controls p { margin: 9px 0; font-size: .65rem; line-height: 1.4; }
.cosmo-clear-interests { width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.05); color: var(--text-primary); font-size: .72rem; }
.cosmo-shopping-head { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.cosmo-shopping-head button { color: #ffb2b2; font-size: .62rem; background: transparent; }
.cosmo-controls ul { margin: 5px 0 0; padding-left: 18px; max-height: 74px; overflow: auto; }

/* ── AI Messages ── */
.ai-messages {
  flex: 1;
  min-height: 180px;
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.ai-msg--user { flex-direction: row-reverse; }

.ai-msg__bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: .84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-msg--bot .ai-msg__bubble {
  background: rgba(0,70,173,.2);
  border: 1px solid rgba(0,70,173,.3);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.ai-msg--user .ai-msg__bubble {
  background: rgba(229,34,34,.2);
  border: 1px solid rgba(229,34,34,.3);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}
.ai-msg__bubble a { color: #9fd3ff; text-decoration: underline; }
.ai-msg--sponsored .ai-msg__bubble { border-color: #d7a62a; background: rgba(215,166,42,.12); }

.ai-msg__avatar {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── AI Input Row ── */
.ai-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.ai-voice {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.07); border: 1px solid var(--border); color: #fff;
}
.ai-voice.is-listening { background: #c52439; box-shadow: 0 0 0 5px rgba(197,36,57,.18); animation: voicePulse 1s infinite; }
@keyframes voicePulse { 50% { transform: scale(1.08); } }

.ai-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: .85rem;
  font-family: var(--body-font);
  outline: none;
  transition: border-color var(--transition);
}
.ai-input:focus { border-color: var(--accent2); }

.ai-send {
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform .1s;
}
.ai-send:hover { background: #0057d8; }
.ai-send:active { transform: scale(.9); }

/* ── AI Suggestion Chips ── */
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 12px;
}

.ai-suggest {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: .72rem;
  cursor: pointer;
  font-family: var(--body-font);
  transition: background var(--transition), color var(--transition);
}
.ai-suggest:hover {
  background: rgba(0,70,173,.25);
  color: var(--text-primary);
  border-color: var(--accent2);
}

/* ── Token Notification Toast ── */
.token-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, #1a1a00, #2a2200);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--pixel-font);
  font-size: .6rem;
  color: var(--gold);
  box-shadow: 0 4px 20px rgba(255,215,0,.3);
  animation: toastIn .4s ease, toastOut .4s ease 2.5s forwards;
}
@keyframes toastIn  { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-8px); } }

/* ── Genre pills accent colour ── */
.genre-pill.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* ── Section title highlight ── */
.section-title {
  color: var(--text-primary);
  font-weight: 900;
}

/* ── Hero badge ── */
.hero__badge {
  font-family: var(--pixel-font);
  font-size: .5rem;
  letter-spacing: 1px;
  background: var(--gold);
  color: #000;
  border-radius: 4px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

/* ── Score colour ── */
.score { color: var(--gold) !important; }

/* ── Rating badge ── */
.rating-badge {
  background: rgba(255,215,0,.15);
  border: 1px solid rgba(255,215,0,.3);
  color: var(--gold);
}

/* ── Footer logo ── */
.footer__logo {
  font-family: var(--pixel-font);
  font-size: .65rem;
  color: var(--gold);
  text-shadow: 1px 1px 0 var(--accent);
}
.footer__logo span { color: var(--text-primary); }

/* ── Responsive: hide nav links on mobile ── */
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav { padding: 0 16px; gap: 12px; }
  .splash__title { font-size: 1.4rem; }
  .ai-panel { right: 10px; bottom: 76px; width: calc(100vw - 20px); }
  .ai-fab { right: 14px; bottom: 16px; }
  .ai-fab { width: 50px; height: 58px; min-width: 0; }
}

/* ── For You section glow ── */
.content-section--for-you {
  border-left: 3px solid var(--accent2);
  padding-left: 12px;
  border-radius: 0 0 0 0;
  background: linear-gradient(90deg, rgba(108,43,217,.07) 0%, transparent 60%);
}
.content-section--for-you .section-title { color: #c084fc; }
.for-you-genre-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Sidebar AI badge ── */
.sidebar-ai-badge {
  background: linear-gradient(135deg, var(--accent2), #6c2bd9);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
  letter-spacing: .5px;
}

/* ── StarWallet card ── */
.sidebar-wallet-card {
  margin: 0 14px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,215,0,.12) 0%, rgba(0,70,173,.12) 100%);
  border: 1px solid rgba(255,215,0,.28);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-card__header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
}

.wallet-card__icon { font-size: 1rem; }

.wallet-card__balance-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.wallet-balance-big {
  font-family: var(--pixel-font);
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255,215,0,.5);
  line-height: 1;
}

.wallet-balance-label {
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,215,0,.7);
}

.wallet-building-balance {
  margin: -3px 0 10px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.35;
}

.wallet-card__progress { display: flex; flex-direction: column; gap: 5px; }

.wallet-progress__label {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
}

.wallet-share-count {
  font-weight: 800;
  color: var(--gold);
}

.wallet-progress__track {
  height: 7px;
  background: rgba(255,255,255,.1);
  border-radius: 4px;
  overflow: hidden;
}

.wallet-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffa500);
  border-radius: 4px;
  transition: width .4s ease;
  min-width: 0;
}

.wallet-card__earn-hints {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .7rem;
  color: var(--text-muted);
}
.sidebar-unified-wallet {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: #f8fafc;
  text-align: left;
  background: linear-gradient(135deg, rgba(59,130,246,.24), rgba(124,58,237,.28));
  border: 1px solid rgba(147,197,253,.35);
  border-radius: 11px;
}
.sidebar-unified-wallet:hover,
.sidebar-unified-wallet:focus-visible { border-color: #facc15; background: linear-gradient(135deg, rgba(59,130,246,.34), rgba(124,58,237,.4)); }
.sidebar-unified-wallet__icon { display: grid; place-items: center; width: 29px; height: 29px; color: #facc15; background: #111827; border-radius: 50%; }
.sidebar-unified-wallet strong,
.sidebar-unified-wallet small { display: block; }
.sidebar-unified-wallet strong { font-size: .76rem; }
.sidebar-unified-wallet small { margin-top: 2px; color: #cbd5e1; font-size: .62rem; }

/* ── Cosmo conversation preview ── */
.convo-preview {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}

.convo-preview__msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 20px;
}

.convo-preview__avatar {
  font-size: .9rem;
  flex-shrink: 0;
  line-height: 1.6;
}

.convo-preview__text {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.convo-preview__msg--user .convo-preview__text { color: var(--text-primary); }
.convo-preview__msg--bot  .convo-preview__text { color: #c084fc; }

.sidebar-continue-chat {
  display: block;
  width: calc(100% - 40px);
  margin: 6px 20px 10px;
  padding: 9px 16px;
  background: linear-gradient(135deg, rgba(108,43,217,.3), rgba(0,70,173,.3));
  border: 1px solid rgba(108,43,217,.5);
  border-radius: 8px;
  color: #c084fc;
  font-size: .83rem;
  font-weight: 700;
  font-family: var(--body-font);
  cursor: pointer;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}
.sidebar-continue-chat:hover {
  background: linear-gradient(135deg, rgba(108,43,217,.5), rgba(0,70,173,.5));
  border-color: rgba(192,132,252,.7);
  color: #fff;
}

/* ── AI typing animation ── */
.ai-typing {
  letter-spacing: 2px;
  animation: aiTypingPulse 1s infinite;
}
@keyframes aiTypingPulse {
  0%, 100% { opacity: .4; }
  50%       { opacity: 1; }
}

/* ── Cosmo watch-along pop-in ── */
.cosmo-popin {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: var(--z-cosmo-popin);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(10, 10, 30, .92);
  border: 1px solid rgba(108,43,217,.5);
  border-radius: 16px;
  padding: 14px 16px;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
  transform: translateY(20px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
.cosmo-popin--in {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cosmo-popin__avatar {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}
.cosmo-popin__body { flex: 1; }
.cosmo-popin__name {
  font-size: .7rem;
  font-weight: 800;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 4px;
}
.cosmo-popin__text {
  font-size: .84rem;
  color: var(--text-primary);
  line-height: 1.5;
}
.cosmo-popin__close {
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--text-muted);
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: .7rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.cosmo-popin__close:hover { background: var(--accent); color: #fff; }

.player-open .ai-fab {
  top: 74px;
  right: 20px;
  bottom: auto;
}

.player-open .ai-panel {
  top: 132px;
  right: 20px;
  bottom: auto;
  max-height: calc(100vh - 152px);
}

.player-page.open .cosmo-popin {
  top: 84px;
  bottom: auto;
  max-width: min(420px, calc(100% - 48px));
}

@media (max-width: 720px) {
  .player-open .ai-fab {
    top: 72px;
    right: 14px;
    bottom: auto;
  }

  .player-open .ai-panel {
    top: 126px;
    right: 10px;
    bottom: auto;
    max-height: calc(100vh - 146px);
  }

  .player-page.open .cosmo-popin {
    top: 74px;
    left: 12px;
    max-width: calc(100% - 24px);
  }
}


/* ── Wallet share-to-coin counter ── */
.nav__wallet-balance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav__wallet-divider {
  width: 1px;
  height: 26px;
  background: rgba(255,215,0,.28);
}
.nav__wallet-progress {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}
.nav__wallet-progress strong {
  color: var(--gold);
  font-size: .58rem;
}
.nav__wallet-progress small {
  color: var(--text-muted);
  font-family: var(--body-font);
  font-size: .58rem;
  font-weight: 700;
}
.player-share-btn[aria-busy="true"] {
  opacity: .7;
  cursor: progress;
}

@media (max-width: 520px) {
  .nav__wallet-progress small { display: none; }
  .nav__wallet-divider { height: 20px; }

  .player-topbar {
    padding: 0 8px;
    gap: 8px;
  }
  .player-back {
    flex: 0 0 auto;
    padding: 7px 9px;
    font-size: .78rem;
  }
  .player-ep-title {
    font-size: .72rem;
  }
  .player-topbar__right {
    gap: 6px;
  }
  .player-token-notif {
    display: none !important;
  }
  .player-share-btn {
    min-width: 76px;
    min-height: 42px;
    padding: 7px 9px;
  }
  .player-pip-btn {
    min-height: 42px;
    padding: 7px 9px;
  }
}

.home-starcoin-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(100%, 430px);
  margin-top: 14px;
  padding: 10px 15px;
  border: 1px solid rgba(255,215,0,.48);
  border-radius: 999px;
  color: #fff4ba;
  background: linear-gradient(135deg, rgba(58,38,8,.78), rgba(35,20,81,.82));
  box-shadow: 0 7px 22px rgba(0,0,0,.3), inset 0 0 18px rgba(255,215,0,.08);
  text-align: left;
  touch-action: manipulation;
}
.home-starcoin-status:hover,
.home-starcoin-status:focus-visible { border-color: #ffe26b; transform: translateY(-1px); }
.home-starcoin-status__star { font-size: 1.25rem; filter: drop-shadow(0 0 7px rgba(255,220,80,.65)); }
.home-starcoin-status strong { color: #ffe36c; font-size: 1rem; white-space: nowrap; }
.home-starcoin-status span:last-child { color: #e6e9f8; font-size: .76rem; line-height: 1.25; }

@media (max-width: 520px) {
  .home-starcoin-status { width: 100%; border-radius: 15px; padding: 11px 13px; }
  .home-starcoin-status span:last-child { font-size: .7rem; }
}


/* ── Avatar Coin Crown design chain ── */
.avatar-chain {
  margin: 22px 0;
  padding: 18px;
  border-radius: 16px;
  background: rgba(14,165,233,.08);
  border: 1px solid rgba(125,211,252,.22);
}
.avatar-chain__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.avatar-chain__header h3 { margin: 0 0 5px; }
.avatar-chain__header p {
  max-width: 520px;
  margin: 0;
  color: var(--text-muted);
  font-size: .74rem;
  line-height: 1.45;
}
.avatar-chain__id {
  max-width: 210px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #bae6fd;
  background: rgba(2,132,199,.14);
  font: 600 .58rem/1.35 monospace;
  overflow-wrap: anywhere;
}
.avatar-request {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 16px;
}
.avatar-request label {
  grid-column: 1 / -1;
  color: #e0f2fe;
  font-size: .76rem;
  font-weight: 800;
}
.avatar-request textarea {
  min-height: 68px;
  resize: vertical;
  padding: 11px;
  border-radius: 10px;
  color: #fff;
  background: #111827;
  border: 1px solid rgba(255,255,255,.16);
  font: inherit;
}
.avatar-chain__list {
  display: grid;
  gap: 7px;
  max-height: 220px;
  margin-top: 14px;
  overflow-y: auto;
}
.avatar-chain-version {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: #f8fafc;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
}
.avatar-chain-version:hover,
.avatar-chain-version:focus-visible { border-color: rgba(250,204,21,.55); }
.avatar-chain-version strong,
.avatar-chain-version span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-chain-version span { color: var(--text-muted); font-size: .68rem; }
.avatar-chain-version small {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #93c5fd;
  font: 600 .56rem/1 monospace;
}
.avatar-chain__empty { color: var(--text-muted); font-size: .72rem; }
.avatar-chain__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 700px) {
  .avatar-chain__header { display: grid; }
  .avatar-chain__id { max-width: 100%; }
  .avatar-request { grid-template-columns: 1fr; }
  .avatar-request label { grid-column: auto; }
  .avatar-chain-version { grid-template-columns: 1fr; }
  .avatar-chain-version small { grid-column: 1; grid-row: auto; }
}


/* Page-wide Avatar Coin edit points */
.avatar-wave-marker {
  width: 28px;
  height: 28px;
  margin: 0 6px;
  padding: 0;
  font-size: 1rem;
  vertical-align: middle;
  color: #fff3a3;
  border: 1px solid rgba(250,204,21,.66);
  background: rgba(250,204,21,.2);
  box-shadow: 0 0 0 2px rgba(250,204,21,.08), 0 0 14px rgba(250,204,21,.2);
}
p + .avatar-wave-marker,
label + .avatar-wave-marker,
.btn + .avatar-wave-marker {
  position: relative;
  top: -.25em;
}

/* ── Reliable share sheet ── */
.share-backdrop[hidden] { display: none; }
.share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
}
.share-sheet {
  width: min(520px, 100%);
  padding: 20px;
  border: 1px solid rgba(250,204,21,.3);
  border-radius: 22px;
  color: var(--text-primary);
  background: linear-gradient(160deg, #17152a, #0c1020);
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
}
.share-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.share-sheet__eyebrow {
  margin-bottom: 4px;
  color: var(--gold);
  font: 700 .56rem/1.3 var(--pixel-font);
}
.share-sheet h2 {
  margin: 0;
  font-size: 1.25rem;
}
.share-sheet__close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.09);
}
.share-sheet__program {
  margin: 12px 0 16px;
  color: var(--text-muted);
  line-height: 1.4;
}
.share-sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.share-action {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.07);
  font: 800 .86rem/1.2 var(--body-font);
  text-align: center;
  touch-action: manipulation;
}
.share-action:hover,
.share-action:focus-visible {
  background: rgba(255,255,255,.14);
  border-color: rgba(250,204,21,.45);
}
.share-action--primary {
  grid-column: 1 / -1;
  color: #17120a;
  background: linear-gradient(135deg, #facc15, #f59e0b);
}
.share-sheet__status {
  min-height: 42px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #dbeafe;
  background: rgba(59,130,246,.12);
  font-size: .8rem;
}
@media (max-width: 420px) {
  .share-backdrop { padding: 8px; }
  .share-sheet { padding: 16px; border-radius: 18px; }
  .share-sheet__actions { grid-template-columns: 1fr; }
  .share-action--primary { grid-column: auto; }
}


/* 2026-09 StarQuest control cleanup: one Avatar Star, menu-only wallet/share. */
.card-avatar-marker,
.avatar-wave-marker,
.design-star:not([data-avatar-portal][data-design-key="brand-name"]) {
  display: none !important;
}
.nav__brand > .design-star[data-design-key="brand-name"] {
  display: inline-grid;
  flex: 0 0 auto;
}
.sidebar-quick-actions {
  display: grid;
  gap: .65rem;
  padding: .8rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-action-button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  margin: 0;
}
.sidebar-schedule-note {
  margin: 0;
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.4;
  text-align: center;
}
@media (max-width: 640px) {
  .nav__brand { min-width: 0; }
  .nav__brand .nav__logo { min-width: 0; }
  .nav__brand > .design-star[data-design-key="brand-name"] {
    width: 36px;
    height: 36px;
  }
  .player-topbar__right { gap: .4rem; }
}

/* Restored Archive shelf: Oracle-style purposeful watch and browse cards. */
.sq-no-programs{display:none!important}
.sq-archive-vault{margin:18px auto;padding:18px;border:1px solid #9b81dc;border-radius:18px;background:linear-gradient(145deg,#14102d,#26224b);color:#fff}
.sq-archive-intro{padding:0 10px 10px;max-width:800px;color:#ddd7fa;line-height:1.5;font-size:13px}
.sq-archive-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px}
.sq-archive-search{min-width:180px;flex:1;min-height:48px;padding:10px 15px;border-radius:12px;background:#fff;color:#20173d;border:2px solid #fbc961;font-size:16px}
.sq-archive-count{color:#f6dfa8;font-size:12px}
.sq-archive-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,165px),1fr));gap:10px;padding:10px}
.sq-archive-card{display:flex;flex-direction:column;gap:7px;min-height:205px;padding:10px;border:1px solid #7a62a7;background:#fff;color:#2a1c40;border-radius:14px;cursor:pointer;text-align:left;touch-action:manipulation;overflow:hidden}
.sq-archive-card img{display:block;width:100%;height:114px;object-fit:cover;border-radius:9px;background:#302554}
.sq-archive-card strong{font-size:15px;line-height:1.25}.sq-archive-card span{font-size:13px;line-height:1.3}
.sq-archive-card small{margin-top:auto;font-size:11px;color:#65458d}
.sq-archive-controls{display:flex;justify-content:center;padding:9px}
.sq-archive-button{min-height:46px;padding:9px 16px;border-radius:12px;background:#ffc66a;color:#251137;font-weight:850;border:0;cursor:pointer}
.sq-archive-viewer{margin:10px;padding:12px;border:1px solid #ffd48b;border-radius:14px;background:#06060e;display:grid;gap:10px;color:#fff}
.sq-archive-viewer[hidden],.sq-archive-button[hidden]{display:none!important}
.sq-archive-video{width:100%;max-height:440px;background:#000}
.sq-archive-video[hidden]{display:none!important}
.sq-archive-original{color:#fbd38e;font-weight:800;min-height:45px;display:inline-flex;align-items:center}
#hamburger-btn[hidden],#player-hamburger-btn[hidden]{display:none!important}

/* Read-only shared Cloudflare wallet inventory in StarQuest's green menu. */
.cloud-unified-wallet-balances{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0 0}
.cloud-unified-wallet-balances[hidden]{display:none!important}
.cloud-unified-wallet-balances>span{min-width:0;padding:10px;border:1px solid rgba(83,221,119,.32);border-radius:10px;background:rgba(13,83,44,.25)}
.cloud-unified-wallet-balances small{display:block;color:#c0e7ce;font-size:11px;font-weight:700}
.cloud-unified-wallet-balances strong{display:block;color:#fff;font-size:18px;line-height:1.5;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
