/* Generated from site.css by tools/scope.mjs: old styles, scoped to .legacy (Dev/Art tools). */
/* ============================================
   LUNA BOT — Premium Fantasy Website
   ============================================ */

/* --- Reset & Base --- */
.legacy *, .legacy, .legacy *::before, .legacy, .legacy *::after, .legacy { box-sizing: border-box; margin: 0; padding: 0; }

.legacy {
    /* Background - dark purple */
    --bg-base: #12102a;
    --bg-surface: #1a1640;
    --bg-card: #211d50;
    --bg-card-hover: #2a265e;
    --bg-elevated: #252158;
    --bg-nav: rgba(18, 16, 42, 0.92);

    /* Accent palette */
    --purple: #a78bfa;
    --purple-deep: #7c3aed;
    --purple-soft: #c4b5fd;
    --indigo: #818cf8;
    --blue: #7dd3fc;
    --blue-deep: #3b82f6;
    --pink: #f9a8d4;
    --rose: #fb7185;
    --green: #86efac;
    --green-deep: #22c55e;
    --gold: #fbbf24;
    --orange: #fb923c;
    --cyan: #67e8f9;


    /* Element colors */
    --el-fire: #ef4444;
    --el-water: #3b82f6;
    --el-earth: #84cc16;
    --el-air: #7dd3fc;
    --el-electric: #facc15;
    --el-ice: #67e8f9;
    --el-dark: #8b5cf6;
    --el-light: #fef08a;
    --el-nature: #4ade80;
    --el-spirit: #e879f9;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #16103a 0%, #251565 30%, #2e1875 60%, #1e1050 100%);
    --gradient-magical: linear-gradient(135deg, #8b5cf6, #c084fc, #f9a8d4);
    --gradient-warm: linear-gradient(135deg, #f97316, #fbbf24);
    --gradient-cool: linear-gradient(135deg, #06b6d4, #7dd3fc);
    --gradient-discord: linear-gradient(135deg, #5865f2, #7c3aed);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    --gradient-section: linear-gradient(180deg, transparent 0%, rgba(99,102,241,0.03) 50%, transparent 100%);

    /* Text */
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-heading: #ffffff;

    /* Effects */
    --glow-purple: 0 0 40px rgba(167, 139, 250, 0.15);
    --glow-pink: 0 0 40px rgba(249, 168, 212, 0.15);
    --glow-blue: 0 0 40px rgba(125, 211, 252, 0.15);
    --glow-gold: 0 0 40px rgba(251, 191, 36, 0.15);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-strong: rgba(255, 255, 255, 0.15);

    /* Discord */
    --discord: #5865f2;
    --discord-hover: #4752c4;

    /* Sizing */
    --nav-height: 72px;
    --max-width: 1200px;
    --max-width-wide: 1400px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.legacy {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.legacy {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    line-height: 1.6;
    min-width: 320px;
    overflow-x: auto;
    min-height: 100vh;
}

.legacy img { max-width: 100%; height: auto; display: block; }
.legacy a { color: inherit; text-decoration: none; }
.legacy button { font-family: inherit; cursor: pointer; border: none; background: none; }
.legacy ul, .legacy ol { list-style: none; }

/* --- Typography --- */
.legacy h1, .legacy h2, .legacy h3, .legacy h4, .legacy h5, .legacy h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

.legacy h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.legacy h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.legacy h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.legacy h4 { font-size: 1.125rem; }

.legacy .text-gradient {
    background: var(--gradient-magical);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legacy .hero-title .text-gradient {
    background: linear-gradient(90deg, #FF8BD8 0%, #C77DFF 38%, #F5A95B 72%, #FFD76A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow:
        0 0 14px rgba(255, 190, 105, 0.35),
        0 0 28px rgba(199, 125, 255, 0.22);
}

.legacy .text-glow {
    text-shadow: 0 0 30px rgba(167, 139, 250, 0.4), 0 0 60px rgba(167, 139, 250, 0.15);
}

/* --- Container & Layout --- */
.legacy .container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.legacy .container-wide {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.legacy .section {
    padding: 5rem 0;
    position: relative;
}

.legacy .section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.legacy .section-header h2 {
    margin-bottom: 1rem;
}

.legacy .section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.legacy .section-divider {
    width: 60px;
    height: 3px;
    background: var(--gradient-magical);
    border-radius: 2px;
    margin: 1rem auto 0;
}

/* --- Navigation --- */
.legacy .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: background var(--ease), box-shadow var(--ease);
}

.legacy .nav.scrolled {
    background: rgba(13, 11, 24, 0.96);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.legacy .nav-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.legacy .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.legacy .nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.4));
}

.legacy .nav-brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--gradient-magical);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legacy .nav-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.legacy .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--ease), background var(--ease);
    white-space: nowrap;
}

.legacy .nav-link:hover, .legacy .nav-link.active {
    color: var(--text);
    background: var(--glass-strong);
}

.legacy .nav-link.active {
    color: var(--purple-soft);
}

.legacy .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

/* Nav user */
.legacy .nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legacy .nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border-strong);
}

.legacy .nav-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 2px solid var(--glass-border);
}

/* Mobile nav toggle */
.legacy .nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.5rem;
    transition: background var(--ease);
}

.legacy .nav-toggle:hover {
    background: var(--glass-strong);
}

.legacy .nav-mobile {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(13, 11, 24, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem;
    z-index: 999;
    flex-direction: column;
    gap: 0.25rem;
    animation: slideDown 0.2s ease;
}

.legacy .nav-mobile.open {
    display: flex;
}

/* Collapse the full nav into the hamburger menu below this width. */
@media (max-width: 1360px) {
    .legacy .nav-links, .legacy .nav-actions {
        display: none;
    }

    .legacy .nav-toggle {
        display: flex;
    }
}

/* Above the collapse width, never show the mobile dropdown — even if it was
   left open (mobileMenuOpen=true) before the viewport grew past the toggle. */
@media (min-width: 1361px) {
    .legacy .nav-mobile,
    .legacy .nav-mobile.open {
        display: none;
    }
}

.legacy .nav-mobile .nav-link {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.legacy .nav-mobile .nav-actions {
    display: flex;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* --- Buttons --- */
.legacy .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all var(--ease);
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1.4;
}

.legacy .btn i { font-size: 1.1em; }

.legacy .btn-primary {
    background: var(--gradient-magical);
    color: #fff;
    box-shadow: 0 2px 15px rgba(99, 102, 241, 0.3);
}

.legacy .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.45);
}

.legacy .btn-discord {
    background: var(--discord);
    color: #fff;
    box-shadow: 0 2px 15px rgba(88, 101, 242, 0.3);
}

.legacy .btn-discord:hover {
    background: var(--discord-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(88, 101, 242, 0.45);
}

.legacy .btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--glass-border-strong);
}

.legacy .btn-outline:hover {
    background: var(--glass-strong);
    border-color: var(--purple);
    color: var(--purple-soft);
    transform: translateY(-2px);
}

.legacy .btn-ghost {
    background: var(--glass);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.legacy .btn-ghost:hover {
    background: var(--glass-strong);
    color: var(--text);
    border-color: var(--glass-border-strong);
}

.legacy .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.legacy .btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.legacy .btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.legacy .btn:active {
    transform: translateY(0) scale(0.98);
}

/* --- Hero Section --- */
.legacy .hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
}

.legacy .hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    z-index: 0;
}

.legacy .hero-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
    mix-blend-mode: luminosity;
    pointer-events: none;
}

.legacy .hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 600px at 20% 50%, rgba(109, 70, 220, 0.28) 0%, transparent 70%),
        radial-gradient(ellipse 600px 500px at 80% 30%, rgba(139, 92, 246, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 500px 400px at 50% 80%, rgba(167, 139, 250, 0.12) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

.legacy .hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='50' cy='50' r='1' fill='%23fff' opacity='0.15'/%3E%3Ccircle cx='150' cy='80' r='0.8' fill='%23fff' opacity='0.1'/%3E%3Ccircle cx='250' cy='30' r='1.2' fill='%23fff' opacity='0.12'/%3E%3Ccircle cx='350' cy='120' r='0.6' fill='%23fff' opacity='0.08'/%3E%3Ccircle cx='100' cy='200' r='1' fill='%23fff' opacity='0.1'/%3E%3Ccircle cx='300' cy='250' r='0.8' fill='%23fff' opacity='0.12'/%3E%3Ccircle cx='200' cy='350' r='1.2' fill='%23fff' opacity='0.15'/%3E%3Ccircle cx='80' cy='320' r='0.5' fill='%23fff' opacity='0.08'/%3E%3Ccircle cx='370' cy='380' r='1' fill='%23fff' opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.6;
    animation: starsDrift 60s linear infinite;
}

.legacy .hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.legacy .hero-particle {
    position: absolute;
    border-radius: 50%;
    animation: lg-float linear infinite;
    opacity: 0;
}

.legacy .hero-particle:nth-child(1) {
    width: 6px; height: 6px;
    background: var(--purple);
    left: 10%; top: 20%;
    animation-duration: 12s; animation-delay: 0s;
}
.legacy .hero-particle:nth-child(2) {
    width: 4px; height: 4px;
    background: var(--pink);
    left: 25%; top: 60%;
    animation-duration: 15s; animation-delay: 2s;
}
.legacy .hero-particle:nth-child(3) {
    width: 8px; height: 8px;
    background: var(--blue);
    left: 70%; top: 30%;
    animation-duration: 10s; animation-delay: 1s;
}
.legacy .hero-particle:nth-child(4) {
    width: 5px; height: 5px;
    background: var(--gold);
    left: 85%; top: 70%;
    animation-duration: 14s; animation-delay: 3s;
}
.legacy .hero-particle:nth-child(5) {
    width: 3px; height: 3px;
    background: var(--green);
    left: 50%; top: 15%;
    animation-duration: 11s; animation-delay: 0.5s;
}
.legacy .hero-particle:nth-child(6) {
    width: 7px; height: 7px;
    background: var(--cyan);
    left: 35%; top: 80%;
    animation-duration: 13s; animation-delay: 4s;
}

.legacy .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.legacy .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.4rem;
    background: rgba(139, 92, 246, 0.22);
    border: 1.5px solid rgba(192, 132, 252, 0.55);
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    color: #e9d5ff;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(12px);
    text-shadow: 0 1px 8px rgba(139, 92, 246, 0.4);
}

