:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --font-main: 'Outfit', sans-serif;
    --font-zh: 'Noto Sans TC', sans-serif;
}

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

body {
    font-family: var(--font-main), var(--font-zh);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 60vh;
    padding: 4rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    transform: scale(1.1);
    z-index: -2;
}

.index-hero .hero-bg {
    background-image: url('../images/bg.jpg');
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.3), var(--bg-color));
    z-index: -1;
}

.hero-content {
    z-index: 1;
    animation: fadeInUp 1s ease-out;
    position: relative;
}

.back-link {
    position: absolute;
    top: -4rem;
    left: 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.team-logo-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.league-logo-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    background: white;

    /* Gradient Border */
    border: 5px solid transparent;
    background: linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, var(--primary-color), var(--secondary-color)) border-box;

    /* Glow Effect */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(78, 205, 196, 0.4);

    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.league-logo-container:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 107, 107, 0.6);
}

.league-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-name {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Stats */
.team-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Roster Section */
.roster-section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.roster-group {
    margin-bottom: 4rem;
}

.roster-subtitle {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
    color: var(--text-color);
    text-align: left;
}

.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.player-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--card-bg);
    z-index: 1;
}

.player-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 0, 0.2);
    border-color: var(--primary-color);
}

.player-bg-number {
    position: absolute;
    top: -20px;
    left: -10px;
    font-size: 10rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    line-height: 1;
    z-index: 0;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    transition: all 0.5s ease;
}

.player-card:hover .player-bg-number {
    color: rgba(255, 255, 255, 0.07);
    transform: scale(1.1) rotate(-5deg);
}

.player-image-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}

.player-card:hover .player-image {
    transform: scale(1.1);
}

.player-info {
    padding: 1.5rem;
    position: relative;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.player-number {
    position: absolute;
    top: -2.5rem;
    right: 1.5rem;
    background: var(--primary-color);
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    transform: rotate(5deg);
    transition: all 0.3s ease;
    z-index: 3;
}

.player-card:hover .player-number {
    transform: rotate(0deg) scale(1.1);
    background: var(--secondary-color);
}

.player-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .team-name {
        font-size: 2rem;
    }

    .hero-section {
        min-height: 50vh;
        padding: 3rem 0;
    }

    .team-stats {
        gap: 3rem;
    }

    .stat-item {
        padding: 0.75rem 1rem;
        min-width: 120px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .back-link {
        top: -2rem;
        left: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Schedule Section */
.schedule-section {
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.schedule-container {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

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

.schedule-table th {
    background: #111827;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
}

.schedule-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

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

.win {
    color: #4ecdc4;
    font-weight: 700;
}

.loss {
    color: #ff6b6b;
    font-weight: 700;
}

.details-link {
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.details-link:hover {
    background: white;
    color: var(--bg-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--secondary-color);
    width: 90%;
    max-width: 2000px;
    border-radius: 1rem;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.3s ease-out;
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

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

.modal-section {
    margin-top: 2rem;
}

.modal-section h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-table th,
.detail-table td {
    padding: 0.6rem 0.4rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-table thead tr:first-child th {
    background: var(--primary-color);
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-table thead tr:nth-child(2) th {
    background: #111827;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.75rem;
}

.detail-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

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

.detail-table [rowspan] {
    background: #111827;
    font-weight: 600;
}

.details-btn {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.details-btn:hover {
    background: var(--secondary-color);
    color: var(--bg-color);
}

.table-responsive {
    overflow-x: auto;
}

/* Player Card Interactive */
.player-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.player-card:active {
    transform: translateY(-2px);
}

/* Player Profile in Modal */
.player-profile-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    flex-shrink: 0;
}

#player-modal-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.player-profile-info h2 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
    color: var(--text-color);
}

.player-averages {
    display: flex;
    gap: 1.5rem;
}

.avg-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avg-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Outfit', sans-serif;
}

.avg-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 600px) {
    .player-profile-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .player-averages {
        justify-content: center;
    }
}

/* League Page Styles */
.league-controls {
    display: flex;
    justify-content: center;
}

/* Terms Page Styles */
.terms-bg {
    background-image: url('../images/bg.jpg');
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.terms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.6), var(--bg-color));
}

.terms-content {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    margin-bottom: 4rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.season-selector-wrapper {
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-radius: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.season-selector-wrapper label {
    color: var(--text-muted);
    font-weight: 600;
}

.season-select {
    background: #111827;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.season-select:focus {
    border-color: var(--primary-color);
}

.league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.league-team-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.league-team-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.team-logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.league-team-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.league-team-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.team-record {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.view-team-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.view-team-btn:hover {
    background: var(--secondary-color);
    color: var(--bg-color);
}

.featured-video-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e11d48;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.featured-video-btn:hover {
    background: #be123c;
}

.featured-photo-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #0ea5e9;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.featured-photo-btn:hover {
    background: #0284c7;
}

@media (max-width: 600px) {
    .season-selector-wrapper {
        flex-direction: column;
        border-radius: 1rem;
        width: 100%;
    }
}

/* Responsive Horizontal Team Layout Styles */
.groups-horizontal-container {
    display: flex;
    flex-direction: column;
    /* Stack groups vertically */
    gap: 4rem;
    margin-top: 2rem;
}

.group-column {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    padding: 2.5rem;
    border-radius: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.8s ease-out;
}

.fancy-group-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
    position: relative;
}

.header-accent {
    width: 10px;
    height: 36px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

.fancy-group-header h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    font-family: var(--font-zh);
}

.group-column .league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Teams wrap horizontally */
    gap: 2rem;
}

@media (max-width: 768px) {
    .group-column {
        padding: 1.5rem;
    }

    .fancy-group-header h2 {
        font-size: 1.8rem;
    }

    .group-column .league-grid {
        grid-template-columns: 1fr;
    }
}

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

/* Top Players Section */
.top-players-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.top-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.top-player-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.top-player-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.top-player-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-player-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary-color);
}

.top-player-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-zh);
    letter-spacing: 1px;
}

