@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --background: 225 22% 8%;
    --foreground: 210 25% 95%;
    --card: 222 20% 14%;
    --card-foreground: 210 25% 95%;
    --popover: 222 20% 14%;
    --popover-foreground: 210 25% 95%;
    --primary: 215 90% 58%;
    --primary-foreground: 0 0% 100%;
    --secondary: 222 18% 20%;
    --secondary-foreground: 210 25% 95%;
    --muted: 222 18% 20%;
    --muted-foreground: 215 16% 46%;
    --accent: 222 18% 20%;
    --accent-foreground: 210 25% 95%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 222 16% 22%;
    --input: 222 20% 11%;
    --ring: 215 90% 58%;
    --radius: 0.5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Chaos Background */
#chaos-bg {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    overflow: hidden;
    filter: blur(0px);
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 5rem 2rem 2rem;
    align-content: start;
    transition: filter 1s ease, opacity 1s ease;
}

body.dimmed #chaos-bg {
    filter: blur(2px);
    opacity: 0.45;
}

.chaos-tile-cat {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Navigation */
.navbar {
    background: hsl(var(--background) / 0.95);
    backdrop-filter: blur(12px);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid hsl(var(--border));
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

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

.nav-link {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover {
    color: hsl(var(--foreground));
}

.login-btn, .cta-btn {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.login-btn:hover, .cta-btn:hover {
    background: hsl(var(--primary) / 0.9);
}

.login-btn:active, .cta-btn:active {
    transform: scale(0.98);
}

/* Main Content */
.main-content {
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Blur and Overlay */
.content-blur {
    filter: blur(4px);
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

body.dimmed .login-overlay {
    opacity: 1;
    pointer-events: auto;
}

.login-message {
    text-align: center;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 4px);
    padding: 2rem 1.5rem;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

.login-message h2 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0;
}

.login-message .login-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.hero-section {
    text-align: center;
    padding: 6rem 0 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 3.75rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.1;
    color: hsl(var(--foreground));
}

.hero-section p {
    font-size: 1.25rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 3rem;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 6rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    letter-spacing: -0.025em;
}

.stat-label {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Markets */
.markets-preview {
    max-width: 1400px;
    margin: 5rem auto;
}

.markets-preview h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: hsl(var(--foreground));
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.market-card {
    background: #1a1d27;
    border: 1px solid #2a2d3e;
    border-radius: 12px;
    padding: 1rem 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Polymarket-style card internals */
.mc-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.mc-icon-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #252836;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
}

.mc-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0;
    padding-top: 0.05rem;
}

.mc-arc-wrap {
    flex-shrink: 0;
    position: relative;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-arc-wrap svg {
    position: absolute;
    inset: 0;
}

.mc-arc-label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 2px;
}

.mc-pct {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
}

.mc-chance-lbl {
    font-size: 0.58rem;
    color: #64748b;
    font-weight: 500;
    text-transform: lowercase;
}

.mc-actions {
    display: flex;
    gap: 0.4rem;
}

.mc-btn-yes,
.mc-btn-no {
    flex: 1;
    padding: 0.5rem 0;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

.mc-btn-yes {
    background: #14532d;
    color: #4ade80;
}

.mc-btn-no {
    background: #7f1d1d;
    color: #f87171;
}

.mc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid #2a2d3e;
}

.mc-vol {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.mc-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #252836;
}
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: hsl(var(--muted));
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 5rem 0;
    margin: 5rem 0;
}

.cta-section h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: hsl(var(--foreground));
}

.cta-section p {
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.cta-btn {
    font-size: 1rem;
    padding: 0.625rem 1.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsl(var(--background) / 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: hsl(var(--card));
    border-radius: 14px;
    padding: 2rem 1.75rem;
    width: 90%;
    max-width: 420px;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 24px 48px -8px rgb(0 0 0 / 0.5), 0 8px 16px -4px rgb(0 0 0 / 0.4);
}

.modal h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: hsl(var(--foreground));
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: hsl(var(--foreground));
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.modal-content p {
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}

.form-group input::placeholder {
    color: hsl(var(--muted-foreground));
}

.submit-btn {
    width: 100%;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.submit-btn:hover {
    background: hsl(var(--primary) / 0.9);
}

.submit-btn:active {
    transform: scale(0.98);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
}

.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 3px solid hsl(var(--muted));
    border-left: 3px solid hsl(var(--foreground));
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.error-message {
    background: hsl(var(--destructive) / 0.1);
    border: 1px solid hsl(var(--destructive) / 0.3);
    color: hsl(0 84.2% 60.2%);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.success-message {
    background: hsl(142.1 76.2% 36.3% / 0.1);
    border: 1px solid hsl(142.1 76.2% 36.3% / 0.3);
    color: hsl(142.1 70.6% 45.3%);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        display: none;
    }
    
    .hero-section {
        padding: 4rem 0 3rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        gap: 3rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .market-grid {
        grid-template-columns: 1fr;
    }
    
    .markets-preview h2,
    .cta-section h2 {
        font-size: 1.875rem;
    }
    
    /* Magic code responsive */
    .magic-code-display .code-box {
        font-size: 2.5rem !important;
        padding: 1rem !important;
    }
}

/* ===== Magic Code Styles ===== */

.magic-code-display {
    animation: fadeInScale 0.4s ease-out;
}

.code-box {
    position: relative;
    transition: all 0.3s ease;
}

.code-box:hover {
    transform: scale(1.02);
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.copy-btn,
.done-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #4f46e5 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.done-btn:hover {
    background: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.done-btn:active {
    transform: translateY(0);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== End Magic Code Styles ===== */