.legacy .hero-badge i { font-size: 1.05rem; color: #c084fc; }

.legacy .hero-title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-shadow:
        0 2px 12px rgba(60, 20, 120, 0.45),
        0 4px 28px rgba(80, 30, 160, 0.25);
}

.legacy .hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.legacy .hero-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legacy .hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--glass-border);
}

.legacy .hero-stat {
    text-align: center;
}

.legacy .hero-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.legacy .hero-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Orb decorations --- */
.legacy .hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}

.legacy .hero-orb-1 {
    width: 450px; height: 450px;
    background: rgba(139, 92, 246, 0.2);
    top: -100px; left: -100px;
    animation: orbFloat 20s ease-in-out infinite;
}

.legacy .hero-orb-2 {
    width: 380px; height: 380px;
    background: rgba(139, 92, 246, 0.12);
    bottom: -80px; right: -80px;
    animation: orbFloat 25s ease-in-out infinite reverse;
}

.legacy .hero-orb-3 {
    width: 280px; height: 280px;
    background: rgba(192, 132, 252, 0.12);
    top: 40%; right: 10%;
    animation: orbFloat 18s ease-in-out infinite 3s;
}

/* --- Section Styles --- */
.legacy .section-alt {
    background: var(--gradient-section);
}

.legacy .section-dark {
    background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-surface) 50%, var(--bg-base) 100%);
}

/* --- Feature Cards --- */
.legacy .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.legacy .feature-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--ease);
    overflow: hidden;
}

.legacy .feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: opacity var(--ease);
}

/* When card is an anchor — reset link styling */
.legacy a.feature-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Only hover-lift when card is a link */
.legacy a.feature-card:hover, .legacy .feature-card[onclick]:hover, .legacy .feature-card.clickable:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-strong);
    box-shadow: var(--glow-purple);
}

.legacy .feature-card:hover::before {
    opacity: 1;
}

.legacy .feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.legacy .feature-icon.purple { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.legacy .feature-icon.pink { background: rgba(249, 168, 212, 0.15); color: var(--pink); }
.legacy .feature-icon.blue { background: rgba(125, 211, 252, 0.15); color: var(--blue); }
.legacy .feature-icon.green { background: rgba(134, 239, 172, 0.15); color: var(--green); }
.legacy .feature-icon.gold { background: rgba(251, 191, 36, 0.15); color: var(--gold); }
.legacy .feature-icon.rose { background: rgba(251, 113, 133, 0.15); color: var(--rose); }

.legacy .feature-card h3 {
    margin-bottom: 0.75rem;
    position: relative;
}

.legacy .feature-card p {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.65;
    position: relative;
}

/* --- Preview Cards (landing page previews) --- */
.legacy .preview-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.legacy .preview-section.reverse {
    direction: rtl;
}

.legacy .preview-section.reverse > * {
    direction: ltr;
}

.legacy .preview-text h3 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.legacy .preview-text p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.legacy .preview-visual {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.legacy .preview-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(167, 139, 250, 0.05), transparent, rgba(249, 168, 212, 0.05), transparent);
    animation: rotate 20s linear infinite;
}

/* Mini creature cards for previews */
.legacy .mini-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 0.75rem;
    position: relative;
}

.legacy .mini-card {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
    transition: all var(--ease);
    display: flex;
    flex-direction: column;
}

/* Only hover-lift mini-cards that are links */
.legacy a.mini-card:hover, .legacy .mini-card[onclick]:hover {
    transform: translateY(-2px);
    border-color: var(--glass-border-strong);
}

.legacy .mini-card-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

.legacy .mini-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.legacy .mini-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.legacy .mini-card-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* --- Stats Cards --- */
.legacy .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.legacy .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--ease);
}

.legacy .stat-card:hover {
    border-color: var(--glass-border-strong);
    transform: translateY(-2px);
}

.legacy .stat-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.legacy .stat-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.legacy .stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Creature Cards (Collection) --- */
.legacy .creature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.legacy .creature-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--ease);
    cursor: pointer;
    position: relative;
}

.legacy .creature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-purple);
    border-color: var(--glass-border-strong);
}

.legacy .creature-card-img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
    position: relative;
    overflow: hidden;
}

.legacy .creature-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ease);
}

.legacy .creature-card:hover .creature-card-img img {
    transform: scale(1.05);
}

.legacy .creature-card-body {
    padding: 1rem;
}

.legacy .creature-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.legacy .creature-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.legacy .creature-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--glass);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.legacy .creature-tag i { font-size: 0.65rem; }

/* Rarity glow borders */
.legacy .creature-card[data-rarity="legendary"] { border-color: rgba(251, 191, 36, 0.3); }
.legacy .creature-card[data-rarity="legendary"]:hover { box-shadow: var(--glow-gold); }
.legacy .creature-card[data-rarity="mythical"] { border-color: rgba(244, 114, 182, 0.3); }
.legacy .creature-card[data-rarity="mythical"]:hover { box-shadow: var(--glow-pink); }
.legacy .creature-card[data-rarity="epic"] { border-color: rgba(167, 139, 250, 0.2); }
.legacy .creature-card[data-rarity="epic"]:hover { box-shadow: var(--glow-purple); }

/* --- Codex Cards --- */
.legacy .codex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.legacy .codex-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--ease);
    cursor: pointer;
}

.legacy a.codex-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-strong);
}

.legacy .codex-card-img {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
    position: relative;
    overflow: hidden;
}

.legacy .codex-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Rarity letter badge — top-right corner of the codex card image. */
.legacy .codex-card-rarity {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
}

/* Undiscovered / Locked */
.legacy .codex-card.locked .codex-card-img {
    filter: brightness(0.15);
}

.legacy .codex-card.locked .codex-card-img::after {
    content: '?';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.15);
}

.legacy .codex-card.locked .codex-card-body {
    opacity: 0.5;
}

.legacy .codex-lock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 1.25rem;
    backdrop-filter: blur(4px);
}

.legacy .codex-card-body {
    padding: 1rem;
}

.legacy .codex-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.legacy .codex-card-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Element tag — pill when icon + name, plain when icon-only. */
.legacy .element-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.78rem;
    text-transform: capitalize;
}

.legacy .element-tag.icon-only {
    background: transparent;
    border: none;
    padding: 0;
}

/* --- Dashboard Components --- */
.legacy .dashboard-welcome {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.legacy .dashboard-welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-magical);
}

.legacy .dashboard-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-magical);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    border: 3px solid var(--glass-border-strong);
}

.legacy .dashboard-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.legacy .dashboard-welcome-text h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.legacy .dashboard-welcome-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.legacy .dashboard-section {
    margin-bottom: 2rem;
}

.legacy .dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.legacy .dashboard-section-header h3 {
    font-size: 1.15rem;
}

.legacy .quick-links {
    display: grid;
    /* Fixed column count so every row keeps identical box widths AND the
       row stretches to fill the container. Empty slots at the end of a
       short row stay invisible-but-reserved. */
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1100px) {
    .legacy .quick-links { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .legacy .quick-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .legacy .quick-links { grid-template-columns: 1fr; }
}

.legacy .quick-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    transition: all var(--ease);
    text-decoration: none;
    color: var(--text);
}

.legacy .quick-link:hover {
    border-color: var(--glass-border-strong);
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

.legacy .quick-link-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.legacy .quick-link-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.legacy .quick-link-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* --- Dashboard Hero (location-scene banner) --- */
.legacy .dashboard-hero {
    position: relative;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--bg-card);
}

.legacy .dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--hero-bg, none);
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    z-index: -2;
}

.legacy .dashboard-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 14, 40, 0.55) 0%, rgba(20, 14, 40, 0.85) 100%);
    z-index: -1;
}

.legacy .dashboard-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    position: relative;
}

.legacy .dashboard-portrait {
    width: 280px;
    max-width: 70%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
    border: 2px solid var(--glass-border-strong);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
}

.legacy .dashboard-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.legacy .dashboard-hero-text h2 {
    font-size: 1.75rem;
    margin-bottom: 0.6rem;
}

.legacy .dashboard-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.legacy .hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text);
}

.legacy .hero-chip i {
    color: var(--purple-soft);
}

/* --- Selected Lunari card --- */
.legacy .lunari-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.legacy .lunari-card-img {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-md);
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
}

.legacy .lunari-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.legacy .lunari-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legacy .lunari-card-collection {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.4rem;
}

