* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.filters {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.filters select {
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filters select:hover {
    border-color: #764ba2;
}

.filters select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.searchable-select input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    cursor: text;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #764ba2;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    margin-top: 5px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dropdown-item:first-child {
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.dropdown-item-disabled {
    padding: 10px 15px;
    color: #999;
    font-style: italic;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.standings-section,
.bracket-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.standings-section h2,
.bracket-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.team-count {
    font-size: 1rem;
    color: #999;
    font-weight: normal;
}

/* Standings Table */
.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table thead {
    background: #667eea;
    color: white;
}

.standings-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.standings-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.standings-table tbody tr:hover {
    background: #f5f5f5;
}

.standings-table td {
    padding: 12px;
}

.team-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Bracket */
.bracket-container {
    overflow-x: auto;
    padding-bottom: 20px;
}

.bracket-rounds {
    display: flex;
    gap: 40px;
    min-width: min-content;
}

.bracket-round {
    min-width: 300px;
}

.bracket-round h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.match-inline:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.team-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.team-inline .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-inline.winner {
    font-weight: 700;
    color: #28a745;
}

.team-inline.loser {
    opacity: 0.6;
    text-decoration: line-through;
}

.score-inline {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.score-inline.pending {
    font-size: 1rem;
    color: #999;
}

.battle-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s;
}

.battle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.battle-btn .live-indicator {
    color: #28a745;
    animation: pulse 2s infinite;
}

/* Old match styles - keep for compatibility */
.match {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.match:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.match.in-progress {
    border-color: #ffc107;
    background: #fffbf0;
}

.match.completed {
    border-color: #28a745;
}

.match-team {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin-bottom: 8px;
}

.match-team:last-of-type {
    margin-bottom: 0;
}

.match-team.winner {
    background: #e8f5e9;
    border: 2px solid #28a745;
    font-weight: 600;
}

.match-team .team-name {
    flex: 1;
    margin-left: 8px;
}

.match-team .team-score {
    font-weight: bold;
    font-size: 1.2rem;
    color: #667eea;
    margin-left: 10px;
}

.match-vs {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin: 5px 0;
}

.match-vs .series-score {
    font-size: 1.4rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.match-vs .series-score.pending {
    font-size: 0.9rem;
    color: #999;
    font-weight: normal;
}

.match-vs .vs-label {
    font-size: 0.85rem;
    color: #999;
}

.match-team.qualified {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

.match-team.eliminated {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    opacity: 0.7;
}

.match-team .team-status {
    display: block;
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 600;
}

.match-team.qualified .team-status {
    color: #28a745;
}

.match-team.eliminated .team-status {
    color: #dc3545;
}

.match-time {
    margin-top: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.match-time .live-score {
    color: #28a745;
    font-weight: bold;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

.match-time .final-score {
    color: #666;
    font-weight: 600;
    margin-left: 8px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Utility classes */
.loading,
.error,
.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

.error {
    color: #dc3545;
}

.progress-text {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

/* Scrollbar styling */
.bracket-container::-webkit-scrollbar {
    height: 8px;
}

.bracket-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.bracket-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.bracket-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Status badges */
.status-active {
    background: #28a745;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #ffc107;
    color: #333;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-completed {
    background: #6c757d;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-ko {
    background: #dc3545;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.match-time a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.match-time a:hover {
    text-decoration: underline;
}

/* MU Avatars */
.mu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: cover;
}

.mu-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    object-fit: cover;
}
