/* Global theme variables (add fallbacks to ensure visibility on all pages) */
:root {
    --primary-color: #0d47a1; /* deep blue */
    --secondary-color: #1565c0; /* medium blue */
    --accent-color: #ffb300; /* amber highlight */
    --border-color: #d0d7de; /* subtle gray border */
    --text-color: #1f2933; /* dark readable text */
    --light-bg: #f4f6f8; /* light neutral background */
}

/* Index page now uses Tailwind exclusively - legacy header/teams-grid/team-card styles removed */

/* Original generic roster grid & player card (for team detail page roster display) */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.player-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.player-card:hover { transform: translateY(-6px); box-shadow: 0 8px 18px rgba(0,0,0,0.08); }
.player-photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid var(--light-bg); }
.player-info { flex: 1; }
.player-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.player-number { font-weight: 700; color: var(--accent-color); }
.player-name { font-weight: 700; color: var(--primary-color); }
.player-pos { margin-left: auto; font-size: 0.85rem; color: var(--secondary-color); }
.player-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.player-stats .stat { background: var(--light-bg); padding: 6px 8px; border-radius: 6px; font-size: 0.85rem; display: flex; gap: 6px; align-items: center; }
.player-stats .label { color: var(--secondary-color); font-weight: 600; }
.player-stats .value { color: var(--primary-color); font-weight: 700; }

/* Scoped enhanced roster card styling (team page only) */
.roster-section .roster-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.roster-section .player-card.roster-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 14px 12px; border-radius: 12px; position: relative; overflow:hidden; min-width:0; box-shadow:0 2px 6px rgba(0,0,0,0.06); cursor:pointer; }
.roster-section .player-card.roster-card::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at 65% 25%, rgba(0,0,0,0.035), transparent 70%); }
.roster-section .player-card.roster-card:hover { transform:translateY(-6px); box-shadow:0 10px 22px rgba(0,0,0,0.12); border-color:var(--accent-color); }
.roster-section .player-card.roster-card .player-photo img { width:100%; aspect-ratio:1/1; border-radius:10px; background:#fafafa; object-fit:contain; object-position:center; }
.roster-section .player-card.roster-card .player-top { flex-wrap:wrap; gap:6px 10px; align-items:baseline; }
.roster-section .player-card.roster-card .player-number { font-size:0.75rem; }
.roster-section .player-card.roster-card .player-name { font-size:0.9rem; flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.roster-section .player-card.roster-card .player-pos { font-size:0.65rem; font-weight:600; letter-spacing:0.5px; padding:2px 6px; background:var(--light-bg); border:1px solid var(--border-color); border-radius:10px; margin-left:auto; }
.roster-section .player-card.roster-card .player-stats { gap:6px; }
.roster-section .player-card.roster-card .player-stats .stat { padding:4px 6px; font-size:0.7rem; flex:1 1 calc(50% - 6px); min-width:70px; }
.roster-section .player-card.roster-card .player-stats .label { font-weight:600; }
.roster-section .player-card.roster-card .player-stats .value { font-variant-numeric:tabular-nums; }
.roster-section .player-card.roster-card.position-G .player-stats .stat { flex:1 1 calc(50% - 6px); }
.roster-section .player-card.roster-card:active { transform:translateY(-2px); }
@media (max-width:540px){ .roster-section .roster-grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); } .roster-section .player-card.roster-card { padding:12px; } .roster-section .player-card.roster-card .player-stats .stat { font-size:0.65rem; } }