.legacy .lunari-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.legacy .lunari-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.legacy .lunari-chip-level   { background: rgba(125, 211, 252, 0.12); color: var(--blue); border-color: rgba(125, 211, 252, 0.3); }
.legacy .lunari-chip-rarity  { background: rgba(167, 139, 250, 0.12); color: var(--purple); border-color: rgba(167, 139, 250, 0.3); }
.legacy .lunari-chip-stars   { background: rgba(251, 191, 36, 0.12); color: var(--gold); border-color: rgba(251, 191, 36, 0.3); letter-spacing: 0.1em; }

/* --- Facilities grid --- */
.legacy .facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.legacy .facility-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    transition: all var(--ease);
}

.legacy .facility-card:hover {
    border-color: var(--glass-border-strong);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.legacy .facility-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.6rem;
    border-radius: var(--radius-md);
    background: rgba(134, 239, 172, 0.08);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--green);
    font-size: 1.5rem;
}

.legacy .facility-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.legacy .facility-card-emoji { font-size: 1.75rem; }

.legacy .facility-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.legacy .facility-card-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    display: flex;
    justify-content: center;
    gap: 0.3rem;
}

@media (max-width: 768px) {
    /* Full-bleed: bleed scene background to the viewport edges, no rounded corners. */
    .legacy .dashboard-hero {
        padding: 1.5rem 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .legacy .lunari-card { flex-direction: column; text-align: center; }
}

/* --- Page Header --- */
/* page-padded already pads for nav-height; .page-header should not double it. */
.legacy .page-header {
    margin-bottom: 2rem;
}

.legacy .page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.legacy .page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.legacy .page-content {
    padding: 0 1.5rem 4rem;
    max-width: var(--max-width-wide);
    margin: 0 auto;
}

.legacy .page-padded {
    padding-top: calc(var(--nav-height) + 2rem);
    padding-bottom: 4rem;
}

/* --- Search & Filters --- */
.legacy .filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legacy .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--ease);
    outline: none;
}

.legacy .search-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.legacy .search-input::placeholder {
    color: var(--text-muted);
}

.legacy .search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.legacy .search-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.legacy .filter-select {
    padding: 0.65rem 2rem 0.65rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: all var(--ease);
}

.legacy .filter-select:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.legacy .filter-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.legacy .filter-chip {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--ease);
}

.legacy .filter-chip:hover, .legacy .filter-chip.active {
    background: rgba(167, 139, 250, 0.15);
    border-color: var(--purple);
    color: var(--purple-soft);
}

/* --- Help Page --- */
.legacy .help-layout {
    display: grid;
    /* minmax(0, …): a plain 1fr column grows to its widest child, so one wide
       scroller (the Luna Pass reward track) would stretch every section. */
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.legacy .help-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.legacy .help-sidebar-link {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--ease);
}

.legacy .help-sidebar-link:hover {
    background: var(--glass-strong);
    color: var(--text);
}

.legacy .help-sidebar-link.active {
    background: rgba(167, 139, 250, 0.12);
    color: var(--purple-soft);
}

.legacy .help-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.legacy .help-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    scroll-margin-top: calc(var(--nav-height) + 2rem);
}

.legacy .help-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.legacy .help-section h3 i {
    font-size: 1.1rem;
    color: var(--purple);
}

.legacy .help-section p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.legacy .help-section p:last-child {
    margin-bottom: 0;
}

/* ── help/premium-badges: fact cards + badge cards ─────────────────────────
   Two scannable grids that replace paragraph text on that one topic. Both
   collapse to a single column on narrow screens. */

.legacy .fact-grid,
.legacy .badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
}

.legacy .fact-card,
.legacy .badge-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
}

/* Circular icon chip. Colour + tint are set inline per card. */
.legacy .fact-icon,
.legacy .badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid transparent;
    font-size: 1.35rem;
    line-height: 1;
}

.legacy .fact-icon-text {
    font-size: 0.95rem;
    font-weight: 700;
}

.legacy .fact-title {
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.15rem;
}

.legacy .fact-body {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.legacy .fact-list {
    margin: 0.2rem 0 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.legacy .fact-list li {
    margin: 0.15rem 0;
    display: list-item;
}

.legacy .fact-list li::marker {
    color: var(--purple);
}

.legacy .fact-title strong,
.legacy .fact-body strong {
    color: var(--purple);
}

.legacy .badge-body {
    flex: 1;
    min-width: 0;
}

.legacy .badge-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.legacy .badge-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.legacy .badge-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.legacy .badge-effect {
    font-size: 1.02rem;
    line-height: 1.35;
    margin: 0.1rem 0 0.2rem;
}

.legacy .badge-effect strong {
    color: var(--gold);
    font-weight: 700;
}

.legacy .badge-blurb {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.legacy .badge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.legacy .badge-tag {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.22);
    color: var(--purple);
}

.legacy .badge-tag-special {
    background: rgba(103, 232, 249, 0.12);
    border-color: rgba(103, 232, 249, 0.25);
    color: var(--cyan);
}

.legacy .help-tip {
    display: flex;
    gap: 1rem;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.legacy .help-tip i {
    color: var(--purple);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.legacy .help-tip p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.legacy .help-command {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--purple-soft);
}

.legacy code.icmd {
    background: rgba(167, 139, 250, 0.12);
    color: var(--purple-soft);
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 4px;
    padding: 0.1em 0.42em;
    font-size: 0.875em;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    /* inline-block so a chip that lands at a line break moves down whole rather
       than splitting into one padded box per line fragment. */
    display: inline-block;
    white-space: nowrap;
}

.legacy .help-steps {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.legacy .help-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    counter-increment: step;
}

.legacy .help-step::before {
    content: counter(step);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(167, 139, 250, 0.12);
    color: var(--purple-soft);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.legacy .help-step p {
    margin: 0;
    padding-top: 0.3rem;
}

/* --- Legal Pages (Privacy / Terms) --- */
.legacy .legal-hero {
    padding: calc(var(--nav-height) + 3rem) 1.5rem 3rem;
    background: linear-gradient(135deg, #16103a 0%, #1e1254 40%, #251565 70%, #1a1040 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.legacy .legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 400px at 30% 60%, rgba(109, 70, 220, 0.2) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 75% 30%, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.legacy .legal-hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
}

.legacy .legal-hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    font-size: 2rem;
}

.legacy .legal-hero-icon.blue   { background: rgba(125, 211, 252, 0.15); color: var(--blue);   box-shadow: 0 0 32px rgba(125, 211, 252, 0.2); }
.legacy .legal-hero-icon.purple { background: rgba(167, 139, 250, 0.15); color: var(--purple); box-shadow: 0 0 32px rgba(167, 139, 250, 0.2); }

.legacy .legal-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.legacy .legal-hero p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.legacy .legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.legacy .legal-updated i {
    font-size: 0.8rem;
    color: var(--purple);
}

.legacy .legal-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2.5rem;
    align-items: start;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}

.legacy .legal-toc {
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
}

.legacy .legal-toc-heading {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.legacy .legal-toc-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all var(--ease);
    line-height: 1.3;
}

.legacy .legal-toc-link i {
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.legacy .legal-toc-link:hover {
    background: var(--glass-strong);
    color: var(--text);
}

.legacy .legal-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.legacy .legal-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    border-left: 3px solid transparent;
    scroll-margin-top: calc(var(--nav-height) + 1.5rem);
    transition: border-color var(--ease);
    line-height: 1.75;
}

.legacy .legal-section:hover {
    border-left-color: var(--purple);
}

.legacy .legal-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.legacy .legal-section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.legacy .legal-section-icon.purple { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.legacy .legal-section-icon.blue   { background: rgba(125, 211, 252, 0.15); color: var(--blue);   }
.legacy .legal-section-icon.green  { background: rgba(134, 239, 172, 0.15); color: var(--green);  }
.legacy .legal-section-icon.gold   { background: rgba(251, 191, 36,  0.15); color: var(--gold);   }
.legacy .legal-section-icon.pink   { background: rgba(249, 168, 212, 0.15); color: var(--pink);   }
.legacy .legal-section-icon.rose   { background: rgba(251, 113, 133, 0.15); color: var(--rose);   }
.legacy .legal-section-icon.cyan   { background: rgba(103, 232, 249, 0.15); color: var(--cyan);   }
.legacy .legal-section-icon.orange { background: rgba(251, 146, 60,  0.15); color: var(--orange); }

.legacy .legal-section-title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.legacy .legal-section-num {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.legacy .legal-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.legacy .legal-section p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.legacy .legal-section p:last-child {
    margin-bottom: 0;
}

.legacy .legal-section ul,
.legacy .legal-section ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.legacy .legal-section ul li,
.legacy .legal-section ol li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.925rem;
}

.legacy .legal-section ul li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--purple);
    margin-top: 0.58em;
    flex-shrink: 0;
    opacity: 0.7;
}

.legacy .legal-section a {
    color: var(--purple-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--ease);
}

.legacy .legal-section a:hover {
    color: var(--purple);
}

/* --- News Page --- */
.legacy .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.legacy .news-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--ease);
    position: relative;
}

.legacy .news-card:hover {
    border-color: var(--glass-border-strong);
    transform: translateY(-3px);
    box-shadow: var(--glow-purple);
}

.legacy .news-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.legacy .news-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.legacy .news-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.legacy .news-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legacy .news-card-pin {
    font-size: 0.7rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legacy .news-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
}

.legacy .news-card-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.legacy .news-card-read {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--purple-soft);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color var(--ease);
}

.legacy .news-card:hover .news-card-read {
    color: var(--purple);
}

