/* ========== Game Detail Layout ========== */

.game-detail-header {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}


.game-hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.game-scoreboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    flex-wrap: wrap;
}

.game-team-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.game-team-block--home .game-team-info {
    flex-direction: row;
}

.game-team-block--away {
    justify-content: flex-end;
}

.game-team-card-link {
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    padding: 0.35rem 0.5rem;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.game-team-card-link:hover {
    background: #f9fafb;
    box-shadow: 0 2px 6px rgba(15,23,42,0.06);
    transform: translateY(-1px);
}

.game-team-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-team-info--right {
    flex-direction: row-reverse;
}

.game-team-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.game-scoreboard img.scores-team-logo {
    width: 65px !important;
    height: 65px !important;
    object-fit: contain;
}

.game-team-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.game-team-name--right {
    text-align: right;
}

.game-team-rank {
    font-weight: 800;
    white-space: nowrap;
}

.game-team-rank-class {
    font-size: 0.72em;
}

.game-team-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.15rem 0 0;
}

.game-team-record {
    margin: 0.25rem 0 0;
    color: #173b65;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.game-team-record--right {
    text-align: right;
}

.game-team-score {
    font-size: 2.6rem;
    font-weight: 700;
    min-width: 3.25rem;
    text-align: center;
}

.game-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 60px;
}

.game-status-pill {
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #d1fae5;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.game-status-pill--live {
    background: #fee2e2;
    color: #b91c1c;
}

.game-status-pill .badge-live {
    margin-left: 0.25rem;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    vertical-align: middle;
    display: inline-block;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    animation: pulse 2s infinite;
}

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

.game-score-vs {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

/* Meta row under hero */

.game-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    font-size: 0.9rem;
}

.game-meta-item {
    display: flex;
    flex-direction: column;
}

.game-meta-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.game-meta-value {
    font-weight: 500;
}

.game-meta-links {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip-link {
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 0.8rem;
}

/* Source link */

.game-source-link {
    font-size: 0.85rem;
    color: #4b5563;
}

/* ========== Stats Layout ========== */

.game-stats-section {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.game-stats-category {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.game-stats-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.game-stats-category-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.game-stats-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.06);
}

.game-stats-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

/* Tables */

.stats-table-wrapper {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.stats-table th,
.stats-table td {
    padding: 0.35rem 0.5rem;
    text-align: center;
    white-space: nowrap;
}

.stats-table th {
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}

.stats-table td {
    border-bottom: 1px solid #f3f4f6;
}

.stats-table a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.stats-table a:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
    text-decoration: none;
}

/* Sort indicators */

.sortable-stats-table th.sorted-asc::after {
    content: " ▲";
    font-size: 0.65em;
}

.sortable-stats-table th.sorted-desc::after {
    content: " ▼";
    font-size: 0.65em;
}

/* Misc */

.school-teams-empty {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.5rem 0 0;
}

/* ========== Box Score ========== */

.box-score-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.box-score-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    overflow-x: auto;
}

.box-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 400px;
}

.box-score-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
}

.box-score-table th {
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid #e2e8f0;
}

.box-score-table th:last-child {
    border-right: none;
}

.box-score-team-header {
    text-align: left !important;
    padding-left: 1.25rem !important;
}

.box-score-period-header {
    min-width: 50px;
    font-weight: 700;
    color: #334155;
}

.box-score-final-header,
.box-score-line-total-header {
    font-weight: 800 !important;
    color: #0f172a !important;
}

.box-score-total-header {
    min-width: 70px;
    font-weight: 700;
    color: #1e293b;
    background: #e2e8f0;
}

.box-score-table tbody tr {
    transition: background-color 0.15s ease;
}

.box-score-table tbody tr:hover {
    background-color: #f8fafc;
}

.box-score-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.box-score-row--home {
    background-color: #fefefe;
}

.box-score-row--away {
    background-color: #fafbfc;
}

