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

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --border-color: #2a3548;
    --text-primary: #e8edf5;
    --text-secondary: #8892a6;
    --text-muted: #5a6478;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-red: #ef4444;
    --accent-red-dark: #7f1d1d;
    --accent-yellow: #854d0e;
    --accent-cyan: #06b6d4;
}

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    top: -200px;
    right: -200px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-cyan);
    bottom: -100px;
    left: -100px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--accent-purple);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7c3aed 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.live-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #f87171;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(239, 68, 68, 0.4); }
    50% { border-color: rgba(239, 68, 68, 0.8); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

.stat-card-alert {
    border-color: rgba(239, 68, 68, 0.4);
}

.stat-card-alert:hover {
    border-color: var(--accent-red);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.15);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-purple {
    color: var(--accent-purple-light);
}

.stat-red {
    color: var(--accent-red);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rules-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.rules-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.rule-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.rule-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.rule-name {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.rule-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    z-index: 1;
    margin-bottom: 24px;
}

.table-title {
    font-size: 20px;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.table-row {
    border-bottom: 1px solid rgba(42, 53, 72, 0.5);
    transition: background 0.2s ease;
}

.table-row:hover {
    background: rgba(139, 92, 246, 0.05);
}

.data-table td {
    padding: 16px;
    vertical-align: middle;
}

.td-time {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.td-market {
    font-size: 14px;
    max-width: 280px;
}

.td-amount {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.wallet-btn {
    background: transparent;
    border: none;
    color: var(--accent-purple-light);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.wallet-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    text-decoration: underline;
}

.flag-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-weight: 500;
}

.flag-whale {
    background: var(--accent-red-dark);
    color: #fca5a5;
}

.flag-repeat {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple-light);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 18px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-title {
    font-size: 22px;
    margin-bottom: 16px;
}

.wallet-code {
    display: block;
    background: var(--bg-primary);
    padding: 14px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    word-break: break-all;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.badge-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.badge-yellow {
    background: var(--accent-yellow);
    color: #fef3c7;
}

.badge-red {
    background: var(--accent-red-dark);
    color: #fca5a5;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.modal-stat {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.modal-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.modal-stat-value {
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.repeated-markets {
    margin-bottom: 24px;
}

.repeated-title {
    font-size: 16px;
    margin-bottom: 12px;
}

.repeated-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    gap: 12px;
}

.repeated-question {
    font-size: 13px;
    color: var(--text-secondary);
}

.repeated-count {
    color: #f87171;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.close-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Space Grotesk', sans-serif;
}

.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.footer {
    text-align: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.remix-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.remix-link:hover {
    color: var(--accent-purple-light);
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-buttons {
        width: 100%;
    }
    
    .btn {
        flex: 1;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
}