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

:root {
    --bg: #0a0a0a;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-faint: #707070;
    --border: #333;
    --link: #7eb8da;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.loading, .no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem;
}

.error {
    background: #1a1a1a;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
}

.market-list {
    display: flex;
    flex-direction: column;
    padding-bottom: 48px;
}

.market-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.market-item.trending {
    position: relative;
    margin: 12px -12px;
    padding: 12px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(236, 72, 153, 0.06), rgba(59, 130, 246, 0.08));
    border: 1px solid transparent;
    background-clip: padding-box;
}

.market-item.trending::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(236, 72, 153, 0.3), rgba(59, 130, 246, 0.4));
    z-index: -1;
    opacity: 0.5;
    filter: blur(8px);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.02); }
}

.vote-box {
    min-width: 56px;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.market-item.trending .vote-box {
    color: var(--text);
}

.market-content {
    flex: 1;
    min-width: 0;
}

.market-title-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    justify-content: space-between;
}

.market-title {
    color: var(--link);
    text-decoration: none;
}

.market-title:hover {
    text-decoration: underline;
}

.probability-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.probability-group span:first-child {
    font-weight: 700;
}

.probability-group span:last-child {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.filters-section {
    padding: 0 0 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 769px) {
    .filters-section {
        position: sticky;
        top: 0;
        background: var(--bg);
        padding-top: 16px;
        margin-top: -16px;
        z-index: 100;
    }
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip {
    padding: 4px 0;
    margin-right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    display: inline-flex;
    gap: 4px;
}

.category-chip:hover, .category-chip.active {
    color: var(--text);
}

.category-chip.active {
    font-weight: 600;
}

.category-count {
    font-size: 0.75rem;
    color: var(--text-faint);
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .market-item { gap: 12px; }
    .vote-box { min-width: 48px; font-size: 0.8125rem; }
    .market-title { font-size: 0.9375rem; }
}

footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-faint);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

@media (max-width: 768px) {
    footer .container { flex-direction: column; gap: 8px; }
}
