/* LITTLE LEAGUE PITCH TRACKER - Retro CRT TV Style */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
    --tv-bezel: #2a2a2a;
    --tv-bezel-light: #3a3a3a;
    --tv-bezel-dark: #1a1a1a;
    --screen-green: #4a7c4e;
    --screen-green-light: #5a8c5a;
    --dirt-brown: #8b7355;
    --card-bg: #1e2a3a;
    --card-border: #8b3a3a;
    --card-border-light: #a04545;
    --text-cream: #e8e0d0;
    --text-white: #ffffff;
    --text-muted: #a0a0a0;
    --status-green: #4ade80;
    --status-red: #ef4444;
    --btn-cream: #e8e0d0;
    --btn-text: #2d3748;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: var(--tv-bezel);
    color: var(--text-cream);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* CRT TV Bezel Frame */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        /* Corner shadows for depth */
        radial-gradient(ellipse at top left, transparent 70%, rgba(0,0,0,0.4) 100%),
        radial-gradient(ellipse at top right, transparent 70%, rgba(0,0,0,0.4) 100%),
        radial-gradient(ellipse at bottom left, transparent 70%, rgba(0,0,0,0.4) 100%),
        radial-gradient(ellipse at bottom right, transparent 70%, rgba(0,0,0,0.4) 100%),
        /* Bezel texture */
        linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 50%, #1f1f1f 100%);
    z-index: -3;
}

/* Screen area with baseball field */
.screen-wrapper {
    flex: 1;
    margin: 10px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 0 50px rgba(0,0,0,0.5),
        inset 0 0 100px rgba(0,0,0,0.3),
        0 0 20px rgba(0,0,0,0.8);
}

main.container {
    flex: 1;
    max-width: 100%;
    margin: 12px;
    padding: 1rem;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        inset 0 0 80px rgba(0,0,0,0.4),
        inset 0 0 20px rgba(0,0,0,0.6),
        0 0 30px rgba(0,0,0,0.8);
}

/* Baseball field background */
main.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background:
        /* Baseball diamond/infield dirt */
        radial-gradient(ellipse 80% 40% at 50% 25%, var(--dirt-brown) 0%, transparent 50%),
        /* Outfield grass */
        linear-gradient(180deg, var(--screen-green) 0%, var(--screen-green-light) 30%, var(--screen-green) 100%);
    filter: brightness(0.85);
}

/* Scanlines overlay */
main.container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    border-radius: 16px;
}

/* Static/noise effect */
@keyframes noise {
    0%, 100% { background-position: 0 0; }
    10% { background-position: -5% -10%; }
    20% { background-position: -15% 5%; }
    30% { background-position: 7% -25%; }
    40% { background-position: 20% 25%; }
    50% { background-position: -25% 10%; }
    60% { background-position: 15% 5%; }
    70% { background-position: 0 15%; }
    80% { background-position: 25% 35%; }
    90% { background-position: -10% 10%; }
}

/* Navigation - Title Bar */
.navbar {
    background: linear-gradient(180deg, #3d2020 0%, #2d1515 100%);
    border: 4px solid #5a3030;
    border-radius: 8px;
    margin: 12px 12px 0 12px;
    padding: 0.625rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.1),
        0 4px 8px rgba(0,0,0,0.5);
}

@media (min-width: 500px) {
    .navbar {
        flex-direction: row;
        justify-content: space-between;
    }
}

.nav-brand {
    font-size: 0.75rem;
    color: var(--text-cream);
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 1px;
    text-align: center;
}

/* Baseball decorations for title */
.nav-brand::before,
.nav-brand::after {
    content: '⚾';
    margin: 0 0.375rem;
    font-size: 0.75rem;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    padding: 0.5rem 0.75rem;
    background: var(--btn-cream);
    color: var(--btn-text);
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid #c0b8a8;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.5),
        0 2px 0 #a09888;
    transition: all 0.1s;
    text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
    background: #fff;
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.5),
        0 1px 0 #a09888;
}

.nav-links a.nav-logout {
    background: #5a2020;
    color: var(--text-cream);
    border-color: #7a3030;
}

.nav-links a.nav-logout:hover {
    background: #6a2525;
}

.nav-links a.nav-entry {
    background: #1a1a1a;
    color: #ccff00;
    border-color: #ccff00;
    box-shadow: 0 0 5px #ccff00;
}

