/* Public "live draw" viewer — embedded banner + board shown on the public
   tournament page (tournaments/tournament-view.php), mirroring the admin's
   live group draw. Namespaced tldv- to stay independent of the admin
   overlay's tld- styles in tournament-live-draw.css. */

.tldv-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-family: 'Roboto Condensed', sans-serif;
}

.tldv-banner-live {
    background: linear-gradient(135deg, rgba(220,53,69,0.08), rgba(255,107,53,0.06));
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.tldv-banner-done {
    background: #eef7ee;
    border: 1px solid #bfe3bf;
}

.tldv-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    animation: tldv-live-pulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes tldv-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.55); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

/* Tournament-wide sticky notice — floats regardless of which category tab
   is active, so a draw happening in "Women" is noticed while browsing
   "Men". Distinct from .tldv-banner (which is inline, per-category). */
.tldv-global-notice {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 10px 14px;
    border-radius: 10px;
    background: #1a0f08;
    color: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(220, 53, 69, 0.5);
    font-family: 'Roboto Condensed', sans-serif;
    animation: tldv-global-notice-in 0.25s ease-out;
}

@keyframes tldv-global-notice-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tldv-global-notice-text {
    font-size: 0.85rem;
    color: #ffd4b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tldv-global-notice-text strong {
    color: #fff;
}

.tldv-global-notice-watch {
    background: linear-gradient(135deg, #dc3545, #ff6b35);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.tldv-global-notice-watch:hover {
    filter: brightness(1.08);
}

.tldv-global-notice-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 2px;
}

.tldv-global-notice-dismiss:hover {
    color: #fff;
}

@media (max-width: 560px) {
    .tldv-global-notice {
        left: 16px;
        right: 16px;
        bottom: 12px;
        transform: none;
        max-width: none;
    }
    .tldv-global-notice-text {
        white-space: normal;
    }
    @keyframes tldv-global-notice-in {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

.tldv-live-label {
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #b02a37;
    font-size: 0.92rem;
}

.tldv-live-sub {
    color: #6b7280;
    font-size: 0.85rem;
    flex: 1 1 auto;
}

.tldv-banner-done i.fa-check-circle {
    color: #28a745;
    font-size: 1.1rem;
}

.tldv-banner-done span {
    color: #2b4d2b;
    font-size: 0.9rem;
    flex: 1 1 auto;
}

.tldv-watch-btn {
    background: linear-gradient(135deg, #dc3545, #ff6b35);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.tldv-banner-done .tldv-watch-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.tldv-watch-btn:hover {
    filter: brightness(1.06);
}

/* Embedded board (opened via "Watch live" / "Watch the draw") */
.tldv-board {
    background: #1a0f08;
    color: #fff;
    border-radius: 12px;
    padding: 16px 18px 18px;
    margin-bottom: 16px;
    font-family: 'Roboto Condensed', sans-serif;
}

.tldv-board-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 700;
    color: #ffb366;
    font-size: 1rem;
}

.tldv-board-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tldv-share-feedback { font-size: .85rem; color: #ffd4b3; overflow-wrap: anywhere; }
.tldv-share-feedback:not(:empty) { margin-bottom: 10px; }
.tldv-share-feedback input { display: block; width: min(100%, 760px); padding: 8px; margin-top: 6px; }
.tldv-container { scroll-margin-top: 90px; }

.tldv-from-start-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffd4b3;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.tldv-from-start-btn:hover {
    background: rgba(255, 140, 66, 0.2);
}

.tldv-board-header i.fa-trophy {
    color: #ff8c42;
    margin-right: 6px;
}

.tldv-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}

.tldv-close-btn:hover {
    opacity: 1;
}

/* Sidebar (narration + history) + groups grid, same idea as the admin
   overlay's layout — keeps all groups visible without needing to scroll
   past a full-width narration banner. */
.tldv-main {
    display: flex;
    gap: 14px;
    max-height: 70vh;
}

.tldv-sidebar {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.tldv-phase-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 8px;
    background: rgba(255, 140, 66, 0.12);
    border: 1px solid rgba(255, 140, 66, 0.35);
    flex-shrink: 0;
}

.tldv-phase-banner i {
    color: #ff8c42;
    font-size: 1rem;
    margin-top: 2px;
}

.tldv-phase-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: #ffd4b3;
    line-height: 1.3;
}

.tldv-phase-detail {
    font-size: 0.68rem;
    color: #cbb199;
}

.tldv-pick-card {
    text-align: center;
    padding: 8px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 140, 66, 0.4);
    flex-shrink: 0;
}