/* Full post detail */
.legacy .news-post-hero-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.legacy .news-post-body {
    color: var(--text-secondary);
    line-height: 1.85;
    font-size: 0.975rem;
    white-space: pre-wrap;
}

.legacy .news-post-body a {
    color: var(--purple-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Accordion for Help */
.legacy .accordion-item {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.legacy .accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ease);
    text-align: left;
}

.legacy .accordion-header:hover {
    background: var(--glass);
}

.legacy .accordion-header i {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform var(--ease);
}

.legacy .accordion-item.open .accordion-header i {
    transform: rotate(180deg);
}

.legacy .accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.legacy .accordion-item.open .accordion-body {
    max-height: 1000px;
}

.legacy .accordion-content {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* --- Badges & Tags --- */
.legacy .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legacy .badge-purple { background: rgba(167, 139, 250, 0.15); color: var(--purple-soft); }
.legacy .badge-blue { background: rgba(125, 211, 252, 0.15); color: var(--blue); }
.legacy .badge-green { background: rgba(134, 239, 172, 0.15); color: var(--green); }
.legacy .badge-gold { background: rgba(251, 191, 36, 0.15); color: var(--gold); }
.legacy .badge-pink { background: rgba(249, 168, 212, 0.15); color: var(--pink); }
.legacy .badge-online { background: rgba(34, 197, 94, 0.15); color: var(--green-deep); }
.legacy .badge-offline { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* --- Empty States --- */
.legacy .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 400px;
    margin: 0 auto;
}

.legacy .empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px dashed var(--glass-border-strong);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--text-muted);
}

.legacy .empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.legacy .empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* --- Detail Panel --- */
.legacy .detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

/* --- Image lightbox (click to zoom) --- */
.legacy .img-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
    animation: fadeIn 0.15s ease;
}

.legacy .img-lightbox img {
    max-width: min(90vw, 900px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    cursor: default;
    animation: slideUp 0.2s ease;
}

.legacy .img-lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ease);
    z-index: 1;
}

.legacy .img-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.legacy .detail-panel {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.legacy .detail-panel-header {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.legacy .detail-panel-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.legacy .detail-panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--ease);
    border: none;
}

.legacy .detail-panel-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.legacy .detail-panel-body {
    padding: 1.5rem 2rem 2rem;
}

.legacy .detail-panel-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legacy .detail-panel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.legacy .detail-stat {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.legacy .detail-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.legacy .detail-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- Footer --- */
.legacy .footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 0;
    margin-top: auto;
}

.legacy .footer-inner {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
}

.legacy .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.legacy .footer-brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient-magical);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legacy .footer-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 300px;
}

.legacy .footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.legacy .footer-link {
    display: block;
    padding: 0.3rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color var(--ease);
}

.legacy .footer-link:hover {
    color: var(--purple-soft);
}

.legacy .footer-bottom {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legacy .footer-socials {
    display: flex;
    gap: 0.75rem;
}

.legacy .footer-social {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1rem;
    transition: all var(--ease);
}

.legacy .footer-social:hover {
    background: var(--glass-strong);
    color: var(--purple-soft);
    border-color: var(--glass-border-strong);
}

/* --- CTA Section --- */
.legacy .cta-section {
    text-align: center;
    padding: 5rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.legacy .cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 600px 400px at 50% 50%, rgba(139, 92, 246, 0.18) 0%, transparent 70%);
}

.legacy .cta-section h2 {
    position: relative;
    margin-bottom: 1rem;
}

.legacy .cta-section p {
    position: relative;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.legacy .cta-buttons {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Commands Table (restyled) --- */
.legacy .commands-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.legacy .commands-table {
    width: 100%;
    border-collapse: collapse;
}

.legacy .commands-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--glass-border);
}

.legacy .commands-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.legacy .commands-table tr:last-child td {
    border-bottom: none;
}

.legacy .commands-table tr:hover td {
    background: var(--glass);
}

.legacy .commands-table code {
    padding: 0.15rem 0.5rem;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: var(--radius-sm);
    color: var(--purple-soft);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.825rem;
    font-weight: 500;
}

.legacy .commands-table .cmd-category {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Command column: one chip for the base command, plain mono for its arguments.
   inline-block keeps a chip from fragmenting into one box per wrapped line. */
.legacy .commands-table code {
    display: inline-block;
}

.legacy .commands-table td.cmd-cell {
    width: 26%;
    min-width: 190px;
    vertical-align: top;
    line-height: 1.7;
}

.legacy .cmd-args {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    margin-left: 0.35rem;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .legacy .commands-table td.cmd-cell {
        width: auto;
        min-width: 0;
    }
}

/* Sub-table rendered beneath a command's description to list its options.
   table-layout: fixed forces the first column to honor its declared width so
   the description column starts at the same x-position across every command's
   options sub-table (otherwise auto-layout would size each table independently
   to its chip width and the descriptions would drift). */
.legacy .help-options-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 0.25rem;
}

.legacy .help-options-table td {
    padding: 0.45rem 0.75rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    vertical-align: top;
}

.legacy .help-options-table tr:last-child td {
    border-bottom: none;
}

.legacy .help-options-table td:first-child {
    white-space: nowrap;
    /* Generous fixed width — must fit the longest option name across every
       command (currently `duplicates_only` at 15 chars). Combined with
       `table-layout: fixed` on the parent table, this guarantees the
       description column starts at the same x-position across every
       command's options sub-table. */
    width: 14rem;
}

/* Icon prefix on rewards in chest / token tables. */
.legacy .commands-table .reward-icon {
    color: var(--gold);
    margin-right: 0.55rem;
    font-size: 1rem;
    vertical-align: -2px;
}

.legacy .help-options-table code {
    padding: 0.1rem 0.45rem;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: var(--radius-sm);
    color: var(--purple-soft);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    /* Fixed-width chip so /page, /inviter, /duplicates_only all render as the
       same visual pill — otherwise short names look tiny and the column
       reads like a ragged left edge. */
    display: inline-block;
    box-sizing: border-box;
    width: 11rem;
    text-align: center;
}

/* --- Progress bar --- */
.legacy .progress-bar {
    height: 6px;
    background: var(--glass);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.legacy .progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-magical);
    transition: width 0.6s ease;
}

/* --- Skeleton loading --- */
.legacy .skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.legacy .skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.legacy .skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 0.75rem; }
.legacy .skeleton-img { aspect-ratio: 1; border-radius: var(--radius-md); }

/* --- Animations & Keyframes --- */
@keyframes heroGlow {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes starsDrift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-400px); }
}

@keyframes lg-float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-10px, 30px); }
    75% { transform: translate(20px, 10px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes lg-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Scrollbar --- */
.legacy ::-webkit-scrollbar {
    width: 8px;
}

.legacy ::-webkit-scrollbar-track {
    background: var(--bg-base);
}

.legacy ::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

.legacy ::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border-strong);
}

/* --- Utility --- */
.legacy .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Egg grid missing state (set by JS onerror) --- */
.legacy .egg-card.egg-missing .mini-card-img img {
    opacity: 0.25;
    filter: grayscale(1);
}

