* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.group-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.group-card h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.5em;
    text-align: center;
}

.group-card table {
    width: 100%;
    border-collapse: collapse;
}

.group-card table th {
    background: #667eea;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.group-card table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.group-card table tr:last-child td {
    border-bottom: none;
}

.group-card table tr:hover {
    background: #f0f0f0;
}

.games-section {
    margin-top: 40px;
}

.games-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.games-table thead {
    background: #667eea;
    color: white;
}

.games-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.games-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.games-table tbody tr:hover {
    background: #f8f9fa;
}

.games-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.score {
    font-weight: bold;
    color: #667eea;
    /*display: flex;
    justify-content: center;
    align-content: center;*/
}

.team-score{
    font-weight: bold;
    color: #667eea;
}

.tournament-tree {
    margin-top: 30px;
    overflow-x: auto;
}

.bracket {
    display: flex;
    justify-content: space-around;
    gap: 40px;
    padding: 20px;
    min-width: 1000px;
    flex-direction: column;
}

.round-header {
    margin: 10px;
    text-align: center;
}

.roundWHeader {
    display:flex;
    flex-direction:column;
    justify-content: space-around;
    min-width: 20%;
}

.rounds {
    display: flex;
    justify-content: space-around;
    gap: 40px;
}

.round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 20%;
    flex:1;
}

.round h4 {
    text-align: center;
    color: #764ba2;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.match {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.match-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.match .match-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tbd {
    color: #999;
    font-style: italic;
}

.winner-highlight {
    background: #ffc10724;
    font-weight: bold;
    color: #ffc107;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .bracket {
        flex-direction: column;
    }
    
    .games-table {
        font-size: 0.85em;
    }
    
    .games-table th, .games-table td {
        padding: 6px 4px;
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .games-table th:first-child, .games-table td:first-child {
        max-width: 50px;
    }
    
    .score {
        max-width: 50px;
    }
}

.current-game {
    background: #e8f5e9 !important;
    border-color: #4caf50;
    border-left: 4px solid #329936;
}

.team-input {
    width:100%;
    padding:10px;
    border:2px solid #ddd;
    border-radius:4px;
    font-size:14px;
    box-sizing:border-box;
}

.score-input {
    width:25%;
    padding:10px;
    border:2px solid #ddd;
    border-radius:4px;
    font-size:14px;
    box-sizing:border-box;
}

#save-teams-btn, #fill-tree-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

#save-teams-btn:hover, #fill-tree-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

#save-teams-btn:active, #fill-tree-btn:active {
    transform: translateY(0);
}

#save-teams-btn:disabled, #fill-tree-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#reset-tournament-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 30px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(211, 47, 47, 0.3);
}

#reset-tournament-btn:hover {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(211, 47, 47, 0.4);
}

#reset-tournament-btn:active {
    transform: translateY(0);
}

#reset-tournament-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
}
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}
.login-form button {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}
.login-form button:hover {
    background: #45a049;
}
.error-message {
    color: #d32f2f;
    text-align: center;
    margin-bottom: 15px;
}