/* Roster utilities */
.roster-tools { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.roster-tools input[type="text"] { flex:1 1 200px; padding:8px 10px; border:1px solid var(--border-color); border-radius:6px; font-size:0.85rem; }
.roster-tools select { padding:8px 10px; border:1px solid var(--border-color); border-radius:6px; background:#fff; font-size:0.85rem; }
.roster-tools select:focus, .roster-tools input[type="text"]:focus { outline:2px solid var(--accent-color); }

/* Team Details (team detail page only) */
.team-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.team-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.team-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Team Record */
.team-record {
    margin-bottom: 40px;
}

.team-record h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.record-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-box {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Roster Section */
.roster-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.roster-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--text-color);
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filter-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}
/* Enhanced visibility for roster filters specifically */
.roster-section .filter-btn { background:#fff; color:var(--primary-color); }
.roster-section .filter-btn.active { background:var(--accent-color); color:#fff; }
.roster-section .filter-btn:hover { border-color:var(--accent-color); color:var(--accent-color); }

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

.roster-table {
    width: 100%;
    border-collapse: collapse;
}

.roster-table thead {
    background: var(--light-bg);
}

.roster-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
}

.roster-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.roster-table tbody tr:hover {
    background: var(--light-bg);
}

.roster-table tbody tr.hidden {
    display: none;
}

/* generic hidden helper for card layout */
.player-card.hidden {
    display: none;
}

/* Player card grid (replaces table) */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.player-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.player-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.player-photo img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--light-bg);
}

.player-info {
    flex: 1;
}

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

.player-number {
    font-weight: 700;
    color: var(--accent-color);
}

.player-name {
    font-weight: 700;
    color: var(--primary-color);
}

.player-pos {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.player-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.player-stats .stat {
    background: var(--light-bg);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    gap: 6px;
    align-items: center;
}

.player-stats .label {
    color: var(--secondary-color);
    font-weight: 600;
}

.player-stats .value {
    color: var(--primary-color);
    font-weight: 700;
}

.no-players {
    padding: 20px;
    color: var(--secondary-color);
}

/* Player modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 900px;
    width: 95%;
    padding: 20px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
}

/* Player badges (inline chips and list) */
.player-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0.02));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    margin-right: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--primary-color);
}
.badge-item { display:flex; gap:10px; align-items:center; padding:8px 0; }

