/* ============================================
   ONIMATCH V3 — Fully Static, Multi-API
   AniList + Jikan + Kitsu (No AI / No Server)
   ============================================ */

:root {
    --bg-primary: #000000;
    --bg-secondary: #05050a;
    --bg-card: rgba(15, 15, 15, 0.85);
    --border-card: rgba(226, 232, 240, 0.1);
    --border-glow: rgba(226, 232, 240, 0.25);
    --neon-purple: #CBD5E1;
    --neon-pink: #E2E8F0;
    --neon-blue: #94A3B8;
    --neon-cyan: #F8FAFC;
    --neon-green: #CBD5E1;   /* neutralizing green/orange/red to maintain chrome look */
    --neon-orange: #94A3B8;
    --neon-red: #D1D5DB;
    --neon-yellow: #E5E7EB;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --gradient-main: linear-gradient(135deg, #8E9196 0%, #F1F5F9 50%, #8E9196 100%);
    --shadow-neon: 0 0 25px rgba(226, 232, 240, 0.12), 0 0 60px rgba(226, 232, 240, 0.05);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 1px rgba(226, 232, 240, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: #000000; /* Fixes white overscroll/gap at top */
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: #000000;
    background: radial-gradient(circle at 50% -20%, #171717 0%, #000000 70%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(226, 232, 240, 0.15);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(226, 232, 240, 0.3);
    background-clip: content-box;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(226, 232, 240, 0.15) transparent;
}

/* Fix mobile scroll lag */
@media (max-width: 1024px) {
    body {
        background-attachment: scroll;
    }
}




/* --- Background: Stellar Galaxy + Stars --- */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Twinkling stars layer */
.bg-particles::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.9) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 25% 8%, rgba(226, 232, 240, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 22%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 55% 5%, rgba(203, 213, 225, 0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 18%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 85% 12%, rgba(241, 245, 249, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 95% 25%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 35%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 30% 28%, rgba(203, 213, 225, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 32%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 65% 30%, rgba(241, 245, 249, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 35%, rgba(255, 255, 255, 0.8) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 42%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 45% 40%, rgba(203, 213, 225, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 45%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(2px 2px at 90% 38%, rgba(226, 232, 240, 0.7) 0%, transparent 100%);
    animation: twinkle 4s ease-in-out infinite alternate;
}

/* Second star layer offset */
.bg-particles::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 8% 10%, rgba(255, 255, 255, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 22% 20%, rgba(226, 232, 240, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 38% 14%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 52% 26%, rgba(241, 245, 249, 0.8) 0%, transparent 100%),
        radial-gradient(2px 2px at 68% 9%, rgba(255, 255, 255, 0.9) 0%, transparent 100%),
        radial-gradient(1px 1px at 82% 22%, rgba(203, 213, 225, 0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 92% 16%, rgba(255, 255, 255, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 18% 48%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 58% 44%, rgba(226, 232, 240, 0.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 78% 50%, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
    animation: twinkle 5s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    filter: blur(60px);
}

/* Ocean wave glow particles */
.p1 {
    width: 350px;
    height: 200px;
    background: rgba(226, 232, 240, 0.05);
    bottom: -5%;
    left: -5%;
    animation: wave1 20s ease-in-out infinite;
    border-radius: 40% 60% 50% 50%;
}

.p2 {
    width: 300px;
    height: 180px;
    background: rgba(148, 163, 184, 0.04);
    bottom: 5%;
    right: -5%;
    animation: wave2 18s ease-in-out infinite;
    border-radius: 50% 40% 60% 50%;
}

.p3 {
    width: 250px;
    height: 150px;
    background: rgba(241, 245, 249, 0.03);
    bottom: 15%;
    left: 30%;
    animation: wave1 25s ease-in-out infinite reverse;
    border-radius: 60% 40% 50% 50%;
}

.p4 {
    width: 200px;
    height: 120px;
    background: rgba(148, 163, 184, 0.04);
    bottom: 0%;
    left: 60%;
    animation: wave2 22s ease-in-out infinite;
    border-radius: 50% 50% 40% 60%;
}

.p5 {
    width: 180px;
    height: 100px;
    background: rgba(203, 213, 225, 0.03);
    bottom: 10%;
    right: 20%;
    animation: wave1 15s ease-in-out infinite;
    border-radius: 40% 60% 60% 40%;
}

.p6 {
    width: 280px;
    height: 160px;
    background: rgba(226, 232, 240, 0.05);
    bottom: -2%;
    left: 10%;
    animation: wave2 28s ease-in-out infinite reverse;
    border-radius: 55% 45% 50% 50%;
}

@keyframes wave1 {

    0%,
    100% {
        transform: translate(0, 0) scaleX(1);
    }

    25% {
        transform: translate(30px, -15px) scaleX(1.05);
    }

    50% {
        transform: translate(-20px, 10px) scaleX(0.95);
    }

    75% {
        transform: translate(15px, -8px) scaleX(1.02);
    }
}

@keyframes wave2 {

    0%,
    100% {
        transform: translate(0, 0) scaleY(1);
    }

    33% {
        transform: translate(-25px, -20px) scaleY(1.05);
    }

    66% {
        transform: translate(20px, 15px) scaleY(0.95);
    }
}

.scan-lines {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px);
}

/* ============================================
   HERO — LOGO + TAGLINE
   ============================================ */
.app-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 24px 100px;
}

.app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 0 16px; /* Tightened from 32px to 16px */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    background: transparent;
    will-change: transform, padding, background-color;
}

.header-spacer {
    height: 260px; /* Reduced from 336px to tighten the gap */
    width: 100%;
}

/* Morph Elements on Scroll (Moved to end of file for priority) */

.hero-logo {
    display: inline-block;
    max-width: 380px;
    width: 100%;
    transition: max-width 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: max-width;
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: screen;
    filter: brightness(1.05) contrast(1.05);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    margin-bottom: 10px;
}

/* Logo Hover states moved to base */

@media (max-width: 768px) {
    .hero-img {
        margin-bottom: 5px;
    }
}

.hero-img:hover {
    transform: scale(1.03);
    filter: brightness(1.15) contrast(1.1) drop-shadow(0 0 25px rgba(226, 232, 240, 0.4));
}

.site-tagline {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 10px auto 5px;
    padding: 0 20px;
    text-align: center;
    letter-spacing: 0.3px;
    line-height: 1.4;
    max-height: 80px;
    opacity: 1;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, max-height, margin;
    white-space: normal;
    width: 100%;
    max-width: 800px;
}

/* Header Row — Grid layout for perfect logo centering and side buttons */
.header-row {
    display: grid;
    grid-template-columns: 60px 1fr 60px; /* Home btn, Logo (auto), Empty spacer */
    align-items: center;
    justify-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

.home-btn {
    grid-column: 1; /* Stay in first grid column */
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    position: relative; /* Remove absolute positioning */
}

.home-btn:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(226, 232, 240, 0.2);
    transform: translateY(-50%) scale(1.1);
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 0px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 10px 10px;
    text-align: center;
    transition: all var(--transition);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.feature-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-neon);
}

.feature-icon {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 3px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature-card p {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    position: relative;
    z-index: 2;
    margin-top: 0;
    border-top: 1px solid var(--border-card);
    background: linear-gradient(180deg, transparent, rgba(10, 10, 15, 0.95));
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
}

.footer-section {
    margin-bottom: 0;
    text-align: left;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-apis {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-apis a {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.footer-apis a:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(226, 232, 240, 0.15);
}

.footer-contact {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-email {
    display: inline-block;
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    color: var(--neon-cyan);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.footer-email:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-card);
    grid-column: 1 / -1;
}

.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.footer-copy {
    font-size: 0.68rem !important;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ============================================
   HOME SECTION — Anime Discovery
   ============================================ */
.home-section {
    margin-top: 16px;
}

.home-cta {
    text-align: center;
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.home-cta-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.home-cta-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.home-cta-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta-quiz,
.btn-cta-similar {
    padding: 10px 22px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-cta-quiz {
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-cta-quiz:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.btn-cta-similar {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.btn-cta-similar:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-cta-filler {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(71, 85, 105, 0.15));
    color: #e2e8f0;
    border: 1px solid rgba(226, 232, 240, 0.35);
    padding: 10px 22px;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-cta-filler:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 4px 20px rgba(226, 232, 240, 0.25);
    transform: translateY(-2px);
}

/* Home Rows */
.home-row {
    margin-bottom: 20px;
}

.home-row-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-left: 2px;
}

/* Horizontal Scroll */
.home-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.home-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.home-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.home-scroll::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 4px;
}

/* Anime Cards */
.home-card {
    flex: 0 0 150px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: all var(--transition);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
}

.home-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-neon);
}

.home-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.home-card-info {
    padding: 6px 8px 8px;
}

.home-card-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.home-card-meta {
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* Studio Grid */
.studio-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.studio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition);
}

.studio-card:hover {
    border-color: var(--neon-purple);
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.06), transparent);
}

.studio-name {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.studio-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.studio-back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 8px;
}

.studio-back-btn:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
}

.studio-selected-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.studio-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    grid-column: 1 / -1;
}

.studio-back-btn,
.studio-selected-name,
.studio-grid>.home-scroll {
    grid-column: 1 / -1;
}

/* Studio Full Page */
.studio-page {
    padding: 10px 0;
}

.studio-page-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0 4px;
}

.studio-page-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.studio-page-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.studio-anime-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.studio-anime-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}

.studio-anime-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-neon);
}

