/* ============================================================================
   Pod player cosmetics (YIP unlocks). Applied by pod-play.js setting
   data-pod-theme / data-streak-style on <html>. The "-default" keys have no
   rules here — they're the base look. Purely visual; no layout impact.
   ============================================================================ */

/* ── Themes: recolor the progress bar, goal chip, and Start button ─────── */
[data-pod-theme="theme-ocean"] #progressBar { background: linear-gradient(90deg, #0891b2, #22d3ee) !important; }
[data-pod-theme="theme-sunset"] #progressBar { background: linear-gradient(90deg, #f97316, #fbbf24) !important; }
[data-pod-theme="theme-grape"] #progressBar { background: linear-gradient(90deg, #7c3aed, #a78bfa) !important; }
[data-pod-theme="theme-rose"] #progressBar { background: linear-gradient(90deg, #db2777, #f472b6) !important; }

[data-pod-theme="theme-ocean"] #scoreGoalChip { background: rgba(8, 145, 178, 0.14) !important; color: #0e7490 !important; border-color: rgba(8, 145, 178, 0.35) !important; }
[data-pod-theme="theme-sunset"] #scoreGoalChip { background: rgba(249, 115, 22, 0.14) !important; color: #c2410c !important; border-color: rgba(249, 115, 22, 0.35) !important; }
[data-pod-theme="theme-grape"] #scoreGoalChip { background: rgba(124, 58, 237, 0.14) !important; color: #6d28d9 !important; border-color: rgba(124, 58, 237, 0.35) !important; }
[data-pod-theme="theme-rose"] #scoreGoalChip { background: rgba(219, 39, 119, 0.14) !important; color: #be185d !important; border-color: rgba(219, 39, 119, 0.35) !important; }

[data-pod-theme="theme-ocean"] #btnStart { background: linear-gradient(135deg, #0891b2, #06b6d4) !important; box-shadow: 0 6px 20px rgba(8, 145, 178, 0.3) !important; }
[data-pod-theme="theme-sunset"] #btnStart { background: linear-gradient(135deg, #f97316, #f59e0b) !important; box-shadow: 0 6px 20px rgba(249, 115, 22, 0.3) !important; }
[data-pod-theme="theme-grape"] #btnStart { background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important; box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3) !important; }
[data-pod-theme="theme-rose"] #btnStart { background: linear-gradient(135deg, #db2777, #ec4899) !important; box-shadow: 0 6px 20px rgba(219, 39, 119, 0.3) !important; }

/* ── Broadened theme accents ───────────────────────────────────────────────
   The rules above recolor the progress bar / goal chip / Start button. These
   extend the SAME accent to the header underline, the primary action buttons,
   and the selected-answer highlight so the whole player visibly changes — not
   just three small elements. Each real theme exposes its accent as variables;
   theme-default sets none, and the :not(theme-default) guard keeps the base
   look completely untouched. */