.top-player-list {
    padding: 1rem;
}

.top-player-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    border-radius: 0.5rem;
}

.top-player-item:last-child {
    border-bottom: none;
}

.top-player-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tp-rank {
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
    width: 2.5rem;
    font-family: 'Outfit', sans-serif;
}

.tp-rank.rank-1 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    opacity: 1;
}

.tp-rank.rank-2 {
    color: #c0c0c0;
    opacity: 1;
}

.tp-rank.rank-3 {
    color: #cd7f32;
    opacity: 1;
}

.tp-info {
    flex: 1;
    padding: 0 1rem;
}

.terms-content p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 2.0;
}

.terms-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-color);
    list-style-type: disc;
}

.terms-content li {
    margin-bottom: 1rem;
    line-height: 2.0;
}

.tp-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.tp-team {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tp-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    font-family: 'Outfit', sans-serif;
}

/* SPA View Styles */
#league-view,
#team-view {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Ensure modals are on top */
.modal {
    z-index: 2000;
}

/* Ensure detail modals appear on top of other modals */
#game-modal,
#player-modal {
    z-index: 3000;
}

/* Featured Games Section */
.featured-games-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.featured-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.featured-game-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.featured-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.featured-game-card:hover::before {
    transform: scaleX(1);
}

.featured-game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.3);
}

.featured-game-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.featured-game-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.featured-team {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    flex: 1;
}

.featured-score {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 0.5rem;
    white-space: nowrap;
}

.featured-game-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.featured-video-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), #ff8787);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.featured-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.featured-photo-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), #ff8787);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.featured-photo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

/* Video Links in Schedule Table */
.video-link,
.photo-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    background: rgba(78, 205, 196, 0.1);
    transition: all 0.3s;
    display: inline-block;
    margin: 0.25rem;
}

.video-link:hover,
.photo-link:hover {
    background: rgba(78, 205, 196, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.3);
}