.studio-anime-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.studio-anime-info {
    padding: 8px 10px 10px;
}

.studio-anime-title {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.studio-anime-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
        padding: 10px 16px 100px;
    }

    .header-spacer {
        height: 180px;
    }

    .features-section {
        grid-template-columns: 1fr 1fr;
        margin-top: 10px;
    }

    .studio-grid {
        grid-template-columns: 1fr 1fr;
    }

    .studio-anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .home-card {
        flex: 0 0 120px;
    }

    .home-card img {
        height: 160px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-apis {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-spacer {
        height: 160px;
    }

    .features-section {
        grid-template-columns: 1fr 1fr;
        margin-top: 5px;
    }

    .studio-grid {
        grid-template-columns: 1fr;
    }

    .studio-anime-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .home-card {
        flex: 0 0 100px;
    }

    .home-card img {
        height: 130px;
    }

}

/* ============================================
   LUMINOUS NAVIGATION (TABS)
   ============================================ */
.tab-bar {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 40px auto 40px;
    padding: 5px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(203, 213, 225, 0.15);
    border-radius: 99px;
    width: min(95%, 480px);
    position: relative;
    box-shadow: 
        0 4px 24px -1px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(203, 213, 225, 0.05);
    z-index: 10;
}

.tab-btn {
    position: relative;
    padding: 11px 0;
    background: transparent;
    border: none;
    border-radius: 99px;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex: 1 1 0;        /* equal thirds — 0 basis so content doesn't skew */
    min-width: 0;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.tab-btn.active {
    color: #000;
}

.tab-indicator {
    position: absolute;
    height: calc(100% - 10px);
    top: 5px;
    left: 5px;
    background: var(--gradient-main);
    border-radius: 99px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1;
    box-shadow: 0 2px 12px rgba(226, 232, 240, 0.3);
}



/* ============================================
   SECTION PANELS
   ============================================ */
.section-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   QUIZ NAV (Back + Next)
   ============================================ */
.quiz-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-back,
.btn-next {
    padding: 10px 24px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-back {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
}

.btn-back:hover {
    border-color: var(--border-glow);
    color: var(--text-primary);
}

.btn-back.hidden {
    visibility: hidden;
}

.btn-next {
    background: var(--gradient-main);
    color: #000;
    box-shadow: 0 2px 12px rgba(226, 232, 240, 0.2);
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(226, 232, 240, 0.3);
}

.btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.selection-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 12px;
    font-style: italic;
}

/* ============================================
   SIMILAR ANIME SEARCH
   ============================================ */
.similar-search-box {
    text-align: center;
    padding: 20px 0;
}

.similar-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.similar-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto 16px;
}

.anime-search-input, .filler-search-input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    outline: none;
    transition: all var(--transition);
}