.nav-links a.nav-entry:hover,
.nav-links a.nav-entry.active {
    background: #1a1a1a;
    color: #ffcc00;
    border-color: #ffcc00;
    box-shadow: 0 0 8px #ffcc00;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* Sonoma AI footer badge */
.site-footer {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 1rem 0 0.5rem;
    position: relative;
    z-index: 2;
}
.footer-badge {
    height: 36px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.footer-badge:hover {
    opacity: 1;
}

/* Page Header */
.page-header {
    background: linear-gradient(180deg, #3d2020 0%, #2d1515 100%);
    border: 4px solid #5a3030;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.1),
        0 4px 8px rgba(0,0,0,0.5);
}

.page-header h1 {
    font-size: 0.85rem;
    color: var(--text-cream);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 0.25rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

h2 {
    font-size: 1rem;
}

.date-display {
    color: var(--text-muted);
    font-size: 0.55rem;
}

.back-link {
    display: inline-block;
    color: var(--text-cream);
    text-decoration: none;
    font-size: 0.55rem;
    margin-bottom: 0.5rem;
}

.player-meta {
    color: var(--text-muted);
    font-size: 0.55rem;
}

/* Team Logo Selector */
/* Division Selector */
.division-selector {
    margin-bottom: 1rem;
}

.division-selector label {
    display: block;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.division-selector select {
    width: 100%;
    max-width: 200px;
}

.team-selector {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 4px 8px rgba(0,0,0,0.4);
}

.team-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.team-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(180deg, #4a4a5a 0%, #2a2a3a 100%);
    border: 3px solid #5a5a6a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 3px 0 #1a1a2a,
        0 4px 8px rgba(0,0,0,0.4);
    padding: 6px;
}

.team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
}

.team-logo:hover {
    transform: translateY(-2px);
    border-color: var(--card-border-light);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 5px 0 #1a1a2a,
        0 6px 12px rgba(0,0,0,0.5);
}

.team-logo:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 1px 0 #1a1a2a;
}

.team-logo.active {
    background: linear-gradient(180deg, #5a5a6a 0%, #3a3a4a 100%);
    border-color: #c05050;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.2),
        0 2px 0 #5a2020,
        0 0 15px rgba(160, 69, 69, 0.5);
}

.team-logo.active img {
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.3));
}

/* Smaller team logos for forms */
.team-logos-small .team-logo {
    width: 48px;
    height: 48px;
    padding: 5px;
}

/* Selected Team Header */
.selected-team-header {
    background: linear-gradient(180deg, #3d2020 0%, #2d1515 100%);
    border: 3px solid #5a3030;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-cream);
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
}

/* Form Elements */
.form-group label {
    display: block;
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
    color: var(--text-cream);
    text-shadow: 1px 1px 0 #000;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-cream);
    border: 3px solid var(--card-border);
    border-radius: 6px;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 2px 0 rgba(0,0,0,0.2);
    /* Prevent iOS zoom on focus */
    -webkit-text-size-adjust: 100%;
}

/* Date input */
input[type="date"].form-control {
    cursor: pointer;
}

/* Custom date display */
.date-display-wrapper {
    position: relative;
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.3),
        0 2px 0 rgba(0,0,0,0.2);
}

.date-display-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    color: var(--text-cream);
    text-align: center;
}

.form-control:focus {
    outline: none;
    border-color: var(--card-border-light);
}

/* Player select dropdown - smaller font */
select.form-control {
    font-size: 0.8rem;
}

.form-control option {
    background: var(--card-bg);
    color: var(--text-cream);
}

.form-hint {
    font-size: 0.5rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    background: var(--card-bg);
    padding: 0.75rem;
    border: 3px solid var(--card-border);
    border-radius: 8px;
}

.filter-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Player Cards - Horizontal Strip Style */
.players-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-card {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 3px 6px rgba(0,0,0,0.4);
}

.player-card.status-eligible {
    border-color: var(--card-border);
}

.player-card.status-resting,
.player-card.status-warning {
    border-color: var(--card-border);
}

.player-header {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
    border: none;
}

.player-name {
    font-size: 0.8rem;
    color: var(--text-white);
    text-shadow: 1px 1px 0 #000;
    text-transform: uppercase;
}

.jersey-number {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.player-details {
    font-size: 0.55rem;
}

.detail-row {
    display: flex;
    gap: 0.25rem;
    padding: 0;
    border: none;
}

.detail-row .label {
    color: var(--text-muted);
}

.detail-row .value {
    color: var(--text-cream);
}

/* Status section on right side of card */
.player-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: right;
}

.status-label {
    font-size: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.status-value {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
}

.status-icon {
    font-size: 1rem;
}

.status-eligible .status-icon,
.status-value.eligible .status-icon {
    color: var(--status-green);
}

.status-resting .status-icon,
.status-warning .status-icon,
.status-value.resting .status-icon {
    color: var(--status-red);
}

.status-text {
    color: var(--text-cream);
    text-transform: uppercase;
}

.status-text.eligible {
    color: var(--status-green);
}

.status-text.resting {
    color: var(--status-red);
}

.eligible-day {
    font-size: 0.55rem;
    padding: 0.25rem 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    color: var(--text-cream);
    text-transform: uppercase;
}

.player-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.player-card-link:hover .player-card {
    border-color: var(--card-border-light);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 4px 8px rgba(0,0,0,0.5);
}

/* Player Info section (left side) */
.player-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pitch-count {
    font-size: 0.55rem;
    color: var(--text-cream);
    text-transform: uppercase;
}

.team-badge {
    font-size: 0.5rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    margin-left: 0.25rem;
}

.team-badge-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-left: 0.5rem;
    vertical-align: middle;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
}

/* Filter Row */
.filter-row {
    margin-bottom: 0.75rem;
}

.filter-row .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    border: 3px solid;
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.btn-primary {
    background: var(--btn-cream);
    color: var(--btn-text);
    border-color: #c0b8a8;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.5),
        inset 0 -2px 0 rgba(0,0,0,0.1),
        0 3px 0 #a09888;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(1px);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.5),
        inset 0 -2px 0 rgba(0,0,0,0.1),
        0 2px 0 #a09888;
}

.btn-primary:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 0 rgba(0,0,0,0.1),
        0 0 0 #a09888;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-cream);
    border-color: var(--card-border);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 2px 0 rgba(0,0,0,0.3);
}

