/* ============================================================
   ANIME PLAYER - MODERN DARK GLASSMORPHISM STYLESHEET
   ============================================================ */

:root {
  --bg-main: #090c15;
  --bg-card: #111625;
  --bg-card-hover: #171f33;
  --bg-elevated: #1a2238;
  --bg-input: #0d121f;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-family);
  --bg-navbar: rgba(9, 12, 21, 0.88);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(37, 99, 235, 0.45);
}

/* ================= COLOR THEMES ================= */
[data-theme="classic"] {
  --bg-main: #090c15;
  --bg-card: #111625;
  --bg-card-hover: #171f33;
  --bg-elevated: #1a2238;
  --bg-input: #0d121f;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --bg-navbar: rgba(9, 12, 21, 0.88);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(37, 99, 235, 0.45);
}

[data-theme="fantasy"] {
  --bg-main: #120b06;
  --bg-card: #1e1209;
  --bg-card-hover: #2b1a0d;
  --bg-elevated: #2a190d;
  --bg-input: #0d0704;
  --accent-primary: #d4a24c;
  --accent-primary-hover: #b9842f;
  --accent-cyan: #e8b45b;
  --accent-amber: #f0c06a;
  --accent-green: #8fa36a;
  --accent-red: #b5432f;
  --text-main: #f4e4c5;
  --text-muted: #c2a479;
  --text-dim: #8e7453;
  --border-subtle: rgba(212, 162, 76, 0.22);
  --border-focus: rgba(212, 162, 76, 0.55);
  --bg-navbar: rgba(18, 11, 6, 0.94);
  --accent-contrast: #1b1006;
  --logo-shadow: rgba(212, 162, 76, 0.4);
  --shadow-glow: 0 0 24px rgba(212, 162, 76, 0.22);
  --font-display: Georgia, 'Times New Roman', serif;
}

[data-theme="navy"] {
  --bg-main: #0a1322;
  --bg-card: #0f1c31;
  --bg-card-hover: #152640;
  --bg-elevated: #172a46;
  --bg-input: #08111e;
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-cyan: #38bdf8;
  --accent-amber: #fbbf24;
  --accent-green: #10b981;
  --accent-red: #f87171;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-focus: rgba(59, 130, 246, 0.5);
  --bg-navbar: rgba(10, 19, 34, 0.92);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(59, 130, 246, 0.45);
}

[data-theme="oled"] {
  --bg-main: #000000;
  --bg-card: #0b0b0b;
  --bg-card-hover: #141414;
  --bg-elevated: #181818;
  --bg-input: #050505;
  --accent-primary: #22d3ee;
  --accent-primary-hover: #06b6d4;
  --accent-cyan: #67e8f9;
  --accent-amber: #fbbf24;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --text-main: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dim: #737373;
  --border-subtle: #242424;
  --border-focus: rgba(34, 211, 238, 0.5);
  --bg-navbar: rgba(0, 0, 0, 0.92);
  --accent-contrast: #001014;
  --logo-shadow: rgba(34, 211, 238, 0.35);
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.2);
}

[data-theme="cyberpunk"] {
  --bg-main: #0b0514;
  --bg-card: #170a26;
  --bg-card-hover: #211033;
  --bg-elevated: #25123a;
  --bg-input: #08030f;
  --accent-primary: #ff2e63;
  --accent-primary-hover: #e11d48;
  --accent-cyan: #22d3ee;
  --accent-amber: #facc15;
  --accent-green: #34d399;
  --accent-red: #fb7185;
  --text-main: #f8ecff;
  --text-muted: #b9a3d0;
  --text-dim: #8b6fa3;
  --border-subtle: rgba(255, 46, 99, 0.22);
  --border-focus: rgba(255, 46, 99, 0.55);
  --bg-navbar: rgba(11, 5, 20, 0.94);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(255, 46, 99, 0.45);
  --shadow-glow: 0 0 22px rgba(255, 46, 99, 0.25);
}

[data-theme="emerald"] {
  --bg-main: #04120d;
  --bg-card: #082018;
  --bg-card-hover: #0c2a1f;
  --bg-elevated: #0d2c21;
  --bg-input: #020a07;
  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-cyan: #34d399;
  --accent-amber: #fbbf24;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --text-main: #eafff6;
  --text-muted: #9ac9b8;
  --text-dim: #6f9c8b;
  --border-subtle: rgba(16, 185, 129, 0.18);
  --border-focus: rgba(16, 185, 129, 0.5);
  --bg-navbar: rgba(4, 18, 13, 0.94);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(16, 185, 129, 0.4);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.22);
}

[data-theme="purple"] {
  --bg-main: #0d0716;
  --bg-card: #180b2a;
  --bg-card-hover: #221038;
  --bg-elevated: #24113c;
  --bg-input: #08030e;
  --accent-primary: #a855f7;
  --accent-primary-hover: #9333ea;
  --accent-cyan: #c084fc;
  --accent-amber: #fbbf24;
  --accent-green: #34d399;
  --accent-red: #fb7185;
  --text-main: #f6edff;
  --text-muted: #b9a4d0;
  --text-dim: #8f75a8;
  --border-subtle: rgba(168, 85, 247, 0.2);
  --border-focus: rgba(168, 85, 247, 0.55);
  --bg-navbar: rgba(13, 7, 22, 0.94);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(168, 85, 247, 0.4);
  --shadow-glow: 0 0 22px rgba(168, 85, 247, 0.25);
}