[data-pod-theme="theme-ocean"]  { --pod-accent: #0891b2; --pod-accent-2: #22d3ee; --pod-accent-soft: rgba(8, 145, 178, 0.16); }
[data-pod-theme="theme-sunset"] { --pod-accent: #f97316; --pod-accent-2: #fbbf24; --pod-accent-soft: rgba(249, 115, 22, 0.16); }
[data-pod-theme="theme-grape"]  { --pod-accent: #7c3aed; --pod-accent-2: #a78bfa; --pod-accent-soft: rgba(124, 58, 237, 0.16); }
[data-pod-theme="theme-rose"]   { --pod-accent: #db2777; --pod-accent-2: #f472b6; --pod-accent-soft: rgba(219, 39, 119, 0.16); }

/* Accent underline on the header bar — painted via inset shadow so it adds no
   height (no layout shift), keeping the existing drop shadow too. */
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .pod-header {
    box-shadow: inset 0 -3px 0 var(--pod-accent), 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    /* Tint the header BODY (not just the top banner + bottom underline) so the
       whole bar reads on-theme. The accent-soft layer sits over the existing
       dark header colour. */
    background-image: linear-gradient(var(--pod-accent-soft), var(--pod-accent-soft)) !important;
}

/* Primary action buttons (Submit / Continue / Next …) carry the theme accent. */
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .btn-primary:not(:disabled) {
    background: linear-gradient(135deg, var(--pod-accent), var(--pod-accent-2)) !important;
    border-color: var(--pod-accent) !important;
    color: #fff !important;
}
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .btn-primary:not(:disabled):hover {
    filter: brightness(1.08) !important;
}

/* Selected-answer highlight uses the theme accent instead of the default blue.
   :not(.correct):not(.incorrect) preserves the green/red post-grading feedback. */
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .ixl-option.selected:not(.correct):not(.incorrect),
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .ep-option.selected:not(.correct):not(.incorrect),
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .matching-item.selected:not(.correct):not(.incorrect),
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .multiselect-option.selected:not(.correct):not(.incorrect) {
    border-color: var(--pod-accent) !important;
    background: var(--pod-accent-soft) !important;
    box-shadow: 0 0 0 3px var(--pod-accent-soft) !important;
}
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .ixl-option.selected:not(.correct):not(.incorrect) .ixl-option-checkbox {
    color: var(--pod-accent) !important;
}

/* More themed surfaces so a theme is clearly worth the YIP: title icon, the
   running-score chip, the mastery meter fill, the streak widget, progress text,
   and in-content links all carry the accent. */
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .pod-title i { color: var(--pod-accent) !important; }
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #progressText { color: var(--pod-accent) !important; }
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #scoreTracker {
    background: var(--pod-accent-soft) !important;
    border-color: var(--pod-accent) !important;
}
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #scoreTracker #scoreText,
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #scoreTracker #scorePercent,
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #scoreTracker #scoreIcon { color: var(--pod-accent) !important; }
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #mfMasteryMeterFill {
    background: linear-gradient(90deg, var(--pod-accent), var(--pod-accent-2)) !important;
}
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .streak-widget {
    background: var(--pod-accent-soft) !important;
    border-color: var(--pod-accent) !important;
}
html[data-pod-theme]:not([data-pod-theme="theme-default"]) .pod-content a:not(.btn) { color: var(--pod-accent) !important; }

/* BOLD: an ambient themed glow across the whole player background (dark mode) +
   a soft glow around the content card. This is what makes a theme actually feel
   different at a glance, not just recolored accents. */
html[data-pod-theme="theme-ocean"][data-theme="dark"]  body { background-image: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(6,182,212,0.22), transparent 60%), radial-gradient(circle at 88% 105%, rgba(6,182,212,0.12), transparent 45%) !important; background-attachment: fixed !important; }
html[data-pod-theme="theme-sunset"][data-theme="dark"] body { background-image: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(249,115,22,0.20), transparent 60%), radial-gradient(circle at 88% 105%, rgba(251,113,133,0.12), transparent 45%) !important; background-attachment: fixed !important; }
html[data-pod-theme="theme-grape"][data-theme="dark"]  body { background-image: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(168,85,247,0.24), transparent 60%), radial-gradient(circle at 88% 105%, rgba(124,58,237,0.14), transparent 45%) !important; background-attachment: fixed !important; }
html[data-pod-theme="theme-rose"][data-theme="dark"]   body { background-image: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(236,72,153,0.20), transparent 60%), radial-gradient(circle at 88% 105%, rgba(219,39,119,0.12), transparent 45%) !important; background-attachment: fixed !important; }

html[data-pod-theme]:not([data-pod-theme="theme-default"]) .pod-content { box-shadow: 0 0 60px var(--pod-accent-soft) !important; }