.legacy .egg-card.egg-missing::after {
    content: 'Missing';
    position: absolute;
    bottom: 0.25rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* --- Form --- */
.legacy .form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legacy .text-center { text-align: center; }
.legacy .text-left { text-align: left; }
.legacy .flex { display: flex; }
.legacy .items-center { align-items: center; }
.legacy .gap-sm { gap: 0.5rem; }
.legacy .gap-md { gap: 1rem; }
.legacy .gap-lg { gap: 1.5rem; }
.legacy .mt-1 { margin-top: 0.5rem; }
.legacy .mt-2 { margin-top: 1rem; }
.legacy .mt-3 { margin-top: 1.5rem; }
.legacy .mb-1 { margin-bottom: 0.5rem; }
.legacy .mb-2 { margin-bottom: 1rem; }
.legacy .mb-3 { margin-bottom: 1.5rem; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .legacy .preview-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .legacy .preview-section.reverse {
        direction: ltr;
    }

    .legacy .footer-inner {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .legacy .footer-inner > div:first-child {
        flex: 0 0 100%;
    }

    .legacy .footer-inner > div:not(:first-child) {
        flex: 1 1 120px;
    }

    .legacy .help-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .legacy .detail-img-sidebar {
        order: -1;
    }

    .legacy .help-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

@media (max-width: 700px) {
    /* Collapse help layout when nav collapses — prevents 250px+1fr overflow */
    .legacy .help-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .legacy .help-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .legacy .hero {
        padding: calc(var(--nav-height) + 1rem) 1rem 3rem;
        min-height: auto;
    }

    .legacy .hero-title {
        font-size: 2.2rem;
    }

    .legacy .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .legacy .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .legacy .hero-buttons .btn {
        width: 100%;
    }

    .legacy .section {
        padding: 3rem 0;
    }

    .legacy .features-grid {
        grid-template-columns: 1fr;
    }

    .legacy .creature-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .legacy .codex-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .legacy .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .legacy .footer-inner {
        display: flex;
        flex-wrap: wrap;
        gap: 1.25rem;
    }

    .legacy .footer-inner > div:first-child {
        flex: 0 0 100%;
    }

    .legacy .footer-inner > div:not(:first-child) {
        flex: 1 1 90px;
    }

    .legacy .footer {
        padding: 2rem 0 1.5rem;
    }

    .legacy .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding-top: 1rem;
        margin-top: 1.25rem;
    }

    .legacy .dashboard-welcome {
        flex-direction: column;
        text-align: center;
    }

    .legacy .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .legacy .search-wrapper,
    .legacy .search-input,
    .legacy .filter-select {
        width: 100%;
        min-width: 0;
    }

    /* tighter mobile breathing room above first heading */
    .legacy .page-padded {
        padding-top: calc(var(--nav-height) + 0.75rem);
    }

    .legacy .detail-overlay {
        padding: 1rem;
        align-items: flex-end;
    }

    .legacy .detail-panel {
        max-height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .legacy .mini-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Filter chips scroll horizontally on mobile */
    .legacy .filter-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.25rem;
    }

    .legacy .filter-chips::-webkit-scrollbar { display: none; }

    .legacy .filter-chip {
        flex-shrink: 0;
    }

    /* Detail panel body flex stacks on mobile */
    .legacy .detail-panel-body > div[style*="display: flex"] {
        flex-direction: column;
    }

    /* Detail stats 2 columns on tablet */
    .legacy .detail-panel-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Commands table scroll */
    .legacy .commands-container {
        overflow-x: auto;
    }

    /* Page content less padding */
    .legacy .page-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Legal pages: collapse to single column on tablet */
    .legacy .legal-layout {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem 3rem;
        gap: 1.5rem;
    }

    .legacy .legal-toc {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.75rem;
    }

    .legacy .legal-toc-heading {
        flex: 0 0 100%;
        margin-bottom: 0.25rem;
    }

    .legacy .legal-toc-link {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .legacy .stats-grid {
        grid-template-columns: 1fr;
    }

    .legacy .creature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .legacy .creature-card-body {
        padding: 0.75rem;
    }

    .legacy .creature-card-name {
        font-size: 0.85rem;
    }

    .legacy .hero-stat-value {
        font-size: 1.25rem;
    }

    /* Codex grid smaller on tiny screens */
    .legacy .codex-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }

    /* Detail panel full width */
    .legacy .detail-panel {
        max-width: 100%;
        margin: 0;
    }

    .legacy .detail-panel-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    .legacy .detail-stat {
        padding: 0.5rem 0.75rem !important;
    }

    /* Section header smaller */
    .legacy .section-header h2 {
        font-size: 1.5rem;
    }

    .legacy .section-header p {
        font-size: 0.9rem;
    }

    /* Help layout — cards smaller */
    .legacy .help-section {
        padding: 1.25rem;
    }

    .legacy .help-section h3 {
        font-size: 1.05rem;
    }

    /* Page header tighter */
    .legacy .page-header h1 {
        font-size: 1.5rem;
    }

    /* Nav mobile actions */
    .legacy .nav-mobile .nav-actions {
        flex-direction: column;
    }

    .legacy .nav-mobile .nav-actions .btn {
        width: 100%;
    }

    /* Creature card meta wraps nicely */
    .legacy .creature-card-meta {
        gap: 0.25rem;
    }

    .legacy .creature-tag {
        font-size: 0.6rem;
        padding: 0.1rem 0.35rem;
    }

    /* Collection detail info grid */
    .legacy .help-layout [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Legal pages: tighter on small screens */
    .legacy .legal-hero {
        padding: calc(var(--nav-height) + 2rem) 1rem 2rem;
    }

    .legacy .legal-section {
        padding: 1.25rem;
    }
}

/* ── Season Pass page ───────────────────────────────────────────────────── */

/* Tier comparison */
.legacy .tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.legacy .tier-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.legacy .tier-card-pro {
    border: 1px solid var(--gold);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25), 0 8px 24px rgba(251, 191, 36, 0.08);
}

.legacy .tier-ribbon {
    position: absolute;
    top: -0.6rem;
    right: 1rem;
    background: var(--gold);
    color: #1a1a2e;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
}

.legacy .tier-card-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.legacy .tier-card-header h4 {
    font-size: 1.25rem;
    margin: 0 0 0.4rem;
}

.legacy .tier-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple-soft);
}

.legacy .tier-card-pro .tier-price { color: var(--gold); }

.legacy .tier-price-alt {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.legacy .tier-perks {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex: 1;
}

.legacy .tier-perks li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--glass-border);
    font-size: 0.85rem;
}

.legacy .tier-perks li:last-child { border-bottom: none; }

.legacy .tier-perk-label { color: var(--text-muted); }
.legacy .tier-perk-value { font-weight: 600; }

.legacy .tier-card-pro .tier-perk-value { color: var(--gold); }

.legacy .tier-cta { margin-top: auto; }

/* XP bar in progress card */
.legacy .pass-xp-bar {
    height: 10px;
    background: var(--bg-elevated);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.legacy .pass-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    transition: width 0.4s ease;
}

/* Horizontal reward track */
.legacy .pass-track {
    display: grid;
    grid-template-rows: 1.75rem repeat(3, minmax(80px, auto));
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    scroll-snap-type: x proximity;
    scroll-padding-left: 110px;
}

.legacy .pass-corner,
.legacy .pass-lane {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.legacy .pass-corner { background: transparent; border: none; }

.legacy .pass-lane-free  { color: var(--text-muted); }
.legacy .pass-lane-plus  { color: var(--blue); }
.legacy .pass-lane-pro   { color: var(--gold); }

.legacy .pass-col-num {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem;
    scroll-snap-align: start;
}

.legacy .pass-col-num.reached { color: var(--purple-soft); }
.legacy .pass-col-num.current {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.legacy .pass-cell {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
}

.legacy .pass-cell.current {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 1px var(--gold);
}

.legacy .pass-cell.claimed { opacity: 0.5; }

.legacy .pass-cell-empty { color: var(--text-muted); font-size: 1rem; }

.legacy .pass-cell-check {
    position: absolute;
    top: 0.25rem;
    right: 0.35rem;
    color: var(--green-deep);
    font-size: 1rem;
    background: var(--bg-card);
    border-radius: 999px;
    padding: 0 0.1rem;
}

.legacy .pass-cell-plus { border-top: 2px solid var(--blue); }
.legacy .pass-cell-pro  { border-top: 2px solid var(--gold); }

.legacy .pass-reward {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: default;
    padding: 0.15rem;
    width: 100%;
}

.legacy .pass-reward i {
    font-size: 1.25rem;
    color: var(--purple-soft);
}

.legacy .pass-cell-plus .pass-reward i { color: var(--blue); }
.legacy .pass-cell-pro  .pass-reward i { color: var(--gold); }

.legacy .pass-reward span {
    font-size: 0.65rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (max-width: 768px) {
    .legacy .tier-grid {
        grid-template-columns: 1fr;
    }
    .legacy .pass-track {
        grid-auto-columns: 130px;
        scroll-padding-left: 100px;
    }
    .legacy .pass-corner,
    .legacy .pass-lane {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ── Shared stat-card sizing (used by Codex and Collection detail pages) ── */
.legacy .stats-lg .detail-stat-label { font-size: 0.95rem; letter-spacing: 0; text-transform: none; color: var(--text-secondary); display: flex; align-items: center; gap: 0.35rem; }
.legacy .stats-lg .detail-stat-value { font-size: 1.6rem; }
.legacy .stats-lg .detail-stat        { padding: 1rem 1.25rem; }

.legacy .detail-stat-sub {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.68rem;
    margin-top: 0.25rem;
}

.legacy .detail-stat-value.compare {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.legacy .detail-stat-value.compare .stat-base {
    color: var(--text-muted);
    font-size: 0.7em;
    font-weight: 600;
    opacity: 0.75;
    font-family: 'Outfit', sans-serif;
}

.legacy .detail-stat-value.compare .stat-base::after {
    content: " →";
    margin-left: 0.25rem;
    opacity: 0.55;
}

/* ── Codex level slider (preview species stats at any level) ─────────────── */
.legacy .codex-level-control {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin: 1rem 0 0.75rem;
}

.legacy .codex-level-control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.legacy .codex-level-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.legacy .codex-level-input {
    width: 4rem;
    padding: 0.3rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary, #fff);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.legacy .codex-level-mult {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.9rem;
}

.legacy .codex-level-presets {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}

.legacy .codex-level-slider {
    width: 100%;
    accent-color: var(--gold);
}

/* ============================================================
   HOME PAGE — COVERFLOW CAROUSELS (region / location / boss)
   ============================================================ */

.legacy .coverflow {
    position: relative;
    margin: 2rem auto 0;
    width: 100%;
    perspective: 1600px;
}

.legacy .cover-stage {
    position: relative;
    width: 100%;
    height: 0;
    /* Crop any slide that extends past the stage edge so neighbour slides
       don't bleed beyond the section line. The dots / arrows are siblings
       of the stage so they aren't affected by this clip. */
    overflow: hidden;
}

/* Per-carousel stage heights (drives the aspect of the active slide) */
.legacy .region-cover   .cover-stage { padding-top: 38%; }   /* 16:9 active centered at ~65% width */
.legacy .location-cover .cover-stage { padding-top: 38%; }   /* 3:2 active at ~55% width — matches region for consistent dot spacing */
.legacy .boss-cover     .cover-stage { padding-top: 56%; }   /* 7:10 portrait active at ~40% width */

.legacy .cover-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity   0.5s ease,
                filter    0.5s ease,
                box-shadow 0.5s ease;
    cursor: pointer;
    will-change: transform, opacity;
}

/* ---------- REGION coverflow geometry ---------- */
.legacy .region-cover   .cover-slide { width: 65%; aspect-ratio: 16/9; }
.legacy .location-cover .cover-slide { width: 55%; aspect-ratio: 3/2; }
.legacy .boss-cover     .cover-slide { width: 40%; aspect-ratio: 7/10; background: transparent; border: none; }

/* Boss is meant to float as a free image; suppress the active-slide ring that frames it. */
.legacy .boss-cover .cover-slide[data-off="0"] {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* Active (offset 0) — front and centered */
.legacy .cover-slide[data-off="0"] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: none;
    z-index: 5;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(167, 139, 250, 0.25);
    cursor: pointer;
}

/* Direct neighbors */
.legacy .region-cover   .cover-slide[data-off="1"]  { transform: translate(20%, -50%)   scale(0.78) rotateY(-12deg); }
.legacy .region-cover   .cover-slide[data-off="-1"] { transform: translate(-120%, -50%) scale(0.78) rotateY(12deg); }
.legacy .region-cover   .cover-slide[data-off="2"]  { transform: translate(60%, -50%)   scale(0.55) rotateY(-18deg); }
.legacy .region-cover   .cover-slide[data-off="-2"] { transform: translate(-160%, -50%) scale(0.55) rotateY(18deg); }

.legacy .location-cover .cover-slide[data-off="1"]  { transform: translate(30%, -50%)   scale(0.78) rotateY(-12deg); }
.legacy .location-cover .cover-slide[data-off="-1"] { transform: translate(-130%, -50%) scale(0.78) rotateY(12deg); }
.legacy .location-cover .cover-slide[data-off="2"]  { transform: translate(75%, -50%)   scale(0.55) rotateY(-18deg); }
.legacy .location-cover .cover-slide[data-off="-2"] { transform: translate(-175%, -50%) scale(0.55) rotateY(18deg); }

/* Side bosses sit symmetrically around the active slide (active is at translate -50%).
   ±1 = -50% ± 40% → -10% / -90%.  ±2 = -50% ± 70% → 20% / -120%. */
.legacy .boss-cover     .cover-slide[data-off="1"]  { transform: translate(-10%, -50%)  scale(0.74) rotateY(-14deg); }
.legacy .boss-cover     .cover-slide[data-off="-1"] { transform: translate(-90%, -50%)  scale(0.74) rotateY(14deg); }
.legacy .boss-cover     .cover-slide[data-off="2"]  { transform: translate(20%, -50%)   scale(0.5)  rotateY(-22deg); }
.legacy .boss-cover     .cover-slide[data-off="-2"] { transform: translate(-120%, -50%) scale(0.5)  rotateY(22deg); }

.legacy .cover-slide[data-off="1"],
.legacy .cover-slide[data-off="-1"] {
    z-index: 3;
    opacity: 0.65;
    filter: brightness(0.7);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.legacy .cover-slide[data-off="2"],
.legacy .cover-slide[data-off="-2"] {
    z-index: 2;
    opacity: 0.32;
    filter: brightness(0.5) saturate(0.8);
}
.legacy .cover-slide[data-off="1"]:hover,
.legacy .cover-slide[data-off="-1"]:hover {
    opacity: 0.85;
    filter: brightness(0.9);
}

/* ---------- Slide internals ---------- */
.legacy .cover-slide-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
}
.legacy .cover-slide-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.legacy .cover-slide-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.3;
}

/* Ken-Burns drift only on active region slide */
.legacy .region-cover .cover-slide[data-off="0"] .cover-slide-bg img {
    animation: cover-kenburns 18s ease-in-out infinite alternate;
}
@keyframes cover-kenburns {
    0%   { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.06) translate(-1.5%, -1%); }
}

.legacy .cover-slide-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(18, 16, 42, 0.92) 100%);
    pointer-events: none;
}

.legacy .cover-slide-index {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 4;
}

.legacy .cover-slide-num {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 4;
}

.legacy .cover-slide-meta {
    position: absolute;
    bottom: 1.5rem;
    left: 1.75rem;
    right: 1.75rem;
    color: #fff;
    z-index: 3;
}
.legacy .cover-slide-badges { margin-bottom: 0.6rem; }
.legacy .cover-slide-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.4rem, 2.6vw, 2.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 0.4rem 0;
    color: #fff;
}
.legacy .cover-slide-title-sm {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
}
.legacy .cover-slide-tagline {
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 60ch;
    margin: 0;
}

