* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #111;
    border-bottom: 1px solid #333;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff88;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #00ff88;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #00ff88, #0088ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 2rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00ff88;
}

.stat-label {
    color: #aaa;
    margin-top: 0.5rem;
}

/* Markets */
.markets {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #fff;
}

.markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.market-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.market-card:hover {
    transform: translateY(-5px);
    border-color: #00ff88;
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.1);
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.category-badge {
    background: #333;
    color: #00ff88;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.time-remaining {
    color: #aaa;
    font-size: 0.8rem;
}

.market-question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
}

.market-description {
    color: #aaa;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.probability-section {
    background: #111;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.probability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.probability-label {
    font-weight: 600;
    color: #ccc;
}

.probability-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff88;
}

.probability-bar {
    background: #333;
    height: 8px;
    border-radius: 4px;
    position: relative;
    margin-bottom: 1rem;
}

.probability-fill {
    background: linear-gradient(90deg, #ff4444 0%, #00ff88 100%);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.vote-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.vote-stat {
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
}

.yes-stat {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.no-stat {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.vote-count {
    font-size: 1.2rem;
    font-weight: bold;
}

.yes-stat .vote-count {
    color: #00ff88;
}

.no-stat .vote-count {
    color: #ff4444;
}

.vote-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 0.3rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto;
    position: relative;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #333;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 2rem;
}

.current-probability {
    background: #111;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.prob-title {
    color: #aaa;
    margin-bottom: 0.5rem;
}

.prob-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00ff88;
}

.vote-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.vote-option {
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.vote-option.yes {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.vote-option.no {
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid rgba(255, 68, 68, 0.3);
}

.vote-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.vote-option.yes .vote-title {
    color: #00ff88;
}

.vote-option.no .vote-title {
    color: #ff4444;
}

.vote-address {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #333;
    border: none;
    color: #aaa;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #555;
    color: #fff;
}

.qr-container {
    margin: 1rem 0;
    text-align: center;
}

.qr-code {
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
}

.vote-info {
    background: #222;
    border-left: 4px solid #00ff88;
    padding: 1rem;
    margin-top: 2rem;
    border-radius: 0 8px 8px 0;
}

.info-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #00ff88;
}

.info-text {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Create Market */
.create-section {
    background: #111;
    padding: 4rem 0;
}

.create-form {
    max-width: 600px;
    margin: 0 auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ccc;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 1rem;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #00ff88;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(45deg, #00ff88, #0088ff);
    border: none;
    color: #000;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: #00ff88;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn:hover {
    color: #00ff88;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .markets-grid {
        grid-template-columns: 1fr;
    }

    .vote-options {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #111;
        border-top: 1px solid #333;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        z-index: 200;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid #222;
    }

    .nav-links a:hover {
        background: #222;
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }
}