:root {
    --primary-color: #000;
    --accent-color: #e31b23;
    --text-color: #1a1a1a;
    --bg-color: #ffffff;
    --secondary-bg: #f8f9fa;
    --border-color: #eee;
    --max-width: 1100px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fcfcfc;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; cursor: pointer; }
ul { list-style: none; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #999;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-color);
    background: #f5f5f5;
}

.tab-btn.active {
    color: white;
    background: var(--accent-color);
}

/* Auth Group in Nav */
.auth-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 6px 15px;
    border-radius: 50px;
    border: 1px solid #eee;
    box-shadow: var(--shadow-sm);
}

#user-display-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-text-only {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.btn-outline {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-full { width: 100%; }

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); opacity: 0.9; }
.btn-outline:hover { background: #f8f9fa; border-color: #000; }

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.5rem; font-weight: 900; color: var(--accent-color); letter-spacing: -1px; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #555; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent-color); }

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: 0.3s;
}

/* Modals */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: 20px auto;
    padding: 48px;
    border-radius: 32px;
    width: 95%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.05);
    animation: modalAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-large { max-width: 800px; }

.close-btn {
    position: absolute; right: 24px; top: 24px;
    font-size: 20px; color: #bbb; cursor: pointer; transition: all 0.2s;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #f5f5f5;
    z-index: 10;
}
.close-btn:hover { color: #000; background: #eee; transform: rotate(90deg); }

/* News Styles */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.news-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.news-info {
    padding: 25px;
}

.news-info .category {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 8px;
}

.news-info h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.news-info p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Registration Form Layout */
.player-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* Profile Headers Refinement */
.profile-header { 
    padding: 80px 48px; 
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%); 
    color: #fff; 
    text-align: left; 
    border-radius: 32px 32px 0 0; 
    margin: -48px -48px 40px; 
    position: relative;
    overflow: hidden;
}