.tldv-pick-label {
    font-size: 0.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffb366;
}

.tldv-pick-name {
    font-size: 1.05rem;
    font-weight: 700;
    word-break: break-word;
}

.tldv-pick-meta {
    font-size: 0.7rem;
    color: #ddb897;
}

.tldv-pick-dest {
    font-size: 0.76rem;
    font-weight: 700;
    color: #ffd4b3;
    margin-top: 3px;
}

.tldv-history-label {
    font-size: 0.62rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.tldv-history-label i {
    margin-right: 4px;
}

.tldv-history {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tldv-history-phase {
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(255, 140, 66, 0.08);
    border-left: 2px solid #ff8c42;
    font-size: 0.7rem;
    color: #ffd4b3;
    font-weight: 700;
}

.tldv-history-phase i {
    color: #ff8c42;
    margin-right: 4px;
}

.tldv-history-phase-detail {
    font-size: 0.62rem;
    font-weight: 400;
    color: #a88a72;
    margin-top: 1px;
    padding-left: 17px;
}

.tldv-history-pick {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.7rem;
}

.tldv-history-seed-tag {
    background: #ff8c42;
    color: #1a0f08;
    font-size: 0.56rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
}

.tldv-history-pick-name {
    font-weight: 700;
    color: #fff;
}

.tldv-history-pick-meta {
    color: #a88a72;
    font-size: 0.65rem;
}

.tldv-history-pick-dest {
    color: #ffb366;
    font-weight: 600;
    margin-left: auto;
    font-size: 0.66rem;
    white-space: nowrap;
}

.tldv-groups-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: min-content;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
}

.tldv-group-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 9px 9px;
}

.tldv-group-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #ff8c42;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tldv-group-slots {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tldv-slot {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    font-size: 0.74rem;
    min-height: 20px;
}

.tldv-slot-num {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    font-size: 0.65rem;
    width: 12px;
    flex-shrink: 0;
}

.tldv-slot-name {
    color: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tldv-slot.tldv-slot-filled {
    background: rgba(255, 140, 66, 0.1);
    border: 1px solid rgba(255, 140, 66, 0.4);
}

.tldv-progress-text {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

@media (max-width: 720px) {
    .tldv-main {
        flex-direction: column;
        max-height: none;
    }
    .tldv-sidebar {
        flex: 0 0 auto;
        max-height: 45vh;
    }
    .tldv-groups-grid {
        flex: 1 1 auto;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .tldv-pick-name { font-size: 1rem; }
    .tldv-live-sub { flex-basis: 100%; }
}
/* Knockout match cards reuse the group reveal and retain exact bracket slots. */
.tldv-knockout .tldv-groups-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tldv-knockout .tldv-slot-name { white-space: normal; overflow-wrap: anywhere; }
.tldv-knockout .tldv-slot-num { width: 22px; }
.tldv-knockout .tldv-pick-card[style*="hidden"],
.tldv-knockout .tldv-phase-banner[style*="hidden"] { display: none; }
.tldv-pick-reason, .tldv-history-reason { font-size: .8rem; line-height: 1.4; margin-top: 7px; }
.tldv-history-reason { flex-basis: 100%; }
.tldv-audit { padding: 12px; }
.tldv-audit summary { cursor: pointer; }
.tldv-audit pre { white-space: pre-wrap; max-height: 45vh; overflow: auto; font-size: .8rem; }
.tldv-warning { color: #7d4100; background: #fff0c9; padding: 8px; }
