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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1d2e;
    color: #e4e4e7;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* Navigation */
.main-nav {
    background: #16181d;
    border-bottom: 2px solid #2d3748;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    font-size: 24px;
}

.nav-title {
    font-size: 20px;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-link {
    padding: 10px 16px;
    background: #2d3748;
    color: #a0aec0;
    text-decoration: none;
    border: 2px solid transparent;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    background: #374151;
    color: #e4e4e7;
}

.nav-link.active {
    background: #374151;
    color: #60a5fa;
    border-color: #60a5fa;
}

/* GitHub icon in navigation */
.github-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #e4e4e7;
    transition: all 0.3s ease;
    opacity: 0.8;
    margin-left: 12px;
}

.github-nav-link:hover {
    opacity: 1;
    color: #60a5fa;
    transform: scale(1.1);
}

.github-nav-link svg {
    width: 24px;
    height: 24px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid #2d3748;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo h1 {
    font-size: 32px;
    color: #60a5fa;
    font-weight: 700;
}

.icon-large {
    width: 40px;
    height: 40px;
    color: #60a5fa;
}

.subtitle {
    font-size: 18px;
    color: #a0aec0;
}

.phase-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

/* Input Panel */
.input-panel {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    margin-bottom: 20px;
    color: #60a5fa;
    font-weight: 600;
}

.icon {
    width: 20px;
    height: 20px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #a0aec0;
}

.input-group input,
.filter-select,
.filter-input {
    background: #2d3748;
    border: 2px solid #374151;
    padding: 10px 12px;
    color: #e4e4e7;
    font-size: 15px;
    font-family: inherit;
}

.input-group input:focus,
.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #60a5fa;
}

.btn-primary {
    width: 100%;
    background: #3b82f6;
    border: none;
    padding: 12px 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #2d3748;
    border: 2px solid #374151;
    padding: 10px 16px;
    color: #e4e4e7;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: #374151;
    border-color: #60a5fa;
}

.btn-small {
    background: #2d3748;
    border: 2px solid #374151;
    padding: 6px 12px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-small:hover {
    background: #374151;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Error Panel */
.error-panel {
    background: #991b1b;
    border: 2px solid #dc2626;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.error-panel .icon {
    color: #fca5a5;
    flex-shrink: 0;
}

.error-title {
    color: #fca5a5;
    font-weight: 700;
    margin-bottom: 4px;
}

.error-message {
    color: #fecaca;
    font-size: 14px;
}

/* Team Cards */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.team-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 20px;
}

.team-title {
    font-size: 18px;
    color: #60a5fa;
    margin-bottom: 6px;
    font-weight: 700;
}

.team-name {
    font-size: 13px;
    color: #a0aec0;
    margin-bottom: 16px;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px;
    background: #2d3748;
}

.stat-label {
    color: #a0aec0;
}

.stat-value {
    font-weight: 700;
    color: #e4e4e7;
}

/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    padding: 20px;
    border: 2px solid;
}

.metric-blue {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.metric-purple {
    background: #581c87;
    border-color: #a855f7;
}

.metric-green {
    background: #065f46;
    border-color: #10b981;
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: #d1d5db;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

/* Chart Panel */
.chart-panel {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
}

#histogramChart,
#comparisonChart,
#eventScoresChart {
    max-height: 400px;
}

/* Disclaimer */
.disclaimer {
    background: #92400e;
    border: 2px solid #d97706;
    padding: 16px;
    margin-bottom: 24px;
}

.disclaimer p {
    font-size: 14px;
    color: #fcd34d;
    line-height: 1.6;
}

.disclaimer strong {
    color: #fbbf24;
}

/* Match Predictor Specific */
.win-prob-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
}

.win-prob-card h3 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 20px;
}

.win-prob-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
}

.alliance-prob {
    text-align: center;
}