.btn-secondary:hover {
    border-color: var(--card-border-light);
}

.btn-danger {
    background: #5a2020;
    color: var(--text-cream);
    border-color: #7a3030;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 2px 0 rgba(0,0,0,0.3);
}

.btn-danger:hover {
    background: #6a2525;
}

.btn-block {
    width: 100%;
}

.btn-small {
    font-size: 0.55rem;
    padding: 0.5rem 0.75rem;
    min-height: 36px;
}

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 1rem;
}

.login-card {
    background: var(--card-bg);
    border: 4px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.05),
        0 6px 12px rgba(0,0,0,0.5);
}

.login-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.5));
}

.login-card h1 {
    font-size: 0.9rem;
    color: var(--text-cream);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.55rem;
    margin-bottom: 1.25rem;
}

/* Alert */
.alert {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.6rem;
    border-radius: 6px;
    border: 2px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--status-red);
    color: var(--status-red);
}

/* Entry Form */
.entry-form {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 4px 8px rgba(0,0,0,0.4);
}

.player-info-box {
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--card-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.6rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-cream);
}

.info-row + .info-row {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.info-row.status-eligible {
    color: var(--status-green);
}

.info-row.status-resting {
    color: var(--status-red);
}

.validation-warnings {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--status-red);
    border-radius: 6px;
    padding: 0.625rem;
    margin-bottom: 0.75rem;
}

.warning-item {
    color: var(--status-red);
    font-size: 0.55rem;
}

.rest-preview {
    background: rgba(74, 222, 128, 0.1);
    border: 2px solid var(--status-green);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.6rem;
    color: var(--status-green);
}

.success-message {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 3px solid var(--status-green);
    border-radius: 8px;
    position: relative;
    z-index: 10;
}

.success-message .data-table {
    text-align: left;
}

.success-message .data-table button {
    pointer-events: auto;
    cursor: pointer;
}

.success-icon {
    font-size: 1.5rem;
    color: var(--status-green);
    margin-bottom: 0.5rem;
}

.success-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.player-history-section {
    margin: 1rem 0;
    text-align: left;
}

.player-history-section h3 {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* Compact table for inline history */
.data-table.compact {
    font-size: 0.65rem;
}

.data-table.compact th,
.data-table.compact td {
    padding: 0.4rem 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
}

.btn-link {
    background: transparent;
    color: var(--text-cream);
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--text-white);
}