.btn-find-filler.ready-pulse {
    animation: buttonPulse 1.5s infinite;
    background: var(--gradient-main);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 0 0 rgba(226, 232, 240, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(226, 232, 240, 0); }
    100% { box-shadow: 0 0 0 0 rgba(226, 232, 240, 0); }
}


.anime-search-input::placeholder {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.anime-search-input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 0 3px rgba(226, 232, 240, 0.15), 0 4px 20px rgba(226, 232, 240, 0.1);
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.5;
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 32px rgba(0, 0, 10, 0.6);
    scrollbar-width: thin;
    scrollbar-color: var(--border-glow) transparent;
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 10px;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ac-item:last-child {
    border-bottom: none;
}

.ac-item:hover {
    background: rgba(226, 232, 240, 0.1);
}

.ac-img {
    width: 36px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(226, 232, 240, 0.1);
}

.ac-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.ac-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.selected-anime-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--neon-purple);
    border-radius: var(--radius-lg);
    padding: 12px;
    max-width: 400px;
    margin: 0 auto 16px;
    text-align: left;
    box-shadow: var(--shadow-neon);
}

.selected-anime-card img {
    width: 50px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
}

.selected-anime-info {
    flex: 1;
}

.selected-anime-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.selected-anime-type {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.btn-clear-anime {
    background: none;
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-anime:hover {
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.btn-find-similar {
    margin: 8px auto 0;
}

.btn-find-similar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.robot-container {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.robot {
    position: relative;
    width: 120px;
    height: 180px;
    transform-origin: bottom right;
    animation: robotIdle 3s ease-in-out infinite;
    cursor: pointer;
}

@keyframes robotIdle {

    0%,
    100% {
        transform: scale(0.85) translateY(0);
    }

    50% {
        transform: scale(0.85) translateY(-5px);
    }
}

/* --- Straw Hat (rebuilt) --- */
.robot-hat {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%) rotate(-4deg);
    z-index: 10;
    width: 90px;
    height: 45px;
}

/* The brim — wide flat oval at the bottom */
.hat-brim {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 18px;
    background: radial-gradient(ellipse at center, #E8C56A 0%, #D4A843 60%, #C49530 100%);
    border-radius: 50%;
    border: 1.5px solid #A07828;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), inset 0 -2px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* The dome — rounded top */
.hat-dome {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 34px;
    background: radial-gradient(ellipse at 40% 30%, #FCEAB6 0%, #F0D080 35%, #D4A843 75%, #C49530 100%);
    border-radius: 50% 50% 12% 12%;
    border: 1.5px solid #A07828;
    border-bottom: none;
    box-shadow: inset 0 4px 6px rgba(255, 255, 255, 0.15), inset 0 -3px 5px rgba(0, 0, 0, 0.1);
    z-index: 2;
    overflow: hidden;
}

/* Straw weave texture on dome */
.hat-dome::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(180, 130, 40, 0.08) 4px, rgba(180, 130, 40, 0.08) 5px),
        repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(180, 130, 40, 0.06) 5px, rgba(180, 130, 40, 0.06) 6px);
    border-radius: inherit;
}

/* Dome highlight */
.hat-dome::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 10px;
    width: 20px;
    height: 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    filter: blur(2px);
}

/* Red band around the dome base */
.hat-band {
    position: absolute;
    bottom: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 7px;
    background: linear-gradient(180deg, #DD3333, #BB2222);
    border-radius: 2px 2px 3px 3px;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Specific scaling for the hat inside the banner icon seal */
.banner-hat {
    transform: translateX(-50%) rotate(-4deg) scale(0.35) !important;
    top: -5px !important;
}

.banner-hat .hat-brim {
    border-width: 3px !important;
}

.banner-hat .hat-dome {
    border-width: 3px !important;
}


/* --- Robot Head --- */
.robot-head {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 60px;
    background: linear-gradient(180deg, #334155, #1E293B);
    border-radius: 20px 20px 16px 16px;
    border: 2px solid rgba(226, 232, 240, 0.25);
    box-shadow: 0 0 15px rgba(226, 232, 240, 0.08), inset 0 -4px 8px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.robot-antenna {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 15px;
    background: linear-gradient(180deg, var(--neon-purple), #2A2A4A);
    border-radius: 2px;
}

.antenna-ball {
    width: 8px;
    height: 8px;
    background: var(--neon-purple);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--neon-purple), 0 0 20px rgba(226, 232, 240, 0.3);
    animation: antennaPulse 2s ease-in-out infinite;
}

@keyframes antennaPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--neon-purple)
    }

    50% {
        box-shadow: 0 0 15px var(--neon-purple), 0 0 30px rgba(226, 232, 240, 0.3)
    }
}

/* --- Eyes --- */
.robot-eyes {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    position: relative;
    z-index: 6;
}

.robot-eye {
    width: 20px;
    height: 20px;
    background: #050510;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(226, 232, 240, 0.2), inset 0 0 5px rgba(226, 232, 240, 0.05);
}

.robot-pupil {
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
    box-shadow: 0 0 6px var(--neon-cyan);
}

.eye-shine {
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 4px;
    right: 4px;
    opacity: 0.7;
}

/* Expression states */
.robot.excited .robot-eye {
    border-color: var(--neon-yellow);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.robot.excited .robot-pupil {
    background: var(--neon-yellow);
    box-shadow: 0 0 8px var(--neon-yellow);
    width: 10px;
    height: 10px;
}

.robot.happy .robot-eye {
    border-color: var(--neon-green);
}

.robot.happy .robot-pupil {
    background: var(--neon-green);
    box-shadow: 0 0 6px var(--neon-green);
}

.robot.thinking .robot-eye {
    border-color: var(--neon-purple);
    animation: thinkBlink 2s ease-in-out infinite;
}

@keyframes thinkBlink {

    0%,
    40%,
    60%,
    100% {
        transform: scaleY(1)
    }

    50% {
        transform: scaleY(0.1)
    }
}

.robot.sad .robot-eye {
    border-color: var(--neon-blue);
}

.robot.sad .robot-pupil {
    background: var(--neon-blue);
    transform: translate(-50%, 30%);
}

/* --- Mouth --- */
.robot-mouth {
    width: 22px;
    height: 8px;
    margin: 8px auto 0;
    background: #0D0D1A;
    border-radius: 0 0 10px 10px;
    border: 2px solid var(--neon-purple);
    border-top: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mouth-inner {
    width: 100%;
    height: 0;
    background: var(--neon-purple);
    position: absolute;
    bottom: 0;
    border-radius: 0 0 8px 8px;
    opacity: 0.3;
    transition: height 0.3s ease;
}

/* Mouth expressions */
.robot.excited .robot-mouth {
    width: 28px;
    height: 14px;
    border-color: var(--neon-yellow);
    border-radius: 4px 4px 14px 14px;
}

.robot.excited .mouth-inner {
    height: 100%;
    background: var(--neon-yellow);
    opacity: 0.3;
}

.robot.happy .robot-mouth {
    width: 24px;
    height: 10px;
    border-color: var(--neon-green);
}

.robot.happy .mouth-inner {
    height: 60%;
    background: var(--neon-green);
}

.robot.thinking .robot-mouth {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    border-top: 2px solid var(--neon-purple);
}

.robot.sad .robot-mouth {
    width: 18px;
    height: 6px;
    border-radius: 10px 10px 0 0;
    border: 2px solid var(--neon-blue);
    border-bottom: none;
    transform: rotate(180deg);
    margin-top: 10px;
}

/* --- Cheek LEDs --- */
.robot-cheek {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    top: 36px;
    background: var(--neon-pink);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cheek-left {
    left: 8px;
}

.cheek-right {
    right: 8px;
}

.robot.excited .robot-cheek,
.robot.happy .robot-cheek {
    opacity: 0.6;
    animation: cheekGlow 1.5s ease-in-out infinite;
}

@keyframes cheekGlow {

    0%,
    100% {
        opacity: 0.3
    }

    50% {
        opacity: 0.7
    }
}

/* --- Body --- */
.robot-body {
    position: absolute;
    top: 86px;
    left: 50%;
    transform: translateX(-50%);
    width: 58px;
    height: 50px;
    background: linear-gradient(180deg, #334155, #1E293B);
    border-radius: 10px 10px 16px 16px;
    border: 2px solid rgba(226, 232, 240, 0.2);
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.3);
    z-index: 4;
}

.robot-chest-light {
    width: 12px;
    height: 12px;
    background: var(--neon-purple);
    border-radius: 50%;
    margin: 10px auto 0;
    box-shadow: 0 0 10px var(--neon-purple), 0 0 20px rgba(226, 232, 240, 0.3);
    animation: chestPulse 2s ease-in-out infinite;
}

@keyframes chestPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--neon-purple)
    }

    50% {
        box-shadow: 0 0 15px var(--neon-purple), 0 0 25px rgba(226, 232, 240, 0.4)
    }
}

.robot-bolt {
    width: 5px;
    height: 5px;
    background: #4A4A6A;
    border-radius: 50%;
    position: absolute;
    top: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bolt-left {
    left: 8px;
}

.bolt-right {
    right: 8px;
}

/* --- Arms --- */
.robot-arm {
    position: absolute;
    width: 12px;
    height: 35px;
    background: linear-gradient(180deg, #2A2A4A, #1E1E3A);
    border-radius: 6px;
    border: 1.5px solid rgba(226, 232, 240, 0.2);
    top: 92px;
    z-index: 3;
    transition: transform 0.3s ease;
}

.robot-arm-left {
    left: 10px;
    transform-origin: top center;
    animation: armSwayL 3s ease-in-out infinite;
}

.robot-arm-right {
    right: 10px;
    transform-origin: top center;
    animation: armSwayR 3s ease-in-out infinite 1.5s;
}

@keyframes armSwayL {

    0%,
    100% {
        transform: rotate(-5deg)
    }

    50% {
        transform: rotate(5deg)
    }
}

@keyframes armSwayR {

    0%,
    100% {
        transform: rotate(5deg)
    }

    50% {
        transform: rotate(-5deg)
    }
}

.robot.excited .robot-arm-left {
    animation: armWaveL 0.4s ease-in-out infinite;
}

.robot.excited .robot-arm-right {
    animation: armWaveR 0.4s ease-in-out infinite;
}

@keyframes armWaveL {

    0%,
    100% {
        transform: rotate(-20deg)
    }

    50% {
        transform: rotate(20deg)
    }
}

@keyframes armWaveR {

    0%,
    100% {
        transform: rotate(20deg)
    }

    50% {
        transform: rotate(-20deg)
    }
}

/* --- Speech Bubble --- */
.robot-speech {
    position: absolute;
    top: -12px;
    right: 110%;
    left: auto;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 12px 12px 2px 12px;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.robot-speech::before {
    content: '';
    position: absolute;
    bottom: 8px;
    right: -6px;
    left: auto;
    width: 0;
    height: 0;
    border-left: 6px solid var(--bg-card);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* --- Progress Bar --- */
.progress-wrapper {
    margin-bottom: 24px;
    transition: opacity 0.3s ease;
}

.progress-wrapper.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--neon-purple);
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 20%;
    background: var(--gradient-main);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(226, 232, 240, 0.4);
}

/* --- Quiz --- */
.quiz-container {
    transition: opacity 0.3s ease;
}

.quiz-container.hidden {
    display: none;
}

.quiz-step {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(24px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.question-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.choice-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    color: inherit;
    font-size: inherit;
}

.choice-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.choice-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
}

.choice-card:hover::before {
    opacity: 0.06;
}

.choice-card.selected {
    border-color: var(--neon-purple);
    background: rgba(226, 232, 240, 0.1);
    box-shadow: var(--shadow-hover), inset 0 0 0 1px rgba(226, 232, 240, 0.3);
}

.choice-label {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    margin-bottom: 3px;
    display: block;
}

.choice-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    line-height: 1.4;
    display: block;
}

.choice-examples {
    font-size: 0.7rem;
    color: var(--neon-purple);
    font-weight: 500;
    margin-top: 5px;
    position: relative;
    z-index: 1;
    opacity: 0.8;
    display: block;
    font-style: italic;
}

/* ============================================
   LOADING — SHIP ON OCEAN WAVES
   ============================================ */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-container.hidden {
    display: none;
}

.loading-track {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px;
    height: 140px;
    overflow: hidden;
}

/* --- Ocean Waves --- */
.ocean-waves {
    position: absolute;
    bottom: 20px;
    left: -10%;
    right: -10%;
    height: 50px;
    z-index: 1;
}

.wave {
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    border-radius: 40% 50% 0 0;
    opacity: 0.6;
}

.wave-1 {
    background: linear-gradient(180deg, rgba(226, 232, 240, 0.35) 0%, rgba(226, 232, 240, 0.05) 100%);
    animation: waveRoll 3s ease-in-out infinite;
    height: 40px;
    bottom: 0;
}

.wave-2 {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.25) 0%, rgba(34, 211, 238, 0.05) 100%);
    animation: waveRoll 3.5s ease-in-out infinite reverse;
    height: 35px;
    bottom: 5px;
    left: 10%;
}

.wave-3 {
    background: linear-gradient(180deg, rgba(203, 213, 225, 0.2) 0%, rgba(203, 213, 225, 0.02) 100%);
    animation: waveRoll 4s ease-in-out infinite;
    height: 30px;
    bottom: 2px;
    left: -15%;
}

@keyframes waveRoll {

    0%,
    100% {
        transform: translateX(0) scaleY(1);
    }

    25% {
        transform: translateX(8px) scaleY(1.1);
    }

    50% {
        transform: translateX(-5px) scaleY(0.9);
    }

    75% {
        transform: translateX(3px) scaleY(1.05);
    }
}

/* --- Ship --- */
.ship {
    position: absolute;
    bottom: 35px;
    left: 0%;
    width: 70px;
    height: 80px;
    z-index: 5;
    animation: shipBob 2.5s ease-in-out infinite;
}

.ship-body {
    position: relative;
    width: 100%;
    height: 100%;
    animation: shipRock 3s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes shipBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes shipRock {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(3deg);
    }

    75% {
        transform: rotate(-3deg);
    }
}

/* Hull */
.ship-hull {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 18px;
    background: linear-gradient(180deg, #5D3A1A, #3E2410);
    border-radius: 4px 4px 40% 40%;
    border: 1.5px solid #2A1808;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.ship-hull-stripe {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 3px;
    background: #F59E0B;
    border-radius: 2px;
    opacity: 0.8;
}

/* Mast */
.ship-mast {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 55px;
    background: linear-gradient(180deg, #7C5B3A, #5D3A1A);
    border-radius: 1px;
}

/* Sail */
.ship-sail {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-20%);
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #F8FAFC, #E2E8F0);
    border-radius: 0 40% 0 0;
    clip-path: polygon(0 0, 100% 10%, 100% 100%, 0 100%);
    box-shadow: inset -3px 0 8px rgba(0, 0, 0, 0.05);
    animation: sailFlutter 4s ease-in-out infinite;
}

@keyframes sailFlutter {

    0%,
    100% {
        transform: translateX(-20%) skewX(0deg);
    }

    50% {
        transform: translateX(-20%) skewX(2deg);
    }
}

/* Flag */
.ship-flag {
    position: absolute;
    bottom: 68px;
    left: 50%;
    transform: translateX(0);
    width: 14px;
    height: 9px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    clip-path: polygon(0 0, 100% 20%, 100% 80%, 0 100%);
    animation: flagWave 1.5s ease-in-out infinite;
}

@keyframes flagWave {

    0%,
    100% {
        transform: translateX(0) scaleX(1);
    }

    50% {
        transform: translateX(1px) scaleX(0.9);
    }
}

/* Crow's nest */
.ship-crows-nest {
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 4px;
    background: #5D3A1A;
    border-radius: 1px;
    border: 1px solid #3E2410;
}

/* Cabin */
.ship-cabin {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-90%);
    width: 16px;
    height: 14px;
    background: linear-gradient(180deg, #6B4423, #4A2E14);
    border-radius: 2px 2px 0 0;
    border: 1px solid #2A1808;
}

/* Windows */
.ship-window {
    position: absolute;
    width: 5px;
    height: 5px;
    background: radial-gradient(circle, #FBBF24, #F59E0B);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.6);
    animation: windowGlow 2s ease-in-out infinite alternate;
}

.ship-window-1 {
    bottom: 7px;
    left: 12px;
}

.ship-window-2 {
    bottom: 7px;
    left: 22px;
}

@keyframes windowGlow {
    0% {
        box-shadow: 0 0 3px rgba(251, 191, 36, 0.4);
    }

    100% {
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
    }
}

/* Bow */
.ship-bow {
    position: absolute;
    bottom: 2px;
    right: -4px;
    width: 10px;
    height: 12px;
    background: linear-gradient(135deg, #5D3A1A, #3E2410);
    clip-path: polygon(0 0, 100% 40%, 0 100%);
}

/* Wake splashes */
.ship-wake {
    position: absolute;
    bottom: -2px;
    left: -8px;
    width: 10px;
    height: 6px;
    background: rgba(203, 213, 225, 0.4);
    border-radius: 50%;
    animation: wakeSplash 1s ease-out infinite;
    z-index: 0;
}

.ship-wake-2 {
    left: -16px;
    bottom: 2px;
    width: 8px;
    height: 4px;
    animation-delay: 0.3s;
    opacity: 0.6;
}

@keyframes wakeSplash {
    0% {
        opacity: 0.6;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-20px) scale(0.3);
    }
}

/* Wave-style progress bar */
.wave-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(226, 232, 240, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.wave-progress .loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0EA5E9, #22D3EE, #0EA5E9);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(226, 232, 240, 0.5);
    animation: waveShimmer 2s linear infinite;
}

@keyframes waveShimmer {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

.loading-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

/* ============================================
   RESULTS + PAGINATION
   ============================================ */
.results-container {
    padding-bottom: 40px;
}

.results-container.hidden {
    display: none;
}

.results-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    animation: slideIn 0.5s ease;
}

.results-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: cardPop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) backwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-glow);
}

@keyframes cardPop {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.result-card:nth-child(1) {
    animation-delay: .05s
}

.result-card:nth-child(2) {
    animation-delay: .1s
}

.result-card:nth-child(3) {
    animation-delay: .15s
}

.result-card:nth-child(4) {
    animation-delay: .2s
}

.result-card:nth-child(5) {
    animation-delay: .25s
}

.result-card:nth-child(6) {
    animation-delay: .3s
}

.result-card:nth-child(7) {
    animation-delay: .35s
}

.result-card:nth-child(8) {
    animation-delay: .4s
}

.result-card:nth-child(9) {
    animation-delay: .45s
}

.result-card:nth-child(10) {
    animation-delay: .5s
}

.result-card-inner {
    display: flex;
    gap: 14px;
    padding: 14px;
}

.result-cover {
    width: 95px;
    min-width: 95px;
    height: 135px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.2), rgba(236, 72, 153, 0.1));
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-rank-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.result-rank {
    background: var(--gradient-main);
    color: white;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 800;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.genre-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.63rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(226, 232, 240, 0.2);
    border: 1px solid rgba(226, 232, 240, 0.25);
}

.genre-pill:nth-child(2n) {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.25)
}