@media (max-width: 768px) {
    .featured-games-grid {
        grid-template-columns: 1fr;
    }

    .featured-game-teams {
        flex-direction: column;
        text-align: center;
    }

    .featured-team {
        width: 100%;
    }

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

/* Sponsor Section Styles */
.sponsors-section {
    padding: 4rem 2rem;
    /* Aligned with .container padding */
    margin-bottom: 3rem;
    position: relative;
}

.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.sponsor-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 1.5rem;
    /* Reduced padding for larger images */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    /* Slightly reduced to keep grid tight */
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    text-decoration: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;

    /* Entrance Animation */
    opacity: 0;
    transform: translateY(30px);
    animation: sponsorFadeIn 0.8s ease forwards;
}

@keyframes sponsorFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Animation */
.sponsor-card {
    animation: sponsorFadeIn 0.8s ease forwards, sponsorFloat 6s ease-in-out infinite;
}

@keyframes sponsorFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.sponsor-card:hover {
    transform: translateY(-15px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(78, 205, 196, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(78, 205, 196, 0.2);
    animation-play-state: paused;
    /* Pause float on hover */
}

/* Shine effect */
.shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: none;
}

.sponsor-card:hover .shine {
    left: 200%;
    transition: all 0.8s ease;
}

.sponsor-logo {
    width: 100%;
    height: 100%;
    max-width: 180px;
    /* Increased max width */
    max-height: 130px;
    /* Increased max height */
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.sponsor-card:hover .sponsor-logo {
    transform: scale(1.1);
}

.sponsor-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sponsor-card:hover .sponsor-name {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
}

@media (max-width: 768px) {
    .sponsors-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.5rem;
    }

    .sponsor-card {
        padding: 1.5rem;
        min-height: 140px;
        border-radius: 1.5rem;
    }

    .sponsor-logo {
        max-height: 90px;
    }

    .sponsor-name {
        font-size: 1.1rem;
    }
}

/* Documentation Modal & Rules Button */
.docs-controls {
    display: flex;
    align-items: center;
}

.rules-btn {
    background: linear-gradient(135deg, var(--primary-color), #ff8e8e);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    font-family: inherit;
    font-size: 0.95rem;
}

.rules-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
    filter: brightness(1.1);
}

.rules-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.2rem;
}

.doc-body {
    color: var(--text-color);
    line-height: 1.8;
    font-size: 1.05rem;
    padding: 1rem 0;
}

.doc-body h1,
.doc-body h2,
.doc-body h3 {
    color: var(--secondary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.doc-body h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.doc-body h2 {
    font-size: 1.8rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.doc-body h3 {
    font-size: 1.4rem;
}

.doc-body p {
    margin-bottom: 1.2rem;
}

.doc-body ul,
.doc-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.doc-body li {
    margin-bottom: 0.5rem;
}

.doc-body strong {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .league-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .season-selector-wrapper {
        width: 100%;
    }

    .rules-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    display: none;
    /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-color-light);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Latest News Section */
.latest-news-section {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.news-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border-left: 5px solid var(--secondary-color);
}

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

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-content {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

/* Team Header Row in stats table */
.team-row-header {
    background: #334155 !important;
    color: white;
    font-weight: 700;
    text-align: left !important;
    padding-left: 1rem !important;
}

/* 頂尖選手 Tabs 樣式 */
.top-players-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.top-players-tab-btn {
    padding: 0.5rem 1.5rem;
    background-color: var(--card-bg, #ffffff);
    border: 2px solid var(--primary-color, #e0e0e0);
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #333333);
    cursor: pointer;
    transition: all 0.3s ease;
}

.top-players-tab-btn:hover {
    background-color: var(--secondary-color, #f0f0f0);
    transform: translateY(-2px);
    color: var(--bg-color, #0f172a);
}

.top-players-tab-btn.active {
    background-color: var(--primary-color, #007bff);
    color: white;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.top-players-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.top-players-pane.active {
    display: block;
}