:root {
    --bracket-width: 350px;
    --game-width: 350px;
    --min-game-height: 102px;
}

/* Gradientes para Winners Bracket */
.royal-victory {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #4CAF50 50%, #81C784 75%, #C8E6C9 100%) !important;
}

.golden-crown {
    background: linear-gradient(45deg, #0f2027 0%, #203a43 25%, #2c5364 50%, #FFD700 75%, #FFF8DC 100%) !important;
}

.emerald-throne {
    background: linear-gradient(225deg, #134e5e 0%, #71b280 25%, #4CAF50 50%, #66BB6A 75%, #A5D6A7 100%) !important;
}

.platinum-elite {
    background: linear-gradient(90deg, #2C3E50 0%, #34495E 20%, #7F8C8D 40%, #BDC3C7 60%, #ECF0F1 80%, #FFFFFF 100%) !important;
}

.sapphire-dominance {
    background: linear-gradient(180deg, #0c0c0c 0%, #1a237e 25%, #3f51b5 50%, #5c6bc0 75%, #9fa8da 100%) !important;
}

.champions-light {
    background: linear-gradient(315deg, #0f3460 0%, #0e4b99 25%, #2e8de1 50%, #7bb3f0 75%, #b3d9ff 100%) !important;
}

.victory-aurora {
    background: linear-gradient(60deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%) !important;
}

.diamond-prestige {
    background: linear-gradient(120deg, #0f0f0f 0%, #2c2c2c 20%, #4d4d4d 40%, #b8b8b8 60%, #e6e6e6 80%, #ffffff 100%) !important;
}

.mythical-power {
    background: linear-gradient(240deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #4CAF50 75%, #81C784 100%) !important;
}

.legendary-status {
    background: linear-gradient(300deg, #000428 0%, #004e92 25%, #009ffd 50%, #00d2ff 75%, #ffffff 100%) !important;
}

.cosmic-champion {
    background: linear-gradient(150deg, #2b1055 0%, #7597de 25%, #74b9ff 50%, #0984e3 75%, #74b9ff 100%) !important;
}

.celestial-glory {
    background: linear-gradient(330deg, #1e3c72 0%, #2a5298 20%, #ff6b6b 40%, #ffd93d 60%, #6bcf7f 80%, #4facfe 100%) !important;
}

/* Gradientes para Losers Bracket */

.crimson-redemption {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 25%, #FF4500 50%, #FF6347 75%, #FFA500 100%) !important;
}

.phoenix-rise {
    background: linear-gradient(45deg, #2C1810 0%, #8B4513 20%, #CD853F 40%, #FF8C00 60%, #FFD700 80%, #FFFF00 100%) !important;
}

.ember-fight {
    background: linear-gradient(225deg, #1a0000 0%, #4d0000 15%, #800000 30%, #cc3300 50%, #ff4d00 70%, #ff8000 85%, #ffaa00 100%) !important;
}

.blood-moon {
    background: linear-gradient(90deg, #0f0f23 0%, #1a0d1a 20%, #330033 40%, #660033 60%, #990033 80%, #cc0033 100%) !important;
}

.molten-steel {
    background: linear-gradient(180deg, #191970 0%, #483D8B 25%, #696969 50%, #A0522D 75%, #FF4500 100%) !important;
}

.shadow-flame {
    background: linear-gradient(315deg, #000000 0%, #1a1a1a 20%, #333333 40%, #8B0000 60%, #DC143C 80%, #FF6347 100%) !important;
}

.volcanic-ash {
    background: linear-gradient(60deg, #2F2F2F 0%, #696969 25%, #A0522D 50%, #CD853F 75%, #FF8C00 100%) !important;
}

.midnight-fire {
    background: linear-gradient(120deg, #0f0f23 0%, #1e1e3f 20%, #2d2d5c 40%, #8B0000 60%, #DC143C 80%, #FF4500 100%) !important;
}

.rust-revival {
    background: linear-gradient(240deg, #2F4F4F 0%, #696969 20%, #A0522D 40%, #CD853F 60%, #D2691E 80%, #FF8C00 100%) !important;
}

.inferno-path {
    background: linear-gradient(300deg, #000000 0%, #800000 25%, #DC143C 50%, #FF4500 75%, #FFD700 100%) !important;
}

.champion {
    background: #FFD700 !important;
}

.runner-up {
    background: #B0BEC5 !important;
}

.third-place {
    background: #CD853F !important;
}

.fourth-place {
    background: #1a1a1a !important;
}

.bracket-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    /* background: #0d1b2a; */
    color: #fff;
}

.bracket-viewport {
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    transition: transform 0.3s ease;
    cursor: grab;
}

.bracket-viewport:active {
    cursor: grabbing;
}

.bracket-content {
    min-width: 100%;
    min-height: 100%;
    position: relative;
    padding: 40px;
}

.bracket-section {
    margin-bottom: 60px;
}

.bracket-separator {
    border: 1px solid #ccc;
    /* height: 10px; */
    margin-top: 50px;
    padding-left: 10px;
    padding-right: 10px;
}

.games-section {
    margin-bottom: 60px;
}

.bracket-title {
    font-size: 2.5rem;
    font-weight: bold;
    /* text-align: center; */
    margin-bottom: 20px;
    background: linear-gradient(45deg, #4CAF50, #2196F3);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.bracket-tree {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    justify-content: start;
    min-height: 500px;
}

.rounds {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    justify-content: start;
    min-height: 500px;
}

.round {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: var(--bracket-width);
    position: relative;
}

.round-row {
    display: flex;
    flex-direction: row;
    justify-content: start;
    flex-wrap: wrap;
    gap: 10px;
    min-width: var(--bracket-width);
}

.round-title {
    /* font-size: 1.2rem;
    font-weight: 600; */
    text-align: center;
    color: #fff;
    margin-bottom: 10px;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(76, 175, 80, 0.3);
}


.game {
    position: relative;
    /* background: linear-gradient(145deg, #2a2a4a, #1e1e3f); */
    background: #2C3E50;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: var(--min-game-height);
    /* height: var(--min-game-height); */
    min-width: var(--game-width);
}

.game.qualification {
    /* border-color: #310202; */
    /* background: linear-gradient(145deg, #5f3038, #643535); */
    background: #8B4513;
    /* box-shadow: 0 0 20px rgba(255, 60, 0, 0.4); */
}

.game.looser {
    /* border-color: #310202; */
    /* background: linear-gradient(145deg, #5f3038, #643535); */
    background: #2F2F2F;
    /* box-shadow: 0 0 20px rgba(255, 60, 0, 0.4); */
}

.game.looser>.game-header {
    color: #CD853F !important;
}

.game.looser:hover {
    border-color: #530303;
    box-shadow: 0 12px 40px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}

.game:hover {
    border-color: #4CAF50;
    box-shadow: 0 12px 40px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}

.game.highlighted {
    border-color: #FF9800;
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.4);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 1.3rem;
    color: #FFD700;
}

.game-info {
    display: flex;
    gap: 15px;
    font-size: 1.3rem;
}

.rankings {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
}

.ranking {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 5px;
    padding-right: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.ranking-info{
    display: flex;
    flex-direction: row;
}

.ranking-position {
    width: 60px;
    height: 60px;
    /* border-radius: 50%; */
    margin-right: 12px;
    /* border: 2px solid rgba(255, 255, 255, 0.2); */
    align-content: center;
    align-items: center;
    text-align: center;
}

.ranking-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}


.players {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.player {
    display: flex;
    align-items: center;
    padding-left: 5px;
    padding-right: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.player:hover {
    background: rgba(76, 175, 80, 0.1);
    transform: translateX(5px);
}

.player.winner {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    border-left: 3px solid #4CAF50;
}

.player.loser {
    opacity: 0.6;
    background: rgba(244, 67, 54, 0.1);
    border-left: 3px solid #bd4c4c;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.player-info {
    flex: 1;
}

.player-id {
    font-weight: 600;
    /* font-size: 0.95rem; */
    font-size: 1.7rem;
    color: #7ad7ee;
    margin-right: 3px;
}

.player-name {
    font-weight: 600;
    /* font-size: 0.95rem; */
    font-size: 1.7rem;
    color: #fff;
}

.player-nickname {
    font-size: 1.6rem;
    color: #fff;
    font-style: italic;
}

.player-score {
    font-weight: bold;
    font-size: 2rem;
    min-width: 30px;
    text-align: right;
}


.connector {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.connector-line {
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 2;
    fill: none;
    transition: all 0.3s ease;
}

.connector-line.highlighted {
    stroke: #FF9800 !important;
    stroke-width: 3;
    drop-shadow: 0 0 10px rgba(255, 152, 0, 0.6);
}

.zoom-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 1000;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(76, 175, 80, 0.8);
    border-color: #4CAF50;
}

.losers-bracket {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 2px dashed rgba(244, 67, 54, 0.3);
}

.losers-bracket .bracket-title {
    background: linear-gradient(45deg, #F44336, #FF9800);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.losers-bracket .round-title {
    color: #F44336;
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    text-align: left;
}

/*@media (max-width: 768px) {
    .rounds {
        gap: 40px;
        flex-direction: column;
        align-items: center;
    }

    .round {
        min-width: 250px;
    }

    .bracket-title {
        font-size: 2rem;
    }

    .game {
        padding: 5px;
        min-height: 100px;
    }

    .player-avatar {
        width: 28px;
        height: 28px;
    }
}*/

.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    margin-right: 8px;
}

.bracket-select {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    color: black;
    /* background: rgba(0, 0, 0, 0.8); */
    padding: 5px;
    border-radius: 8px;
    font-size: 1.3rem;
    z-index: 1000;
}

.bracket-line {
    position: absolute;
    top: 20px;
    right: 130px;
    width: 80px;
    color: black;
    /* background: rgba(0, 0, 0, 0.8); */
    padding: 5px;
    border-radius: 8px;
    font-size: 1.3rem;
    z-index: 1000;
}

.bracket-tools {
    position: absolute;
    display: flex;
    flex-direction: row;
    gap: 5px;
    top: 20px;
    right: 20px;
    color: black;
    /* background: rgba(0, 0, 0, 0.8); */
    padding: 5px;
    border-radius: 8px;
    font-size: 1.3rem;
    z-index: 1000;
}

.bracket-tools div {
    width: 100%;
}

.bracket-tools label {
    color: white;
}

.bracket-tools select {
    color: black;
    min-width: 150px;
    /* background: rgba(0, 0, 0, 0.8); */
    padding: 5px;
    border-radius: 8px;
    font-size: 1.3rem;
}


/* Método 1: CSS Fixed Position */
.fullscreen-css {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-size: 24px;
    text-align: center;
}

.fullscreen-css.active {
    display: flex;
}

.bracket-viewport:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.bracket-viewport:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.bracket-viewport:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}