/* GeoDex - Geometric Index Styling */

/* Import base variables from main styles */
:root {
    --primary-dark: #0A0E1A;
    --secondary-dark: #121826;
    --accent-cyan: #00D9FF;
    --accent-purple: #B794F6;
    --text-primary: #E8E9F3;
    --text-secondary: #A0A3BD;
    --fire: #ff4500;
    --life: #22c55e;
    --water: #3b82f6;
    --energy: #fbbf24;
    --space: #8b5cf6;
    --sound: #06b6d4;
    --synthetic: #ec4899;
    --body: #f97316;
    --mind: #a855f7;
    --light: #fef08a;
    --dark: #4c1d95;
    --balance: #64748b;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navigation */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    z-index: 1000;
    transition: all var(--transition-speed);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-cyan);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width var(--transition-speed);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ── Mobile Filter Toggle & Drawer ──────────────────────────────────────────── */
/* Toggle button - hidden on desktop, shown on mobile via media query */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1500;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(0, 217, 255, 0.5);
    background: linear-gradient(145deg, rgba(18, 24, 38, 0.95), rgba(10, 14, 26, 0.95));
    color: var(--accent-cyan);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 20px rgba(0, 217, 255, 0.25),
        0 0 40px rgba(0, 217, 255, 0.08),
        inset 0 1px 0 rgba(0, 217, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
}

.mobile-filter-toggle svg {
    width: 22px;
    height: 22px;
    stroke-linecap: round;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-filter-toggle .filter-icon {
    display: block;
}

.mobile-filter-toggle .close-icon {
    display: none;
}

.mobile-filter-toggle.active .filter-icon {
    display: none;
}

.mobile-filter-toggle.active .close-icon {
    display: block;
}

.mobile-filter-toggle:hover {
    border-color: var(--accent-cyan);
    box-shadow:
        0 0 25px rgba(0, 217, 255, 0.4),
        0 0 50px rgba(0, 217, 255, 0.15),
        inset 0 1px 0 rgba(0, 217, 255, 0.3);
    transform: translateY(-2px);
}

.mobile-filter-toggle.active {
    background: linear-gradient(145deg, rgba(0, 217, 255, 0.2), rgba(183, 148, 246, 0.15));
    border-color: var(--accent-purple);
    box-shadow:
        0 0 25px rgba(183, 148, 246, 0.35),
        0 0 50px rgba(0, 217, 255, 0.1);
}

/* Filter drawer - slides up from bottom on mobile */
.mobile-filter-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1400;
    background: rgba(18, 24, 38, 0.98);
    backdrop-filter: blur(15px);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 20px 20px 0 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 1rem;
}

.mobile-filter-drawer.open {
    max-height: 75vh;
    padding: 1rem 1rem 4.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Drawer handle bar */
.drawer-handle {
    width: 40px;
    height: 4px;
    background: rgba(0, 217, 255, 0.4);
    border-radius: 2px;
    margin: 0 auto 0.8rem;
}

/* Drawer header row */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.drawer-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    color: var(--accent-cyan);
    margin: 0;
}

.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

/* Mobile filter sections - compact horizontal chips */
.mobile-filter-section {
    margin-bottom: 0.8rem;
}

.mobile-filter-section h4 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.mobile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mobile-chip {
    padding: 0.3rem 0.65rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 217, 255, 0.25);
    background: rgba(31, 41, 55, 0.6);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Rajdhani', sans-serif;
    white-space: nowrap;
}

.mobile-chip:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 217, 255, 0.1);
}

.mobile-chip.active {
    background: var(--accent-cyan);
    color: var(--primary-dark);
    border-color: var(--accent-cyan);
}