/* Dashboard Table */
.table-container {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    overflow-x: auto;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 4px 8px rgba(0,0,0,0.4);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.55rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.data-table th {
    background: rgba(0,0,0,0.3);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.5rem;
    letter-spacing: 0.5px;
}

.data-table td {
    color: var(--text-cream);
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.05);
}

.data-table a {
    color: var(--text-cream);
    text-decoration: none;
}

.data-table a:hover {
    color: var(--status-green);
}

.data-table .status-eligible td:last-child {
    color: var(--status-green);
}

.data-table .status-resting td:last-child,
.data-table .status-warning td:last-child {
    color: var(--status-red);
}

/* Table row status styling */
.data-table tr.status-eligible .status-cell {
    color: var(--status-green);
}

.data-table tr.status-resting .status-cell {
    color: var(--status-red);
}

.data-table tr {
    cursor: pointer;
}

.data-table .status-cell {
    white-space: nowrap;
}

.data-table .status-icon {
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

.table-player-name {
    font-size: 0.55rem;
    vertical-align: middle;
}

.table-team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.eligible-day-badge {
    font-size: 0.5rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
}

.eligible-count {
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--status-green);
}

.eligible-day-badge.resting {
    background: var(--status-red);
    color: #fff;
}

.team-header {
    font-size: 0.7rem;
    color: var(--text-cream);
    margin: 1rem 0 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(180deg, #3d2020 0%, #2d1515 100%);
    border: 3px solid #5a3030;
    border-radius: 6px;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
}

.team-header:first-child {
    margin-top: 0;
}

/* Player Detail */
.player-status-card {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 4px 8px rgba(0,0,0,0.4);
}

.player-status-card.status-eligible {
    border-color: var(--status-green);
}

.player-status-card.status-resting {
    border-color: var(--status-red);
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
}

.status-row.status-eligible {
    color: var(--status-green);
}

.status-row.status-resting {
    color: var(--status-red);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat {
    text-align: center;
    padding: 0.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
}

.stat-value {
    font-size: 1rem;
    color: var(--text-cream);
    text-shadow: 1px 1px 0 #000;
}

.stat-label {
    font-size: 0.45rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Entries List */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry-card {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 3px 6px rgba(0,0,0,0.4);
}

.entry-date {
    font-size: 0.65rem;
    color: var(--text-cream);
    margin-bottom: 0.375rem;
    text-shadow: 1px 1px 0 #000;
}

.entry-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.55rem;
}

.entry-stat .label {
    color: var(--text-muted);
}

.entry-stat .value {
    color: var(--text-cream);
}

.entry-actions {
    display: flex;
    gap: 0.375rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10000;
}

.modal * {
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    border: 4px solid var(--card-border);
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 2px solid var(--card-border);
}

.modal-header h3 {
    font-size: 0.7rem;
    color: var(--text-cream);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--status-red);
}

.modal-content form {
    padding: 0.75rem;
}

.modal-content input,
.modal-content select,
.modal-content button {
    pointer-events: auto !important;
}

.modal-content input[type="number"],
.modal-content input[type="text"],
.modal-content input[type="date"] {
    cursor: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.modal-content button {
    cursor: pointer;
}

.modal-close {
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 10001;
    position: relative;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
    position: relative;
    z-index: 10002;
}

.modal-actions .btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 10003;
}

/* Ensure all interactive elements are clickable */
button, .btn, a, input, select, textarea {
    position: relative;
    z-index: 10;
}

.team-logo {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

.team-selector, .division-selector, .form-group, .filter-row {
    position: relative;
    z-index: 10;
}

.table-container, .data-table {
    position: relative;
    z-index: 10;
}

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

.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.65rem;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 2px dashed var(--card-border);
    border-radius: 8px;
    font-size: 0.65rem;
}

.error {
    color: var(--status-red);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.65rem;
}

/* Responsive */
.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }

    .players-grid {
        grid-template-columns: 1fr;
    }

    main.container {
        max-width: 100%;
        margin: 12px;
    }
}


/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--card-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--card-border-light);
}

/* Admin Pages */
.admin-card {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.05),
        0 4px 8px rgba(0,0,0,0.4);
}

.admin-card h3 {
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.upload-form .form-group {
    margin-bottom: 1rem;
}

.warning-box {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid var(--status-red);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.6rem;
    color: var(--text-cream);
}

.warning-box strong {
    color: var(--status-red);
}

.error-item {
    color: var(--status-red);
    font-weight: bold;
}

.code-block {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.6rem;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-cream);
}