[data-theme="light"] {
  --bg-main: #eef2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-cyan: #0891b2;
  --accent-amber: #d97706;
  --accent-green: #059669;
  --accent-red: #dc2626;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-focus: rgba(37, 99, 235, 0.45);
  --bg-navbar: rgba(255, 255, 255, 0.9);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(37, 99, 235, 0.3);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.18);
}

[data-theme="limesky"] {
  --bg-main: #baf3d7;
  --bg-card: rgba(255, 255, 255, 0.64);
  --bg-card-hover: rgba(255, 255, 255, 0.8);
  --bg-elevated: rgba(255, 255, 255, 0.5);
  --bg-input: rgba(255, 255, 255, 0.64);
  --accent-primary: #ec4899;
  --accent-primary-hover: #db2777;
  --accent-cyan: #0369a1;
  --accent-amber: #d97706;
  --accent-green: #15803d;
  --accent-red: #dc2626;
  --text-main: #0b1f1a;
  --text-muted: #274b42;
  --text-dim: #3f6259;
  --border-subtle: rgba(8, 47, 73, 0.16);
  --border-focus: rgba(236, 72, 153, 0.45);
  --bg-navbar: rgba(2, 132, 199, 0.84);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(2, 132, 199, 0.35);
  --shadow-glow: 0 0 22px rgba(236, 72, 153, 0.22);
}

[data-theme="sakura"] {
  --bg-main: #f7c6e0;
  --bg-card: rgba(255, 255, 255, 0.64);
  --bg-card-hover: rgba(255, 255, 255, 0.8);
  --bg-elevated: rgba(255, 255, 255, 0.5);
  --bg-input: rgba(255, 255, 255, 0.66);
  --accent-primary: #ec4899;
  --accent-primary-hover: #db2777;
  --accent-cyan: #be185d;
  --accent-amber: #d97706;
  --accent-green: #15803d;
  --accent-red: #dc2626;
  --text-main: #2b1024;
  --text-muted: #5b2a45;
  --text-dim: #71445a;
  --border-subtle: rgba(76, 5, 25, 0.16);
  --border-focus: rgba(236, 72, 153, 0.45);
  --bg-navbar: rgba(190, 24, 93, 0.84);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(190, 24, 93, 0.35);
  --shadow-glow: 0 0 22px rgba(236, 72, 153, 0.22);
}

[data-theme="kyoto"] {
  --bg-main: #8fe6a9;
  --bg-card: rgba(255, 255, 255, 0.66);
  --bg-card-hover: rgba(255, 255, 255, 0.82);
  --bg-elevated: rgba(255, 255, 255, 0.52);
  --bg-input: rgba(255, 255, 255, 0.68);
  --accent-primary: #e11d48;
  --accent-primary-hover: #be123c;
  --accent-cyan: #047857;
  --accent-amber: #b45309;
  --accent-green: #15803d;
  --accent-red: #dc2626;
  --text-main: #052e16;
  --text-muted: #27543d;
  --text-dim: #3e6b52;
  --border-subtle: rgba(6, 78, 59, 0.16);
  --border-focus: rgba(225, 29, 72, 0.42);
  --bg-navbar: rgba(21, 128, 61, 0.86);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(21, 128, 61, 0.35);
  --shadow-glow: 0 0 22px rgba(225, 29, 72, 0.2);
}

[data-theme="cloudy"] {
  --bg-main: #a7e3f7;
  --bg-card: rgba(255, 255, 255, 0.66);
  --bg-card-hover: rgba(255, 255, 255, 0.82);
  --bg-elevated: rgba(255, 255, 255, 0.52);
  --bg-input: rgba(255, 255, 255, 0.68);
  --accent-primary: #ef4444;
  --accent-primary-hover: #dc2626;
  --accent-cyan: #0369a1;
  --accent-amber: #b45309;
  --accent-green: #15803d;
  --accent-red: #dc2626;
  --text-main: #0c1a2b;
  --text-muted: #27445f;
  --text-dim: #3f607a;
  --border-subtle: rgba(12, 74, 110, 0.16);
  --border-focus: rgba(239, 68, 68, 0.42);
  --bg-navbar: rgba(37, 99, 235, 0.78);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(37, 99, 235, 0.35);
  --shadow-glow: 0 0 22px rgba(239, 68, 68, 0.2);
}

[data-theme="nightcity"] {
  --bg-main: #05070a;
  --bg-card: #081016;
  --bg-card-hover: #0c1821;
  --bg-elevated: #0b141c;
  --bg-input: #030608;
  --accent-primary: #f5e642;
  --accent-primary-hover: #ffe83d;
  --accent-cyan: #22e6ff;
  --accent-amber: #ffb020;
  --accent-green: #3dff7a;
  --accent-red: #ff2e4d;
  --text-main: #edf2df;
  --text-muted: #9aaa9c;
  --text-dim: #68786c;
  --border-subtle: rgba(245, 230, 66, 0.28);
  --border-focus: rgba(245, 230, 66, 0.62);
  --bg-navbar: rgba(4, 8, 10, 0.94);
  --accent-contrast: #050806;
  --logo-shadow: rgba(245, 230, 66, 0.35);
  --shadow-glow: 0 0 18px rgba(245, 230, 66, 0.22);
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --font-family: 'Cascadia Code', 'Consolas', 'JetBrains Mono', monospace;
  --font-display: var(--font-family);
}