.box-score-table td {
    padding: 0.875rem 1rem;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    color: #334155;
}

.box-score-table td:last-child {
    border-right: none;
}

.box-score-final,
.box-score-line-total {
    font-weight: 800;
    color: #0f172a;
    background: #f8fafc;
}

.box-score-team-name {
    text-align: left !important;
    padding-left: 1.25rem !important;
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.box-score-period-score {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
    min-width: 50px;
}

.box-score-total-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    background: #f1f5f9;
    min-width: 70px;
    border-left: 2px solid #cbd5e1;
}

.box-score-total-score strong {
    color: #0f172a;
}

/* Responsive adjustments for box score */
@media (max-width: 768px) {
    .box-score-container {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .box-score-table {
        font-size: 0.85rem;
        min-width: 350px;
    }
    
    .box-score-table th,
    .box-score-table td {
        padding: 0.6rem 0.75rem;
    }
    
    .box-score-period-score {
        font-size: 1rem;
    }
    
    .box-score-total-score {
        font-size: 1.1rem;
    }
    
    .box-score-team-name {
        font-size: 0.9rem;
    }
}

.stats-table tfoot.stats-totals td {
    border-top: 2px solid #94a3b8;
    background: #f1f5f9;
    font-weight: 700;
    color: #0f172a;
}

.football-stat-group-title {
    margin: 2.5rem 0 1rem;
    padding: 0.8rem 1rem;
    border-left: 5px solid #1d4ed8;
    border-radius: 6px;
    background: linear-gradient(90deg, #eaf2ff, #f8fafc);
    color: #173b65;
    font-size: 1.55rem;
}

.field-goal-result-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.field-goal-result-badge--made {
    background: #dcfce7;
    color: #166534;
}

.field-goal-result-badge--missed {
    background: #fee2e2;
    color: #991b1b;
}

.admin-view-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
    padding: 0.65rem 0.75rem 0.65rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.admin-view-switch-label {
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 700;
}

.admin-view-switch-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.admin-view-switch-link:hover,
.admin-view-switch-link:focus-visible {
    background: #1e40af;
    color: #fff;
    transform: translateY(-1px);
}

.admin-game-editor {
    margin-top: 1.5rem;
}

@media (max-width: 560px) {
    .admin-view-switch {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-view-switch-link {
        justify-content: center;
    }
}

.admin-game-editor-header {
    margin-bottom: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.admin-game-editor-header h2 {
    margin: 0.35rem 0;
}

.admin-game-editor-header p {
    margin: 0;
    color: #475569;
}

.admin-game-editor-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-team-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-team-switch {
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-team-switch span {
    display: block;
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
}

.admin-team-switch.active {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.22);
}

.admin-team-switch.active span {
    color: #dbeafe;
}

.admin-game-video-editor {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.admin-game-video-editor label {
    display: block;
    font-weight: 700;
}

.admin-game-video-editor p {
    margin: 0.25rem 0 0.7rem;
    color: #64748b;
    font-size: 0.88rem;
}

.admin-game-video-controls {
    display: flex;
    gap: 0.6rem;
}

.admin-game-video-controls input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    font: inherit;
}

.admin-game-video-status {
    display: block;
    min-height: 1.2em;
    margin-top: 0.5rem;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 600;
}

.game-video-section {
    margin-top: 2rem;
}

.game-video-card {
    max-width: 900px;
    overflow: hidden;
    border-radius: 12px;
    background: #0f172a;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
}

.game-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

.game-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 640px) {
    .admin-team-switcher {
        grid-template-columns: 1fr;
    }

    .admin-game-video-controls {
        flex-direction: column;
    }
}

/* Responsive */

@media (max-width: 900px) {
    .game-scoreboard {
        flex-wrap: wrap;
        justify-content: center;
    }
    .game-team-block--home,
    .game-team-block--away {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .game-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .game-meta-links {
        margin-left: 0;
    }
    .game-stats-category-grid {
        grid-template-columns: 1fr;
    }
}