.genre-pill:nth-child(3n) {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.25)
}

.genre-pill:nth-child(5n) {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.25)
}

.result-episodes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.63rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--neon-blue);
}

.result-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.63rem;
    font-weight: 700;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: var(--neon-yellow);
}

.result-synopsis {
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-why {
    background: rgba(226, 232, 240, 0.08);
    border-left: 2px solid var(--neon-purple);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 7px 10px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 14px 10px;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px 10px;
}

.result-difficulty {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.66rem;
    font-weight: 700;
}

.difficulty-beginner {
    background: rgba(16, 185, 129, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(16, 185, 129, 0.25)
}

.difficulty-casual {
    background: rgba(59, 130, 246, 0.15);
    color: var(--neon-blue);
    border: 1px solid rgba(59, 130, 246, 0.25)
}

.difficulty-veteran {
    background: rgba(249, 115, 22, 0.15);
    color: var(--neon-orange);
    border: 1px solid rgba(249, 115, 22, 0.25)
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--gradient-main);
    border-color: transparent;
    color: #000;
    box-shadow: 0 4px 16px rgba(226, 232, 240, 0.3);
}

.page-btn.nav-btn {
    width: auto;
    padding: 0 14px;
    font-size: 0.8rem;
}

/* --- Buttons --- */
.btn-action {
    display: block;
    margin: 24px auto 0;
    padding: 14px 36px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(226, 232, 240, 0.25);
    letter-spacing: 1px;
}

.btn-action:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 30px rgba(226, 232, 240, 0.35);
}

