/* 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%;
}

/* ── GeoDex Wrapper & Filter Bar ─────────────────────────────────────────── */
.geodex-wrapper {
    display: flex;
    flex-direction: column;
    padding-top: 72px; /* account for fixed nav height */
    min-height: 100vh;
}

/* Sticky filter bar — replaces the old heavy left sidebar */
.filter-bar {
    position: sticky;
    top: 72px;
    z-index: 900;
    background: rgba(10, 14, 26, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 217, 255, 0.18);
    padding: 0.65rem 1.75rem;
}

/* Main row: search | state chips | right controls */
.filter-bar-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* Search */
.fb-search-wrap {
    position: relative;
    flex: 0 0 200px;
}

.fb-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

.fb-search {
    width: 100%;
    padding: 0.42rem 0.75rem 0.42rem 2.1rem;
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.22);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.fb-search:focus {
    border-color: var(--accent-cyan);
    background: rgba(0, 217, 255, 0.05);
}

.fb-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.65;
}

/* State chips — horizontal inline row */
.fb-states {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.state-btn {
    padding: 0.35rem 0.8rem;
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.22);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.state-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-color: transparent;
    color: var(--primary-dark);
    font-weight: 700;
}

/* Right-side controls */
.fb-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.fb-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem;
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.28);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fb-filter-toggle:hover,
.fb-filter-toggle[aria-expanded="true"] {
    border-color: var(--accent-cyan);
    background: rgba(0, 217, 255, 0.1);
    color: var(--accent-cyan);
}

.fb-badge {
    background: var(--accent-purple);
    color: white;
    border-radius: 10px;
    padding: 0.05rem 0.42rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.4;
}

.fb-chevron {
    font-size: 0.6rem;
    transition: transform 0.25s;
    display: inline-block;
}

.fb-filter-toggle[aria-expanded="true"] .fb-chevron {
    transform: rotate(180deg);
}

.filter-count {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.btn-reset {
    padding: 0.38rem 0.85rem;
    background: transparent;
    border: 1px solid rgba(183, 148, 246, 0.45);
    border-radius: 8px;
    color: var(--accent-purple);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-reset:hover {
    background: rgba(183, 148, 246, 0.12);
    border-color: var(--accent-purple);
}

/* Expandable filter panel: Type / Role / Rarity */
.fb-panel {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(0, 217, 255, 0.12);
}

.fb-panel.open {
    display: flex;
}

.fb-panel-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.fb-panel-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    min-width: 42px;
    flex-shrink: 0;
}

/* Type button pills */
.type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.type-btn {
    padding: 0.18rem 0.2rem;
    background: rgba(31, 41, 55, 0.55);
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}

.type-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 217, 255, 0.45);
}

.type-btn.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.3);
    transform: translateY(-1px);
}

.type-badge {
    display: block;
    padding: 0.28rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.72rem;
    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 button pills */
.role-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.role-btn {
    padding: 0.28rem 0.6rem;
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.73rem;
    font-weight: 600;
    flex-shrink: 0;
}

.role-btn:hover {
    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.18);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.22);
}

.role-icon {
    font-size: 0.82rem;
}

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

/* Rarity button pills */
.rarity-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.rarity-btn {
    padding: 0.18rem 0.2rem;
    background: rgba(31, 41, 55, 0.55);
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}

.rarity-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 217, 255, 0.45);
}

.rarity-btn.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.3);
    transform: translateY(-1px);
}

.rarity-badge {
    display: block;
    padding: 0.28rem 0.85rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.72rem;
    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); }

/* GeoDex main area — full-width creature grid */
.geodex-main {
    flex: 1;
    padding: 1.5rem 2rem 2rem;
}

/* 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: 1200px) {
    .creature-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 968px) {
    .filter-bar {
        padding: 0.55rem 1rem;
    }

    .fb-search-wrap {
        flex: 0 0 160px;
    }

    .fb-states {
        flex-wrap: wrap;
    }

    .geodex-main {
        padding: 1rem;
    }

    .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 ── */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        padding: 1.2rem;
        border-radius: 10px;
        gap: 1rem;
    }

    .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;
    }

    .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; }

    .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; }
}

@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;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TEAM BUILDER PANEL
   Sticky footer panel for composing, saving, and analysing GST battle teams.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Panel container ── */
.team-builder-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(180deg, rgba(8, 12, 24, 0.97) 0%, rgba(4, 6, 14, 0.99) 100%);
    border-top: 2px solid rgba(251, 191, 36, 0.5);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.7), 0 -2px 0 rgba(251, 191, 36, 0.2);
    backdrop-filter: blur(16px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(calc(100% - 52px)); /* collapsed: only header visible */
    font-family: 'Rajdhani', sans-serif;
}

/* Expanded state (class toggled by JS) */
.team-builder-panel.tb-expanded {
    transform: translateY(0);
}

/* ── Header bar ── */
.tb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 52px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}

