* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
}

.role-selection {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    display: inline-block;
    padding: 30px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 200px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn small {
    display: block;
    font-size: 0.6em;
    margin-top: 5px;
    font-weight: normal;
    opacity: 0.8;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-manage {
    background: #c3c91a;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

/* Pool Selection */
.pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.pool-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.pool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    background: #e8f4f8;
}

.pool-card.active {
    border: 3px solid #3498db;
    background: #e8f4f8;
}

/* Match Table */
.match-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.match-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.match-table th {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

.match-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

.match-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    white-space: nowrap;
}

.status-not_started {
    background: #ecf0f1;
    color: #7f8c8d;
}

.status-in_progress {
    background: #3498db;
    color: white;
}

.status-completed {
    background: #2ecc71;
    color: white;
}

/* Score Controls */
.score-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-display {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.score-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background 0.2s;
}

.score-btn:hover {
    opacity: 0.8;
}

.score-up {
    background: #2ecc71;
    color: white;
}

.score-down {
    background: #e74c3c;
    color: white;
}

.status-btn {
    padding: 5px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.status-btn:hover {
    transform: scale(1.05);
}

.status-btn.status-active {
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.8), 0 0 40px rgba(52, 152, 219, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(52, 152, 219, 1), 0 0 60px rgba(52, 152, 219, 0.7);
    }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #34495e;
}

.form-group input,
.form-group select,
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.form-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Navigation */
.nav-bar {
    background: #34495e;
    padding: 15px 0;
    margin-bottom: 20px;
}

.nav-bar a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background 0.3s;
    display: inline-block;
}

.nav-bar a:hover {
    background: #2c3e50;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Team Input Grid */
.team-input-grid {
    display: grid;
    gap: 15px;
}

.team-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auto-refresh {
    text-align: right;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* Pool tabs for spectator view */
.pool-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pool-tab {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    background: #ecf0f1;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    font-weight: bold;
}

.pool-tab:hover {
    background: #bdc3c7;
}

.pool-tab.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.pool-content {
    display: none;
}

.pool-content.active {
    display: block;
}

/* Bracket styles */
.bracket-container {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 250px;
}

.bracket-round h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.2em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.bracket-match {
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    transition: all 0.3s;
}

.bracket-match:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border-color: #3498db;
}

.bracket-match.completed {
    border-color: #2ecc71;
    background: #e8f8f5;
}

.bracket-match.in_progress {
    border-color: #f39c12;
    background: #fef9e7;
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #ddd;
}

.bracket-team.winner {
    border-left-color: #2ecc71;
    background: #d4edda;
    font-weight: bold;
}

.bracket-team-name {
    flex: 1;
    font-size: 1em;
}

.bracket-score {
    font-size: 1.3em;
    font-weight: bold;
    margin-left: 10px;
    min-width: 30px;
    text-align: center;
}

.bracket-vs {
    text-align: center;
    color: #95a5a6;
    font-weight: bold;
    margin: 5px 0;
}

.bracket-info {
    text-align: center;
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .container {
        padding: 10px;
    }
    
    .btn {
        padding: 20px 25px;
        font-size: 1em;
        min-width: 150px;
    }
    
    .button-group {
        gap: 10px;
    }
    
    .pool-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .pool-card {
        padding: 15px;
    }
    
    .form-card {
        padding: 20px;
    }
    
    .match-table th,
    .match-table td {
        padding: 8px;
        font-size: 0.9em;
    }
    
    .nav-bar {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .nav-bar a {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .bracket-container {
        gap: 20px;
        padding: 10px;
    }
    
    .bracket-round {
        min-width: 200px;
    }
    
    .bracket-match {
        padding: 10px;
    }
    
    .score-display {
        font-size: 1.2em;
        min-width: 30px;
    }
    
    .score-btn {
        padding: 3px 8px;
        font-size: 0.9em;
    }
    
    .status-btn {
        padding: 4px 10px;
        font-size: 0.8em;
        margin: 2px;
    }
    
    .pool-tabs {
        padding: 10px;
        gap: 5px;
    }
    
    .pool-tab {
        min-width: 80px;
        padding: 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    
    .btn {
        padding: 15px 20px;
        font-size: 0.9em;
        min-width: 100%;
    }
    
    .pool-grid {
        grid-template-columns: 1fr;
    }
    
    .match-table table {
        min-width: 500px;
    }
    
    .role-selection {
        padding: 20px;
    }
}