/* Season table similar to Wikipedia */
.season-table { width:100%; border-collapse: collapse; margin-top:8px; }
.season-table th, .season-table td { padding:8px 10px; border:1px solid var(--border-color); }
.season-table thead { background: var(--light-bg); }
.season-table th { text-align:left; font-weight:700; color:var(--primary-color); }
.season-table tbody tr:hover { background: #fbfbfb; }

.season-meta { font-size:0.95rem; color:var(--secondary-color); }

.muted { color: #666; font-size:0.9rem; }

/* Wrapped table with subtle card style */
.season-table-wrap {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    overflow: auto;
}

.season-table thead th {
    background: var(--light-bg);
}

.season-table tbody tr { background: white; }
.season-table tbody tr:hover { background: #f9f9f9; }
.season-table tbody tr.current-season { background: #fffbf0; }
.season-table td.num.highlight { background: #e3f2fd; font-weight: 600; }

.season-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.season-table td.season-meta { font-weight:600; }

/* Career summary cards */
.career-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.career-summary-card {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 8px;
    text-align: center;
}
.career-summary-card .label {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}
.career-summary-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Seasons grid layout */
.seasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.season-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.season-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.season-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.season-card:hover::before {
    opacity: 1;
}

.season-card.current-season {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, #fffbf0 0%, #fff4d9 100%);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
}

.season-card.current-season::before {
    opacity: 1;
    background: var(--accent-color);
}

.season-card-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.season-label {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.team-info .team-logo {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.team-info .team-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    flex: 1;
    min-width: 140px;
}

.league-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.season-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
    background: white;
    border-radius: 10px;
    border: 2px solid #e8e8e8;
    transition: all 0.2s ease;
}

.stat-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-item.career-best {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #42a5f5;
    position: relative;
}

.stat-item.career-best::after {
    content: '★';
    position: absolute;
    top: 4px;
    right: 6px;
    color: #1976d2;
    font-size: 0.9rem;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.stat-item .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-item.career-best .stat-value {
    color: #1565c0;
}

/* New Player Page Enhancements */
.player-shell { max-width:1180px; margin:0 auto; padding:0 20px 60px; }
.page-glass { background:rgba(255,255,255,0.78); backdrop-filter:blur(6px); border-radius:16px; box-shadow:0 8px 32px rgba(0,0,0,0.12); }
body.action-bg { background-size:cover; background-position:center; background-attachment:fixed; }
.site-header { display:flex; justify-content:space-between; align-items:center; padding:14px 0 6px; }
.site-title { margin:0; font-size:1.4rem; font-weight:700; }
.back-link { font-size:0.85rem; text-decoration:none; padding:6px 10px; background:var(--light-bg); border:1px solid var(--border-color); border-radius:6px; }
.back-link:hover { background:#fff; }

.player-sticky-nav { position:sticky; top:0; z-index:80; display:flex; gap:4px; background:#ffffffcc; backdrop-filter:blur(6px); padding:6px 6px; border:1px solid var(--border-color); border-radius:10px; margin-bottom:12px; }
.player-sticky-nav button { background:var(--light-bg); border:1px solid var(--border-color); border-radius:6px; padding:6px 12px; font-size:0.8rem; font-weight:600; cursor:pointer; letter-spacing:0.4px; color:var(--primary-color); }
.player-sticky-nav button.active { background:var(--accent-color); color:#fff; border-color:var(--accent-color); }
.player-sticky-nav button:hover { background:#fff; }

.player-hero { display:flex; gap:28px; padding:26px 22px; border:1px solid var(--border-color); border-radius:16px; margin-top:10px; position:relative; overflow:hidden; background:linear-gradient(135deg,#ffffff,#f5f8fa); }
.player-hero::after { content:''; position:absolute; inset:0; background:radial-gradient(circle at 75% 25%, rgba(0,140,255,0.08), transparent 60%); pointer-events:none; }
.player-photo-frame { margin:0; }
.player-photo-frame img { width:180px; height:180px; object-fit:cover; border-radius:12px; box-shadow:0 4px 14px rgba(0,0,0,0.12); }
.hero-right { flex:1; display:flex; flex-direction:column; gap:10px; }
.player-name { font-size:2.2rem; margin:0; font-weight:800; letter-spacing:-0.5px; }
.hero-meta-pills { display:flex; flex-wrap:wrap; gap:6px; }
.hero-meta-pills .meta-pill { background:var(--light-bg); border:1px solid var(--border-color); padding:4px 10px; border-radius:20px; font-size:0.7rem; font-weight:600; letter-spacing:0.5px; }
.hero-team-logo { width:64px; height:64px; object-fit:contain; filter:drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }
.hero-career-summary { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.hero-career-summary .career-cell { background:#fff; border:1px solid var(--border-color); padding:6px 10px; border-radius:10px; font-size:0.75rem; font-weight:600; display:flex; flex-direction:column; align-items:center; min-width:72px; }
.hero-career-summary .career-cell .val { font-size:1.1rem; font-weight:700; color:var(--primary-color); }
.player-bio { font-size:0.9rem; line-height:1.4; max-width:720px; }

.player-tabs { margin-top:26px; }
.tab-panels { border:1px solid var(--border-color); border-radius:14px; padding:18px; background:#fff; box-shadow:0 4px 16px rgba(0,0,0,0.04); }
/* Tab panel visibility now managed by Tailwind hidden class */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Season filters */
.season-filters { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.season-filters button { background:#fff; border:1px solid var(--border-color); padding:4px 10px; border-radius:18px; font-size:0.7rem; font-weight:600; cursor:pointer; }
.season-filters button.active { background:var(--accent-color); color:#fff; border-color:var(--accent-color); }

/* Pinned stats bar */
.player-quick-pins { display:flex; gap:6px; flex-wrap:wrap; }
.player-quick-pins .pin { background:#fff; border:1px solid var(--border-color); padding:4px 8px; border-radius:16px; font-size:0.65rem; font-weight:600; position:relative; cursor:pointer; }
.player-quick-pins .pin:hover { background:var(--light-bg); }
.player-quick-pins .pin .remove { position:absolute; top:-4px; right:-4px; background:#ff5252; color:#fff; width:16px; height:16px; border-radius:50%; font-size:10px; display:flex; align-items:center; justify-content:center; cursor:pointer; }

/* Award section */
#playerAwards { display:flex; flex-direction:column; gap:14px; }
.award-row { display:flex; gap:14px; align-items:center; background:#fff; border:1px solid var(--border-color); padding:10px 14px; border-radius:12px; box-shadow:0 2px 6px rgba(0,0,0,0.04); }
.award-icon { width:40px; height:40px; object-fit:contain; border-radius:50%; background:#f2f2f2; border:1px solid var(--border-color); }
.award-meta { flex:1; }
.award-name { font-weight:700; font-size:0.95rem; color:var(--primary-color); }
.award-years { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.year-chip { background:var(--light-bg); border:1px solid var(--border-color); padding:3px 8px; border-radius:16px; font-size:0.65rem; font-weight:600; }
.year-chip:hover { background:#fff; }

/* Skeleton loaders */
.skeleton-line { height:14px; background:linear-gradient(90deg,#eee,#f5f5f5,#eee); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:6px; margin-bottom:8px; }
@keyframes shimmer { from { background-position:200% 0; } to { background-position:-200% 0; } }

/* Accessibility helpers */
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); border:0; }

/* Season row cards refinements (already added earlier – additions only) */
.season-row-card { font-size:0.78rem; }
.season-row-card.current-season { box-shadow:0 2px 10px rgba(255,193,7,0.2); }
.season-team-name { font-weight:700; }
.stat-pill { position:relative; }
.stat-pill.best { font-weight:700; }

/* Expandable extra stats (hidden container) */
.season-extra { display:none; width:100%; margin-top:8px; padding-top:8px; border-top:1px dashed var(--border-color); }
.season-row-card.expanded .season-extra { display:flex; gap:8px; flex-wrap:wrap; }
.season-expand-btn { background:#fff; border:1px solid var(--border-color); padding:3px 8px; border-radius:14px; font-size:0.65rem; cursor:pointer; align-self:flex-start; margin-left:auto; }
.season-expand-btn:hover { background:var(--light-bg); }

@media (max-width: 820px) {
    .player-hero { flex-direction:column; align-items:flex-start; }
    .player-photo-frame img { width:150px; height:150px; }
    .player-name { font-size:1.8rem; }
    .hero-career-summary { justify-content:flex-start; }
    .season-row-left { flex-wrap:wrap; }
}

@media (max-width: 520px) {
    .player-sticky-nav { flex-wrap:wrap; }
    .hero-meta-pills .meta-pill { font-size:0.6rem; }
    .hero-career-summary .career-cell { min-width:60px; }
}

/* New season row card layout */
.seasons-list { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.season-row-card {
        display:flex;
        align-items:stretch;
        gap:24px;
        background:#fff;
        border:1px solid var(--border-color);
        border-radius:10px;
        padding:14px 18px;
        box-shadow:0 2px 6px rgba(0,0,0,0.05);
        transition:box-shadow .2s, transform .2s;
}
.season-row-card:hover { box-shadow:0 4px 14px rgba(0,0,0,0.12); transform:translateY(-2px); }
.season-row-card.current-season { border-color: var(--accent-color); background: linear-gradient(90deg,#fffbf0,#fff); }

.season-row-left { display:flex; gap:16px; align-items:center; min-width:240px; }
.season-year { font-size:1.2rem; font-weight:700; color:var(--primary-color); width:70px; }
.season-team-block { display:flex; align-items:center; gap:12px; }
.season-team-logo { width:42px; height:42px; object-fit:contain; }
.season-team-fallback { width:42px; height:42px; border-radius:50%; background: var(--secondary-color); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.75rem; letter-spacing:1px; }
.season-team-meta { display:flex; flex-direction:column; }
.season-team-name { font-weight:600; color:var(--primary-color); font-size:0.95rem; }
.season-league { font-size:0.7rem; text-transform:uppercase; letter-spacing:0.5px; color:var(--secondary-color); font-weight:600; }
.season-phase { font-size:0.6rem; font-weight:700; padding:2px 6px; border:1px solid var(--border-color); border-radius:12px; background:var(--light-bg); margin-left:6px; letter-spacing:0.5px; }
.season-phase.playoffs { background:#ffe8e8; border-color:#ffb3b3; color:#c40000; }

.season-row-stats { display:flex; flex-wrap:wrap; gap:8px; align-content:flex-start; }
.stat-pill { background: var(--light-bg); border:1px solid var(--border-color); padding:4px 8px; border-radius:20px; font-size:0.75rem; font-weight:600; letter-spacing:0.3px; display:inline-flex; align-items:center; gap:4px; color: var(--primary-color); }
.stat-pill.best { background:#e3f2fd; border-color:#64b5f6; color:#1565c0; position:relative; }
.stat-pill.best::after { content:'★'; margin-left:4px; font-size:0.7rem; color:#1976d2; }
.season-row-toi { width:100%; font-size:0.65rem; font-weight:600; color:var(--secondary-color); margin-top:4px; letter-spacing:0.4px; }

@media (max-width: 760px) {
    .season-row-card { flex-direction:column; gap:12px; }
    .season-row-left { min-width:unset; }
    .season-year { width:auto; }
}

/* League groupings */
.league-group {
    margin-bottom: 18px;
}
.league-group-header {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 10px 14px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}
.league-group-header:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.league-group-header .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}
.league-group-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}
.league-group-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.league-group-content.collapsed {
    max-height: 0;
}
.league-stats-summary {
    font-size: 0.85rem;
    opacity: 0.9;
}

.player-badge-chip img, .badge-item img { border-radius:6px; border:1px solid var(--border-color); background: white; }
.player-badge-chip { cursor: help; transition: transform 0.15s ease; }
.player-badge-chip:hover { transform: translateY(-2px); }

.badge-item strong { display:block; color:var(--primary-color); }
.badge-item .muted { margin-top:4px; }

.player-detail-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    align-items: start;
}

.player-detail-photo img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.player-detail-row {
    margin-bottom: 8px;
}

.player-detail-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.player-detail-stats .stat {
    background: var(--light-bg);
    padding: 8px 10px;
    border-radius: 6px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

/* Standings page styles */
.filter-btn {
    background: white;
    color: #0d47a1;
    border: 2px solid #e5e7eb;
}

.filter-btn:hover {
    background: #f3f4f6;
    border-color: #0d47a1;
}

.filter-btn.active {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: white;
    border-color: #0d47a1;
}

/* Responsive (team/player pages only - index uses Tailwind responsive classes) */
@media (max-width: 768px) {
    .record-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .roster-table {
        font-size: 0.9rem;
    }

    .roster-table th,
    .roster-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .record-grid {
        grid-template-columns: 1fr;
    }

    .roster-filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }
}

/* Coach page - player side indicators */
.natural-side {
    border-color: #22c55e !important; /* green border for natural side */
    background: linear-gradient(to right, rgba(34, 197, 94, 0.05), white) !important;
}

.off-wing {
    border-color: #f59e0b !important; /* amber border for off-wing */
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), white) !important;
}

.off-side-d {
    border-color: #ef4444 !important; /* red border for off-side defense */
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), white) !important;
}

/* Team Schedule Calendar Styles */
.calendar-day-cell {
    min-height: 120px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day-cell.empty {
    background: #f9fafb;
    cursor: default;
}

.calendar-day-cell.today {
    background: #eff6ff;
    border-color: #3b82f6;
    border-width: 2px;
}

.calendar-day-cell.has-game {
    border-color: #d1d5db;
}

.calendar-day-cell.day-win {
    background: #d1fae5 !important;
    border-color: #10b981 !important;
}

.calendar-day-cell.day-loss {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
}

.calendar-day-cell.day-otl {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
}

.calendar-day-cell.has-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.day-number {
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
    font-size: 0.875rem;
}

.games-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.game-item {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.75rem;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.game-item-calendar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.game-item-calendar:hover {
    cursor: pointer;
}

.game-item:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.game-item.live {
    background: #fee2e2;
    border-color: #ef4444;
    animation: pulse 2s ease-in-out infinite;
}

.game-logos {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.team-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.team-logo-calendar {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.team-abbrev {
    font-weight: 700;
    font-size: 0.7rem;
    color: #374151;
}

.vs-text {
    font-weight: 700;
    color: #6b7280;
    font-size: 0.8rem;
}

.game-opponent {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.game-time-result {
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 600;
}

.game-score-display {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9rem;
    text-align: center;
}

.game-result-text {
    font-weight: 800;
    font-size: 0.85rem;
    text-align: center;
    color: #1f2937;
}

.game-item.live .game-time-result,
.game-item.live .game-score-display {
    color: #ef4444;
}

/* Game Details Modal */
.game-detail-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.teams-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 12px;
}

.team-detail {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.team-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.team-name-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.team-record {
    color: #6b7280;
    font-size: 0.875rem;
}

.team-score-large {
    font-size: 3rem;
    font-weight: 800;
    color: #0d47a1;
}

.vs-divider {
    font-size: 1.5rem;
    font-weight: 700;
    color: #9ca3af;
}

.section-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3f4f6;
}

.three-stars {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.star-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    min-width: 200px;
}

.star-number {
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.star-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.star-name {
    font-weight: 700;
    color: #1f2937;
}

.star-team {
    font-size: 0.875rem;
    color: #6b7280;
}

.period-header {
    font-weight: 700;
    color: #4b5563;
    margin-top: 16px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
}

.goal-item, .penalty-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-left: 4px solid #d1d5db;
    background: #f9fafb;
    margin-bottom: 8px;
    border-radius: 4px;
}

.goal-item.home-goal {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.goal-item.away-goal {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.penalty-item.home-penalty {
    border-left-color: #3b82f6;
}

.penalty-item.away-penalty {
    border-left-color: #ef4444;
}

.goal-time, .penalty-time {
    font-weight: 700;
    color: #1f2937;
    min-width: 60px;
}

.goal-info, .penalty-info {
    flex: 1;
}

.goal-scorer, .penalty-player {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.goal-assists, .penalty-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

.goal-score {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.125rem;
}

.highlight-link {
    display: inline-block;
    margin-left: 8px;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.highlight-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Mobile optimizations for team schedule calendar */
@media (max-width: 640px) {
    .calendar-day-cell {
        min-height: 140px;
        padding: 4px;
    }

    .day-number {
        font-size: 0.75rem;
        margin-bottom: 4px;
        font-weight: 800;
    }

    /* Stack game logos vertically on mobile */
    .game-logos {
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .vs-text {
        font-size: 0.7rem;
        font-weight: 700;
        order: 2; /* Place VS between the teams */
    }

    .team-logo-container {
        gap: 4px;
        width: 100%;
    }

    /* Make logos bigger on mobile for better visibility */
    .team-logo-calendar {
        width: 56px;
        height: 56px;
    }

    .team-abbrev {
        font-size: 0.7rem;
        font-weight: 700;
    }

    .game-result-text {
        font-size: 0.8rem;
        font-weight: 800;
        margin-top: 2px;
    }

    .game-score-display {
        font-size: 0.85rem;
        font-weight: 700;
        margin-top: 2px;
    }

    .game-time-result {
        font-size: 0.7rem;
        font-weight: 600;
        margin-top: 2px;
    }

    .game-item-calendar {
        gap: 6px;
        padding: 6px 4px;
    }

    /* Reduce calendar section padding */
    #calendarSection {
        padding: 1rem !important;
    }

    /* Reduce gap between calendar cells */
    #calendarGrid {
        gap: 0.25rem !important;
    }

    /* Make day headers smaller */
    #calendarSection .grid.grid-cols-7 > div:not(#calendarGrid) {
        font-size: 0.65rem;
        padding: 0.25rem 0;
    }

    /* Reduce month record stats grid */
    #monthRecord {
        padding: 1rem !important;
    }

    #monthRecord h3 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }

    #monthRecord .grid > div {
        padding: 0.5rem !important;
    }

    #monthRecord .text-3xl {
        font-size: 1.5rem !important;
    }

    /* Calendar controls */
    #calendarControls {
        padding: 1rem !important;
    }

    #calendarControls h2 {
        font-size: 1.25rem;
    }

    #calendarControls button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 400px) {
    .calendar-day-cell {
        min-height: 130px;
        padding: 3px;
    }

    .day-number {
        font-size: 0.7rem;
        margin-bottom: 3px;
        font-weight: 800;
    }

    /* Keep logos reasonably sized even on very small screens */
    .team-logo-calendar {
        width: 48px;
        height: 48px;
    }

    .team-abbrev {
        font-size: 0.65rem;
        font-weight: 700;
    }

    .vs-text {
        font-size: 0.65rem;
        font-weight: 700;
    }

    .game-result-text {
        font-size: 0.75rem;
        font-weight: 800;
    }

    .game-score-display {
        font-size: 0.8rem;
        font-weight: 700;
    }

    .game-time-result {
        font-size: 0.65rem;
        font-weight: 600;
    }

    .game-logos {
        gap: 4px;
    }

    /* Further reduce gaps and padding */
    #calendarGrid {
        gap: 0.125rem !important;
    }

    #calendarSection {
        padding: 0.5rem !important;
    }

    #calendarSection .grid.grid-cols-7 > div:not(#calendarGrid) {
        font-size: 0.6rem;
        padding: 0.125rem 0;
    }

    /* Ultra compact month record */
    #monthRecord .grid > div {
        padding: 0.375rem !important;
    }

    #monthRecord .text-3xl {
        font-size: 1.25rem !important;
    }

    #monthRecord .text-xs {
        font-size: 0.625rem !important;
    }
}

/* Mobile header navigation fixes */
@media (max-width: 768px) {
    /* Make header navigation responsive */
    header .flex.gap-2 {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-end;
    }

    header .flex.gap-2 > a,
    header .flex.gap-2 > button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Stack header content vertically on very small screens */
    header .flex.items-center.justify-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    header h1 {
        font-size: 1.875rem !important;
    }

    header p {
        font-size: 1rem !important;
    }

    /* Ensure navigation buttons are visible and scrollable if needed */
    header .flex.gap-2 {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    header .flex.gap-2::-webkit-scrollbar {
        height: 4px;
    }

    header .flex.gap-2::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    /* Calendar improvements for tablets */
    .calendar-day-cell {
        min-height: 110px;
    }

    .team-logo-calendar {
        width: 40px;
        height: 40px;
    }

    /* Make month record stats stack better */
    #monthRecord .grid {
        gap: 0.75rem;
    }

    /* Calendar header days */
    #calendarSection .grid.grid-cols-7 > div {
        font-size: 0.75rem;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem !important;
    }

    header .flex.gap-2 > a,
    header .flex.gap-2 > button {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Make buttons smaller and allow horizontal scroll */
    header .flex.gap-2 {
        gap: 0.375rem;
        justify-content: flex-start;
    }
}