.profile-header::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: radial-gradient(circle at 90% 10%, rgba(227, 27, 35, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.profile-header h1 { font-size: 2.8rem; font-weight: 900; letter-spacing: -1.5px; position: relative; z-index: 1; }
.profile-header p { font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--accent-color); font-size: 0.85rem; position: relative; z-index: 1; margin-bottom: 5px; }

/* Stats Grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 35px;
    padding: 0 5px;
}

.stat-box {
    background: #fff;
    padding: 24px 15px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}

.stat-box:hover { transform: translateY(-5px); border-color: #ddd; }

.stat-box .value { display: block; font-size: 1.6rem; font-weight: 850; color: #111; line-height: 1; margin-bottom: 8px; }
.stat-box .label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: #999; letter-spacing: 0.5px; }

/* Input Refinement */
.input-full {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 16px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.input-full:focus {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(227, 27, 35, 0.1);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: white;
    border: 2px solid #f0f0f0;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.95rem;
    color: #333;
}

.btn-google img { width: 20px; }

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px; background: #eee;
    z-index: 1;
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    z-index: 2;
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 0.95rem;
    color: #666;
}

.auth-switch a {
    color: var(--accent-color);
    font-weight: 700;
    margin-left: 4px;
}

/* Section Styles */
.section { padding: 80px 0; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 40px; }
.section-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; color: #111; }

/* Standings Table Fixes */
.table-container { 
    background: #fff; 
    border-radius: 24px; 
    border: 1px solid #eee; 
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.standings-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.standings-table th { 
    background: #fafafa; 
    padding: 20px 16px; 
    font-size: 0.75rem; 
    color: #999; 
    text-transform: uppercase; 
    font-weight: 700;
    letter-spacing: 1.2px;
    border-bottom: 1px solid #eee;
}

.standings-table td { 
    padding: 18px 16px; 
    text-align: center; 
    border-bottom: 1px solid #f9f9f9; 
    color: #333;
}

.standings-table .team-name { 
    text-align: left !important; 
    font-weight: 700; 
    color: #000;
    padding-left: 32px;
    min-width: 150px;
}

.standings-table tr.clickable-row { cursor: pointer; transition: background 0.1s; }
.standings-table tr.clickable-row:hover { background: #fbfbfb !important; }

/* Scorers Refinement */
.scorers-list { 
    background: #fff;
    border-radius: 24px; 
    border: 1px solid #eee;
    overflow: hidden; 
    box-shadow: var(--shadow-sm);
}

.scorer-item { 
    display: flex; 
    align-items: center; 
    padding: 20px 32px; 
    cursor: pointer; 
    border-bottom: 1px solid #f9f9f9; 
    transition: all 0.2s;
}

.scorer-item:hover { background: #fbfbfb; }

.rank { width: 40px; font-size: 1.1rem; font-weight: 900; color: #ddd; font-style: italic; }
.scorer-item:nth-child(1) .rank { color: #FFD700; }
.scorer-item:nth-child(2) .rank { color: #C0C0C0; }
.scorer-item:nth-child(3) .rank { color: #CD7F32; }

.player-info { flex: 1; }
.player-name { font-weight: 700; color: #000; font-size: 1rem; display: block; }
.player-team { font-size: 0.8rem; color: #999; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.goals-badge {
    background: #fff;
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    border: 2px solid #fff1f2;
}

/* Games Grid Styles */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.game-card {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.game-card:hover { transform: translateY(-5px); }

.game-status {
    position: absolute;
    top: 0;
    right: 0;
    background: #f8f9fa;
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom-left-radius: 15px;
    color: #666;
}

.game-status.live { background: var(--accent-color); color: #fff; }

.game-matchup {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
}

.team-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.team-display .team-name {
    font-weight: 800;
    font-size: 1.1rem;
    text-align: center;
}

.game-score-display {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
}

.score-num {
    font-size: 2.2rem;
    font-weight: 900;
    color: #111;
}

.score-divider {
    font-size: 1.2rem;
    font-weight: 300;
    color: #ccc;
}

.game-footer {
    border-top: 1px solid #f5f5f5;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    font-size: 0.85rem;
    color: #999;
    font-weight: 600;
}

/* Hero */
.hero { 
    background: #000; 
    color: #fff; 
    padding: 140px 0; 
    text-align: center; 
    background-image: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000 100%);
}
.hero h1 { font-size: 4.5rem; font-weight: 950; letter-spacing: -3px; }

.footer {
    text-align: center;
    padding: 60px 0;
    color: #999;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    margin-top: 80px;
}

/* Payment Summary */
#payment-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-top: 20px;
}

#payment-summary div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

#payment-summary .total-row {
    font-weight: 700;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
    color: var(--accent-color);
}

/* Stripe Modal & Elements */
#card-element {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.StripeElement--focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(227, 27, 35, 0.1);
}

/* Media Queries */

@media (max-width: 900px) {
    .games-grid { grid-template-columns: 1fr; }
    .hero { padding: 100px 0; }
    .hero h1 { font-size: 3.5rem; }
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        gap: 1.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .auth-group {
        gap: 10px;
    }

    .user-profile-badge {
        padding: 6px 10px;
    }

    #user-display-name {
        display: none;
    }

    .section { padding: 40px 0; }
    .section-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .section-title { font-size: 1.5rem; }
    
    .news-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .hero h1 { font-size: 2.8rem; letter-spacing: -1.5px; }
    .hero p { font-size: 1rem; }
    
    .profile-header { padding: 60px 24px; margin: -24px -24px 30px; border-radius: 0; }
    .profile-header h1 { font-size: 2rem; }
    
    .profile-stats-grid { gap: 10px; }
    .stat-box { padding: 15px 10px; }
    .stat-box .value { font-size: 1.2rem; }
    .stat-box .label { font-size: 0.6rem; }
    
    .modal-content { padding: 24px; border-radius: 20px; }
    .modal-content.modal-large { padding: 0; }
    #team-reg-form { padding: 0 24px 24px !important; }
    
    .player-grid { grid-template-columns: 1fr; }
    
    .game-card { padding: 20px; }
    .score-num { font-size: 1.8rem; }
    
    .scorer-item { padding: 15px 20px; }
    .goals-badge { padding: 4px 12px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.2rem; }
    .btn-primary, .btn-outline { padding: 10px 16px; font-size: 0.85rem; }
    
    .profile-header { padding: 40px 20px; }
    .profile-header h1 { font-size: 1.8rem; }
    
    .game-matchup { flex-direction: column; gap: 20px; }
    .game-score-display { padding: 10px 0; }
    
    #match-details-content .profile-header div { gap: 20px; }
    #match-details-content .profile-header h2 { font-size: 1.2rem !important; }
    #match-details-content .profile-header h1 { font-size: 3rem !important; }
    
    #match-details-content > div:nth-child(2) { grid-template-columns: 1fr !important; gap: 20px !important; padding: 24px !important; }
    #match-details-content > div:nth-child(3) { padding: 0 24px 24px !important; }
}
