  :root {
    --bg: #08081f;
    --bg2: #0d0d2b;
    --purple: #7b2fff;
    --purple-light: #a855f7;
    --gold: #ffd700;
    --gold-dim: #b8970a;
    --coral: #ff6b6b;
    --text: #e8e8ff;
    --text-dim: #8888aa;
    --card-bg: rgba(255,255,255,0.04);
    --card-border: rgba(255,255,255,0.08);
    --locked-bg: rgba(10,10,30,0.85);
  }

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

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ── STARS ── */
  #stars-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
  }

  /* ── HEADER ── */
  header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(8,8,31,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(123,47,255,0.2);
  }

  .logo {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
  }
  .logo span { color: var(--text-dim); font-size: 0.9em; }

  .hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
  }
  .hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
  }

  .music-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 0 12px;
    height: 34px;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .music-btn:hover { background: rgba(123,47,255,0.2); color: var(--text); border-color: rgba(123,47,255,0.4); }
  .music-btn.playing { color: var(--gold); border-color: var(--gold-dim); background: rgba(255,215,0,0.08); }
  .music-btn .music-label { font-size: 0.72rem; letter-spacing: 0.3px; }
  @media (max-width: 540px) { .music-btn .music-label { display: none; } .music-btn { padding: 0 8px; } }


  /* ── HEADER NAV LINKS (desktop) ── */
  .header-nav {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .header-nav-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 6px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
  }
  .header-nav-btn:hover {
    background: rgba(123,47,255,0.2);
    color: var(--text);
    border-color: rgba(123,47,255,0.5);
  }
  .header-nav-btn.comic-btn {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
  }
  .header-nav-btn.comic-btn:hover { opacity: 0.85; }

  @media (max-width: 540px) {
    .header-nav { display: none; }
  }

  /* ── SIDE NAV ── */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .nav-overlay.open { opacity: 1; pointer-events: all; }

  .side-nav {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100%;
    background: #0f0f2e;
    border-right: 1px solid rgba(123,47,255,0.3);
    z-index: 300;
    padding: 24px 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .side-nav.open { transform: translateX(0); }

  .side-nav .nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
  }
  .side-nav .nav-header .logo { font-size: 0.85rem; }
  .close-nav {
    background: none; border: none; color: var(--text-dim);
    font-size: 1.5rem; cursor: pointer;
  }

  .nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold);
    text-transform: uppercase;
    padding: 8px 12px 4px;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }
  .nav-link:hover, .nav-link.active {
    background: rgba(123,47,255,0.2);
    color: var(--text);
  }
  .nav-link.active { color: var(--gold); }
  .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

  .nav-footer {
    margin-top: auto;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 12px 0;
  }

  /* ── PAGES ── */
  .page { display: none; padding-top: 70px; min-height: 100vh; position: relative; z-index: 1; }
  .page.active { display: block; }

  /* ── HOME ── */
  .hero {
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    position: relative;
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(123,47,255,0.2);
    border: 1px solid rgba(123,47,255,0.4);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--purple-light);
    margin-bottom: 32px;
  }
  .hero-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--purple-light);
    border-radius: 50%;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
  }

  .hero h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.8rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 24px;
    text-shadow: 0 0 60px rgba(123,47,255,0.4);
  }

  .hero-planet {
    position: absolute;
    width: clamp(300px, 60vw, 600px);
    height: clamp(300px, 60vw, 600px);
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, rgba(123,47,255,0.15), transparent 70%);
    border: 1px solid rgba(123,47,255,0.1);
    pointer-events: none;
    z-index: -1;
  }

  .hero p {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text-dim);
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 40px;
  }

  .hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 60px;
  }

  .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
  }
  .btn-primary:hover { background: #6320dd; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(123,47,255,0.4); }

  .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
  }
  .btn-secondary:hover { background: rgba(255,215,0,0.1); transform: translateY(-2px); }

  .stats-bar {
    display: flex;
    gap: 1px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    width: min(600px, 90vw);
  }

  .stat {
    flex: 1;
    padding: 18px 12px;
    text-align: center;
    background: rgba(255,255,255,0.02);
  }
  .stat:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.06); }
  .stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
  }
  .stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 4px;
    display: block;
  }

  /* ── STORIES ── */
  .page-header {
    text-align: center;
    padding: 50px 24px 40px;
  }
  .page-header h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 4px;
    margin-bottom: 12px;
  }
  .page-header p { color: var(--text-dim); font-size: 0.95rem; }

  .stories-list {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .story-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
  }

  .story-card.unlocked {
    border-color: rgba(123,47,255,0.4);
    background: rgba(123,47,255,0.07);
  }
  .story-card.unlocked::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--gold));
  }
  .story-card.unlocked:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(123,47,255,0.2); }

  .story-card.locked { opacity: 0.5; }

  .ep-num {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: rgba(255,255,255,0.1);
    min-width: 60px;
    line-height: 1;
  }
  .story-card.unlocked .ep-num { color: rgba(123,47,255,0.4); }

  .story-info { flex: 1; }
  .story-ep-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--purple-light);
    margin-bottom: 6px;
  }
  .story-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
  }
  .story-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 10px;
  }
  .story-meta {
    font-size: 0.75rem;
    color: var(--purple-light);
    font-weight: 700;
  }

  .story-action { flex-shrink: 0; }

  .lock-icon {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
  }

  /* ── AUDIO PLAYER ── */
  .audio-player {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(123,47,255,0.3);
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 16px;
    display: none;
  }
  .audio-player.visible { display: block; }

  .audio-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  .lang-toggle {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
  }
  .lang-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
  }
  .lang-btn.active {
    background: var(--purple);
    color: white;
  }

  .play-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--purple);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  .play-btn:hover { background: #6320dd; transform: scale(1.05); }

  .audio-progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .progress-bar-wrap {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
  }
  .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s;
  }
  .audio-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
  }

  .audio-note {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    padding: 6px 0 0;
    font-style: italic;
  }

  /* ── CHARACTERS ── */
  .characters-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 80px;
  }

  @media (max-width: 900px) {
    .characters-grid { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 600px) {
    .characters-grid { grid-template-columns: repeat(2, 1fr); }
  }

  .char-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    transition: all 0.25s;
    cursor: pointer;
    position: relative;
  }

  .char-card.unlocked {
    border-color: rgba(123,47,255,0.5);
    box-shadow: 0 0 0 0 rgba(123,47,255,0);
    animation: glow-idle 3s ease-in-out infinite;
  }
  .char-card.unlocked:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(123,47,255,0.35);
    animation: none;
  }

  .char-card.villain {
    border-color: rgba(168,85,247,0.6);
  }

  @keyframes glow-idle {
    0%, 100% { box-shadow: 0 0 8px rgba(123,47,255,0.15); }
    50% { box-shadow: 0 0 20px rgba(123,47,255,0.35); }
  }

  .char-img-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #0a0a20;
  }

  .char-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
  }
  .char-card.unlocked:hover .char-img-wrap img { transform: scale(1.06); }

  .char-card.locked .char-img-wrap img {
    filter: grayscale(100%) brightness(0.35);
  }

  .unlock-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--purple);
    color: white;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
  }

  .lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(5,5,20,0.5);
  }
  .lock-overlay svg { color: rgba(255,255,255,0.3); width: 28px; height: 28px; }
  .lock-overlay span {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
  }

  .char-info {
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
  }
  .char-name {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .char-card.locked .char-name { color: var(--text-dim); }
  .char-role {
    font-size: 0.65rem;
    color: var(--purple-light);
    font-weight: 600;
  }
  .char-card.locked .char-role { color: rgba(255,255,255,0.2); }
  .char-card.villain .char-role { color: #c084fc; }

  /* ── CHARACTER MODAL ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }

  .modal {
    background: #0f0f2e;
    border: 1px solid rgba(123,47,255,0.4);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.25s;
  }
  .modal-overlay.open .modal { transform: scale(1); }

  .modal img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
  }
  .modal-body { padding: 20px 24px 24px; }
  .modal-name {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }
  .modal-role { color: var(--purple-light); font-size: 0.85rem; font-weight: 700; margin-bottom: 14px; }
  .modal-desc { color: var(--text-dim); font-size: 0.88rem; line-height: 1.7; margin-bottom: 16px; }
  .modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-close:hover { background: rgba(255,255,255,0.2); }

  /* ── FLOATING PLANETS ── */
  .planet {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float linear infinite;
  }
  @keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
  }

  /* ── STORY COMIC PREVIEW ── */
  .story-comic-preview {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    margin: 10px 0 12px;
    height: 160px;
    border: 2px solid rgba(123,47,255,0.3);
    transition: border-color 0.2s, transform 0.2s;
  }
  .story-comic-preview:hover { border-color: rgba(123,47,255,0.8); transform: scale(1.01); }
  .story-comic-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
  }
  .preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .story-comic-preview:hover .preview-overlay,
  .story-comic-preview:active .preview-overlay { opacity: 1; }
  .preview-overlay span {
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  /* ══════════════════════════════════════════════
     COMIC READER
  ══════════════════════════════════════════════ */
  #page-comic {
    background: #f5f0e8;
    min-height: 100vh;
    padding-top: 72px;
  }

  .comic-reader {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 12px 32px;
  }

  .comic-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 2px solid #1a0a00;
    border-radius: 8px;
    padding: 6px 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a0a00;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background 0.15s;
  }
  .comic-back-btn:hover { background: rgba(26,10,0,0.08); }

  .comic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
  }

  .comic-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 900;
    color: #1a0a00;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .comic-lang-toggle { display: flex; gap: 6px; }

  .comic-lang-btn {
    background: white;
    border: 2px solid #1a0a00;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: #1a0a00;
    transition: all 0.15s;
  }
  .comic-lang-btn.active { background: #1a0a00; color: white; }

  .comic-page { display: none; }
  .comic-page.active { display: block; }

  .comic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #1a0a00;
    border: 4px solid #1a0a00;
    border-radius: 4px;
    overflow: hidden;
  }

  .comic-panel {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #222;
  }

  .comic-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .story5-comic-grid .comic-panel {
    aspect-ratio: 1232 / 928;
    background: #f5efe6;
  }

  .story5-comic-grid .comic-panel img {
    object-fit: contain;
    background: #f5efe6;
  }

  .story6-comic-grid .comic-panel {
    aspect-ratio: 928 / 1232;
    background: #f5efe6;
  }

  .story6-comic-grid .comic-panel img {
    object-fit: contain;
    background: #f5efe6;
  }

  /* Captions */
  .panel-caption {
    position: absolute;
    left: 0; right: 0;
    background: rgba(255,255,210,0.93);
    color: #1a0a00;
    font-family: 'Nunito', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 5px 8px;
    text-align: center;
    line-height: 1.4;
    border-top: 2px solid #1a0a00;
    border-bottom: 2px solid #1a0a00;
    z-index: 5;
  }
  .caption-top { top: 0; border-top: none; }
  .caption-bottom { bottom: 0; border-bottom: none; }

  /* Speech bubbles */
  .speech-bubble {
    position: absolute;
    background: white;
    border: 2px solid #1a0a00;
    border-radius: 10px;
    padding: 4px 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.6rem;
    font-weight: 800;
    color: #1a0a00;
    max-width: 52%;
    line-height: 1.3;
    z-index: 6;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.35);
  }

  /* Tail using ::after — diamond approach */
  .speech-bubble::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    background: white;
  }

  .left-bubble { top: 6%; left: 4%; }
  .left-bubble::after {
    bottom: -5px; left: 10px;
    transform: rotate(45deg);
    border-right: 2px solid #1a0a00;
    border-bottom: 2px solid #1a0a00;
  }

  .right-bubble { top: 6%; right: 4%; text-align: right; }
  .right-bubble::after {
    bottom: -5px; right: 10px;
    transform: rotate(45deg);
    border-left: 2px solid #1a0a00;
    border-bottom: 2px solid #1a0a00;
  }

  .left-bubble.b2 { top: auto; bottom: 22%; }
  .left-bubble.b2::after {
    bottom: auto; top: -5px;
    border-right: none; border-bottom: none;
    border-left: 2px solid #1a0a00;
    border-top: 2px solid #1a0a00;
  }

  .right-bubble.b2 { top: auto; bottom: 22%; }
  .right-bubble.b2::after {
    bottom: auto; top: -5px;
    border-left: none; border-bottom: none;
    border-right: 2px solid #1a0a00;
    border-top: 2px solid #1a0a00;
  }

  .center-bubble {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    max-width: 70%;
    font-size: 0.65rem;
  }
  .center-bubble::after {
    bottom: -5px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-right: 2px solid #1a0a00;
    border-bottom: 2px solid #1a0a00;
  }

  /* Comic navigation */
  .comic-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 0 2px;
  }

  .comic-nav-btn {
    background: #1a0a00;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .comic-nav-btn:hover:not(:disabled) { opacity: 0.8; }
  .comic-nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }

  .comic-dots { display: flex; gap: 8px; align-items: center; }

  .comic-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: #c0b090;
    cursor: pointer;
    border: 2px solid #1a0a00;
    padding: 0;
    transition: background 0.2s;
  }
  .comic-dot.active { background: #1a0a00; }
  .comic-dot:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }

  .comic-page-label {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: #7a6040;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 8px;
  }

  /* Read Comic button on story card */
  .read-comic-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    background: var(--purple);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .read-comic-btn:hover { opacity: 0.85; }

  @media (max-width: 480px) {
    .comic-panel { aspect-ratio: 1 / 1; }
    .speech-bubble { font-size: 0.62rem; line-height: 1.25; padding: 4px 7px; }
    .panel-caption { font-size: 0.62rem; line-height: 1.25; }
    .comic-nav-btn { padding: 8px 14px; font-size: 0.75rem; }
  }


