/* SantaGPT Design System & Main Styles */

:root {
    /* Color Palette */
    --bg-color: #0a0a0f;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);

    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --primary-dark: #4f46e5;
    
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.4);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.4);

    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Spacing & Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Chat Specific */
    --user-msg-bg: var(--primary);
    --user-msg-text: #ffffff;
    --bot-msg-bg: var(--card-bg);
    --bot-msg-text: var(--text-main);

    /* Safe-area helpers (iOS) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

button, input, textarea {
    font-family: inherit;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* --- Background Animations --- */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    z-index: -2;
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
}

.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Components: Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #d97706);
    color: #000;
    box-shadow: 0 4px 12px var(--gold-glow);
}

.btn-gold:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--gold-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* --- Layout: Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a:not(.btn):hover {
    color: var(--text-main);
}

/* --- Layout: Containers --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 1.5rem 2rem; /* Top padding for fixed nav */
}

/* --- Components: Badges & Pills --- */

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent); border-color: rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--gold); border-color: rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }


/* --- Components: Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: #111116; /* slightly lighter than bg */
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-main);
}

/* --- Chat Interface (Refactored for Dark Mode) --- */
#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 2rem;
}

.message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    position: relative;
    font-size: 1rem;
    animation: fadeIn 0.3s ease;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--user-msg-text);
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.message.bot {
    align-self: flex-start;
    background-color: var(--bot-msg-bg);
    color: var(--bot-msg-text);
    border-bottom-left-radius: 2px;
    border: 1px solid var(--card-border);
}

.message.system {
    align-self: center;
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold);
    font-size: 0.85rem;
    font-style: italic;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Input Area */
#input-area {
    padding: 1.5rem 1.5rem calc(1.5rem + var(--safe-bottom));
    background: rgba(10, 10, 15, 0.95);
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

#message-input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-right: 3rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s;
}

#message-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.05);
}

/* Typing Indicator */
.typing-indicator {
    padding: 0.5rem 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
}

.typing-indicator.visible {
    opacity: 1;
}

/* Gift Banner */
.gift-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin: 1rem auto;
    max-width: 800px;
    width: 90%;
}

.gift-banner .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.05em;
    font-weight: 700;
}

.gift-banner .gift-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.gift-banner .gift-url {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem calc(8rem + var(--safe-bottom)); /* Extra padding for chat input */
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

footer a {
    color: var(--text-secondary);
}

footer a:hover {
    color: var(--text-main);
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: calc(0.85rem + var(--safe-top)) 1rem 0.85rem;
    }
    
    .nav-links.desktop-only {
        display: none;
    }

    .container {
        padding: calc(5rem + var(--safe-top)) 1rem 2rem;
    }

    .message {
        max-width: 90%;
    }

    #input-area {
        padding: 1rem 1rem calc(1rem + var(--safe-bottom));
    }
    
    .gift-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    
    .gift-banner button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .nav-links .btn {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
        min-width: 0;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .container {
        padding-top: calc(6.25rem + var(--safe-top));
    }

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

    .page-header p {
        font-size: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .benefits-section,
    .highlight-box,
    .warning-box {
        padding: 1.5rem;
    }

    footer {
        padding: 3rem 1rem calc(6rem + var(--safe-bottom));
    }
}

/* --- Content Pages (About, Privacy, etc) --- */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-bottom: 2rem;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.15);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card p, .card li {
    color: var(--text-secondary);
    line-height: 1.7;
}

.card ul {
    list-style: none;
    margin-top: 1rem;
}

.card li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bullet {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.6rem;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.team-member {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--card-border);
}

.team-member .name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.team-member .role {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item .question {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

/* Privacy Page Specifics */
.visibility-grid {
    display: grid;
    gap: 1rem;
}

.visibility-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border-left: 3px solid var(--primary);
}

.visibility-item.donors { border-left-color: var(--gold); }
.visibility-item.public { border-left-color: var(--accent); }

.visibility-item .who {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
}

.warning-box h3 {
    color: var(--gold);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}


.highlight-box .big-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

/* --- Leaderboard --- */
.leaderboard {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.leaderboard-header,
.leaderboard-row {
    display: grid;
    grid-template-columns: 80px 1fr 140px;
    padding: 1.25rem 2rem;
    align-items: center;
}

.leaderboard-header {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
    background: rgba(0,0,0,0.2);
}

.leaderboard-row {
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: rgba(255,255,255,0.02);
}

.rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.nickname {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.score {
    text-align: right;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* --- Sponsor Tiers (Pricing) --- */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.tier-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tier-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 40px var(--gold-glow);
    transform: translateY(-5px);
}

.tier-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.tier-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 1rem;
}

.tier-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.tier-benefits {
    list-style: none;
    margin-bottom: 1.5rem;
}

.tier-benefits li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Benefits Grid (Sponsor Page) */
.benefits-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-bottom: 4rem;
}

.benefits-section h2 {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.benefit-item {
    text-align: center;
    padding: 1.5rem;
}

.benefit-item .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.benefit-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.benefit-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .leaderboard-header,
    .leaderboard-row {
        grid-template-columns: 1fr 1fr;
        row-gap: 0.5rem;
    }

    .rank {
        grid-column: span 2;
        font-size: 1.2rem;
    }

    .score {
        text-align: left;
    }
    


    .tiers-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Dashboard (Sponsor) --- */
.header-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.header-actions a {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.05);
}

.header-actions a:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--text-secondary);
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

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