input[type="file"].form-control {
    padding: 0.5rem;
}

.subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.admin-actions {
    margin-bottom: 1rem;
}

/* ==================== CALL-UP STYLES ==================== */

/* Inactive (called-up) player row */
tr.status-inactive {
    opacity: 0.5;
}

tr.status-inactive:hover {
    opacity: 0.7;
}

/* Inline badge on player name cell */
.callup-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.45rem;
    font-family: 'Press Start 2P', monospace;
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.5);
    border-radius: 3px;
    color: #ffa500;
    white-space: nowrap;
    vertical-align: middle;
}

.callup-badge-up {
    background: rgba(0, 200, 100, 0.15);
    border-color: rgba(0, 200, 100, 0.5);
    color: #00c864;
}

/* Undo callup button (officials only) */
.btn-revert-callup {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.3rem;
    font-size: 0.65rem;
    background: none;
    border: 1px solid rgba(255, 80, 80, 0.5);
    border-radius: 3px;
    color: rgba(255, 80, 80, 0.8);
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
}
.btn-revert-callup:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff5050;
}

/* Call-up modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay .modal-content {
    max-height: 80vh;
    overflow-y: auto;
    width: 100%;
    max-width: 480px;
}

.modal-subtitle {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.modal-body {
    padding: 0.75rem;
}

/* Callup player list */
.callup-player-option {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.55rem;
    color: var(--text-cream);
    transition: border-color 0.15s;
}

.callup-player-option:hover {
    border-color: var(--card-border-light);
    background: rgba(255,255,255,0.05);
}

.callup-player-option.selected {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 0,200,100), 0.1);
}

.callup-player-team {
    font-size: 0.45rem;
    color: var(--text-muted);
}

/* Team label on pitch entry cards */
.entry-team-label {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.45rem;
    color: var(--text-muted);
    font-family: 'Press Start 2P', monospace;
    vertical-align: middle;
}

/* ==================== WEEKLY VIEW ==================== */

#weekly-container {
    max-width: 960px;
    margin: 0 auto;
}

/* Constrain eligibility/team tables on wide screens */
#players-container,
#season-container,
#dashboard-container,
.team-content {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.weekly-day {
    margin-bottom: 2rem;
}

.weekly-day-header {
    font-size: 0.7rem;
    color: var(--text-cream);
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 0.4rem;
    margin-bottom: 0.75rem;
}

/* On wide screens: cards flow into a responsive grid */
.weekly-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.weekly-game-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0;
    min-width: 0;
    position: relative;
    z-index: 10;
}

.weekly-game-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.weekly-team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.weekly-team-name {
    font-size: 0.65rem;
    color: var(--text-cream);
    font-family: 'Press Start 2P', monospace;
}

.weekly-pitchers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.55rem;
    table-layout: fixed;
}

.weekly-pitchers-table th {
    text-align: left;
    color: var(--text-muted);
    padding: 0.25rem 0.4rem;
    border-bottom: 1px solid var(--card-border);
}

