/* NCA Evolution - UI Components (Profile, Leaderboard, Modals, Background) */

/* ============================================================
   Animated Background - Cellular Automata Inspired
   ============================================================ */

.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-deep);
}

/* Organic cell-like pattern overlay */
.bg-animation::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(96, 165, 250, 0.04) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(167, 139, 250, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.02) 0%, transparent 30%);
    animation: cells-drift 40s ease-in-out infinite;
}

@keyframes cells-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -10px) scale(1.02); }
    50% { transform: translate(-15px, 15px) scale(0.98); }
    75% { transform: translate(10px, 5px) scale(1.01); }
}

/* Slow morphing gradient */
.bg-animation::after {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(ellipse 80% 60% at 30% 20%, rgba(96, 165, 250, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 70% 80%, rgba(167, 139, 250, 0.1) 0%, transparent 50%);
    animation: morph-gradient 30s ease-in-out infinite;
    will-change: transform;
}

@keyframes morph-gradient {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    33% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
    66% {
        transform: scale(0.95) rotate(-3deg);
        opacity: 1;
    }
}

/* Primary blob - Blue organic shape */
.bg-blob {
    position: absolute;
    filter: blur(80px);
    will-change: transform;
    pointer-events: none;
    opacity: 0.8;
}

.bg-blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(
        ellipse at 40% 40%,
        rgba(96, 165, 250, 0.3) 0%,
        rgba(96, 165, 250, 0.15) 30%,
        rgba(167, 139, 250, 0.1) 50%,
        transparent 70%
    );
    top: -200px;
    left: -200px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blob-morph-1 25s ease-in-out infinite;
}

.bg-blob-2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(
        ellipse at 60% 60%,
        rgba(167, 139, 250, 0.25) 0%,
        rgba(244, 114, 182, 0.1) 40%,
        transparent 70%
    );
    bottom: -150px;
    right: -150px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: blob-morph-2 30s ease-in-out infinite;
}

.bg-blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(34, 211, 238, 0.15) 0%,
        rgba(96, 165, 250, 0.08) 40%,
        transparent 70%
    );
    top: 50%;
    left: 50%;
    border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%;
    animation: blob-morph-3 35s ease-in-out infinite;
}

/* Extra blob for more depth */
.bg-blob-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        rgba(251, 191, 36, 0.1) 0%,
        rgba(244, 114, 182, 0.05) 50%,
        transparent 70%
    );
    top: 20%;
    right: 20%;
    border-radius: 60% 40% 50% 50% / 50% 60% 40% 50%;
    animation: blob-morph-4 28s ease-in-out infinite;
}

@keyframes blob-morph-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        transform: translate(30px, 20px) scale(1.05) rotate(5deg);
        border-radius: 40% 60% 70% 30% / 50% 60% 30% 60%;
    }
    50% {
        transform: translate(-20px, 40px) scale(0.95) rotate(-5deg);
        border-radius: 50% 50% 40% 60% / 40% 40% 60% 60%;
    }
    75% {
        transform: translate(40px, -10px) scale(1.02) rotate(3deg);
        border-radius: 30% 70% 50% 50% / 60% 30% 70% 40%;
    }
}

@keyframes blob-morph-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    33% {
        transform: translate(-30px, -20px) scale(1.08) rotate(-8deg);
        border-radius: 70% 30% 40% 60% / 60% 70% 30% 40%;
    }
    66% {
        transform: translate(20px, -40px) scale(0.92) rotate(5deg);
        border-radius: 50% 50% 60% 40% / 30% 60% 40% 70%;
    }
}

@keyframes blob-morph-3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%;
    }
    50% {
        transform: translate(-45%, -55%) scale(1.2);
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
    }
}

@keyframes blob-morph-4 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: translate(-20px, 30px) scale(1.15) rotate(10deg);
        opacity: 1;
    }
}

/* ============================================================
   Profile Bar - Glassmorphism
   ============================================================ */

.profile-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(10, 12, 18, 0.85) 0%, rgba(20, 24, 32, 0.85) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 30px rgba(96, 165, 250, 0.05);
    position: relative;
    overflow: hidden;
}