.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

/* Dashboard: Conversations */
.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.conversation-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.conversation-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.conversation-nickname {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conversation-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.conversation-preview {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.conversation-meta {
    margin-top: 0.75rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.conversation-meta a {
    color: var(--accent);
    font-weight: 600;
}

/* Dashboard: Suggestions */
.suggestion-form {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.suggestion-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-main);
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
}

.suggestion-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.suggestion-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.suggestion-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-pending { background: rgba(245, 158, 11, 0.15); color: var(--gold); }
.status-approved { background: rgba(16, 185, 129, 0.15); color: var(--accent); }

/* Dashboard: Prompts */
.prompt-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.prompt-version {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.active-badge {
    background: var(--accent);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.prompt-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 10px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* Modal Chat Specifics */
.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
}

.chat-message.user {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-left: 2rem;
}

.chat-message.assistant, .chat-message.bot {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    margin-right: 2rem;
}


.message-role {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* --- Tables (Analytics) --- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}

th {
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* --- Chips (Insights) --- */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chip {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

/* --- Static Chat Log (Sponsor View) --- */
.chat-log {
    margin-top: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-border);
    padding: 2rem;
}

/* --- Hamburger Menu --- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 110;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
}

/* --- 480px Breakpoint --- */
@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.6rem;
    }

    .badge, .chip {
        font-size: 0.8rem;
    }

    .card {
        padding: 1.25rem;
    }

    .modal {
        padding: 1.25rem;
    }

    nav {
        padding: calc(0.6rem + var(--safe-top)) 0.75rem 0.6rem;
    }

    .logo {
        font-size: 1.15rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .team-grid {
        grid-template-columns: 1fr 1fr;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    /* Leaderboard card layout */
    .leaderboard-header {
        display: none;
    }

    .leaderboard-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.25rem;
    }

    .rank {
        flex-shrink: 0;
        width: 40px;
        font-size: 1.3rem;
    }

    .nickname {
        flex: 1;
        font-size: 1rem;
    }

    .score {
        flex-shrink: 0;
        text-align: right;
        font-size: 1.1rem;
    }

    /* Reduce backdrop-filter intensity */
    nav {
        background: rgba(10, 10, 15, 0.92);
        backdrop-filter: blur(10px);
    }

    .grid-pattern {
        display: none;
    }
}

/* --- Touch Target Improvements --- */
@media (pointer: coarse) {
    .btn-icon {
        width: 44px;
        height: 44px;
    }

    .close-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    select {
        min-height: 44px;
    }
}

/* --- Performance: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .bg-gradient {
        animation: none;
    }

    .grid-pattern {
        display: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Performance: Hide grid pattern on mobile --- */
@media (max-width: 768px) {
    .grid-pattern {
        display: none;
    }
}

/* --- Footer mobile fix --- */
@media (max-width: 640px) {
    footer p {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem 0.5rem;
    }
}

/* --- Hamburger menu at 640px --- */
@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 80vw);
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: calc(5rem + var(--safe-top)) 1.5rem 2rem;
        display: none;
        z-index: 105;
        gap: 0.5rem;
        overflow-y: auto;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .desktop-only.nav-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        position: static;
        width: auto;
        background: none;
        backdrop-filter: none;
        padding: 0;
        overflow-y: visible;
    }

    .nav-links a:not(.btn) {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-links a:not(.btn):hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-links .btn {
        width: 100%;
        min-height: 44px;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 101;
        display: none;
    }

    .nav-overlay.open {
        display: block;
    }
}

/* --- Admin table card transforms --- */
@media (max-width: 768px) {
    .table-container table.mobile-cards thead {
        display: none;
    }

    .table-container table.mobile-cards tbody tr {
        display: block;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .table-container table.mobile-cards tbody td {
        display: block;
        padding: 0.4rem 0;
        border-bottom: none;
        font-size: 0.9rem;
    }

    .table-container table.mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: block;
        margin-bottom: 0.2rem;
    }
}