/* ---------- BOSS slide (no card frame, transparent) ---------- */
.legacy .boss-slide-bg {
    position: absolute;
    inset: -10%;
    background: var(--bg-card);
    border-radius: 50%;
    filter: blur(20px);
    z-index: 0;
}
.legacy .boss-slide-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.legacy .boss-slide-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: filter 0.5s ease;
}
.legacy .boss-slide-tag {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.legacy .boss-slide-scrim {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(180deg, transparent 0%, rgba(18, 16, 42, 0.85) 90%);
    z-index: 2;
    pointer-events: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.legacy .boss-cover .cover-slide[data-off="0"] .boss-slide-scrim { display: block; }
.legacy .boss-cover .cover-slide:not([data-off="0"]) .boss-slide-scrim { display: none; }
.legacy .boss-slide-elements {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}
.legacy .boss-slide-elements .badge {
    font-size: 0.7rem;
    padding: 0.18rem 0.5rem;
    text-transform: lowercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.legacy .boss-cover .cover-slide-meta {
    text-align: center;
}
.legacy .boss-slide-elements { justify-content: center; }

/* ---------- Arrows ---------- */
.legacy .cover-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(33, 29, 80, 0.9);
    border: 1px solid var(--glass-border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: background var(--ease), transform var(--ease);
    font-size: 1.5rem;
}
.legacy .cover-arrow:hover {
    background: var(--purple);
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}
.legacy .cover-arrow-prev { left: 1rem; }
.legacy .cover-arrow-next { right: 1rem; }

/* ---------- Dots ---------- */
.legacy .cover-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 10;
}
.legacy .cover-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(167, 139, 250, 0.25);
    cursor: pointer;
    padding: 0;
    transition: background var(--ease), transform var(--ease);
}
.legacy .cover-dot:hover { background: rgba(167, 139, 250, 0.5); }
.legacy .cover-dot.active {
    background: var(--purple);
    transform: scale(1.3);
}

.legacy .carousel-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Mini-card "DUAL" stamp on dual-element eggs */
.legacy .mini-card-img { position: relative; }
.legacy .mini-card-dual {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    background: rgba(167, 139, 250, 0.9);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    z-index: 2;
}

/* ---------- Responsive ---------- */
/* Decoupled from the navbar breakpoint: carousel sides hide earlier
   so the active slide doesn't fight a half-visible neighbor in the
   tablet/narrow-laptop range. */
@media (max-width: 1024px) {
    .legacy .region-cover   .cover-slide { width: 75%; }
    .legacy .location-cover .cover-slide { width: 65%; }
    .legacy .boss-cover     .cover-slide { width: 50%; }
    .legacy .cover-slide[data-off="1"],
    .legacy .cover-slide[data-off="-1"],
    .legacy .cover-slide[data-off="2"],
    .legacy .cover-slide[data-off="-2"] { opacity: 0; pointer-events: none; }
}
@media (max-width: 768px) {
    .legacy .cover-stage { overflow: hidden; }
    /* Stage padding-top must match the active slide's actual height (width × 1/aspect)
       so meta text isn't cropped. */
    .legacy .region-cover   .cover-stage { padding-top: 56%; }   /* 100% width × 9/16 */
    .legacy .location-cover .cover-stage { padding-top: 67%; }   /* 100% width × 2/3  */
    .legacy .boss-cover     .cover-stage { padding-top: 132%; }  /*  92% width × 10/7 */
    .legacy .region-cover   .cover-slide { width: 100%; }
    .legacy .location-cover .cover-slide { width: 100%; }
    .legacy .boss-cover     .cover-slide { width: 92%; }
    /* Subtle drop shadow under the active slide for depth on mobile. */
    .legacy .cover-slide[data-off="0"] {
        box-shadow: 0 18px 32px rgba(0, 0, 0, 0.55);
    }
    .legacy .cover-arrow { width: 40px; height: 40px; font-size: 1.2rem; }
    .legacy .cover-arrow-prev { left: 0.25rem; }
    .legacy .cover-arrow-next { right: 0.25rem; }
    .legacy .cover-slide-meta { bottom: 1rem; left: 1rem; right: 1rem; }
    .legacy .cover-slide-tagline { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .legacy .cover-slide { transition: opacity 0.2s ease; }
    .legacy .region-cover .cover-slide[data-off="0"] .cover-slide-bg img { animation: none; }
}

/* ============================================
   Floating Support Widget
   ============================================ */
.legacy .support-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.legacy .support-widget-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--gradient-cool);
    color: #0b1020;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), var(--glow-blue);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.legacy .support-widget-fab:hover { transform: translateY(-2px) scale(1.05); }
.legacy .support-widget-fab.is-open { background: var(--bg-card-hover); color: var(--text); }

.legacy .support-widget-window {
    width: 360px;
    max-width: calc(100vw - 3rem);
    height: 480px;
    max-height: calc(100vh - 8rem);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border-strong);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    animation: support-pop 0.18s ease;
}
@keyframes support-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.legacy .support-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--gradient-discord);
    color: #fff;
}
.legacy .support-widget-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.legacy .support-widget-min {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.85;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
}
.legacy .support-widget-min:hover { opacity: 1; background: rgba(255, 255, 255, 0.15); }

