/* SEAL TEAM SIX Colors */
:root {
    --primary-red: #AE0201;
    --primary-black: #020203;
    --primary-gray: #707275;
    --background-dark: #0a0a0b;
    --card-background: #1a1a1c;
    --border-color: #2a2a2c;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--primary-black) 100%);
    color: var(--primary-gray);
    min-height: 100vh;
    line-height: 1.6;
}

header {
    background: var(--primary-black);
    border-bottom: 3px solid var(--primary-red);
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(174, 2, 1, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-red);
    background: var(--primary-black);
}

.header-text h1 {
    color: var(--primary-red);
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-text p {
    color: var(--primary-gray);
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.bracket-section {
    margin-bottom: 4rem;
}

/* Accordion Styles */
.accordion-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    transform: translateY(-2px);
}

.accordion-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 0.5rem;
}

.accordion-icon.collapsed {
    transform: rotate(-90deg);
}

.bracket-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.bracket-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.bracket-title {
    color: var(--primary-red);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 10px;
    border-left: 5px solid var(--primary-red);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.bracket {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    overflow-x: auto;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    position: relative;
}

.round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 240px;
    position: relative;
}

.round-label {
    text-align: center;
    font-weight: bold;
    color: var(--primary-red);
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--primary-black);
    border-radius: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match {
    background: var(--primary-black);
    border-radius: 8px;
    margin: 1rem 0;
    overflow: visible;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.match:hover {
    border-color: var(--primary-red);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(174, 2, 1, 0.4);
}

/* Connectors drawn by JS SVG overlay — see drawBracketConnectors() */
.bracket-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.player {
    padding: 5px;
    box-shadow: inset 0 0 0 1px #303030;
    border-radius: 2px;
    background: rgba(0, 0, 0, .1);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.player:last-child {
    border-bottom: none;
}

.player-name {
    flex: 1;
}

/* Round Score Display */
.round-score {
    background: var(--primary-red);
    color: white;
    padding: 5px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 2rem;
    text-align: center;
}

/* WoW Class Icons - Using actual images */
.class-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Hide icon for empty/TBD players */
.player.empty .class-icon {
    display: none;
}

/* WoW Class Colors for Player Names */
.player[data-class="druid"] .player-name {
    color: #ff7c0a;
    text-shadow: 0 0 8px rgba(255, 124, 10, 0.5);
}

.player[data-class="hunter"] .player-name {
    color: #aad372;
    text-shadow: 0 0 8px rgba(170, 211, 114, 0.5);
}

.player[data-class="rogue"] .player-name {
    color: #fff468;
    text-shadow: 0 0 8px rgba(255, 244, 104, 0.5);
}

.player[data-class="mage"] .player-name {
    color: #3fc7eb;
    text-shadow: 0 0 8px rgba(63, 199, 235, 0.5);
}

.player[data-class="warrior"] .player-name {
    color: #c69b6d;
    text-shadow: 0 0 8px rgba(198, 155, 109, 0.5);
}

.player[data-class="warlock"] .player-name {
    color: #8788ee;
    text-shadow: 0 0 8px rgba(135, 136, 238, 0.5);
}

.player:hover {
    background: rgba(174, 2, 1, 0.1);
}

.player:hover .player-name {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.player.empty {
    color: var(--primary-gray);
    opacity: 0.5;
    font-style: italic;
}

.player.winner {
    background: linear-gradient(90deg, rgba(174, 2, 1, 0.3) 0%, rgba(174, 2, 1, 0.1) 100%);
    font-weight: bold;
    border-left: 4px solid var(--primary-red);
}

.player.winner .player-name {
    color: #fff;
    text-shadow: 0 0 12px rgba(174, 2, 1, 0.8), 0 0 4px rgba(255, 255, 255, 0.6);
}

.player.winner .round-score {
    background: linear-gradient(135deg, #FF0000 0%, #AE0201 100%);
    box-shadow: 0 0 10px rgba(174, 2, 1, 0.8);
}

.player.winner .class-icon {
    box-shadow: 0 0 12px rgba(174, 2, 1, 0.8);
    border: 2px solid var(--primary-red);
}

.player.loser {
    opacity: 0.2 !important;
}

/* Upper Bracket specific spacing */
.upper-bracket .round-1 {
    justify-content: start;
}

.upper-bracket .round-2 {
    justify-content: start;
}

.upper-bracket .round-3 {
    justify-content: start;
}

.upper-bracket .round-4 {
    justify-content: start;
}

/* Lower Bracket specific spacing */
.lower-bracket .round {
    justify-content: start;
}

/* Grand Finals */
.grand-finals-section {
    text-align: center;
}

.grand-finals {
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.grand-final-match {
    border: 3px solid var(--primary-red);
    background: linear-gradient(135deg, var(--primary-black) 0%, #1a0000 100%);
}

.grand-final-match .player {
    font-size: 1.1rem;
    padding: 1.5rem;
}

footer {
    background: var(--primary-black);
    border-top: 3px solid var(--primary-red);
    padding: 2rem;
    text-align: center;
    color: var(--primary-gray);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .bracket {
        overflow-x: scroll;
    }
    
    .round {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 2rem;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .bracket-title {
        font-size: 1.5rem;
    }
    
    .round {
        min-width: 150px;
    }
    
    .player {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Scrollbar styling */
.bracket::-webkit-scrollbar {
    height: 10px;
}

.bracket::-webkit-scrollbar-track {
    background: var(--primary-black);
    border-radius: 5px;
}

.bracket::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 5px;
}

.bracket::-webkit-scrollbar-thumb:hover {
    background: #8a0101;
}
