@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Standalone page reset */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.rat-bracket-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.rat-bracket-wrapper {
    font-family: "Press Start 2P", serif;
    width: 100%;
    height: 100vh;
    background-color: #1a1a2e;
    color: #e0e0e0;
    overflow: hidden;
}

/* Each game bracket fills the viewport */
.rat-bracket-game-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.rat-bracket-game-bracket {
    width: 100%;
    height: 100%;
}

/* =========================================================================
   Split Bracket Layout
   ========================================================================= */

.rat-bd-bracket {
    display: flex;
    align-items: stretch;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Half: contains round columns */
.rat-bd-half {
    display: flex;
    align-items: stretch;
    gap: 30px;
}

.rat-bd-half.rat-bd-right {
    flex-direction: row-reverse;
}

/* Round column */
.rat-bd-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 16px;
    min-width: 160px;
}

/* Pair wrapper */
.rat-bd-pair {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =========================================================================
   Center Column
   ========================================================================= */

.rat-bd-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 0 100px;
    min-width: 400px;
}

.rat-bd-game-logo,
.rat-bd-rooters-logo {
    max-height: 180px;
    max-width: 360px;
    width: auto;
    object-fit: contain;
}

/* =========================================================================
   Match & Player Styles
   ========================================================================= */

.rat-bd-match {
    display: flex;
    flex-direction: column;
    border: 1px solid #444;
    border-radius: 4px;
    background: #16213e;
    overflow: hidden;
    min-width: 160px;
}

.rat-bd-final {
    border-color: #f39c12;
    border-width: 2px;
}

.rat-bd-player {
    padding: 7px 10px;
    font-size: 10px;
    border-bottom: 1px solid #333;
    white-space: nowrap;
    color: #ccc;
    display: flex;
    align-items: center;
}

.rat-bd-player:last-child {
    border-bottom: none;
}

.rat-bd-player.winner {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

.rat-bd-player.tbd {
    color: #555;
    font-style: italic;
}

/* =========================================================================
   Champion
   ========================================================================= */

.rat-bd-champion-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rat-bd-winner-label {
    font-size: 14px;
    font-weight: bold;
    color: #f39c12;
    letter-spacing: 4px;
    text-shadow: 0 0 12px rgba(243, 156, 18, 0.5);
}

.rat-bd-champion {
    padding: 16px 28px;
    font-size: 16px;
    font-weight: bold;
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    border: 3px solid #f39c12;
    border-radius: 6px;
    text-align: center;
    text-shadow: 0 0 12px rgba(243, 156, 18, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rat-bd-champion.tbd {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: normal;
    color: #555;
    font-style: italic;
    background: rgba(255, 255, 255, 0.03);
    border-color: #444;
    border-width: 2px;
    text-shadow: none;
}

/* =========================================================================
   Avatars
   ========================================================================= */

.rat-bd-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    flex-shrink: 0;
}

.rat-bd-champion .rat-bd-avatar {
    width: 72px;
    height: 72px;
}

/* =========================================================================
   Connector Lines
   ========================================================================= */

.rat-bd-line {
    position: absolute;
    background: #555;
    pointer-events: none;
}

/* =========================================================================
   Status Messages
   ========================================================================= */

.rat-bracket-loading-msg {
    text-align: center;
    padding: 10vh 0;
    color: #666;
    font-size: 12px;
}

.rat-bracket-empty {
    text-align: center;
    padding: 20vh 0;
    color: #555;
    font-size: 12px;
}

.rat-bd-bracket-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 30px;
}

.rat-bd-bracket-empty .rat-bd-game-logo {
    position: static;
    transform: none;
    max-width: 300px;
    max-height: 300px;
}

.rat-bd-bracket-empty .rat-bracket-empty {
    padding: 0;
    font-size: 14px;
    color: #888;
}

/* =========================================================================
   Navigation Buttons
   ========================================================================= */

.rat-bracket-nav {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 100;
    pointer-events: none;
}

.rat-bracket-nav-btn {
    font-family: "Press Start 2P", serif;
    font-size: 10px;
    padding: 10px 18px;
    background: rgba(22, 33, 62, 0.9);
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s, border-color 0.2s;
}

.rat-bracket-nav-btn:hover {
    background: rgba(40, 60, 100, 0.95);
    border-color: #f39c12;
    color: #f39c12;
}

/* =========================================================================
   Double Elimination Layout
   ========================================================================= */

.rat-bd-de-bracket {
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Section labels */
.rat-bd-section-label {
    font-size: 12px;
    font-weight: bold;
    color: #f39c12;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.3);
}

/* Winners Bracket Section */
.rat-bd-wb-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rat-bd-wb-content {
    display: flex;
    align-items: stretch;
}

.rat-bd-wb-finals {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
}

/* Losers Bracket Section */
.rat-bd-lb-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rat-bd-lb-content {
    display: flex;
    align-items: stretch;
    gap: 30px;
}

/* Grand Finals Section */
.rat-bd-gf-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rat-bd-gf-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.rat-bd-gf-match-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rat-bd-gf-label {
    font-size: 9px;
    font-weight: bold;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.rat-bd-gf-reset.rat-bd-hidden {
    display: none;
}

.rat-bd-de-bracket .rat-bd-game-logo,
.rat-bd-de-bracket .rat-bd-rooters-logo {
    max-height: 120px;
    max-width: 240px;
}