.tb-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.tb-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tb-active-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fbbf24;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tb-slot-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.07);
    padding: 2px 8px;
    border-radius: 10px;
}

.tb-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tb-btn {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
    text-decoration: none;
}

.tb-btn-save {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.4);
    color: var(--accent-cyan);
}
.tb-btn-save:hover { background: rgba(0, 217, 255, 0.2); }

.tb-btn-arena {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
}
.tb-btn-arena:hover { background: rgba(251, 191, 36, 0.25); }

.tb-chevron {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: transform 0.3s;
    display: inline-block;
    line-height: 1;
}
.team-builder-panel.tb-expanded .tb-chevron {
    transform: rotate(180deg);
}

/* ── Body ── */
.tb-body {
    padding: 1rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* ── Team tabs bar ── */
.tb-teams-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tb-teams-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tb-tab {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tb-tab:hover { border-color: rgba(0,217,255,0.4); color: var(--text-primary); }
.tb-tab.tb-tab-active {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
}
.tb-tab-delete {
    opacity: 0.5;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
}
.tb-tab-delete:hover { opacity: 1; color: #ef4444; }

.tb-new-team-btn {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px dashed rgba(0,217,255,0.4);
    background: transparent;
    color: rgba(0,217,255,0.7);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.tb-new-team-btn:hover { background: rgba(0,217,255,0.08); color: var(--accent-cyan); }

/* ── Creature slots row ── */
.tb-slots-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.tb-slot {
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    min-height: 110px;
    transition: all 0.2s;
}
.tb-slot.tb-slot-empty {
    justify-content: center;
    cursor: default;
}
.tb-slot.tb-slot-filled {
    border-style: solid;
    border-color: rgba(251,191,36,0.35);
    background: rgba(251,191,36,0.04);
}
.tb-slot.tb-slot-highlight {
    border-color: rgba(0,217,255,0.6);
    box-shadow: 0 0 12px rgba(0,217,255,0.2);
}

.tb-slot-num {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    font-weight: 700;
}

.tb-slot-empty-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.2);
    text-align: center;
    line-height: 1.4;
}

.tb-slot-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.tb-slot-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tb-slot-type {
    font-size: 0.65rem;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
}

.tb-slot-remove {
    position: absolute;
    top: 4px;
    right: 6px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.tb-slot-remove:hover { background: rgba(239,68,68,0.3); }

/* ── Analysis row ── */
.tb-analysis-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 0.85rem;
}

.tb-analysis-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tb-analysis-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Type badge row in analysis */
.tb-type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tb-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

/* Stat bars in analysis */
.tb-stat-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tb-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
}

.tb-stat-label {
    width: 36px;
    color: var(--text-secondary);
    font-weight: 600;
}

.tb-stat-bar-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.tb-stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    transition: width 0.4s ease;
}

.tb-stat-value {
    width: 28px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
}

/* Division badge */
.tb-division-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
}
.tb-division-badge.div-lightweight {
    border-color: rgba(34,197,94,0.5);
    color: #22c55e;
    background: rgba(34,197,94,0.07);
}
.tb-division-badge.div-heavyweight {
    border-color: rgba(251,191,36,0.5);
    color: #fbbf24;
    background: rgba(251,191,36,0.07);
}
.tb-division-badge.div-freeform {
    border-color: rgba(183,148,246,0.5);
    color: var(--accent-purple);
    background: rgba(183,148,246,0.07);
}
.tb-division-badge.div-mixed {
    border-color: rgba(239,68,68,0.5);
    color: #ef4444;
    background: rgba(239,68,68,0.07);
}

.tb-division-note {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 2px;
}

/* ── Modal "Add to Team" button ── */
.modal-add-to-team {
    margin: 0.5rem 0;
    padding: 7px 18px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.04));
    color: #fbbf24;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.modal-add-to-team:hover {
    background: rgba(251,191,36,0.22);
    box-shadow: 0 0 14px rgba(251,191,36,0.2);
}
.modal-add-to-team.tb-full {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Card quick-add "+" button (appears on hover) ── */
.creature-card {
    position: relative; /* ensure relative for absolute child */
}
.creature-card .card-add-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(251,191,36,0.5);
    background: rgba(8,12,24,0.9);
    color: #fbbf24;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.2s;
    z-index: 5;
}
.creature-card:hover .card-add-btn {
    opacity: 1;
    transform: scale(1);
}
.creature-card .card-add-btn:hover {
    background: rgba(251,191,36,0.2);
    box-shadow: 0 0 8px rgba(251,191,36,0.3);
}

/* ── Responsive adjustments ── */
@media (max-width: 900px) {
    .tb-slots-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .tb-analysis-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .tb-header {
        padding: 0 1rem;
    }
    .tb-body {
        padding: 0.75rem 1rem 1rem;
    }
    .tb-slots-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .tb-analysis-row {
        grid-template-columns: 1fr;
    }
}