.alliance-label {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.prob-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.your-alliance .prob-value {
    color: #22c55e;
}

.opp-alliance .prob-value {
    color: #ef4444;
}

.prob-label {
    font-size: 12px;
    color: #6b7280;
}

.vs-divider {
    font-size: 24px;
    font-weight: 700;
    color: #6b7280;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.comparison-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 20px;
}

.your-card {
    border-left: 4px solid #22c55e;
}

.opp-card {
    border-left: 4px solid #ef4444;
}

.comparison-card h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.score-display {
    text-align: center;
    margin-bottom: 16px;
    padding: 16px;
    background: #2d3748;
}

.score-main {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.your-card .score-main {
    color: #22c55e;
}

.opp-card .score-main {
    color: #ef4444;
}

.score-range {
    font-size: 13px;
    color: #9ca3af;
}

.team-breakdown h4 {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.insights-panel {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
}

.insights-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #2d3748;
    border-left: 4px solid #60a5fa;
}

.insight-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.insight-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: #60a5fa;
}

.insight-content p {
    font-size: 14px;
    color: #d1d5db;
    line-height: 1.5;
}

/* Pick List */
.event-info-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.event-info-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #60a5fa;
}

.event-code {
    color: #9ca3af;
    font-size: 13px;
}

.team-count {
    color: #6b7280;
    font-size: 15px;
    margin-top: 8px;
}

.filters-panel {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 20px;
    margin-bottom: 24px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    color: #9ca3af;
}

.pick-list-panel {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 20px;
    margin-bottom: 24px;
}

.pick-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.pick-list-table,
.rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pick-list-table thead,
.rankings-table thead {
    background: #2d3748;
}

.pick-list-table th,
.rankings-table th {
    padding: 12px;
    text-align: left;
    font-weight: 700;
    color: #9ca3af;
    border-bottom: 2px solid #374151;
}

.pick-list-table td,
.rankings-table td {
    padding: 12px;
    border-bottom: 1px solid #374151;
}

.pick-list-row:hover,
.rankings-table tr:hover {
    background: #2d3748;
}

.pick-order {
    font-weight: 700;
    font-size: 16px;
}

.team-number {
    font-size: 15px;
}

.pick-score {
    font-weight: 700;
}

.tier-s { color: #fbbf24; }
.tier-a { color: #60a5fa; }
.tier-b { color: #34d399; }
.tier-c { color: #9ca3af; }

.consistency {
    font-size: 13px;
    color: #9ca3af;
}

.legend-panel {
    background: #1e3a8a;
    border: 2px solid #3b82f6;
    padding: 20px;
    margin-bottom: 24px;
}

.legend-panel h4 {
    margin-bottom: 12px;
    color: #60a5fa;
}

.legend-grid {
    display: grid;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.legend-item {
    color: #d1d5db;
}

.legend-item strong {
    color: #60a5fa;
}

/* Event Dashboard */
.event-header-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.event-header-content h2 {
    font-size: 24px;
    color: #60a5fa;
    margin-bottom: 12px;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #9ca3af;
}

.event-date,
.event-location {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-live {
    background: #991b1b;
    color: #ef4444;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #dc2626;
}

.badge-finished {
    background: #374151;
    color: #9ca3af;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #4b5563;
}

.badge-upcoming {
    background: #1e3a8a;
    color: #60a5fa;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #3b82f6;
}

.stat-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 20px;
    text-align: center;
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.alliance-result-card {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 24px;
    margin-bottom: 24px;
}

.alliance-result-card h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #60a5fa;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.result-item {
    text-align: center;
    padding: 16px;
    background: #2d3748;
}

.result-label {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: #22c55e;
}

.rankings-panel {
    background: #16181d;
    border: 2px solid #2d3748;
    padding: 20px;
    margin-bottom: 24px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: #6b7280;
    font-size: 13px;
    border-top: 2px solid #2d3748;
    margin-top: 40px;
}

.footer p {
    margin-bottom: 8px;
}

.creator-credit {
    font-size: 15px;
    color: #60a5fa;
    margin-bottom: 12px;
}

.creator-credit strong {
    color: #93c5fd;
}

.footer a {
    color: #60a5fa;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-small {
    font-size: 12px;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 24px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .win-prob-display {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .vs-divider {
        transform: rotate(90deg);
    }
    
    .prob-value {
        font-size: 36px;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
    }
    
    .github-nav-link {
        width: 28px;
        height: 28px;
        margin-left: 8px;
    }
    
    .github-nav-link svg {
        width: 20px;
        height: 20px;
    }
    /* Legend color samples */
.legend-item .tier-s {
    color: #fbbf24;
    font-weight: 700;
}

.legend-item .tier-a {
    color: #60a5fa;
    font-weight: 700;
}

.legend-item .tier-b {
    color: #34d399;
    font-weight: 700;
}

.legend-item .tier-c {
    color: #9ca3af;
    font-weight: 700;
}
}