/* ── Theme drives the streak flame + banner too (one coordinated pack) ──── */
[data-pod-theme="theme-ocean"]  .streak-fire i, [data-pod-theme="theme-ocean"]  .streak-count { color: #06b6d4 !important; }
[data-pod-theme="theme-ocean"]  .streak-widget { border-color: rgba(6,182,212,0.45) !important; }
[data-pod-theme="theme-ocean"]  .pod-banner-strip { display: block; background: linear-gradient(90deg, #0891b2, #22d3ee, #06b6d4); }

[data-pod-theme="theme-sunset"] .streak-fire i, [data-pod-theme="theme-sunset"] .streak-count { color: #f97316 !important; }
[data-pod-theme="theme-sunset"] .streak-widget { border-color: rgba(249,115,22,0.45) !important; }
[data-pod-theme="theme-sunset"] .pod-banner-strip { display: block; background: linear-gradient(90deg, #fb7185, #f97316, #fbbf24); }

[data-pod-theme="theme-grape"]  .streak-fire i, [data-pod-theme="theme-grape"]  .streak-count { color: #a855f7 !important; }
[data-pod-theme="theme-grape"]  .streak-widget { border-color: rgba(168,85,247,0.45) !important; }
[data-pod-theme="theme-grape"]  .pod-banner-strip { display: block; background: linear-gradient(90deg, #312e81, #7c3aed, #a855f7); }

[data-pod-theme="theme-rose"]   .streak-fire i, [data-pod-theme="theme-rose"]   .streak-count { color: #ec4899 !important; }
[data-pod-theme="theme-rose"]   .streak-widget { border-color: rgba(236,72,153,0.45) !important; }
[data-pod-theme="theme-rose"]   .pod-banner-strip { display: block; background: linear-gradient(90deg, #db2777, #ec4899, #f472b6); }

/* Generic accent rules so EVERY theme (incl. premium) recolors the core
   elements from --pod-accent — no per-theme duplication needed. */
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #progressBar { background: linear-gradient(90deg, var(--pod-accent), var(--pod-accent-2)) !important; }
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #btnStart { background: linear-gradient(135deg, var(--pod-accent), var(--pod-accent-2)) !important; box-shadow: 0 6px 20px var(--pod-accent-soft) !important; }
html[data-pod-theme]:not([data-pod-theme="theme-default"]) #scoreGoalChip { background: var(--pod-accent-soft) !important; color: var(--pod-accent) !important; border-color: var(--pod-accent) !important; }

/* ── PREMIUM animated themes — a slowly drifting gradient makes them feel
   alive (vs the static themes), justifying the higher YIP price. ──────────── */
@keyframes podBgDrift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
html[data-pod-theme="theme-aurora"] { --pod-accent:#34d399; --pod-accent-2:#22d3ee; --pod-accent-soft:rgba(52,211,153,0.18); }
html[data-pod-theme="theme-galaxy"] { --pod-accent:#a855f7; --pod-accent-2:#60a5fa; --pod-accent-soft:rgba(124,58,237,0.20); }
html[data-pod-theme="theme-aurora"] .streak-fire i, html[data-pod-theme="theme-aurora"] .streak-count { color:#34d399!important; }
html[data-pod-theme="theme-galaxy"] .streak-fire i, html[data-pod-theme="theme-galaxy"] .streak-count { color:#a855f7!important; }
html[data-pod-theme="theme-aurora"] .streak-widget, html[data-pod-theme="theme-galaxy"] .streak-widget { border-color: var(--pod-accent) !important; }
html[data-pod-theme="theme-aurora"] .pod-banner-strip { display:block; background:linear-gradient(90deg,#0891b2,#22d3ee,#34d399,#a855f7); background-size:220% 100%; animation:podBgDrift 12s ease infinite; }
html[data-pod-theme="theme-galaxy"] .pod-banner-strip { display:block; background:linear-gradient(90deg,#312e81,#7c3aed,#3b82f6,#a855f7); background-size:220% 100%; animation:podBgDrift 12s ease infinite; }
html[data-pod-theme="theme-aurora"][data-theme="dark"] body { background-image:linear-gradient(125deg,#0a241c,#0f3a30,#0c3344,#0a241c)!important; background-size:280% 280%!important; background-attachment:fixed!important; animation:podBgDrift 20s ease infinite!important; }
html[data-pod-theme="theme-galaxy"][data-theme="dark"] body { background-image:linear-gradient(125deg,#16112f,#2a1858,#1a2468,#16112f)!important; background-size:280% 280%!important; background-attachment:fixed!important; animation:podBgDrift 20s ease infinite!important; }

/* ── Streak flame color: recolor the FA flame + the count/border ───────── */
/* Base = ember (orange). The flame is now a FontAwesome glyph, so color is exact. */
.streak-fire i { color: #f59e0b; transition: color 0.2s ease; }

[data-streak-style="streak-blue"] .streak-fire i { color: #3b82f6; }
[data-streak-style="streak-blue"] .streak-count { color: #3b82f6 !important; }
[data-streak-style="streak-blue"] .streak-widget { border-color: rgba(59, 130, 246, 0.45) !important; }

[data-streak-style="streak-green"] .streak-fire i { color: #22c55e; }
[data-streak-style="streak-green"] .streak-count { color: #22c55e !important; }
[data-streak-style="streak-green"] .streak-widget { border-color: rgba(34, 197, 94, 0.45) !important; }

[data-streak-style="streak-violet"] .streak-fire i { color: #a855f7; }
[data-streak-style="streak-violet"] .streak-count { color: #a855f7 !important; }
[data-streak-style="streak-violet"] .streak-widget { border-color: rgba(168, 85, 247, 0.45) !important; }

[data-streak-style="streak-gold"] .streak-fire i { color: #eab308; }
[data-streak-style="streak-gold"] .streak-count { color: #eab308 !important; }
[data-streak-style="streak-gold"] .streak-widget { border-color: rgba(234, 179, 8, 0.5) !important; }

/* ── Avatar (equipped glyph in a colored circle; JS sets bg + icon) ─────── */
.pod-avatar {
    width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #64748b; color: #fff; font-size: 15px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    overflow: hidden;
}
.pod-avatar svg { width: 100%; height: 100%; display: block; }

/* ── Banner: decorative strip across the top of the player ──────────────── */
.pod-banner-strip { display: none; width: 100%; height: 10px; }
[data-pod-banner="banner-aurora"] .pod-banner-strip { display: block; background: linear-gradient(90deg, #22d3ee, #34d399, #a855f7); }
[data-pod-banner="banner-sunset"] .pod-banner-strip { display: block; background: linear-gradient(90deg, #fb7185, #f97316, #fbbf24); }
[data-pod-banner="banner-galaxy"] .pod-banner-strip { display: block; background: linear-gradient(90deg, #312e81, #7c3aed, #a855f7); }
[data-pod-banner="banner-mint"] .pod-banner-strip { display: block; background: linear-gradient(90deg, #34d399, #22d3ee); }

/* ── Customize button + store modal ────────────────────────────────────── */
#cosmeticStoreOverlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.cos-modal {
    background: #1a2332; color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px;
    width: 100%; max-width: 540px; max-height: 86vh; overflow-y: auto;
    padding: 20px;
}
.cos-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cos-head h3 { margin: 0; font-size: 17px; }
.cos-balance { font-size: 13px; font-weight: 700; color: #fbbf24; display: inline-flex; align-items: center; gap: 5px; }
.cos-sub { font-size: 12px; color: #94a3b8; margin-bottom: 14px; }
.cos-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #94a3b8; margin: 14px 0 8px; }
.cos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cos-card { border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 12px; background: #131a26; display: flex; flex-direction: column; gap: 8px; }
.cos-card.cos-equipped { border-color: #00e0ff; box-shadow: 0 0 0 2px rgba(0, 224, 255, 0.25); }
.cos-swatch { height: 30px; border-radius: 8px; }
.cos-swatch-avatar { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.cos-name { font-size: 13px; font-weight: 600; }
.cos-btn { appearance: none; border: none; border-radius: 8px; padding: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.cos-btn-buy { background: linear-gradient(135deg, #00e0ff, #0891b2); color: #06222a; }
.cos-btn-buy:disabled { background: #334155; color: #64748b; cursor: default; }
.cos-btn-equip { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.15); }
.cos-btn-equipped { background: transparent; color: #00e0ff; border: 1px solid #00e0ff; cursor: default; }
.cos-close { appearance: none; background: transparent; border: 1px solid rgba(255, 255, 255, 0.15); color: #94a3b8; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.cos-msg { font-size: 12px; min-height: 16px; margin-top: 10px; }

/* Loading / error states for the shop modal (so the palette button always
   gives visible feedback instead of appearing dead). */
.cos-state { font-size: 13px; color: #94a3b8; text-align: center; padding: 22px 6px; }
.cos-state-error { color: #f87171; }