/* ── Story card actions ──────────────────────────────── */
.card-lang-toggle { display:flex; gap:8px; margin:12px 0 10px; }
.story-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:4px; }
.btn-story-read, .btn-story-watch {
  padding:10px 20px; border-radius:24px; font-weight:700; font-size:0.85rem;
  cursor:pointer; border:2px solid transparent; transition:all 0.2s; white-space:nowrap;
}
.btn-story-read {
  background:transparent; border-color:var(--gold); color:var(--gold);
}
.btn-story-read:hover { background:var(--gold); color:#0a0a1a; }
.btn-story-watch {
  background:linear-gradient(135deg,#7c3aed,#4f46e5);
  color:#fff; border-color:transparent;
  box-shadow:0 4px 15px rgba(124,58,237,0.4);
}
.btn-story-watch:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(124,58,237,0.55); }
@media (max-width: 600px) {
  .btn-story-read, .btn-story-watch {
    padding: 13px 18px; font-size: 0.9rem; min-height: 44px;
  }
  .story-actions { gap: 8px; }
  .card-lang-toggle .lang-card-btn { min-height: 36px; padding: 7px 14px; }
}

/* ── Story reader page ────────────────────────────────── */
.reader-topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 24px; background:rgba(255,255,255,0.04);
  border-bottom:1px solid rgba(255,255,255,0.08); position:sticky; top:0; z-index:10;
}
.reader-back-btn {
  display:flex; align-items:center; gap:6px; background:transparent;
  border:1px solid rgba(255,255,255,0.2); color:#ccc; padding:8px 14px;
  border-radius:20px; cursor:pointer; font-size:0.85rem; transition:all 0.2s;
}
.reader-back-btn:hover { border-color:var(--gold); color:var(--gold); }
.reader-lang-toggle { display:flex; gap:8px; }
.story-reader-body {
  max-width:680px; margin:0 auto; padding:40px 24px 80px;
  font-size:1.05rem; line-height:1.85; color:rgba(255,255,255,0.85);
}
.story-reader-body h2 {
  font-family:'Cinzel', serif; color:var(--gold); font-size:1.6rem;
  margin-bottom:32px; text-align:center; line-height:1.3;
}
.story-reader-body p { margin-bottom:1.2em; }
.story-reader-body p:first-of-type::first-letter {
  font-size:3em; font-family:'Cinzel', serif; color:var(--gold);
  float:left; line-height:0.8; margin:4px 8px 0 0;
}
.story-illustration {
  display:block; width:100%; max-width:520px;
  margin:1.8rem auto; border-radius:12px;
  box-shadow:0 4px 24px rgba(0,0,0,0.5);
}
.comic-panel .speech-bubble,
.comic-panel .panel-caption { display:none; }

