/* Tournament Banner — sticky strip across hub screens */
.tournament-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    color: #1a1a2e;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.4);
    cursor: pointer;
    animation: tbShine 6s linear infinite;
}

@keyframes tbShine {
    0%   { background-position: 200% 50%; }
    100% { background-position: 0% 50%; }
}

.tournament-banner .tb-label {
    flex: 1;
    text-align: center;
    pointer-events: none;
}

.tournament-banner .tb-action {
    background: rgba(0, 0, 0, 0.85);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.6);
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.tournament-banner .tb-action:hover {
    background: #000;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Push body content down when banner visible */
body:has(.tournament-banner[style*="display: flex"]) {
    padding-top: 44px;
}

/* ───────── Bracket Modal ───────── */
.tournament-bracket-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tournament-bracket-modal {
    background: #1a1a2e;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.tbm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tbm-header h2 {
    margin: 0;
    color: #FFD700;
    font-size: 1.3rem;
}

.tbm-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 8px;
}

.tbm-close:hover {
    color: #fff;
}

.tbm-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.tbm-meta {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #ddd;
}

.tbm-meta strong { color: #FFD700; }

.tbm-rounds {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 12px;
}

.tbm-round {
    min-width: 220px;
    flex: 1;
}

.tbm-round h4 {
    color: #aaa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
    text-align: center;
}

.tbm-match {
    background: #14142a;
    border: 1px solid #2a2a45;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    position: relative;
}

.tbm-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.tbm-match-id {
    color: #666;
    font-family: monospace;
}

.tbm-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tbm-badge--done    { background: rgba(80, 200, 120, 0.2); color: #5fc878; }
.tbm-badge--live    { background: rgba(255, 80, 80, 0.2); color: #ff6666; animation: tbmLivePulse 1s ease-in-out infinite alternate; }
.tbm-badge--pending { background: rgba(180, 180, 180, 0.15); color: #aaa; }

@keyframes tbmLivePulse {
    from { opacity: 0.6; }
    to   { opacity: 1.0; }
}

.tbm-slot {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    padding: 6px 8px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #ddd;
    border-left: 3px solid transparent;
}

.tbm-slot--winner {
    border-left-color: #5fc878;
    background: rgba(80, 200, 120, 0.08);
    color: #5fc878;
}

.tbm-slot--loser {
    opacity: 0.5;
    text-decoration: line-through;
}

.tbm-slot--empty {
    background: rgba(255, 255, 255, 0.02);
    color: #666;
}

.tbm-vs {
    text-align: center;
    color: #666;
    font-size: 0.7rem;
    padding: 2px 0;
}

.tbm-spectate-btn {
    margin-top: 8px;
    width: 100%;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #FFD700;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.tbm-spectate-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

/* ───────── Tournament Guard Modal ───────── */
.tournament-guard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tournament-guard-modal {
    background: #1a1a2e;
    border-radius: 12px;
    border: 2px solid rgba(255, 165, 0, 0.5);
    box-shadow: 0 12px 48px rgba(255, 165, 0, 0.3);
    max-width: 480px;
    width: 100%;
}

.tg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tg-icon {
    font-size: 1.6rem;
}

.tg-header h2 {
    margin: 0;
    color: #FFA500;
    font-size: 1.2rem;
}

.tg-body {
    padding: 16px 20px;
    color: #ddd;
    line-height: 1.5;
}

.tg-body p {
    margin: 0 0 10px;
}

.tg-body strong {
    color: #FFD700;
}

.tg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 16px;
}

.tg-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.tg-btn-cancel {
    background: transparent;
    color: #aaa;
    border-color: #444;
}

.tg-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.tg-btn-confirm {
    background: #FFA500;
    color: #1a1a2e;
    border-color: #FFA500;
}

.tg-btn-confirm:hover {
    background: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