/* Subtle shine effect */
.profile-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.3), transparent);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.profile-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

.profile-btn {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.profile-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
    transform: translateY(-1px);
}

.profile-btn.edit {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.profile-btn.x {
    background: rgba(29, 161, 242, 0.15);
    border-color: rgba(29, 161, 242, 0.3);
    color: #1da1f2;
}

.profile-btn.x:hover {
    background: rgba(29, 161, 242, 0.25);
    border-color: #1da1f2;
    box-shadow: 0 0 15px rgba(29, 161, 242, 0.3);
}

.x-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(29, 161, 242, 0.15);
    border: 1px solid rgba(29, 161, 242, 0.3);
    border-radius: 12px;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    color: #1da1f2;
    text-decoration: none;
    transition: all 0.2s ease;
}

.x-badge:hover {
    background: rgba(29, 161, 242, 0.25);
    border-color: #1da1f2;
    box-shadow: 0 0 12px rgba(29, 161, 242, 0.3);
}

.profile-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-score .score-label {
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-score .score-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(255, 200, 87, 0.3);
}

/* ============================================================
   Leaderboard Panel (Tabbed: Curators / Hall of Fame)
   ============================================================ */

.leaderboard-panel {
    background: linear-gradient(135deg, rgba(10, 12, 18, 0.85) 0%, rgba(20, 24, 32, 0.85) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    flex-shrink: 0;
    position: relative;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.leaderboard-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 87, 0.3), transparent);
}

.panel-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.panel-tab {
    background: none;
    border: none;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.panel-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.panel-tab.active {
    color: var(--gold);
    text-shadow: 0 0 15px var(--gold-glow);
    background: rgba(255, 200, 87, 0.1);
}

.panel-link {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.panel-link:hover {
    color: var(--primary-bright);
    text-shadow: 0 0 10px var(--primary-glow);
}

.panel-content {
    position: relative;
}

.panel-section {
    display: none;
}

.panel-section.active {
    display: block;
}

.top-curators-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.3) transparent;
}

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

.top-curators-list::-webkit-scrollbar-track {
    background: transparent;
}

.top-curators-list::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 2px;
}

.top-curators-list::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

.curator-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.curator-item:hover {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.15);
}

.curator-item.is-you {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.1);
}

.curator-rank {
    font-family: var(--font-mono);
    font-weight: 800;
    min-width: 1.4rem;
    text-align: center;
}

.curator-item:nth-child(1) .curator-rank {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}
.curator-item:nth-child(2) .curator-rank {
    color: #e0e0e0;
    text-shadow: 0 0 8px rgba(224, 224, 224, 0.4);
}
.curator-item:nth-child(3) .curator-rank {
    color: #cd7f32;
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.curator-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    min-width: 0;
    font-weight: 500;
}

.curator-x-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #e53935;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 0.4rem;
    transition: all 0.2s ease;
    text-shadow: 0 0 8px rgba(229, 57, 53, 0.4);
}

.curator-x-icon:hover {
    color: #ff5252;
    transform: scale(1.2);
    text-shadow: 0 0 12px rgba(255, 82, 82, 0.6);
}

.curator-score {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    text-shadow: 0 0 10px var(--primary-glow);
}

.no-curators {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.75rem;
    padding: 0.5rem;
}

/* ============================================================
   Hall of Fame - Inside Panel
   ============================================================ */

.hall-of-fame-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 200, 87, 0.3) transparent;
}

.hall-of-fame-list::-webkit-scrollbar {
    width: 4px;
}

.hall-of-fame-list::-webkit-scrollbar-track {
    background: transparent;
}

.hall-of-fame-list::-webkit-scrollbar-thumb {
    background: rgba(255, 200, 87, 0.3);
    border-radius: 2px;
}

.hof-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 200, 87, 0.08);
    border-radius: 8px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hof-item:hover {
    background: rgba(255, 200, 87, 0.08);
    border-color: rgba(255, 200, 87, 0.2);
}

.hof-preview-small {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    image-rendering: pixelated;
    border: 1px solid rgba(255, 200, 87, 0.2);
    flex-shrink: 0;
}