[data-theme="edgerunners"] {
  --bg-main: #040a0e;
  --bg-card: #06121a;
  --bg-card-hover: #0a1b25;
  --bg-elevated: #091821;
  --bg-input: #02070a;
  --accent-primary: #22e6ff;
  --accent-primary-hover: #00c8e0;
  --accent-cyan: #22e6ff;
  --accent-amber: #ffb020;
  --accent-green: #3dff7a;
  --accent-red: #ff3dbd;
  --text-main: #e2f9ff;
  --text-muted: #8eb2bf;
  --text-dim: #5d7c89;
  --border-subtle: rgba(34, 230, 255, 0.28);
  --border-focus: rgba(34, 230, 255, 0.62);
  --bg-navbar: rgba(3, 8, 12, 0.94);
  --accent-contrast: #001217;
  --logo-shadow: rgba(34, 230, 255, 0.35);
  --shadow-glow: 0 0 18px rgba(34, 230, 255, 0.22);
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --font-family: 'Cascadia Code', 'Consolas', 'JetBrains Mono', monospace;
  --font-display: var(--font-family);
}

[data-theme="arasaka"] {
  --bg-main: #0a0406;
  --bg-card: #12070b;
  --bg-card-hover: #1d0a10;
  --bg-elevated: #18080d;
  --bg-input: #060204;
  --accent-primary: #ff2e4d;
  --accent-primary-hover: #e11d3a;
  --accent-cyan: #22e6ff;
  --accent-amber: #f5e642;
  --accent-green: #3dff7a;
  --accent-red: #ff2e4d;
  --text-main: #ffe9ed;
  --text-muted: #b88d96;
  --text-dim: #805e66;
  --border-subtle: rgba(255, 46, 77, 0.3);
  --border-focus: rgba(255, 46, 77, 0.62);
  --bg-navbar: rgba(8, 3, 5, 0.95);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(255, 46, 77, 0.35);
  --shadow-glow: 0 0 18px rgba(255, 46, 77, 0.24);
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --font-family: 'Cascadia Code', 'Consolas', 'JetBrains Mono', monospace;
  --font-display: var(--font-family);
}

[data-theme="netrunner"] {
  --bg-main: #020805;
  --bg-card: #04110a;
  --bg-card-hover: #071d11;
  --bg-elevated: #06180e;
  --bg-input: #010603;
  --accent-primary: #3dff7a;
  --accent-primary-hover: #18e85c;
  --accent-cyan: #22e6ff;
  --accent-amber: #f5e642;
  --accent-green: #3dff7a;
  --accent-red: #ff2e4d;
  --text-main: #e0ffe9;
  --text-muted: #8fbca0;
  --text-dim: #5d826b;
  --border-subtle: rgba(61, 255, 122, 0.26);
  --border-focus: rgba(61, 255, 122, 0.6);
  --bg-navbar: rgba(2, 7, 4, 0.95);
  --accent-contrast: #001407;
  --logo-shadow: rgba(61, 255, 122, 0.35);
  --shadow-glow: 0 0 18px rgba(61, 255, 122, 0.22);
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --font-family: 'Cascadia Code', 'Consolas', 'JetBrains Mono', monospace;
  --font-display: var(--font-family);
}

[data-theme="berserk"] {
  --bg-main: #050102;
  --bg-card: #0f0204;
  --bg-card-hover: #170307;
  --bg-elevated: #140308;
  --bg-input: #070102;
  --accent-primary: #e31937;
  --accent-primary-hover: #ff2445;
  --accent-cyan: #ff6b81;
  --accent-amber: #f5c542;
  --accent-green: #a3b18a;
  --accent-red: #ff2445;
  --text-main: #f3e6e7;
  --text-muted: #b98c92;
  --text-dim: #7d5b61;
  --border-subtle: rgba(227, 25, 55, 0.32);
  --border-focus: rgba(227, 25, 55, 0.65);
  --bg-navbar: rgba(5, 1, 2, 0.95);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(227, 25, 55, 0.42);
  --shadow-glow: 0 0 24px rgba(227, 25, 55, 0.25);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
}

[data-theme="berserksteel"] {
  --bg-main: #080a0c;
  --bg-card: #11161a;
  --bg-card-hover: #182026;
  --bg-elevated: #161d23;
  --bg-input: #05080a;
  --accent-primary: #c7d0d9;
  --accent-primary-hover: #e6edf3;
  --accent-cyan: #e31937;
  --accent-amber: #f5c542;
  --accent-green: #a3b18a;
  --accent-red: #e31937;
  --text-main: #edf1f4;
  --text-muted: #a2adb6;
  --text-dim: #707b84;
  --border-subtle: rgba(199, 208, 217, 0.24);
  --border-focus: rgba(199, 208, 217, 0.55);
  --bg-navbar: rgba(5, 8, 10, 0.95);
  --accent-contrast: #080b0e;
  --logo-shadow: rgba(199, 208, 217, 0.32);
  --shadow-glow: 0 0 22px rgba(199, 208, 217, 0.18);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
}

[data-theme="berserkviolet"] {
  --bg-main: #08020d;
  --bg-card: #13061c;
  --bg-card-hover: #1c0a29;
  --bg-elevated: #180824;
  --bg-input: #050108;
  --accent-primary: #a855f7;
  --accent-primary-hover: #c084fc;
  --accent-cyan: #e31937;
  --accent-amber: #f5c542;
  --accent-green: #a3b18a;
  --accent-red: #e31937;
  --text-main: #f2e8ff;
  --text-muted: #b69ac9;
  --text-dim: #80618f;
  --border-subtle: rgba(168, 85, 247, 0.28);
  --border-focus: rgba(168, 85, 247, 0.6);
  --bg-navbar: rgba(6, 1, 9, 0.95);
  --accent-contrast: #0b0212;
  --logo-shadow: rgba(168, 85, 247, 0.4);
  --shadow-glow: 0 0 24px rgba(168, 85, 247, 0.24);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
}