/* --- Error --- */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-container.hidden {
    display: none;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--neon-red);
}

.error-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-text {
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-logo {
        max-width: 200px;
    }

    .question-text {
        font-size: 1.25rem;
    }

    .choices-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .robot-speech {
        font-size: 0.65rem;
        left: 105%;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px 12px 60px;
    }

    .hero-logo {
        max-width: 160px;
    }

    .robot-container {
        bottom: 60px;
    }

    .robot {
        width: 100px;
        height: 150px;
    }

    .question-text {
        font-size: 1.05rem;
    }

    .choices-grid {
        grid-template-columns: 1fr;
    }

    .result-card-inner {
        flex-direction: column;
    }

    .result-cover {
        width: 100%;
        height: 160px;
        min-width: unset;
    }

    .result-title {
        white-space: normal;
    }

    .robot-speech {
        display: none;
    }
}

/* ============================================
   RESULT CARD — Clickable
   ============================================ */
.result-card {
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.result-detail-hint {
    font-size: 0.7rem;
    color: var(--neon-purple);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover .result-detail-hint {
    opacity: 1;
}

/* ============================================
   ANIME DETAIL MODAL
   ============================================ */
.anime-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.anime-modal-overlay.active {
    display: flex;
}

.anime-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), var(--shadow-neon);
    animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--neon-red);
    border-color: var(--neon-red);
    transform: scale(1.1);
}