.hof-rank {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
    width: 24px;
    flex-shrink: 0;
}

.hof-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hof-votes {
    font-size: 0.7rem;
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 600;
}

.hof-discoverer {
    font-size: 0.6rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* HoF Preview Modal */
.hof-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
}

.hof-modal.active {
    display: flex;
}

.hof-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.hof-modal-close:hover {
    color: var(--text);
}

.hof-modal-canvas {
    width: min(80vw, 300px);
    height: min(80vw, 300px);
    border-radius: 16px;
    image-rendering: pixelated;
    border: 2px solid var(--gold-dim);
    box-shadow: 0 0 40px rgba(255, 200, 87, 0.3);
}

.hof-modal-info {
    text-align: center;
    color: var(--text);
}

.hof-modal-info h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.hof-modal-info p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.hof-modal-x {
    color: var(--gold);
    text-decoration: none;
    margin-left: 0.25rem;
    transition: opacity 0.2s;
}

.hof-modal-x:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================================
   Modals - Glassmorphism
   ============================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fade-in 0.2s ease-out;
    padding: 1rem;
}

.modal-content {
    background: linear-gradient(135deg, rgba(15, 18, 25, 0.95) 0%, rgba(22, 26, 36, 0.95) 100%);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 20px;
    padding: 1.75rem;
    width: 100%;
    max-width: 320px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(96, 165, 250, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: modal-in 0.3s ease-out;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.4), transparent);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 1.25rem;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
}

.modal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.modal-input-prefix {
    position: absolute;
    left: 0.85rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    pointer-events: none;
}

.modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 10px;
    padding: 0.85rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.modal-input.with-prefix {
    padding-left: 1.85rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), 0 0 20px rgba(96, 165, 250, 0.1);
}

.modal-input::placeholder {
    color: var(--text-muted);
}

.modal-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.6rem;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
    color: var(--bg-deep);
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(96, 165, 250, 0.4);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.modal-btn.danger {
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff6464;
}

.modal-btn.danger:hover {
    background: rgba(255, 100, 100, 0.25);
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.2);
}

/* ============================================================
   Title Row & How It Works Link
   ============================================================ */

.title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.how-it-works-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-transform: lowercase;
    animation: glow-pulse 4s infinite;
}

.how-it-works-link:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-1px);
    text-shadow: 0 0 8px var(--primary);
}

/* ============================================================
   How It Works Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 7, 13, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 1rem;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.how-it-works-content {
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.3);
    color: #ff6464;
}

.how-section {
    margin-bottom: 1.25rem;
}

.how-section:last-child {
    margin-bottom: 0;
}

.how-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.how-section p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.how-section ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.how-section li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.3rem;
}

.how-section li strong {
    color: var(--text);
}

.how-section .paper-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border-bottom: 1px solid transparent;
}

.how-section .paper-link:hover {
    color: var(--primary-bright);
    border-bottom-color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* ============================================
   Enlarged Grid Modal
   ============================================ */
.grid-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 7, 13, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 2500;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fade-in 0.25s ease-out;
    padding: 2rem;
}

.grid-modal-content {
    position: relative;
    width: min(90vw, 900px);
    max-height: 85vh;
    animation: modal-in 0.3s ease-out;
}

.grid-modal-controls {
    position: absolute;
    top: -2.5rem;
    right: 0;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.grid-modal-replay {
    width: 36px;
    height: 36px;
    background: rgba(34, 211, 238, 0.15);
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 50%;
    color: #22d3ee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.grid-modal-replay:hover {
    background: rgba(34, 211, 238, 0.25);
    border-color: #22d3ee;
    color: #22d3ee;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
    transform: scale(1.05);
}

.grid-modal-replay:active {
    transform: scale(0.95);
}

.grid-modal-replay svg {
    width: 18px;
    height: 18px;
}

.grid-modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.grid-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.grid-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    aspect-ratio: 3 / 2;
}

.grid-modal-grid .nca-cell {
    border-radius: 16px;
}

.grid-modal-grid .nca-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.grid-modal.fade-out {
    animation: fade-out 0.2s ease-out forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}