[data-theme="berserkember"] {
  --bg-main: #0a0502;
  --bg-card: #171006;
  --bg-card-hover: #211708;
  --bg-elevated: #1e1408;
  --bg-input: #070301;
  --accent-primary: #e0a12a;
  --accent-primary-hover: #f5c542;
  --accent-cyan: #e31937;
  --accent-amber: #f5c542;
  --accent-green: #a3b18a;
  --accent-red: #e31937;
  --text-main: #f6ead7;
  --text-muted: #c0a67d;
  --text-dim: #8a7351;
  --border-subtle: rgba(224, 161, 42, 0.28);
  --border-focus: rgba(224, 161, 42, 0.6);
  --bg-navbar: rgba(8, 4, 2, 0.95);
  --accent-contrast: #120a02;
  --logo-shadow: rgba(224, 161, 42, 0.38);
  --shadow-glow: 0 0 24px rgba(224, 161, 42, 0.22);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
}

[data-theme="grandlinegold"] {
  --bg-main: #0b0a06;
  --bg-card: #151109;
  --bg-card-hover: #20190e;
  --bg-elevated: #1b150b;
  --bg-input: #070603;
  --accent-primary: #d6a43a;
  --accent-primary-hover: #f0bf4c;
  --accent-cyan: #38bdf8;
  --accent-amber: #f5c542;
  --accent-green: #4ade80;
  --accent-red: #ef4444;
  --text-main: #f7ead0;
  --text-muted: #c5ab7f;
  --text-dim: #8c7450;
  --border-subtle: rgba(214, 164, 58, 0.3);
  --border-focus: rgba(214, 164, 58, 0.58);
  --bg-navbar: rgba(8, 7, 4, 0.96);
  --accent-contrast: #1a1206;
  --logo-shadow: rgba(214, 164, 58, 0.38);
  --shadow-glow: 0 0 26px rgba(214, 164, 58, 0.2);
  --wanted-paper: #efe0bc;
  --wanted-ink: #2a1b0d;
  --wanted-line: #b08a3e;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
}

[data-theme="grandlinemarine"] {
  --bg-main: #06111f;
  --bg-card: #0b1f34;
  --bg-card-hover: #112b47;
  --bg-elevated: #0e263f;
  --bg-input: #040c16;
  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-cyan: #38bdf8;
  --accent-amber: #e0b54a;
  --accent-green: #34d399;
  --accent-red: #ef4444;
  --text-main: #e8f6ff;
  --text-muted: #9fbfd6;
  --text-dim: #6f8ea5;
  --border-subtle: rgba(56, 189, 248, 0.3);
  --border-focus: rgba(56, 189, 248, 0.6);
  --bg-navbar: rgba(4, 16, 28, 0.96);
  --accent-contrast: #04131f;
  --logo-shadow: rgba(56, 189, 248, 0.38);
  --shadow-glow: 0 0 26px rgba(56, 189, 248, 0.22);
  --wanted-paper: #e8f1f8;
  --wanted-ink: #102434;
  --wanted-line: #6d93ab;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
}

[data-theme="grandlineemperor"] {
  --bg-main: #130b1e;
  --bg-card: #1e1230;
  --bg-card-hover: #2a1a43;
  --bg-elevated: #25153a;
  --bg-input: #0b0614;
  --accent-primary: #b06cff;
  --accent-primary-hover: #c995ff;
  --accent-cyan: #f472b6;
  --accent-amber: #f0b84a;
  --accent-green: #34d399;
  --accent-red: #ef4444;
  --text-main: #f7ecff;
  --text-muted: #c2a8d8;
  --text-dim: #8d73a6;
  --border-subtle: rgba(176, 108, 255, 0.3);
  --border-focus: rgba(176, 108, 255, 0.6);
  --bg-navbar: rgba(14, 7, 24, 0.96);
  --accent-contrast: #12061e;
  --logo-shadow: rgba(176, 108, 255, 0.4);
  --shadow-glow: 0 0 26px rgba(176, 108, 255, 0.22);
  --wanted-paper: #efe4f7;
  --wanted-ink: #2a1738;
  --wanted-line: #9b74b8;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
}

[data-theme="grandlinegear5"] {
  --bg-main: #171105;
  --bg-card: #241a09;
  --bg-card-hover: #31240d;
  --bg-elevated: #2b1f0b;
  --bg-input: #0d0902;
  --accent-primary: #f5c542;
  --accent-primary-hover: #ffdc6a;
  --accent-cyan: #ef4444;
  --accent-amber: #f5c542;
  --accent-green: #34d399;
  --accent-red: #ef4444;
  --text-main: #fff8e0;
  --text-muted: #d8bd82;
  --text-dim: #9c8251;
  --border-subtle: rgba(245, 197, 66, 0.34);
  --border-focus: rgba(245, 197, 66, 0.63);
  --bg-navbar: rgba(18, 13, 4, 0.96);
  --accent-contrast: #1a1204;
  --logo-shadow: rgba(245, 197, 66, 0.42);
  --shadow-glow: 0 0 26px rgba(245, 197, 66, 0.24);
  --wanted-paper: #fff5d7;
  --wanted-ink: #33220a;
  --wanted-line: #c39a45;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-xl: 10px;
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
}