/* ── Watch & Listen audio bar in comic ───────────────── */
.wal-bar {
  display:flex; align-items:center; gap:12px; justify-content:center;
  background:rgba(124,58,237,0.18); border-bottom:1px solid rgba(124,58,237,0.3);
  padding:10px 20px; flex-wrap:wrap;
}
.wal-bar.hidden { display:none; }
.wal-play-btn {
  background:linear-gradient(135deg,#7c3aed,#4f46e5); color:#fff;
  border:none; border-radius:50%; width:36px; height:36px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.wal-progress-wrap {
  flex:1; min-width:120px; max-width:300px; height:20px;
  background:transparent; cursor:pointer; position:relative;
  display:flex; align-items:center;
}
.wal-progress-wrap::before {
  content:''; position:absolute; left:0; right:0; top:50%; transform:translateY(-50%);
  height:4px; background:rgba(255,255,255,0.15); border-radius:2px;
}
.wal-progress-fill { height:4px; background:#7c3aed; border-radius:2px; width:0; transition:width 0.5s linear; position:relative; z-index:1; }
.wal-time { font-size:0.78rem; color:rgba(255,255,255,0.6); min-width:80px; text-align:center; }
.wal-lang-toggle { display:flex; gap:6px; }
.wal-fullscreen-btn {
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.18);
  color:white;
  border-radius:6px;
  padding:4px 8px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.wal-fullscreen-btn:hover { background:rgba(255,255,255,0.14); }
.wal-exit-btn { display:none; }

body.comic-fullscreen {
  overflow:hidden;
  overscroll-behavior:none;
}
body.comic-fullscreen header,
body.comic-fullscreen .planet {
  display:none;
}
#page-comic.fullscreen-mode {
  position:fixed;
  inset:0;
  z-index:1000;
  padding-top:0;
  min-height:100dvh;
  overflow:hidden;
  background:#f5f0e8;
}
#page-comic.fullscreen-mode .wal-bar {
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:1002;
  padding:8px max(12px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  background:rgba(15,15,46,0.96);
  border-top:1px solid rgba(124,58,237,0.45);
  border-bottom:none;
  box-shadow:0 -8px 28px rgba(0,0,0,0.28);
}
#page-comic.fullscreen-mode .wal-enter-btn { display:none; }
#page-comic.fullscreen-mode .wal-exit-btn { display:inline-flex; align-items:center; }
#page-comic.fullscreen-mode .comic-reader {
  width:100%;
  max-width:none;
  height:100dvh;
  margin:0;
  padding:10px 8px calc(96px + env(safe-area-inset-bottom));
  overflow:auto;
}
#page-comic.fullscreen-mode .comic-back-btn {
  display:none;
}
#page-comic.fullscreen-mode .comic-header {
  margin-bottom:8px;
}
#page-comic.fullscreen-mode .comic-title {
  font-size:0.78rem;
}
#page-comic.fullscreen-mode .comic-grid {
  gap:3px;
}
#page-comic.fullscreen-mode .comic-nav {
  position:sticky;
  bottom:0;
  background:rgba(245,240,232,0.92);
  padding:8px 0 4px;
}
@media (max-width: 560px) {
  #page-comic.fullscreen-mode .wal-bar { gap:8px; justify-content:space-between; }
  #page-comic.fullscreen-mode .wal-progress-wrap { order:2; flex-basis:100%; max-width:none; }
  #page-comic.fullscreen-mode .wal-time { min-width:66px; font-size:0.7rem; }
  #page-comic.fullscreen-mode .lang-btn { padding:5px 8px; font-size:0.68rem; }
  #page-comic.fullscreen-mode .comic-reader { padding-inline:4px; }
}