.modal-banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-content {
    padding: 24px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.modal-score {
    color: var(--neon-yellow);
    font-weight: 700;
}

.modal-ep,
.modal-format,
.modal-status {
    background: rgba(226, 232, 240, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
}

.modal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 14px 0;
}

.modal-genres .genre-pill {
    font-size: 0.72rem;
}

.modal-trailer {
    margin: 20px 0;
}

.modal-trailer h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.trailer-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.trailer-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.trailer-fallback-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.25);
}

.trailer-fallback-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 0, 0, 0.35);
    filter: brightness(1.1);
}

.modal-description {
    margin-top: 16px;
}

.modal-description h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-description p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-loading {
    padding: 60px 20px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Responsive modal */
@media (max-width: 600px) {
    .anime-modal {
        max-height: 95vh;
        border-radius: var(--radius-lg);
    }

    .modal-banner {
        height: 140px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal-content {
        padding: 16px;
    }

    .modal-title {
        font-size: 1.2rem;
    }
}

/* ============================================
   RESULTS SIDEBAR — Filter Panel
   ============================================ */
.results-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.results-sidebar {
    position: sticky;
    top: 20px;
    background: rgba(8, 22, 48, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-card) transparent;
}

.results-sidebar::-webkit-scrollbar {
    width: 4px;
}

.results-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 4px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    text-align: center;
}

.sidebar-section {
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.08);
    padding-bottom: 14px;
}