[data-theme="grandlineocean"] {
  --bg-main: #0a3a5c;
  --bg-card: #0c3553;
  --bg-card-hover: #124362;
  --bg-elevated: #0e3b5b;
  --bg-input: #06283f;
  --accent-primary: #f5c542;
  --accent-primary-hover: #ffdc6a;
  --accent-cyan: #22d3ee;
  --accent-amber: #f5c542;
  --accent-green: #34d399;
  --accent-red: #ef4444;
  --text-main: #f7f1dd;
  --text-muted: #bed8df;
  --text-dim: #82a8b6;
  --border-subtle: rgba(245, 197, 66, 0.3);
  --border-focus: rgba(245, 197, 66, 0.58);
  --bg-navbar: rgba(25, 14, 7, 0.96);
  --accent-contrast: #1a1204;
  --logo-shadow: rgba(245, 197, 66, 0.4);
  --shadow-glow: 0 0 28px rgba(34, 211, 238, 0.22);
  --wanted-paper: #f4e2b8;
  --wanted-ink: #2b1b0b;
  --wanted-line: #b8863b;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --font-display: "Russo One", "Oswald", "Trebuchet MS", sans-serif;
}

[data-theme="bleach"] {
  --bg-main: #050506;
  --bg-card: #0d0d10;
  --bg-card-hover: #16161a;
  --bg-elevated: #18181c;
  --bg-input: #08080a;
  --accent-primary: #c8102e;
  --accent-primary-hover: #e01b2e;
  --accent-cyan: #e9e4dc;
  --accent-amber: #c8102e;
  --accent-green: #7fae8b;
  --accent-red: #e01b2e;
  --text-main: #f2eee7;
  --text-muted: #a8a29a;
  --text-dim: #7b766f;
  --border-subtle: rgba(200, 16, 46, 0.26);
  --border-focus: rgba(224, 27, 46, 0.58);
  --bg-navbar: rgba(4, 4, 5, 0.96);
  --accent-contrast: #ffffff;
  --logo-shadow: rgba(200, 16, 46, 0.38);
  --shadow-glow: 0 0 26px rgba(200, 16, 46, 0.26);
  --wanted-paper: #e7e1d7;
  --wanted-ink: #16100f;
  --wanted-line: #7d5c58;
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-xl: 6px;
  --font-display: "Oswald", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Global utility classes */
.hidden {
  display: none !important;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ================= HEADER / NAVBAR ================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-navbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  height: 68px;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.nav-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 0 10px var(--logo-shadow));
  transition: transform 0.2s ease;
}

.logo:hover .nav-logo-img {
  transform: scale(1.06);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.logo-text .accent {
  color: var(--accent-primary);
}

/* UI Icons */
.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ui-icon-fill {
  fill: currentColor;
  stroke: none;
}

.ui-icon-spin {
  animation: spin 1s linear infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 9px 36px 9px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--border-focus);
  /* Keep width: 100% so focus does not overflow the 280px .search-box. */
}

.search-clear-btn {
  position: absolute;
  right: 32px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}
.search-clear-btn:hover { color: var(--text-main); }

.search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
}

.search-btn:hover {
  color: var(--accent-cyan);
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
}

/* User menu */
.user-menu-wrap {
  position: relative;
}

.user-menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
}

.user-menu-icon {
  width: 19px;
  height: 19px;
}

.user-menu-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border: 2px solid var(--bg-main);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-green);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 4000;
  width: 232px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  animation: modalPop 0.15s ease;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
}

.user-menu-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--accent-primary);
}

.user-menu-avatar svg {
  width: 20px;
  height: 20px;
}

.user-menu-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-menu-info strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-info span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-subtle);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-menu-item:hover {
  background: var(--bg-elevated);
}

.user-menu-item .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.user-menu-item:hover .ui-icon {
  color: var(--accent-cyan);
}

.user-menu-item-danger {
  color: #fca5a5;
}

.user-menu-item-danger .ui-icon {
  color: #fca5a5;
}

.user-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.user-menu-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.user-menu-item:disabled:hover {
  background: transparent;
}