/* Type-colored chips */
.mobile-chip.chip-fire.active    { background: var(--fire); border-color: var(--fire); color: #fff; }
.mobile-chip.chip-life.active    { background: var(--life); border-color: var(--life); color: #000; }
.mobile-chip.chip-water.active   { background: var(--water); border-color: var(--water); color: #fff; }
.mobile-chip.chip-energy.active  { background: var(--energy); border-color: var(--energy); color: #000; }
.mobile-chip.chip-space.active   { background: var(--space); border-color: var(--space); color: #fff; }
.mobile-chip.chip-sound.active   { background: var(--sound); border-color: var(--sound); color: #000; }
.mobile-chip.chip-synthetic.active { background: var(--synthetic); border-color: var(--synthetic); color: #fff; }
.mobile-chip.chip-body.active    { background: var(--body); border-color: var(--body); color: #000; }
.mobile-chip.chip-mind.active    { background: var(--mind); border-color: var(--mind); color: #fff; }
.mobile-chip.chip-light.active   { background: var(--light); border-color: var(--light); color: #000; }
.mobile-chip.chip-dark.active    { background: var(--dark); border-color: var(--dark); color: #fff; }
.mobile-chip.chip-balance.active { background: var(--balance); border-color: var(--balance); color: #fff; }

.mobile-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(0, 217, 255, 0.15);
}

.mobile-filter-actions button {
    flex: 1;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.3);
    background: rgba(31, 41, 55, 0.8);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-filter-actions .btn-apply {
    background: var(--accent-cyan);
    color: var(--primary-dark);
    border-color: var(--accent-cyan);
}

/* GeoDex Container - Sidebar + Grid Layout */
.geodex-container {
    display: grid;
    grid-template-columns: 350px 1fr 200px;
    gap: 2rem;
    padding: 6rem 2rem 2rem;
    max-width: 2000px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Left Sidebar - Filtering System */
.filter-sidebar {
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 15px;
    padding: 2rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.sidebar-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filter-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.filter-section {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

/* State Filters */
.state-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.state-btn {
    padding: 0.5rem 0.75rem;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.state-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--accent-cyan);
    transform: translateX(5px);
}

.state-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.state-icon {
    font-size: 1.1rem;
}

/* Type Filters */
.type-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.type-btn {
    padding: 0.4rem;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.type-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
}

.type-btn.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

.type-badge {
    display: block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    color: white;
    text-align: center;
}

.type-badge.fire { background: linear-gradient(135deg, var(--fire), #ff6b35); }
.type-badge.life { background: linear-gradient(135deg, var(--life), #16a34a); }
.type-badge.water { background: linear-gradient(135deg, var(--water), #2563eb); }
.type-badge.energy { background: linear-gradient(135deg, var(--energy), #f59e0b); }
.type-badge.space { background: linear-gradient(135deg, var(--space), #7c3aed); }
.type-badge.sound { background: linear-gradient(135deg, var(--sound), #0891b2); }
.type-badge.synthetic { background: linear-gradient(135deg, var(--synthetic), #db2777); }
.type-badge.body { background: linear-gradient(135deg, var(--body), #ea580c); }
.type-badge.mind { background: linear-gradient(135deg, var(--mind), #9333ea); }
.type-badge.light { background: linear-gradient(135deg, var(--light), #fde047); color: var(--primary-dark); }
.type-badge.dark { background: linear-gradient(135deg, var(--dark), #6b21a8); }
.type-badge.balance { background: linear-gradient(135deg, var(--balance), #475569); }

/* Role Filters */
.role-filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.role-btn {
    padding: 0.4rem 0.5rem;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
    background: rgba(0, 217, 255, 0.1);
}

.role-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

.role-icon {
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.role-name {
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 0.7rem;
}

/* Filter Actions */
.filter-actions {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-reset {
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 2px solid var(--accent-purple);
    border-radius: 5px;
    color: var(--accent-purple);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-reset:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
}

.filter-count {
    padding: 1rem;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.3);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.filter-count span {
    color: var(--accent-cyan);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Right Side - Geometric Index */
.geometric-index {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.index-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.index-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 217, 255, 0.2);
    border-top: 4px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Creature Grid - Geometric Layout */
/* Uses auto-fit so columns expand to fill width. max() enforces max 6 per row by
   ensuring each column is at least 1/6 of the available space on wide screens. */
.creature-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
}

.creature-card {
    background: rgba(31, 41, 55, 0.6);
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    --card-glow-color: rgba(0, 217, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.creature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(183, 148, 246, 0.1));
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.creature-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 20px 40px var(--card-glow-color);
}

.creature-card:hover::before {
    opacity: 1;
}

.creature-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 217, 255, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    z-index: 2;
}

.creature-role-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.4rem;
    border-radius: 50%;
    font-size: 1.2rem;
    z-index: 2;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(0, 217, 255, 0.3);
    transition: all var(--transition-speed);
    cursor: help;
}

.creature-role-icon:hover {
    transform: scale(1.2);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
}

.creature-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.creature-image img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

.creature-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.creature-types {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.creature-type {
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 15px;
    border: 2px dashed rgba(0, 217, 255, 0.3);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Rarity Filter Styles */
.rarity-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.rarity-btn {
    padding: 0.8rem;
    background: rgba(31, 41, 55, 0.8);
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.rarity-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
}

.rarity-btn.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

.rarity-badge {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: white;
    text-align: center;
}

.rarity-badge.common {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.rarity-badge.rare {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.rarity-badge.epic {
    background: linear-gradient(135deg, #a855f7, #c084fc);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modal Styles — Redesigned Vertical Flow
   ═══════════════════════════════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    width: 92%;
    margin: 2rem auto;
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.97) 0%, rgba(10, 14, 26, 0.99) 100%);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 217, 255, 0.1);
    z-index: 1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.4);
    transform: scale(1.1);
}

/* ── Shared section title ── */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Hero Banner: Image + Identity side by side ── */
.modal-hero {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.12);
}

.modal-hero-image {
    position: relative;
    flex-shrink: 0;
    width: 220px;
    height: 220px;
    border-radius: 12px;
    border: 2px solid rgba(0, 217, 255, 0.3);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-hero-image img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.modal-rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}

.modal-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.modal-hero-info h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    margin: 0;
    line-height: 1.2;
}

.modal-types {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-basic-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.8rem;
    background: rgba(0, 217, 255, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.1);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
}

.info-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

/* ── Description ── */
.modal-description {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--accent-cyan);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Evolution Chain ── */
.evo-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(0, 217, 255, 0.1);
}

.evo-frame {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    border: 2px solid rgba(0, 217, 255, 0.3);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: rgba(18, 24, 38, 0.6);
}

.evo-frame:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
    transform: scale(1.05);
}

.evo-frame.active-evo {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.4);
}

.evo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 4px;
}

.evo-frame .evo-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-primary);
    font-size: 0.55rem;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    padding: 2px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evo-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.evo-level {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.4);
    white-space: nowrap;
}

.evo-arrow-icon {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
    line-height: 1;
}

/* ── Type Matchup Chart (Damage Dealt) ── */
.modal-type-matchup {
    background: rgba(18, 24, 38, 0.5);
    border: 1px solid rgba(0, 217, 255, 0.12);
    border-radius: 10px;
    padding: 1.2rem;
}

/* Scrollable grid for the matchup cells */
.matchup-chart {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.matchup-chart::-webkit-scrollbar {
    height: 4px;
}

.matchup-chart::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.matchup-chart::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.3);
    border-radius: 4px;
}

/* Each cell: vertical type badge + multiplier */
.matchup-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.15rem;
    border-radius: 6px;
    min-width: 50px;
    transition: background 0.2s;
}

.matchup-cell:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Rotated type label */
.matchup-type-badge {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Multiplier label under the badge */
.matchup-multiplier {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.25rem;
    border-radius: 4px;
    min-width: 42px;
    text-align: center;
    white-space: nowrap;
}

/* ── Multiplier colour coding (offensive: green = strong, red = weak) ── */
.matchup-strong {
    color: #44cc44;
    background: rgba(68, 204, 68, 0.12);
    border: 1px solid rgba(68, 204, 68, 0.25);
}

.matchup-weak {
    color: #ff6666;
    background: rgba(255, 102, 102, 0.12);
    border: 1px solid rgba(255, 102, 102, 0.25);
}

.matchup-neutral {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Weak Against Section ── */
.modal-weak-against {
    background: rgba(18, 24, 38, 0.5);
    border: 1px solid rgba(255, 68, 68, 0.18);
    border-radius: 10px;
    padding: 1.2rem;
}

.weak-against-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ── Two-Column Layout: Stats + Physical/Passive ── */
.modal-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* Combat Stats Section */
.modal-combat-stats {
    padding: 1.2rem;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(0, 217, 255, 0.12);
}

.stats-grid {
    display: grid;
    gap: 0.8rem;
}

.stat-bar {
    margin-bottom: 0;
}

.stat-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.stat-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.stat-val {
    font-weight: 700;
    color: var(--accent-cyan);
    font-size: 0.85rem;
}

.stat-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 217, 255, 0.12);
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.4);
}

.stat-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 217, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.total-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* Right sidebar column (Physical + Passive) */
.modal-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Physical Attributes Section */
.modal-physical-info {
    padding: 1.2rem;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(0, 217, 255, 0.12);
}

.physical-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.physical-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
}

.physical-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.physical-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

/* Passive Skill Section */
.modal-passive-skill {
    padding: 1.2rem;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-left: 3px solid var(--accent-purple);
}

.passive-content {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.passive-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.passive-element {
    font-size: 0.65rem;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.passive-desc {
    width: 100%;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    font-style: italic;
    margin-top: 0.2rem;
}

/* ── Skills Row: Skillset + Compatible Software side by side ── */
.modal-skills-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* Skillset Section */
.modal-skillset {
    padding: 1.2rem;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(0, 217, 255, 0.12);
}

.skillset-list {
    display: grid;
    gap: 0.35rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.skillset-list::-webkit-scrollbar {
    width: 4px;
}

.skillset-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.skillset-list::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 4px;
}

.skill-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    transition: background 0.2s;
}

.skill-row:hover {
    background: rgba(0, 217, 255, 0.08);
}

.skill-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-element-icon {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 50px;
}

.skill-type-icon {
    font-size: 0.85rem;
    text-align: center;
    min-width: 22px;
}

.skill-level {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-align: right;
    min-width: 35px;
}

/* Compatible Software Skills section */
.modal-compatible-software {
    padding: 1.2rem;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(183, 148, 246, 0.15);
}

.compatible-software-list {
    display: grid;
    gap: 0.35rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.compatible-software-list::-webkit-scrollbar {
    width: 4px;
}

.compatible-software-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.compatible-software-list::-webkit-scrollbar-thumb {
    background: rgba(183, 148, 246, 0.3);
    border-radius: 2px;
}

.software-skill-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    align-items: center;
    transition: background 0.2s;
}

.software-skill-row:hover {
    background: rgba(0, 0, 0, 0.4);
}

.software-skill-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.software-skill-element {
    font-size: 0.55rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 45px;
}

.software-skill-role {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    min-width: 55px;
    text-transform: capitalize;
}
.el-fire { background: linear-gradient(135deg, #ff4500, #ff6b35); color: #fff; }
.el-life { background: linear-gradient(135deg, #22c55e, #4ade80); color: #000; }
.el-water { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: #fff; }
.el-energy { background: linear-gradient(135deg, #fbbf24, #fcd34d); color: #000; }
.el-space { background: linear-gradient(135deg, #8b5cf6, #a78bfa); color: #fff; }
.el-sound { background: linear-gradient(135deg, #06b6d4, #22d3ee); color: #000; }
.el-synthetic { background: linear-gradient(135deg, #ec4899, #f472b6); color: #fff; }
.el-body { background: linear-gradient(135deg, #f97316, #fb923c); color: #000; }
.el-mind { background: linear-gradient(135deg, #a855f7, #c084fc); color: #fff; }
.el-light { background: linear-gradient(135deg, #fef08a, #fde047); color: #000; }
.el-dark { background: linear-gradient(135deg, #4c1d95, #7c3aed); color: #fff; }
.el-balance { background: linear-gradient(135deg, #64748b, #94a3b8); color: #fff; }

/* Responsive Design */
@media (max-width: 1400px) {
    .geodex-container {
        grid-template-columns: 300px 1fr;
    }
    
    .quick-view-sidebar {
        display: none;
    }
}

@media (max-width: 1200px) {
    .geodex-container {
        grid-template-columns: 300px 1fr;
    }
    
    .creature-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 968px) {
    .geodex-container {
        grid-template-columns: 1fr;
        padding-top: 5rem;
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 1rem;
    }

    /* Hide desktop filter sidebar on mobile */
    .filter-sidebar {
        display: none;
    }

    /* Show mobile filter toggle */
    .mobile-filter-toggle {
        display: flex;
    }

    /* Mobile filter drawer */
    .mobile-filter-drawer {
        display: block;
    }
    
    .creature-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .nav-links {
        gap: 0.8rem;
        font-size: 0.85rem;
    }

    /* ── Modal mobile fixes (redesigned layout) ── */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        padding: 1.2rem;
        border-radius: 10px;
        gap: 1rem;
    }

    /* Hero stacks vertically on tablet/mobile */
    .modal-hero {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .modal-hero-image {
        width: 180px;
        height: 180px;
        margin: 0 auto;
    }

    .modal-hero-info h2 {
        font-size: 1.4rem;
    }

    .modal-basic-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .section-title {
        font-size: 0.9rem;
    }

    /* Two-column areas stack on mobile */
    .modal-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-skills-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-combat-stats {
        padding: 1rem;
    }

    .modal-physical-info {
        padding: 1rem;
    }

    .modal-passive-skill {
        padding: 0.8rem;
    }

    .modal-skillset {
        padding: 1rem;
    }

    .skillset-list {
        max-height: 250px;
    }

    .modal-compatible-software {
        padding: 0.8rem;
    }

    .compatible-software-list {
        max-height: 200px;
    }

    /* Type matchup chart — 6 columns on tablet */
    .matchup-chart {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.3rem;
    }

    .matchup-cell {
        min-width: unset;
        padding: 0.3rem 0.12rem;
    }

    .matchup-type-badge {
        font-size: 0.5rem;
        min-height: 40px;
        padding: 0.15rem 0.35rem;
    }

    .matchup-multiplier {
        font-size: 0.6rem;
        min-width: 36px;
    }

    .evo-chain {
        gap: 0.5rem;
        padding: 0.8rem;
    }

    .evo-frame {
        width: 75px;
        height: 75px;
    }

    .index-header h1 {
        font-size: 2rem;
    }
}

/* Right Sidebar - Quick View List */
.quick-view-sidebar {
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 15px;
    padding: 1rem;
    height: calc(100vh - 120px);
    position: sticky;
    top: 100px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.quick-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    margin-bottom: 1rem;
}

.quick-view-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--accent-cyan);
    margin: 0;
}

.quick-view-count {
    background: rgba(0, 217, 255, 0.2);
    color: var(--accent-cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.quick-view-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 0.5rem;
}

.quick-view-list::-webkit-scrollbar {
    width: 6px;
}

.quick-view-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.quick-view-list::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.3);
    border-radius: 3px;
}

.quick-view-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.5);
}

.quick-view-item {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.3);
}

.quick-view-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
}

.quick-view-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quick-view-item .quick-view-number {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-cyan);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    z-index: 1;
}

@media (max-width: 640px) {
    .creature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    /* Keep square aspect ratio on small screens */
    .creature-image {
        aspect-ratio: 1;
    }

    .modal-content {
        width: 98%;
        margin: 0.5rem auto;
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .modal-hero-image {
        width: 150px;
        height: 150px;
    }

    .modal-hero-info h2 {
        font-size: 1.2rem;
    }

    .modal-close {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
        top: 0.5rem;
        right: 0.5rem;
    }

    .section-title {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }

    .evo-frame {
        width: 60px;
        height: 60px;
    }

    .evo-level {
        font-size: 0.6rem;
    }

    .evo-arrow-icon {
        font-size: 1.2rem;
    }

    /* Matchup chart — 4 columns on small phones */
    .matchup-chart {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }

    .matchup-cell {
        padding: 0.2rem 0.08rem;
        gap: 0.2rem;
    }

    .matchup-type-badge {
        font-size: 0.45rem;
        min-height: 34px;
        padding: 0.1rem 0.25rem;
    }

    .matchup-multiplier {
        font-size: 0.55rem;
        min-width: 32px;
        padding: 0.1rem 0.15rem;
    }

    .nav-bar .container {
        padding: 0 0.8rem;
    }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .logo {
        font-size: 1rem;
    }
}