.sidebar-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.sidebar-section-title {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar-pill {
    padding: 5px 10px;
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(8, 22, 48, 0.6);
    border: 1px solid var(--border-card);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.sidebar-pill:hover {
    border-color: var(--border-glow);
    color: var(--text-secondary);
    transform: translateY(-1px);
}

.sidebar-pill.active {
    background: rgba(226, 232, 240, 0.2);
    border-color: var(--neon-purple);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(226, 232, 240, 0.15);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.btn-refresh-results {
    width: 100%;
    padding: 10px 16px;
    background: var(--gradient-main);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(226, 232, 240, 0.25);
}

.btn-refresh-results:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(226, 232, 240, 0.35);
}

.btn-feeling-lucky {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.25);
}

.btn-feeling-lucky:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
}

.results-main {
    min-width: 0;
}

/* --- Mobile: FAB + Bottom Sheet --- */
.sidebar-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 90;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: #000;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(226, 232, 240, 0.4);
    transition: all var(--transition);
    align-items: center;
    justify-content: center;
}

.sidebar-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(226, 232, 240, 0.5);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 201;
    background: rgba(8, 22, 48, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 16px 32px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-bottom-sheet.active {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-card);
    border-radius: 2px;
    margin: 0 auto 16px;
}

/* Desktop sidebar visible, mobile hidden */
@media (max-width: 900px) {
    .results-layout {
        grid-template-columns: 1fr;
    }

    .results-sidebar {
        display: none;
    }

    .sidebar-fab {
        display: flex;
    }
}

/* Sidebar skeleton loading */
.sidebar-loading .sidebar-pill {
    opacity: 0.4;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* ============================================
   ULTIMATE PRIORITY: FIXED HEADER MORPH
   ============================================ */

.app-header.scrolled {
    padding: 8px 0 8px !important;
    background: rgba(10, 10, 15, 0.7) !important;
    -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.2) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
}

.app-header.scrolled .hero-logo {
    max-width: 150px !important;
    transition: max-width 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
}

.app-header.scrolled .hero-img {
    margin-bottom: 0 !important;
}

.app-header.scrolled .site-tagline {
    opacity: 0 !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   FILLER GUIDE
   ============================================ */
.filler-api-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: -8px auto 16px;
    max-width: 520px;
    line-height: 1.5;
}

.filler-code {
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(226, 232, 240, 0.08);
    border-radius: 4px;
    border: 1px solid rgba(226, 232, 240, 0.15);
}

.filler-search-box .similar-desc a {
    color: var(--neon-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.filler-results-panel {
    margin-top: 28px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(12px);
}

.filler-results-panel.hidden {
    display: none;
}

.filler-results-header {
    text-align: center;
    margin-bottom: 20px;
}

.filler-results-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.filler-source-line {
    font-size: 0.78rem;
}

.filler-source-line a {
    color: var(--neon-cyan);
}

.filler-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.filler-stat {
    text-align: center;
    padding: 14px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
}

.filler-stat-canon {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
}

.filler-stat-filler {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.08);
}

.filler-stat-mixed {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.08);
}

.filler-stat-pct {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.filler-stat-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 6px;
}

.filler-stat-n {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.filler-total-meta {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.filler-ranges-box {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.25);
    font-size: 0.78rem;
}

.filler-ranges-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    color: var(--neon-orange);
}

.filler-ranges-text {
    color: var(--text-secondary);
    line-height: 1.55;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
}

.filler-ep-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.filler-ep {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
    font-size: 0.75rem;
    font-weight: 700;
}

.filler-ep-num {
    font-size: 0.95rem;
}

.filler-ep small {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 2px;
}

.filler-ep-canon {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
}

.filler-ep-filler {
    border-color: rgba(249, 115, 22, 0.45);
    background: rgba(249, 115, 22, 0.1);
}

.filler-ep-mixed {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(148, 163, 184, 0.1);
}