.shiki-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.shiki-badge.not-connected {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.shiki-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

.shiki-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.shiki-badge.connected .shiki-dot {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* ================= TOAST NOTIFICATION ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast.toast-success { border-left: 4px solid var(--accent-green); }
.toast.toast-info { border-left: 4px solid var(--accent-cyan); }
.toast.toast-warn { border-left: 4px solid var(--accent-amber); }

.toast-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.toast.toast-success .toast-icon-wrap { color: var(--accent-green); }
.toast.toast-info .toast-icon-wrap { color: var(--accent-cyan); }
.toast.toast-warn .toast-icon-wrap { color: var(--accent-amber); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= MAIN CONTENT ================= */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.page-view {
  display: block;
}

.page-view.hidden {
  display: none;
}

/* Continue Watching Shelf */
.shelf-section {
  margin-bottom: 36px;
  background: linear-gradient(180deg, rgba(23, 31, 51, 0.4) 0%, rgba(17, 22, 37, 0) 100%);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.continue-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.continue-card {
  display: flex;
  min-height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.continue-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.continue-poster {
  width: 90px;
  height: 120px;
  object-fit: cover;
  flex-shrink: 0;
}

.continue-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.continue-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.continue-ep {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 4px;
}

.continue-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.continue-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
}

/* Catalog Header & Filters */
.catalog-header {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.catalog-title-box h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.catalog-title-box p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.custom-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select:focus {
  border-color: var(--accent-primary);
}

/* ================= ANIME GRID & CARDS ================= */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.anime-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.anime-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}

.card-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0e121d;
  line-height: 0;
}

.card-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.continue-poster,
.history-item-poster,
.related-poster,
.image-result-poster {
  display: block;
}

.anime-card:hover .card-poster {
  transform: scale(1.05);
}

.badge-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: #facc15;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(250, 204, 21, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-kind-floating {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(9, 12, 21, 0.85);
  backdrop-filter: blur(6px);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
}

.badge-status-ongoing {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(6, 182, 212, 0.9);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-details {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Loading & Pagination */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pagination-bar {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ================= PLAYER PAGE ================= */
.player-page-top {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
}

.player-breadcrumbs {
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-breadcrumbs strong, #crumb-title {
  color: var(--text-main);
  font-weight: 600;
}

.crumb-sep {
  color: var(--text-dim);
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* Main Column: Video, Dubs, Episodes */
.video-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.native-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: #000;
}

.player-source-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.source-btn {
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.source-btn:hover {
  color: #fff;
}

.source-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

.player-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 12, 21, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  color: var(--text-muted);
}

.player-loading-overlay.hidden {
  display: none;
}

.player-unavailable {
  max-width: 520px;
  padding: 24px;
  text-align: center;
}

.player-unavailable-icon {
  display: block;
  margin-bottom: 10px;
  font-size: 36px;
}

.player-unavailable h3 {
  margin-bottom: 8px;
  color: #fff;
  font-size: 18px;
}

.player-unavailable p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Opening Skip Floating Banner */
.opening-skip-banner {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 55%, transparent);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: var(--shadow-glow);
  animation: pulseGlow 2s infinite;
}

.opening-skip-banner.hidden {
  display: none;
}

/* Ending Skip Floating Banner */
.ending-skip-banner {
  border-color: color-mix(in srgb, var(--accent-cyan) 55%, transparent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent-cyan) 35%, transparent);
  animation: pulseGlowEnding 2s infinite;
}

@keyframes pulseGlowEnding {
  0%, 100% { border-color: color-mix(in srgb, var(--accent-cyan) 55%, transparent); }
  50% { border-color: color-mix(in srgb, var(--accent-primary) 85%, transparent); }
}

.ending-skip-icon {
  color: var(--accent-cyan);
}

@keyframes pulseGlow {
  0%, 100% { border-color: color-mix(in srgb, var(--accent-primary) 55%, transparent); }
  50% { border-color: color-mix(in srgb, var(--accent-cyan) 90%, transparent); }
}

.skip-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skip-icon {
  font-size: 18px;
  color: #fbbf24;
}

.skip-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-muted);
}

.skip-text strong {
  color: #fff;
  font-size: 13px;
}

.btn-skip-action {
  background: var(--accent-primary);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skip-action:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.04);
}

/* Filler Auto-Skip Floating Banner */
.filler-skip-banner {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 21;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.55);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
  max-width: calc(100% - 40px);
  animation: pulseGlowFiller 2s infinite;
}

.filler-skip-banner.hidden {
  display: none;
}

@keyframes pulseGlowFiller {
  0%, 100% { border-color: rgba(239, 68, 68, 0.55); }
  50% { border-color: rgba(245, 158, 11, 0.95); }
}

.filler-skip-icon {
  color: var(--accent-red);
}

.btn-skip-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skip-ghost:hover {
  color: #fff;
  border-color: var(--text-muted);
}

/* Kodik / player failure notice */
.player-status-banner {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 23;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  font-size: 12px;
}

.player-status-banner.hidden {
  display: none;
}

.player-status-icon {
  font-size: 18px;
  color: var(--accent-amber);
}

.player-status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
}

.player-status-text strong {
  font-size: 12.5px;
  color: #fff;
}

.player-status-text span {
  color: var(--text-muted);
  line-height: 1.4;
}

.player-status-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* Player Controls Row */
.player-controls-row {
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ctrl:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-ctrl:disabled,
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Download modal */
.download-modal-card {
  max-width: 520px;
}

.download-source-info {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.download-source-info > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

.download-source-info span {
  color: var(--text-muted);
}

.download-source-info strong {
  color: var(--text-main);
  font-weight: 700;
  text-align: right;
}

.download-section {
  margin-bottom: 18px;
}

.download-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.download-scope {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-scope label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.download-scope label:has(input:checked) {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.download-scope input {
  accent-color: var(--accent-primary);
}

.download-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.download-select:focus {
  border-color: var(--accent-primary);
}

.download-hint {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.download-status {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.download-status.hidden {
  display: none;
}

.download-status.success {
  color: var(--accent-green);
}

.download-status.error {
  color: var(--accent-red);
}

.download-footer {
  gap: 8px;
}

.quick-skip-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.btn-skip-quick {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skip-quick:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 34px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-control input:checked + .toggle-slider {
  background: var(--accent-primary);
}

.toggle-control input:checked + .toggle-slider::before {
  transform: translateX(14px);
}

.toggle-control input:checked ~ .toggle-label {
  color: #fff;
}

/* Shikimori Sync Bar */
.shiki-sync-bar {
  padding: 10px 18px;
  background: rgba(16, 22, 38, 0.7);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.btn-mini-action {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: auto;
}

.btn-mini-action:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* Dub / Voiceover Selector Card */
.dub-selector-card, .episodes-card, .related-card, .characters-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}

.card-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-section-title h3 {
  font-size: 15px;
  font-weight: 700;
}

.badge-count {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.badge-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.dubs-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.dub-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dub-pill:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.dub-pill.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-glow);
}

.dub-tag-ua {
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 50%, #eab308 50%, #facc15 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
}

/* Episodes & Seasons */
.episodes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.seasons-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.season-tab-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.season-tab-btn:hover {
  color: var(--text-main);
}

.season-tab-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-contrast);
}

.episodes-info {
  font-size: 12.5px;
  color: var(--text-dim);
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.ep-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep-btn:hover {
  color: #fff;
  border-color: var(--accent-primary);
}

.ep-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.ep-btn.watched::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  color: var(--accent-green);
  font-weight: 900;
}

/* ---- Canon / mixed / filler episode markers ---- */
.filler-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
}

.filler-legend-label {
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filler-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 600;
}

.filler-chip b {
  color: var(--text-main);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.filler-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 2px solid currentColor;
  flex: 0 0 auto;
}

.filler-chip.canon { color: var(--accent-green); }
.filler-chip.mixed { color: var(--accent-amber); }
.filler-chip.filler { color: var(--accent-red); }
.filler-chip.canon .filler-swatch { background: rgba(16, 185, 129, 0.22); }
.filler-chip.mixed .filler-swatch { background: rgba(245, 158, 11, 0.22); }
.filler-chip.filler .filler-swatch { background: rgba(239, 68, 68, 0.22); }

.filler-source {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 11px;
  text-decoration: none;
}

.filler-source:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.filler-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}

.filler-note a {
  color: var(--accent-cyan);
}

/* Status frame: green = canon, orange = mixed, red = filler.
   The tiny corner glyph (dot / triangle) keeps the meaning readable
   without relying on colour alone. */
.ep-btn.ep-status-canon,
.ep-btn.ep-status-mixed,
.ep-btn.ep-status-filler {
  border-width: 2px;
}

.ep-btn.ep-status-canon { border-color: var(--accent-green); }
.ep-btn.ep-status-mixed { border-color: var(--accent-amber); }
.ep-btn.ep-status-filler { border-color: var(--accent-red); }

.ep-btn.ep-status-canon:not(.active) { background: rgba(16, 185, 129, 0.07); }
.ep-btn.ep-status-mixed:not(.active) { background: rgba(245, 158, 11, 0.07); }
.ep-btn.ep-status-filler:not(.active) { background: rgba(239, 68, 68, 0.07); }

.ep-btn.ep-status-mixed::before,
.ep-btn.ep-status-filler::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 5px;
}

.ep-btn.ep-status-mixed::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-amber);
}

