:root {
    --primary-color: #004d98; /* FIFA Blue */
    --secondary-color: #ed1c24; /* Red */
    --accent-color: #ffcc00; /* Gold */
    --bg-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
    --success: #28a745;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* ===== Header & Nav — 4 кнопки ===== */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    align-items: stretch;
    max-width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 52px;
}

/* Скрываем старый бургер */
.burger { display: none !important; }

/* Логотип — скрыт, кнопки занимают всю ширину */
.logo { display: none; }

/* Контейнер 4 кнопок */
.nav-links {
    display: flex;
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.nav-links li {
    flex: 1;
    margin: 0;
    border-right: 1px solid rgba(255,255,255,0.15);
}

.nav-links li:last-child {
    border-right: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    padding: 0 8px;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: var(--accent-color);
}

/* Hero Section */
#hero {
    background: linear-gradient(rgba(0, 77, 152, 0.8), rgba(0, 77, 152, 0.8)), url('../images/stadium-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
    padding: 60px 20px;
}

#hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* User Card */
.user-card {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
}

.stage-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.stage-buttons button {
    padding: 10px 20px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.stage-buttons button:hover {
    background: #003366;
}

/* Bracket Styles */
.bracket-wrapper {
    overflow-x: auto;
    padding: 20px 0;
}

.bracket {
    display: flex;
    gap: 40px;
    min-width: 1000px;
    justify-content: center;
}

.round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.matchup {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 180px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.team {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.team:first-child {
    border-bottom: 1px solid #eee;
}

.team img {
    width: 24px;
    height: 16px;
    margin-right: 10px;
    object-fit: cover;
    border: 1px solid #eee;
}

.score {
    margin-left: auto;
    font-weight: bold;
    color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

.stat-box {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.stat-box h3 {
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

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

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
}

/* Forms */
.auth-form {
    max-width: 500px;
    margin: 40px auto;
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.btn-submit, .btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-secondary {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* Prediction List */
.prediction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.prediction-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prediction-inputs input {
    width: 50px;
    text-align: center;
    padding: 5px;
}

.btn-save {
    margin-top: 20px;
    background: var(--success);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* ===== Адаптив ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    #hero h1 {
        font-size: 2rem;
    }

    nav {
        min-height: 48px;
    }

    .nav-links a {
        font-size: 0.75rem;
        height: 48px;
        letter-spacing: 0;
        padding: 0 4px;
    }

    .stat-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 400px; }
}

@media (max-width: 480px) {
    nav {
        min-height: 50px;
    }
    
    .nav-links a {
        font-size: 0.68rem;
        height: 50px;
        padding: 0 2px;
        line-height: 1.1;
        word-break: break-word;
    }
}

/* Гарантия видимости кнопок на мобильных */
.nav-links {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
}