.weekly-pitchers-table td {
    padding: 0.3rem 0.4rem;
    color: var(--text-cream);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.weekly-pitchers-table tr:last-child td {
    border-bottom: none;
}

.weekly-pitchers-table th:nth-child(2),
.weekly-pitchers-table td:nth-child(2) {
    width: 72px;
    text-align: right;
}

.weekly-pitchers-table th:nth-child(3),
.weekly-pitchers-table td:nth-child(3) {
    width: 56px;
    text-align: right;
}

.player-link {
    color: var(--text-cream);
    text-decoration: none;
}

.player-link:hover {
    text-decoration: underline;
    color: var(--primary);
}

/* Game outcome badges */
.outcome-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.outcome-w {
    background: #166534;
    color: #4ade80;
    border: 2px solid #4ade80;
}

.outcome-l {
    background: #7f1d1d;
    color: #f87171;
    border: 2px solid #f87171;
}

.outcome-t {
    background: #374151;
    color: #9ca3af;
    border: 2px solid #9ca3af;
}

/* Team detail / game log sections */
.game-log-section {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.game-log-header {
    font-size: 0.55rem;
    color: var(--text-cream);
    margin-bottom: 0.75rem;
    line-height: 1.8;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #000;
}

.game-row-opponent {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.game-row-opponent.expanded {
    color: var(--accent, #7fff00);
}

.pitcher-detail-row {
    display: none;
}

.pitcher-detail-row > td {
    background: var(--card-bg);
    padding: 0.75rem 1rem;
    border-top: none;
}

/* Static form value (preselected team) */
.form-static-value {
    font-size: 0.7rem;
    color: var(--text-cream);
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 6px;
    padding: 0.75rem;
    text-shadow: 1px 1px 0 #000;
}

/* Table container */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

/* Success screen: game score result */
.game-score-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.6rem;
    color: var(--text-cream);
}

.game-score-result-score {
    font-size: 0.75rem;
    font-family: 'Press Start 2P', monospace;
}

/* Entry form: game score section */
.game-score-section {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.game-score-header {
    font-size: 0.6rem;
    color: var(--text-cream);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

/* Weekly: scoreboard layout */
.weekly-scoreboard {
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.6rem;
}

.weekly-sb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.weekly-sb-team-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.weekly-sb-score {
    font-size: 0.9rem;
    color: var(--text-cream);
    font-family: 'Press Start 2P', monospace;
    min-width: 1.5rem;
    text-align: right;
}

/* Weekly: week-of section separator (All Weeks mode) */
.weekly-week-section {
    margin-bottom: 2.5rem;
}

.weekly-week-header {
    font-size: 0.7rem;
    color: var(--text-cream);
    border-left: 4px solid var(--card-border);
    border-bottom: 2px solid var(--card-border);
    padding: 0.3rem 0 0.3rem 0.6rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

/* Weekly: division section header (red line) */
.weekly-division-header {
    font-size: 0.7rem;
    color: var(--text-cream);
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* Weekly: date label on each game card */
.weekly-date-badge {
    font-size: 0.45rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

/* Weekly: edit score button */
.weekly-edit-btn {
    display: block;
    margin-top: 0.4rem;
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}

.weekly-edit-btn:hover {
    border-color: var(--text-cream);
    color: var(--text-cream);
}

/* Weekly: fix date gear button */
.fix-date-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
    opacity: 0.4;
    display: block;
    margin-top: 0.25rem;
    margin-left: auto;
    text-align: right;
}

.fix-date-btn:hover {
    opacity: 1;
}

.weekly-tip-gear {
    font-size: 1.5rem;
    color: var(--text-muted);
    vertical-align: middle;
}

/* Weekly: tip note */
.weekly-tip {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: var(--text-cream);
    text-align: center;
    margin-top: 2rem;
    line-height: 1.8;
}

/* Weekly: edit score modal */
.weekly-edit-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.weekly-edit-modal-inner {
    background: var(--card-bg);
    border: 3px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    width: 90%;
    max-width: 340px;
}

.weekly-edit-modal-title {
    font-size: 0.65rem;
    color: var(--text-cream);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
}

.weekly-edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.weekly-edit-label {
    font-size: 0.55rem;
    color: var(--text-cream);
    flex: 1;
}

.weekly-edit-input {
    width: 70px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    background: var(--tv-bezel);
    border: 2px solid var(--card-border);
    color: var(--text-cream);
    padding: 0.4rem;
    border-radius: 4px;
    text-align: center;
}

.weekly-edit-date {
    width: auto;
    flex: 1;
    text-align: left;
    font-size: 0.55rem;
}

.weekly-edit-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

/* Weekly: pitcher section under scoreboard */
.weekly-pitchers-section {
    margin-top: 0.5rem;
}

.weekly-pitchers-team-label {
    font-size: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}

/* Over-limit pitch count badge */
.over-limit-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.5rem;
    color: #ff4444;
    border: 1px solid #ff4444;
    padding: 1px 4px;
    vertical-align: middle;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.over-limit-row td {
    color: #ff6666;
}

/* ==================== STANDINGS ==================== */
.standings-header {
    font-size: 0.7rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-cream);
    letter-spacing: 1px;
}

.standings-meta {
    font-size: 0.5rem;
    color: var(--text-muted);
    margin: 0.3rem 0 1rem;
}

.standings-my-team td {
    background: rgba(255, 255, 255, 0.08);
    font-weight: bold;
}

.trend-cell {
    text-align: center;
    font-size: 0.65rem;
}

.trend-up {
    color: #4caf50;
    font-size: 1.3rem;
}

.trend-down {
    color: #f44336;
    font-size: 1.3rem;
}

.standings-place-col {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
}

.win-pct-zero {
    color: var(--text-muted);
}

.standings-wrapper-outer,
.controls-wrapper {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