.ep-btn.ep-status-filler::before {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-bottom: 6px solid var(--accent-red);
}

/* Related Anime Carousel / Grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.related-card-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.related-card-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
}

.related-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.related-info {
  padding: 8px;
}

.related-rel-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.related-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Characters (Shikimori) */
.characters-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.characters-all-link {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
}

.characters-all-link:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.character-card {
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.character-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.character-photo {
  width: 72px;
  height: 96px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.character-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.character-role {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.character-role.supporting {
  color: var(--text-dim);
}

.character-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.character-name-orig {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--text-dim);
}

.character-desc {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Right Sidebar Column: Anime Info */
.anime-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 88px;
}

.poster-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background: #0e121d;
}

.poster-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.score-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  color: #facc15;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(250, 204, 21, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.anime-info-card h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 4px;
}

.title-original {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.meta-badge {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.info-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}

.info-label {
  color: var(--text-dim);
}

.info-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  max-width: 65%;
}

.synopsis-box h4 {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.synopsis-box p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-links {
  margin-top: 18px;
}

.btn-shiki-link {
  display: block;
  text-align: center;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-shiki-link:hover {
  background: var(--accent-primary);
  color: var(--accent-contrast);
}

/* ================= HISTORY & BOOKMARKS ================= */
.page-header-simple {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header-simple h1 {
  font-size: 24px;
  font-weight: 800;
}

.page-header-simple p {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* ================= THEME PICKER ================= */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.theme-card {
  position: relative;
  padding: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.theme-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-glow);
}

.theme-preview {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 165px;
  padding: 8px;
  overflow: hidden;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
}

.theme-preview[data-theme="fantasy"] {
  border-color: rgba(212, 162, 76, 0.5);
  box-shadow: inset 0 0 0 3px rgba(212, 162, 76, 0.08);
}

.tp-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 18px;
  padding: 3px 5px;
  background: var(--bg-navbar);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.tp-dot {
  width: 9px;
  height: 9px;
  background: var(--accent-primary);
  border-radius: 3px;
}

.tp-bar-line {
  width: 28%;
  height: 4px;
  background: var(--text-dim);
  border-radius: 3px;
  opacity: 0.7;
}

.tp-pill {
  width: 18%;
  height: 7px;
  margin-left: auto;
  background: var(--accent-primary);
  border-radius: 5px;
  opacity: 0.9;
}

.tp-avatar {
  width: 11px;
  height: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
}

.tp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 44px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
}

.tp-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 52%;
}

.tp-hero-copy i:first-child {
  width: 90%;
  height: 5px;
  background: var(--text-main);
  border-radius: 3px;
  opacity: 0.8;
}

.tp-hero-copy i:last-child {
  width: 62%;
  height: 4px;
  background: var(--text-muted);
  border-radius: 3px;
  opacity: 0.65;
}

.tp-hero-actions {
  display: flex;
  gap: 4px;
}

.tp-hero-actions i {
  width: 24px;
  height: 9px;
  background: var(--accent-primary);
  border-radius: 4px;
  opacity: 0.9;
}

.tp-hero-actions i:last-child {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  flex: 1;
  min-height: 0;
}

.tp-grid i {
  display: block;
  min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.tp-grid i:nth-child(2n) {
  background: var(--bg-card-hover);
}

.theme-card-meta {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2px 6px;
  padding: 9px 4px 2px;
}

.theme-card-meta strong {
  flex: 1 1 calc(100% - 28px);
  min-width: 0;
  color: var(--text-main);
  font-size: 12.5px;
  line-height: 1.35;
}

.theme-card-meta span {
  overflow: hidden;
  flex: 1 1 100%;
  order: 2;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-card-meta .theme-check {
  flex: 0 0 auto;
  order: 1;
  margin-left: auto;
}

.theme-check {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
  background: var(--accent-primary);
  color: var(--accent-contrast);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.theme-card.active .theme-check {
  display: flex;
}

@media (max-width: 700px) {
  .themes-grid {
    grid-template-columns: 1fr 1fr;
  }
  .theme-preview {
    height: 135px;
  }
}

@media (max-width: 480px) {
  .themes-grid {
    grid-template-columns: 1fr;
  }
}

.history-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.history-item-card {
  display: flex;
  min-height: 174px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.history-item-poster {
  width: 100px;
  height: 140px;
  object-fit: cover;
  cursor: pointer;
}

.history-item-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.history-item-title {
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-item-meta {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin: 4px 0;
}

.history-item-time {
  font-size: 11px;
  color: var(--text-dim);
}

.history-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.btn-resume {
  background: var(--accent-primary);
  border: none;
  color: var(--accent-contrast);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-resume:hover { background: var(--accent-primary-hover); }

.btn-del-history {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}
.btn-del-history:hover { color: var(--accent-red); }

.bookmarks-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.bm-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bm-tab:hover { color: var(--text-main); }
.bm-tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-contrast);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 500px;
  margin: 40px auto;
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 20px;
}

/* ================= MODAL DIALOGS ================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.25s ease;
  overflow: hidden;
}

.modal-sm { max-width: 380px; }

/* Image search modal */
.image-search-modal-card {
  max-width: 620px;
}

.image-search-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg-input);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.image-search-drop:hover,
.image-search-drop.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
}

.image-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}

.image-search-empty .ui-icon {
  width: 42px;
  height: 42px;
  color: var(--accent-primary);
}

.image-search-empty strong {
  color: #fff;
  font-size: 14px;
}

.image-search-empty span {
  font-size: 12px;
}

.image-search-preview {
  display: block;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.image-search-preview.hidden {
  display: none;
}

.image-search-hint {
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.5;
}

.image-search-hint a {
  color: var(--accent-cyan);
}

.image-search-submit {
  width: 100%;
  margin-bottom: 12px;
}

.image-search-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-search-status {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.image-search-status.error {
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.image-search-status.success {
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.image-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.image-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.image-result-poster {
  flex: 0 0 auto;
  width: 54px;
  height: 76px;
  object-fit: cover;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.image-result-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.image-result-title {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.image-result-meta {
  color: var(--text-muted);
  font-size: 11.5px;
}

.image-result-confidence {
  color: var(--accent-green);
  font-weight: 700;
}

.image-result-confidence.uncertain {
  color: var(--accent-amber);
}

.image-result-open {
  flex: 0 0 auto;
  white-space: nowrap;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2, .modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-main); }

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.settings-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.input-with-button {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.input-with-button input {
  flex-grow: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.input-with-button input:focus { border-color: var(--accent-primary); }

.btn-primary {
  background: var(--accent-primary);
  border: none;
  color: var(--accent-contrast);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary:hover { background: var(--accent-primary-hover); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.btn-danger:hover { background: var(--accent-red); color: #fff; }

.btn-mini-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-mini-danger:hover { background: var(--accent-red); color: #fff; }

.help-details {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.help-details summary {
  color: var(--accent-cyan);
  font-weight: 600;
}

.help-steps {
  margin-top: 8px;
  padding-left: 20px;
  line-height: 1.6;
}

.help-steps a {
  color: var(--accent-primary);
}

.help-steps code {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
}

.setting-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  cursor: pointer;
  font-size: 13px;
}

.setting-checkbox-row input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.setting-checkbox-row strong {
  display: block;
  color: var(--text-main);
}

.setting-checkbox-row span {
  color: var(--text-dim);
  font-size: 12px;
}

.setting-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.setting-action-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setting-action-row strong {
  color: #fff;
  font-size: 13px;
}

.setting-action-row span {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.setting-hint {
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.45;
}

#translation-toggle-btn {
  white-space: nowrap;
}

.shiki-user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.shiki-user-card.hidden { display: none; }

.shiki-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--accent-primary);
}

.shiki-avatar svg {
  width: 24px;
  height: 24px;
}

.shiki-connected-tag {
  display: block;
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 600;
}

.bm-folder-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.bm-folder-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.bm-folder-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--accent-contrast);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .player-layout {
    grid-template-columns: 1fr;
  }
  .anime-info-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 16px;
  }
  .nav-links {
    display: none; /* Mobile navigation */
  }
  .search-box {
    width: 160px;
  }
  .catalog-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .characters-grid {
    grid-template-columns: 1fr;
  }
  .player-controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .controls-left, .controls-right {
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .filler-skip-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
  .player-status-banner {
    top: 8px;
    left: 8px;
    right: 8px;
    max-width: none;
  }
  .player-status-actions {
    margin-left: 0;
  }
  .setting-action-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .image-search-drop {
    min-height: 180px;
  }
  .image-search-preview {
    max-height: 220px;
  }
  .image-result-card {
    flex-wrap: wrap;
  }
  .image-result-open {
    width: 100%;
  }
  .filler-skip-banner .skip-banner-content {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filler-skip-banner .skip-text {
    flex: 1 1 140px;
  }
  .filler-legend {
    gap: 6px 10px;
    padding: 7px 10px;
  }
  .filler-legend-label {
    display: none;
  }
  .filler-source {
    width: 100%;
    margin-left: 0;
  }
}