.legacy .support-widget-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.legacy .support-widget-msg {
    max-width: 85%;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.legacy .support-widget-you {
    align-self: flex-end;
    background: var(--blue-deep);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.legacy .support-widget-luna {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-bottom-left-radius: 4px;
}
.legacy .support-widget-thinking { color: var(--text-muted); }

.legacy .support-widget-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-base);
}
.legacy .support-widget-input input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--ease);
    outline: none;
}
.legacy .support-widget-input input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}
.legacy .support-widget-input input::placeholder { color: var(--text-muted); }

@media (max-width: 480px) {
    .legacy .support-widget { bottom: 1rem; right: 1rem; }
    .legacy .support-widget-window { height: 70vh; }
}

/* ── Filter sidebar layout ──────────────────────────────────── */
.legacy .filter-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.legacy .filter-main { min-width: 0; }
.legacy .filter-toggle { display: none; }
.legacy .filter-backdrop { display: none; }

.legacy .filter-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.legacy .filter-sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.legacy .filter-sidebar-title {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-weight: 700; font-size: 0.95rem; color: var(--text-heading);
}
.legacy .filter-sidebar-close {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.4rem; line-height: 1;
}

/* Stack the filter controls vertically inside the sidebar. */
.legacy .filter-sidebar .filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
}
.legacy .filter-sidebar .search-wrapper,
.legacy .filter-sidebar .search-input,
.legacy .filter-sidebar .filter-select { width: 100%; }

/* Checkbox group used for optional table columns. */
.legacy .filter-group-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.legacy .filter-checks { display: flex; flex-direction: column; gap: 0.45rem; }
.legacy .filter-check {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; color: var(--text-secondary);
    cursor: pointer;
}
.legacy .filter-check input { accent-color: var(--purple); cursor: pointer; }
.legacy .filter-check:hover { color: var(--text); }

@media (max-width: 900px) {
    .legacy .filter-layout { grid-template-columns: 1fr; }
    .legacy .filter-toggle { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem; }

    .legacy .filter-sidebar {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        width: 300px; max-width: 85vw;
        max-height: none;
        border-radius: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .legacy .filter-layout.is-open .filter-sidebar { transform: translateX(0); }
    .legacy .filter-sidebar-close { display: inline-flex; }

    .legacy .filter-layout.is-open .filter-backdrop {
        display: block;
        position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 150;
    }
}

/* ── Discovery filter group ─────────────────────────────────── */
.legacy .discovery-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    background: rgba(167, 139, 250, 0.06);
}
.legacy .discovery-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gold);
}

/* ── Pagination ─────────────────────────────────────────────── */
.legacy .pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 2rem 0 1rem;
}
.legacy .pager-btn {
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border-strong);
    background: var(--bg-card);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.legacy .pager-btn:hover:not(:disabled):not(.is-active) {
    background: var(--bg-card-hover);
    border-color: var(--purple);
    color: var(--text-heading);
}
.legacy .pager-btn.is-active {
    background: var(--purple);
    border-color: var(--purple);
    color: var(--bg-base);
    cursor: default;
}
.legacy .pager-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.legacy .pager-gap {
    min-width: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}
.legacy .pager-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
}
.legacy .pager-jump-input {
    width: 3.2rem;
    height: 2.4rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border-strong);
    background: var(--bg-base);
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
/* Hide the native up/down spinner arrows */
.legacy .pager-jump-input::-webkit-outer-spin-button,
.legacy .pager-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.legacy .pager-jump-input:focus {
    outline: none;
    border-color: var(--purple);
}

/* ── Battle Advanced ────────────────────────────────────────────────────────
   Reuses .fact-grid / .fact-card (the same cards the other help pages use);
   these are only column-count and density modifiers, plus the value chips.
   Both grids collapse 3/4 → 2 → 1 as the viewport narrows, so nothing ever
   scrolls sideways. */

.legacy .fact-grid.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.legacy .fact-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.legacy .fact-grid.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* An odd last card (e.g. the 5th in a 2×2) spans the full row instead of sitting
   half-width beside empty space — that's the "big box on its own line". */
.legacy .fact-grid.grid-2 > .fact-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (max-width: 1100px) {
    .legacy .fact-grid.grid-3,
    .legacy .fact-grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .legacy .fact-grid.grid-2,
    .legacy .fact-grid.grid-3,
    .legacy .fact-grid.grid-4 { grid-template-columns: 1fr; }
}

/* Cards need to read as objects, not as tinted background. */
.legacy .fact-grid.grid-2 > .fact-card,
.legacy .fact-grid.grid-3 > .fact-card,
.legacy .fact-grid.grid-4 > .fact-card {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.1);
}

/* One mechanic = several short lines; give them a little air between. */
.legacy .fact-grid.grid-3 .fact-body + .fact-body { margin-top: 0.3rem; }

/* Status cards: thirty of them, so tighter padding and a smaller icon. */
.legacy .fact-card.compact {
    padding: 0.7rem 0.8rem;
    gap: 0.6rem;
}

.legacy .fact-card.compact .fact-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
}

.legacy .fact-card.compact .fact-title { font-size: 0.9rem; }
.legacy .fact-card.compact .fact-body  { font-size: 0.8rem; }

/* Emoji icons carry their own colour — no tint, no ring. */
.legacy .fact-icon.emoji {
    background: transparent;
    border-color: transparent;
}

.legacy .status-group { margin-top: 1.25rem; }

.legacy .status-group-title {
    font-weight: 700;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
}

/* Values worth spotting at a glance — 40%, 1.25×, +20%, /view. */
.legacy .mech-chip {
    display: inline-block;
    padding: 0.06rem 0.45rem;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.32);
    color: var(--purple);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

/* A flex child defaults to min-width:auto, so a non-wrapping chip inside a card
   pushes the card wider than its grid column and spills over the next one. */
.legacy .fact-grid.grid-3 .fact-card > div,
.legacy .fact-grid.grid-4 .fact-card > div {
    min-width: 0;
}

.legacy .fact-grid.grid-3 .fact-body,
.legacy .fact-grid.grid-4 .fact-body {
    overflow-wrap: anywhere;
}

/* Formulas are too long to sit inline: give them their own line, let them wrap. */
.legacy .mech-chip.formula {
    display: block;
    width: 100%;
    margin: 0.15rem 0 0.1rem;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    font-size: 0.8rem;
}

/* ── Anatomy inheritance graph (help/breeding-advanced) ─────────────────────
   One stacked bar per compatibility tier: father share, mother share, wildcard
   share. Widths are inline (generated from WildcardAnatomyOdds), so everything
   here is colour, shape and layout only. Pure CSS, no chart library. */

.legacy .anatomy-graph {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.legacy .ag-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr 3rem;
    align-items: center;
    gap: 0.75rem;
}

.legacy .ag-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.legacy .ag-bar {
    display: flex;
    height: 1.75rem;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.legacy .ag-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(10, 8, 30, 0.85);
    white-space: nowrap;
    overflow: hidden;
}

.legacy .ag-seg.ag-father   { background: var(--blue); }
.legacy .ag-seg.ag-mother   { background: var(--pink); }
/* The wildcard slice is the small one, so it carries the loudest colour and a
   soft glow: at 4% it has to be findable without a label inside it. */
.legacy .ag-seg.ag-wildcard {
    background: var(--gold);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}

.legacy .ag-value {
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gold);
}

.legacy .ag-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legacy .ag-key {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legacy .ag-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    display: inline-block;
}

.legacy .ag-dot.ag-father   { background: var(--blue); }
.legacy .ag-dot.ag-mother   { background: var(--pink); }
.legacy .ag-dot.ag-wildcard { background: var(--gold); }

/* Narrow screens: the tier name moves above its bar so the bar keeps its width
   instead of squeezing the parent labels out of their segments. */
@media (max-width: 640px) {
    .legacy .ag-row {
        grid-template-columns: 1fr 3rem;
        row-gap: 0.25rem;
    }

    .legacy .ag-name  { grid-column: 1 / -1; }
    .legacy .ag-seg   { font-size: 0.7rem; }
}