.filler-error {
    color: var(--neon-red);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

.btn-find-filler {
    margin-top: 4px;
}


/* ============================================
   WELCOME BANNER (EDITORIAL NIGHT SEA)
   ============================================ */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.welcome-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.welcome-banner-card {
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    padding: 45px;
    position: relative;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8),
                0 0 50px rgba(255, 255, 255, 0.05);
    
    /* Animation Control */
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: visible; /* Allow shards to fly outside */
}

/* Fragment Grid Container */
.fragment-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.fragment-tile {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.05);
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
}

/* Jigsaw Puzzle Piece Variants */
/* Tab Out = bulge, Tab In = indentation */

/* Pattern A: Interior (Top: In, Right: Out, Bottom: Out, Left: In) */
.pz-mid-a {
    clip-path: polygon(
        0% 35%, 10% 35%, 10% 25%, 25% 25%, 25% 35%, 0% 35%, /* Top In */
        0% 0%, 100% 0%, 
        100% 35%, 110% 35%, 110% 65%, 100% 65%, /* Right Out */
        100% 100%, 75% 100%, 75% 110%, 45% 110%, 45% 100%, /* Bottom Out */
        0% 100%, 0% 65%, 10% 65%, 10% 35% /* Left In */
    );
}

/* Pattern B: Interior (Top: Out, Right: In, Bottom: In, Left: Out) - Inverse of A */
.pz-mid-b {
    clip-path: polygon(
        0% 0%, 35% 0%, 35% -10%, 65% -10%, 65% 0%, 100% 0%, /* Top Out */
        100% 35%, 90% 35%, 90% 65%, 100% 65%, /* Right In */
        100% 100%, 0% 100%, 
        0% 65%, -10% 65%, -10% 35%, 0% 35% /* Left Out */
    );
}

/* Edge Top */
.pz-edge-t {
    clip-path: polygon(0% 0%, 100% 0%, 100% 35%, 110% 35%, 110% 65%, 100% 65%, 100% 100%, 0% 100%, 0% 65%, 10% 65%, 10% 35%);
}

/* Edge Bottom */
.pz-edge-b {
    clip-path: polygon(0% 0%, 35% 0%, 35% -10%, 65% -10%, 65% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 65%, -10% 65%, -10% 35%, 0% 35%);
}

/* Corner Top-Left */
.pz-corner-tl {
    clip-path: polygon(0% 0%, 100% 0%, 100% 35%, 110% 35%, 110% 65%, 100% 65%, 100% 100%, 0% 100%);
}

.welcome-overlay:not(.hidden) .welcome-banner-card {
    opacity: 1;
}

/* State when tiles are active: Hide the main background card fully */
.assembling .welcome-banner-card {
    background: transparent !important;
    backdrop-filter: none !important; /* CRITICAL: Remove blur to make box truly invisible */
    border: none !important;
    box-shadow: none !important;
    transition: none !important;
    opacity: 1 !important; 
}

.assembling .banner-content,
.assembling .banner-close,
.assembling .banner-icon-seal {
    visibility: hidden;
}

/* Keyframes for the 'Scatter' */
@keyframes tile-fly-in {
    0% {
        opacity: 0;
        transform: translate(var(--startX), var(--startY)) rotate(var(--startRot)) scale(0);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

@keyframes tile-fly-out {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--endX), var(--endY)) rotate(var(--endRot)) scale(0);
    }
}


/* Decryption Shimmer */
.welcome-banner-card::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 55%
    );
    transform: rotate(-45deg);
    animation: banner-shimmer 3s infinite;
    pointer-events: none;
}

@keyframes banner-shimmer {
    0% { transform: translateX(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) rotate(-45deg); }
}


.banner-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.banner-content {
    text-align: center;
}

.banner-icon-seal {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
}

.banner-hat {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 60px !important;
    height: 30px !important;
    margin-top: -5px;
}

.banner-hat .hat-brim {
    width: 60px !important;
    height: 12px !important;
}

.banner-hat .hat-dome {
    width: 38px !important;
    height: 22px !important;
    bottom: 5px !important;
}

.banner-hat .hat-band {
    width: 38px !important;
    height: 5px !important;
    bottom: 5px !important;
}

.banner-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(to bottom, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.banner-divider {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.banner-message {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.banner-message span {
    display: block;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.banner-message strong {
    color: var(--text-primary);
    font-weight: 600;
}

.btn-banner-confirm {
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
    color: #0f172a;
    border: none;
    padding: 14px 35px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-banner-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

.btn-banner-confirm:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .welcome-banner-card {
        padding: 30px 20px;
        border-radius: 24px;
    }
    .banner-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .filler-stats-row {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        padding: 10px 0;
        font-size: 0.78rem;
        flex: 1 1 0;
    }

    .app-header {
        padding: 12px 0;
    }

    .hero-logo {
        max-width: 250px;
    }

    .site-tagline {
        font-size: 0.72rem;
        line-height: 1.5;
        max-height: 120px;
        white-space: normal !important;
        padding: 0 24px;
        width: 100%;
    }

    .home-cta {
        padding: 24px 16px;
    }

    .home-cta-buttons {
        gap: 8px;
    }

    .btn-cta-quiz, .btn-cta-similar, .btn-cta-filler {
        padding: 10px 16px;
        font-size: 0.8rem;
        flex: 1 1 120px;
    }
}

@media (max-width: 480px) {
    .site-tagline {
        font-size: 0.68rem;
        padding: 0 20px;
    }

    .header-spacer {
        height: 180px;
    }

    .hero-logo {
        max-width: 200px;
    }
}

@media (max-width: 360px) {
    .btn-cta-quiz, .btn-cta-similar, .btn-cta-filler {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}

