:root {
    /* Fenway Greens */
    --color-fenway-50: oklch(0.97 0.01 155);
    --color-fenway-100: oklch(0.94 0.03 155);
    --color-fenway-200: oklch(0.88 0.05 155);
    --color-fenway-600: oklch(0.48 0.10 155);
    --color-fenway-700: oklch(0.40 0.09 155);
    --color-fenway-800: oklch(0.33 0.08 155);
    --color-fenway-900: oklch(0.26 0.06 155);

    /* Cream Neutrals */
    --color-cream-50: oklch(0.97 0.012 80);
    --color-cream-100: oklch(0.95 0.016 80);
    --color-cream-200: oklch(0.92 0.020 80);
    --color-cream-300: oklch(0.87 0.022 80);
    --color-cream-400: oklch(0.81 0.024 80);

    /* Seat Reds */
    --color-seat-500: oklch(0.55 0.14 28);
    --color-seat-600: oklch(0.48 0.15 28);
    --color-seat-700: oklch(0.40 0.13 28);

    /* Ink */
    --color-ink-muted: oklch(0.45 0.02 155);
    --color-ink-soft: oklch(0.60 0.015 155);

    /* Tier Colors */
    --tier-aa: #43937F;
    --tier-a: #588857;
    --tier-b: #3D5354;
    --tier-c: #93493B;
    --tier-d: #455F89;

    /* Typography */
    --font-body: "Merriweather", Georgia, "Times New Roman", Times, serif;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-fenway-900);
    background-color: var(--color-cream-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1 {
    font-family: var(--font-body);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-fenway-900);
}

/* Header / Nav Bar */
.header {
    background: var(--color-cream-100);
    border-bottom: 1px solid var(--color-cream-400);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo img {
    height: 36px;
    width: 53px;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.header-nav a {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-ink-muted);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 12px;
    border-bottom: 2px solid transparent;
}

.header-nav a:hover {
    color: var(--color-fenway-900);
}

.header-nav a.active {
    color: var(--color-fenway-900);
    border-bottom-color: var(--color-fenway-800);
}

/* Controls Bar */
.controls {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 24px 0 16px;
    gap: 16px;
}

/* Week Selector */
.eow-select {
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--color-cream-400);
    border-radius: 2px;
    background-color: var(--color-cream-50);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: var(--color-fenway-900);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.eow-select:focus {
    outline: 2px solid var(--color-fenway-600);
    outline-offset: 2px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

thead th {
    background: var(--color-cream-200);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-bottom: 2px solid var(--color-cream-400);
    color: var(--color-fenway-900);
    white-space: nowrap;
    text-align: left;
}

thead th[aria-sort] {
    cursor: pointer;
    user-select: none;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-cream-300);
    font-size: 0.9375rem;
}

tbody tr:hover {
    background: var(--color-cream-200);
}

/* Links */
a {
    color: var(--color-fenway-600);
    text-decoration: none;
}

a:hover {
    color: var(--color-fenway-800);
    text-decoration: underline;
}

/* Focus */
a:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-fenway-600);
    outline-offset: 2px;
}

/* Utility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading & Error States */
.loading-message {
    text-align: center;
    font-style: italic;
    color: var(--color-ink-soft);
    padding: 32px 12px;
}

.error-message {
    text-align: center;
    color: var(--color-seat-600);
    padding: 32px 12px;
}

.error-message button {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    padding: 8px 16px;
    border: 1px solid var(--color-fenway-700);
    border-radius: 2px;
    background: transparent;
    color: var(--color-fenway-700);
    cursor: pointer;
    margin-top: 12px;
    min-height: 44px;
}

.error-message button:hover {
    background: var(--color-fenway-100);
    color: var(--color-fenway-900);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 16px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .controls {
        flex-wrap: wrap;
        padding: 16px 0 12px;
    }

    thead th {
        padding: 8px 10px;
    }

    td {
        padding: 8px 10px;
        font-size: 0.875rem;
    }
}