/* --- Lunadex: element type chart + pair calculator --- */
.legacy .el-subnav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.legacy .el-legend { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.legacy .el-key {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.7rem 0.3rem 0.45rem;
    border: 1px solid var(--glass-border); border-radius: var(--radius-full); background: var(--glass);
    font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap;
}
.legacy .el-key b { color: var(--text); font-variant-numeric: tabular-nums; }
.legacy .el-chip {
    width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; font-size: 8px; line-height: 1; flex: none;
}
.legacy .el-s   { background: rgba(74, 222, 128, 0.18); color: #4ade80; box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.45); }
.legacy .el-w   { background: rgba(248, 113, 113, 0.18); color: #f87171; box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.45); }
.legacy .el-n   { background: var(--glass); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--glass-border); }
.legacy .el-ss  { background: rgba(74, 222, 128, 0.34); color: #bbf7d0; box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.7); }
.legacy .el-ww  { background: rgba(248, 113, 113, 0.34); color: #fecaca; box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.7); }

.legacy .el-detail {
    background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: 1rem 1.15rem; margin-bottom: 1rem;
}
.legacy .el-detail-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.legacy .el-detail-top h2 { margin: 0; font-size: 1.15rem; }
.legacy .el-detail-top .hint { color: var(--text-muted); font-size: 0.75rem; }
.legacy .el-lanes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem 1.25rem; }
@media (min-width: 640px)  { .legacy .el-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legacy .el-lane h3 {
    margin: 0 0 0.4rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem;
}
.legacy .el-lane h3 .mult { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.legacy .el-lane h3.s .mult { color: #4ade80; }
.legacy .el-lane h3.w .mult { color: #f87171; }
.legacy .el-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.legacy .el-tag {
    display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; padding: 0.2rem 0.55rem;
    border-radius: 6px; border: 1px solid transparent; background: var(--glass); color: var(--text-secondary);
    cursor: pointer; font-family: inherit;
}
.legacy .el-tag.s  { background: rgba(74, 222, 128, 0.12);  border-color: rgba(74, 222, 128, 0.4);  color: #bbf7d0; }
.legacy .el-tag.w  { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); color: #fecaca; }
.legacy .el-tag.ss { background: rgba(74, 222, 128, 0.26);  border-color: rgba(74, 222, 128, 0.7);  color: #dcfce7; }
.legacy .el-tag.ww { background: rgba(248, 113, 113, 0.26); border-color: rgba(248, 113, 113, 0.7); color: #fee2e2; }
.legacy .el-tag:hover { filter: brightness(1.15); }
.legacy .el-none { color: var(--text-muted); font-size: 0.75rem; font-style: italic; margin: 0; }

.legacy .tc-scroll {
    overflow: auto; background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    max-height: min(76vh, 940px); overscroll-behavior: contain;
}
.legacy .tc-table { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.legacy .tc-table th, .legacy .tc-table td { padding: 0; margin: 0; }
.legacy .tc-corner {
    position: sticky; left: 0; top: 0; z-index: 6; background: var(--bg-card);
    border-right: 1px solid var(--glass-border-strong); border-bottom: 1px solid var(--glass-border-strong);
    width: 130px; min-width: 130px; height: 120px; vertical-align: bottom; text-align: left;
}
.legacy .tc-corner span {
    display: block; padding: 0 0.6rem 0.5rem; font-size: 0.6rem; line-height: 1.35; color: var(--text-muted);
    letter-spacing: 0.05em; text-transform: uppercase;
}
.legacy .tc-corner span b { color: var(--text-secondary); display: block; }
.legacy .tc-col {
    position: sticky; top: 0; z-index: 4; background: var(--bg-card); height: 120px;
    width: 26px; min-width: 26px; max-width: 26px; border-bottom: 1px solid var(--glass-border-strong);
    border-left: 1px solid var(--glass-border); vertical-align: bottom; cursor: pointer;
}
.legacy .tc-col span {
    writing-mode: vertical-rl; transform: rotate(180deg); display: block; margin: 0 auto 0.4rem;
    font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); white-space: nowrap;
}
.legacy .tc-row {
    position: sticky; left: 0; z-index: 3; background: var(--bg-card);
    width: 130px; min-width: 130px; text-align: left; border-right: 1px solid var(--glass-border-strong);
    border-top: 1px solid var(--glass-border); cursor: pointer;
}
.legacy .tc-row span {
    display: block; padding: 0 0.6rem; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legacy .tc-table tbody tr { height: 26px; }
.legacy .tc-table td {
    width: 26px; min-width: 26px; height: 26px; text-align: center; font-size: 9px; line-height: 26px;
    border-left: 1px solid var(--glass-border); border-top: 1px solid var(--glass-border); color: transparent;
}
.legacy .tc-table td.s    { background-color: rgba(74, 222, 128, 0.22);  color: #4ade80; }
.legacy .tc-table td.w    { background-color: rgba(248, 113, 113, 0.22); color: #f87171; }
.legacy .tc-table td.self { background-color: var(--glass-strong); }
.legacy .tc-table tbody tr:hover td, .legacy .tc-table tbody tr:hover .tc-row { background-image: linear-gradient(rgba(167, 139, 250, 0.14), rgba(167, 139, 250, 0.14)); }
.legacy .tc-col:hover span, .legacy .tc-row:hover span { color: var(--text); }
.legacy .tc-table tr.sel .tc-row span, .legacy .tc-col.sel span { color: var(--purple-soft); font-weight: 700; }
.legacy .tc-table tr.sel .tc-row, .legacy .tc-col.sel { background: rgba(167, 139, 250, 0.15); }
.legacy .tc-table td.selc { background-image: linear-gradient(rgba(167, 139, 250, 0.14), rgba(167, 139, 250, 0.14)); }
@media (max-width: 640px) { .legacy .tc-corner, .legacy .tc-row { width: 100px; min-width: 100px; } }

.legacy .eg-group { margin-bottom: 2.5rem; max-width: 860px; }
.legacy .eg-group-title { margin: 0 0 0.9rem; font-size: 1.05rem; }
.legacy .eg-group-count { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }

/* Pre-rendered counter-map art, one portrait image per section */
.legacy .eg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 560px) { .legacy .eg-cards { grid-template-columns: 1fr; } }
.legacy .eg-img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }

.legacy .pc-picker {
    background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: 1rem 1.15rem; margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end;
}
.legacy .pc-slot { flex: 1 1 200px; min-width: 0; }
.legacy .pc-slot label {
    display: block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 0.3rem;
}
.legacy .pc-slot .filter-select { width: 100%; }
.legacy .pc-bar { display: flex; gap: 2px; height: 34px; margin: 0.75rem 0 0.5rem; }
.legacy .pc-seg { display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; min-width: 3px; overflow: hidden; font-variant-numeric: tabular-nums; }
.legacy .pc-seg:first-child { border-radius: 5px 0 0 5px; }
.legacy .pc-seg:last-child  { border-radius: 0 5px 5px 0; }
.legacy .pc-k1 { background: #b91c1c; color: #fee2e2; }
.legacy .pc-k2 { background: rgba(248, 113, 113, 0.55); color: #fff; }
.legacy .pc-k3 { background: var(--glass-strong); color: var(--text-secondary); }
.legacy .pc-k4 { background: rgba(74, 222, 128, 0.5); color: #052e16; }
.legacy .pc-k5 { background: #15803d; color: #dcfce7; }
.legacy .pc-lanes { display: grid; gap: 0.6rem; margin-bottom: 1.5rem; }
.legacy .pc-lane {
    display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0.75rem; align-items: start;
    background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 0.7rem 0.9rem;
}
.legacy .pc-lane-k { display: flex; flex-direction: column; gap: 0.1rem; }
.legacy .pc-lane-k .m { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.legacy .pc-lane-k .n { font-size: 0.7rem; color: var(--text-muted); }
.legacy .pc-lane.k1 .m { color: #f87171; } .legacy .pc-lane.k2 .m { color: #fca5a5; } .legacy .pc-lane.k3 .m { color: var(--text-secondary); }
.legacy .pc-lane.k4 .m { color: #86efac; } .legacy .pc-lane.k5 .m { color: #4ade80; }
.legacy .pc-note { color: var(--text-muted); font-size: 0.8rem; max-width: 70ch; margin: 0 0 0.5rem; }
.legacy .bc-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.legacy .bc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0.9rem; }
.legacy .bc-card {
    background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0;
}
.legacy .bc-top { display: flex; align-items: center; gap: 0.55rem; }
.legacy .bc-name { font-weight: 700; font-size: 0.95rem; }
.legacy .bc-count { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legacy .bc-bar { display: flex; gap: 2px; height: 6px; }
.legacy .bc-seg:first-child { border-radius: 3px 0 0 3px; }
.legacy .bc-seg:last-child  { border-radius: 0 3px 3px 0; }
.legacy .bc-seg.s { background: #4ade80; }
.legacy .bc-seg.n { background: var(--glass-strong); }
.legacy .bc-seg.w { background: #f87171; }
.legacy .bc-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0.5rem; align-items: start; }
.legacy .bc-label {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted);
    padding-top: 0.3rem;
}
.legacy .bc-label span { font-variant-numeric: tabular-nums; letter-spacing: 0; margin-left: 0.2rem; }
.legacy .bc-label.s { color: #4ade80; }
.legacy .bc-label.w { color: #f87171; }
@media (max-width: 560px) {
    .legacy .pc-lane { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
    .legacy .pc-lane-k { flex-direction: row; align-items: baseline; gap: 0.5rem; }
}

/* Legacy tools restyled through tokens to match the new design */
.legacy {
  --bg-base: #0b0907; --bg-surface: #120e0b; --bg-card: #17120e; --bg-card-hover: #1f1813; --bg-elevated: #1c1611; --bg-nav: rgba(11,9,7,.92);
  --purple: #ffc95c; --purple-deep: #ff9a4d; --purple-soft: #ffe0a3; --indigo: #ffb35c;
  --text: #f6eadb; --text-secondary: #cdbfae; --text-muted: #8f8170; --text-heading: #fff7ec;
  --glass: rgba(255,240,220,.035); --glass-strong: rgba(255,240,220,.07); --glass-border: rgba(255,240,220,.09); --glass-border-strong: rgba(255,240,220,.16);
  --gradient-hero: linear-gradient(160deg, #120d09 0%, #1d140d 55%, #0b0907 100%);
  --gradient-magical: linear-gradient(135deg, #ff9a4d, #ffc95c);
  --gradient-card: linear-gradient(145deg, rgba(255,240,220,.05), rgba(255,240,220,0));
  --glow-purple: 0 0 40px rgba(255,201,92,.12);
  font-family: 'Manrope', system-ui, sans-serif; color: var(--text); background: var(--bg-base);
}
.legacy h1, .legacy h2, .legacy h3 { font-family: 'Big Shoulders Display', 'Manrope', sans-serif; letter-spacing: .01em; }
