html, body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    color: #1a1a1a;
    background: #f7f7f5;
}

.home {
    max-width: 40rem;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.home h1 {
    font-size: 1.75rem;
    font-weight: 650;
    margin: 0 0 0.75rem;
}

.home p {
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.home .muted {
    color: #666;
    font-size: 0.95rem;
}

.page {
    max-width: 48rem;
}

.page-wide {
    max-width: 56rem;
}

.page h1 {
    font-size: 1.5rem;
    font-weight: 650;
    margin: 0 0 0.75rem;
}

.page p {
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.page .muted {
    color: #666;
    font-size: 0.95rem;
}

.page .status,
.page .empty {
    color: #555;
    font-size: 0.95rem;
}

.page .error {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    background: #f8d7da;
    color: #842029;
    border-radius: 4px;
    font-size: 0.95rem;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e2dc;
    vertical-align: middle;
}

.data-table thead th {
    font-weight: 650;
    color: #333;
    background: #f0f0ec;
    border-bottom-color: #d5d5ce;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .col-jersey,
.data-table .col-num {
    width: 5.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table .col-date {
    width: 7rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.data-table .col-time {
    width: 4.5rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.data-table .col-action {
    width: 4.5rem;
    text-align: right;
    white-space: nowrap;
}

.data-table .row-link,
.data-table .detail-link {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
}

.data-table .row-link:hover,
.data-table .detail-link:hover {
    text-decoration: underline;
}

.venue-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #ecece8;
    color: #333;
}

.venue-badge.venue-home {
    background: #e4ede6;
    color: #1e4d2b;
}

.venue-badge.venue-away {
    background: #e6e8ec;
    color: #2c3a4a;
}

.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;
}

.page-stats {
    max-width: none;
}

.back-link {
    margin: 0 0 1rem;
}

.back-link a {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.game-meta {
    margin-bottom: 1rem;
}

.game-meta .meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.game-meta .meta-hint {
    margin-bottom: 0.75rem;
}

.game-actions {
    margin: 0 0 0.5rem;
}

.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #c5c5c0;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #f5f5f2;
}

.btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.stats-grid {
    min-width: 36rem;
}

.stats-grid .col-player {
    min-width: 10rem;
    white-space: nowrap;
}

.stats-grid .col-stat {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 3.25rem;
}

.stats-grid thead .col-stat {
    vertical-align: bottom;
}

.stats-grid .stat-code {
    display: block;
    font-weight: 650;
}

.stats-grid .stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-grid tfoot th,
.stats-grid tfoot td {
    font-weight: 650;
    background: #f0f0ec;
    border-bottom: none;
    border-top: 1px solid #d5d5ce;
}

.events-section {
    margin-top: 2rem;
}

.events-section h2 {
    font-size: 1.15rem;
    font-weight: 650;
    margin: 0 0 0.35rem;
}

.events-section .events-hint {
    margin-bottom: 0.75rem;
}

.events-table {
    min-width: 28rem;
}

.events-table .col-time {
    width: 5.5rem;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
}

.events-table .col-quarter {
    width: 4rem;
    font-weight: 650;
    white-space: nowrap;
}

.events-table .col-player {
    min-width: 10rem;
    white-space: nowrap;
}

.events-table .col-stat-event .stat-label {
    display: block;
    font-weight: 600;
}

.events-table .col-stat-event .stat-code-muted {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

.section-links {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.section-links a {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
}

.section-links a:hover {
    text-decoration: underline;
}

.login {
    max-width: 24rem;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.login h1 {
    font-size: 1.75rem;
    font-weight: 650;
    margin: 0 0 0.5rem;
}

.login .lead {
    margin: 0 0 1.25rem;
    color: #444;
    line-height: 1.45;
}

.login .error {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    background: #f8d7da;
    color: #842029;
    border-radius: 4px;
    font-size: 0.95rem;
}

.login-form .field {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.login-form .input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem;
    border: 1px solid #c5c5c0;
    border-radius: 4px;
    font: inherit;
    background: #fff;
}

.login-form .validation-message {
    display: block;
    margin-top: 0.25rem;
    color: #842029;
    font-size: 0.85rem;
}

.btn-primary {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 4px;
    background: #1a1a1a;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#blazor-error-ui {
    background: #f8d7da;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
