﻿/* Pages scoped to portal layout */
.portal-shell {
    /* Kill the normal page scroll; the portal will manage scrolling internally */
    height: 100vh;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    /* Undo default template "body margin-bottom: 60px" behavior for portal layout */
    .portal-shell body,
    body.portal-shell {
        margin-bottom: 0 !important;
    }

/* Make main take remaining height between header and footer */
.portal-shell-main {
    flex: 1 1 auto;
    min-height: 0; /* critical for nested flex scrolling */
    overflow: hidden;
    display: flex;
}

/* If your footer is positioned by site.css, neutralize it for portal */
.portal-shell .footer {
    position: static !important;
}

/* ----------------------------
   Portal page internal layout
---------------------------- */

.portal-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The pinned 3-column frame */
.portal-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    gap: 1rem;
    /* you can add padding like Bootstrap container-fluid would */
    padding: 1rem;
}

/* Left/right rails are “pinned” because the page isn’t scrolling */
.portal-rail {
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
}

.portal-rail-left {
    width: auto;
}

/* Center fills remaining space */
.portal-center {
    flex: 1 1 auto;
    min-width: 0; /* critical so overflow works and content can shrink */
    min-height: 0;
    overflow: hidden;
    display: flex;
}

/* Panel chrome */
.portal-panel {
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: .5rem;
    padding: 0;
    width: 100%;
    display: flex;
    min-height: 0;
}

/* Allow the partials to control their own scroll regions */
.portal-panel-fill {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Bottom audio bar sits above the footer (not fixed) */
@media (max-width: 767.98px) {
    #callHistoryRail {
        display: none !important;
    }
}

.portal-audiobar {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.1);
    padding: .5rem 1rem;
}

/* Existing behaviors */
.list-group-item-action {
    cursor: pointer;
}

    .list-group-item-action:hover {
        background-color: #f2f2f2;
    }

.overflow-auto {
    min-height: 0;
}

/* Call history: make the card a flex column and the list scroll */
.callhistory-card {
    display: flex;
    flex-direction: column;
    min-height: 0; /* critical */
}

.callhistory-scroller {
    flex: 1 1 auto;
    min-height: 0; /* critical */
    overflow-y: auto;
    overflow-x: hidden;
}
.plugin-detail-pane {
    min-height: 0; /* critical for nested scrolling */
}

#pluginDetailBody {
    flex: 1 1 auto;
    min-height: 0; /* critical */
}
/* ----------------------------
   Plugin Search rail collapse
   ---------------------------- */

/* Left rail defaults */
.portal-rail-left {
    width: 200px;
    flex: 0 0 200px;
    min-width: 0;
    transition: width 180ms ease, flex-basis 180ms ease, opacity 180ms ease;
}

    /* Collapsed state: skinny tab */
    .portal-rail-left.is-collapsed {
        width: 56px !important;
        flex: 0 0 56px !important;
        opacity: 1;
    }

        /* Hide everything except header when collapsed */
        .portal-rail-left.is-collapsed #pluginSearchCollapse {
            display: none !important;
        }

        /* Header compaction */
        .portal-rail-left.is-collapsed .pluginsearch-header {
            flex-direction: row !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 0 !important;
        }

        .portal-rail-left.is-collapsed .pluginsearch-title {
            display: none !important;
        }

        .portal-rail-left.is-collapsed .pluginsearch-actions {
            width: 100%;
            justify-content: center;
        }

/* Icon-only button styling (parallel to call history) */
.pluginsearch-iconbtn {
    padding: .25rem .4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pluginsearch-icon {
    width: 16px;
    height: 16px;
}


/* ----------------------------
   Call History rail collapse
   ---------------------------- */

/* Right rail defaults (matches your markup: .portal-rail-right) */
.portal-rail-right {
    width: 300px;
    flex: 0 0 300px;
    min-width: 0;
    transition: width 180ms ease, flex-basis 180ms ease, opacity 180ms ease;
}

    /* Collapsed state: rail becomes a skinny tab instead of full width */
    .portal-rail-right.is-collapsed {
        width: 56px !important;
        flex: 0 0 56px !important;
        opacity: 1;
    }

        /* Hide everything except the header when collapsed */
        .portal-rail-right.is-collapsed #callHistoryCollapse {
            display: none !important;
        }

        /* Collapsed: keep header horizontal and center the single toggle button */
        .portal-rail-right.is-collapsed .callhistory-header {
            flex-direction: row !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 0 !important;
        }

        .portal-rail-right.is-collapsed .callhistory-title {
            display: none; /* hides "Call History / Your recent calls" */
        }

        /* Buttons fill width when collapsed */
        /* Collapsed: do NOT stretch buttons (keeps the icon button size) */
        .portal-rail-right.is-collapsed #callHistoryToggleBtn {
            width: auto !important;
        }

/* Icon-only buttons */
.callhistory-iconbtn {
    padding: .25rem .4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.callhistory-icon {
    width: 16px;
    height: 16px;
}

/* When rail is collapsed, center the action buttons */
.portal-rail-right.is-collapsed .callhistory-actions {
    width: 100%;
    justify-content: center;
}

/* In collapsed mode, hide the title so the buttons fit comfortably */
.portal-rail-right.is-collapsed .callhistory-title {
    display: none;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.salt-embedded #mainHeader {
    display: none !important;
}

/* Full-height shell for portal layout */
body.portal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-history-shell {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

    .portal-history-shell .callhistory-card {
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
    }

/* Collapsed: keep toggle identical to normal icon button */
.portal-rail-right.is-collapsed #callHistoryToggleBtn {
    width: auto !important;
    padding: .25rem .4rem !important; /* match .callhistory-iconbtn */
}

    /* Optional: scale the icon a bit in collapsed mode */
    .portal-rail-right.is-collapsed #callHistoryToggleBtn .callhistory-icon {
        width: 16px !important;
        height: 16px !important;
    }

#callHistoryScroller,
.portal-history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.portal-rail-right.is-collapsed #callHistoryRefreshBtn {
    display: none !important;
}

/* Main content grows; footer stays at bottom */
.portal-shell-main {
    flex: 1 1 auto;
    min-height: 0;
}
.portal-topbar {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.portal-topbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.portal-topbar-group #wallet-control { margin-right: 0; }
.portal-topbar-account { margin-left: auto; gap: 10px; }
.portal-topbar-account .portal-online-users { order: -1; }
.portal-topbar-group > .btn { white-space: nowrap; }

.guest-trial-control {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
    padding: 5px 9px;
    border: 1px solid rgba(128,128,128,0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.guest-trial-control a {
    margin-left: 4px;
    font-weight: 600;
}

.guest-trial-control.is-expiring {
    border-color: #d99a22;
    background: rgba(217,154,34,0.15);
}

.portal-online-users {
    font-size: 0.95rem;
    opacity: 0.9;
}

#onlineUsersCount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* ----------------------------
   Forced disclaimer modal
---------------------------- */

.ss-modal[hidden] {
    display: none !important;
}

.ss-modal {
    position: fixed;
    inset: 0;
    z-index: 9999; /* ensure it's above portal UI */
    display: flex;
    align-items: center;
    justify-content: center;
}

.ss-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.ss-modal__panel {
    position: relative;
    width: min(720px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #111; /* matches modern dark UI */
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 1.25rem 1.25rem 1rem;
}

.ss-modal__title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

#pluginDetail, #pluginDetailHeader, #pluginDetailBody {
    min-width: 0;
}

/* Optional: prevent accidental horizontal clipping issues */
#pluginDetailBody {
    overflow-x: hidden;
}

.portal-panel,
.portal-rail,
.portal-content > * {
    min-width: 0;
}

@media (max-width: 576px) {
    .plugin-actions > .btn,
    .plugin-actions > a.btn {
        flex: 1 1 100%;
    }
}

.user-flair {
    color: #fff;
    font-size: 0.6em;
    font-weight: 600;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

/* ---- Leaderboard ---- */
.leaderboard-table {
    font-size: 0.875rem;
}

.leaderboard-table thead th {
    position: sticky;
    top: 0;
    background: var(--bs-body-bg);
    z-index: 1;
    white-space: nowrap;
}

.leaderboard-rank {
    font-weight: 600;
    width: 2.5rem;
    text-align: center;
}

.leaderboard-rank--1 { color: #ffd700; }
.leaderboard-rank--2 { color: #c0c0c0; }
.leaderboard-rank--3 { color: #cd7f32; }

@keyframes lottery-winner-pulse {
    0%   { background-color: transparent; }
    20%  { background-color: rgba(255, 215, 0, 0.5); }
    50%  { background-color: rgba(255, 215, 0, 0.25); }
    70%  { background-color: rgba(255, 215, 0, 0.5); }
    100% { background-color: rgba(255, 215, 0, 0.2); }
}
.lottery-winner td {
    animation: lottery-winner-pulse 1.2s ease-in-out 2;
    background-color: rgba(255, 215, 0, 0.2) !important;
    font-weight: 600;
}

/* Prize cell flash when recalculated after lottery draw */
@keyframes prize-cell-fade {
    0%   { opacity: 1; }
    40%  { opacity: 0; }
    60%  { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes prize-cell-highlight {
    0%   { background-color: rgba(255, 193, 7, 0.45); }
    100% { background-color: transparent; }
}
.prize-recalc-flash {
    animation: prize-cell-fade 0.55s ease forwards;
}
.prize-recalc-updated {
    animation: prize-cell-highlight 0.9s ease;
}

.leaderboard-scroll {
    max-height: 55vh;
    overflow-y: auto;
}

.ss-userchip {
    border-radius: 999px;
    flex-shrink: 0;
}

.ss-userchip:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.ss-userchip-wrap {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ---- Participants tray ---- */
.ss-participants-tray {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
    padding: 0.375rem;
    min-width: 220px;
    max-width: 300px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
}

.ss-participant-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
}

.ss-participant-row:hover {
    background: rgba(0, 0, 0, .04);
}

.ss-participant-name {
    min-width: 0;
    flex: 0 1 auto;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #212529;
}

.ss-participant-name-link {
    cursor: pointer;
}

.ss-participant-name-link:hover {
    text-decoration: underline;
}

.ss-participant-mute-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: #6c757d;
}

.ss-participant-muted {
    color: #dc3545 !important;
}

/* Equalizer bars */
.ss-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ss-equalizer span {
    flex: 1;
    background: #ced4da;
    border-radius: 1px;
    height: 3px;
}

.ss-equalizer.speaking span {
    background: #198754;
}

.ss-equalizer.speaking span:nth-child(1) {
    animation: ss-eq .5s ease-in-out infinite alternate;
}

.ss-equalizer.speaking span:nth-child(2) {
    animation: ss-eq .5s ease-in-out .15s infinite alternate;
}

.ss-equalizer.speaking span:nth-child(3) {
    animation: ss-eq .5s ease-in-out .3s infinite alternate;
}

@keyframes ss-eq {
    from { height: 3px; }
    to   { height: 12px; }
}

/* Count badge */
.ss-participant-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #0d6efd;
    color: #fff;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* Active state for participants button */
.ss-audio-btn-active {
    background-color: rgba(13, 110, 253, .12) !important;
    color: #0d6efd !important;
}

.ss-userchip-wrap::-webkit-scrollbar {
    display: none;
}

.callhistory-item [data-started],
.callhistory-item [data-duration],
.callhistory-item [data-ended] {
    white-space: nowrap;
}

.callhistory-item {
    transition: transform 180ms ease, opacity 180ms ease, max-height 220ms ease, margin 220ms ease;
    will-change: transform, opacity, max-height;
}

    .callhistory-item.enter {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        overflow: hidden;
    }

    .callhistory-item.enter-active {
        opacity: 1;
        transform: translateY(0);
        max-height: 120px; /* pick a safe max; can be larger */
        margin-top: 8px; /* match your spacing */
        margin-bottom: 8px;
    }
    .callhistory-item.pulse {
        animation: pulse-bg 350ms ease;
    }

@keyframes pulse-bg {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.15);
    }

    100% {
        filter: brightness(1);
    }
}

button.is-busy {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ----------------------------
   Lobby List
   ---------------------------- */
.lobby-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.lobby-entry {
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
    border-left: 3px solid transparent;
}

.lobby-entry:hover {
    filter: brightness(1.1);
}

.lobby-entry--i-selected {
    border-left-color: #198754;
    outline: 2px solid #198754;
    outline-offset: -2px;
}

.lobby-entry--they-selected {
    border-left-color: #198754;
}

.lobby-entry--mutual {
    border-left-color: #198754;
}

.lobby-entry--incall {
    opacity: 0.55;
}

.lobby-entry--blocked {
    opacity: 0.5;
    cursor: default;
    border-left-color: #dc3545;
}

.lobby-entry__code {
    font-family: monospace;
    letter-spacing: 0.03em;
}

.lobby-entry__name {
    text-decoration: none;
    cursor: pointer;
}

.lobby-entry__name:hover {
    text-decoration: underline;
}

#lobbySection {
    flex: 0 0 auto;
    min-height: 150px;
    max-height: 280px;
    overflow: hidden;
}

/* ============================
   Chat Modal
   ============================ */

.chat-modal .modal-dialog {
    max-width: 860px;
    width: 95vw;
}

.chat-modal .modal-content {
    height: min(600px, 85vh);
    display: flex;
    flex-direction: column;
}

.chat-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.chat-modal .modal-body > .d-flex {
    height: 100%;
    min-height: 0;
}

.chat-sidebar {
    width: 210px;
    flex: 0 0 210px;
    min-height: 0;
    overflow: hidden;
}

.chat-sidebar-label {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#chatConversationList {
    min-height: 0;
    overflow-y: auto;
}

.chat-main {
    min-height: 0;
    overflow: hidden;
}

.chat-thread-header {
    flex: 0 0 auto;
}

.chat-thread-name {
    cursor: pointer;
    text-decoration: none;
}

.chat-thread-name:hover {
    text-decoration: underline;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chat-message-row {
    display: flex;
    flex-direction: column;
}

.chat-message-row--mine {
    align-items: flex-end;
}

.chat-message-row--theirs {
    align-items: flex-start;
}

.chat-bubble {
    max-width: 72%;
    padding: 0.45rem 0.8rem;
    border-radius: 1.1rem;
    font-size: 0.875rem;
    line-height: 1.45;
    word-wrap: break-word;
    word-break: break-word;
}

.chat-bubble--mine {
    background-color: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 0.3rem;
}

.chat-bubble--theirs {
    background-color: #f1f3f4;
    color: #212529;
    border-bottom-left-radius: 0.3rem;
}

.chat-timestamp {
    font-size: 0.68rem;
    color: #adb5bd;
    margin-top: 0.1rem;
    padding: 0 0.2rem;
}

.chat-conv-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: background-color 100ms ease;
}

.chat-conv-item:hover {
    background-color: rgba(0,0,0,0.04);
}

.chat-conv-item.active {
    background-color: rgba(13,110,253,0.08);
    border-left: 3px solid #0d6efd;
    padding-left: calc(0.8rem - 3px);
}

.chat-conv-name {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chat-conv-name--unread {
    font-weight: 700;
}

.chat-conv-preview {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conv-preview--unread {
    color: #212529;
    font-weight: 500;
}

.chat-conv-unread {
    font-size: 0.7rem;
    font-weight: 700;
    background-color: #0d6efd;
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.35rem;
    min-width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.4;
}

.chat-input-bar {
    flex: 0 0 auto;
}

.chat-removed-notice {
    font-size: 0.75rem;
    color: #adb5bd;
    font-style: italic;
    padding: 0.1rem 0.2rem;
    align-self: center;
}

#pluginDetailSection {
    flex: 1 1 auto; /* grows to fill space; lobby stays pinned below */
    min-height: 0;
    overflow-y: auto;
}

/* ----------------------------
   Call invite card (in chat thread)
   ---------------------------- */
.chat-invite-card {
    align-self: center;
    background: rgba(13, 110, 253, 0.07);
    border: 1px solid rgba(13, 110, 253, 0.25);
    border-radius: 0.6rem;
    padding: 0.7rem 1rem;
    max-width: 320px;
    width: fit-content;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-invite-card-text {
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.4;
}

.chat-invite-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* ----------------------------
   Users panel
   ---------------------------- */
.users-list {
    overflow-y: auto;
    max-height: 440px;
}

.users-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    transition: background-color 0.1s;
}

.users-list-item:last-child {
    border-bottom: none;
}

.users-list-item:hover {
    background-color: var(--bs-tertiary-bg);
}

.users-list-main {
    min-width: 0;
    flex: 1;
}

.users-list-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-list-friend-badge {
    font-size: 0.7rem;
    color: var(--bs-success);
    white-space: nowrap;
}

.users-list-friend-badge--incoming {
    color: var(--bs-primary);
}

.users-list-friend-badge--pending {
    color: var(--bs-secondary);
}

.users-list-presence-wrap {
    flex-shrink: 0;
    text-align: right;
}

.users-list-presence {
    font-size: 0.7rem;
    color: var(--bs-secondary);
    white-space: nowrap;
}

.users-list-presence--online {
    color: var(--bs-success);
}

/* ── Wager bars in spectate modal ─────────────────────────────────────────── */
.spectate-wager-layout {
    display: flex;
    align-items: stretch;
}

.spectate-video-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.broadcast-frame-controls {
    display: grid;
    grid-template-columns: auto minmax(110px, 1fr) auto minmax(110px, 1fr) auto;
    align-items: center;
    gap: .45rem .7rem;
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: #20262d;
    color: #e9eef3;
}
.broadcast-frame-controls[hidden] { display: none; }
.broadcast-frame-controls label { margin: 0; font-size: .75rem; white-space: nowrap; }
.broadcast-frame-controls output { min-width: 2.5rem; color: #ffc107; font-weight: 700; }
.broadcast-frame-controls input[type="range"] { min-width: 0; accent-color: #ffc107; }
.broadcast-frame-controls #broadcastFrameStatus { grid-column: 1 / -1; min-height: 1em; }

.ss-participant-flairs {
    display: flex;
    min-width: 0;
    max-width: 52%;
    flex: 0 1 auto;
    gap: .2rem;
}
.ss-participant-flairs .user-flair {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-spectate-participants {
    top: calc(100% + 8px);
    bottom: auto;
    left: auto;
    right: 0;
    transform: none;
    color: #212529;
    width: min(300px, 85vw);
}

.spectate-money-match {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    max-width: calc(100% - 16px);
    padding: 6px 12px;
    border: 1px solid #f4cc72;
    border-radius: 8px;
    background: #21170ff2;
    color: #ffe299;
    font-size: clamp(11px, 1.5vw, 17px);
    font-weight: 800;
    text-align: center;
    box-shadow: 0 2px 10px #0009;
    pointer-events: none;
}

.wager-bar-side {
    width: 52px;
    flex-shrink: 0;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    background: #111;
}

.wager-bar-name {
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    color: #ccc;
    word-break: break-word;
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wager-bar-track {
    flex: 1;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    min-height: 120px;
}

.wager-bar-fill {
    width: 100%;
    height: 50%;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
}

.wager-fill-left  { background: linear-gradient(to top, #0d6efd, #6ea8fe); }
.wager-fill-right { background: linear-gradient(to top, #dc3545, #f1aeb5); }

.wager-bar-pts {
    font-size: 0.6rem;
    color: #888;
    text-align: center;
}

.wager-controls-bar {
    background: #111;
    border-top: 1px solid #2a2a2a;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.wager-controls-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.wager-controls-center .form-control {
    background: #222;
    color: #fff;
    border-color: #444;
    width: 100px;
}

.wager-controls-center .form-control:focus {
    background: #2a2a2a;
    color: #fff;
    border-color: #666;
    box-shadow: none;
}

/* ── "Watch Live" button in the lobby list ───────────────────────────────── */
.lobby-entry__broadcast-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 999px;
    border: none;
    color: #fff;
    animation: lobby-broadcast-pulse 2s ease-in-out infinite;
}

.lobby-entry__broadcast-btn:hover,
.lobby-entry__broadcast-btn:focus {
    animation: none;
}

.lobby-entry__live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    display: inline-block;
    animation: lobby-live-dot-blink 1.4s ease-in-out infinite;
}

.lobby-entry__viewer-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
}

.lobby-entry__viewer-count i {
    font-size: 0.68rem;
}

@keyframes lobby-live-dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@keyframes lobby-broadcast-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

/* Keep help separate from the centered audio controls. */
.portal-audiobar { position: relative; padding-inline: 3.25rem; }
.portal-audiobar #portal-tutorial-open { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }
#pluginDetailSection.is-compact { flex: 0 1 auto; }
#pluginDetailSection.is-compact #pluginDetail { height: auto !important; }
#pluginDetailSection.is-compact + #lobbySection { flex: 1 1 auto; max-height: none; }

#saltRankingsRows .salt-vault-self > td { color: #a87500; font-weight: 600; }
#saltRankingsRows .salt-vault-extra > td { border-top: 2px solid #d4af37; }

#saltRankingsModal .modal-body { padding: .75rem 1rem; }
#saltRankingsRows > tr > td { padding-top: .2rem; padding-bottom: .2rem; font-size: .875rem; }

/* Keep betting actions inside the viewer at every width. */
.wager-controls-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(90px, 120px) minmax(0, 1fr); }
.wager-controls-bar > *, .wager-controls-center { min-width: 0; }
#wager-btn-left, #wager-btn-right { white-space: normal; overflow-wrap: anywhere; }
.wager-balance-summary { font-size: .65rem; text-align: center; overflow-wrap: anywhere; }
.wager-fee-note { margin: 0; padding: 4px 12px 8px; font-size: .65rem; text-align: center; color: #aaa; background: #111; }
@media (max-width: 380px) {
    .wager-controls-bar { gap: 4px; padding-inline: 6px; grid-template-columns: 28px minmax(0,1fr) 82px minmax(0,1fr); }
    .wager-controls-center .form-control { width: 100%; }
    .wager-controls-bar .btn { padding-inline: 4px; font-size: .75rem; }
}
/* Expanded broadcast: reserve controls first, fit media into the remaining space. */
#spectateModal .modal-fullscreen { height: 100dvh; }
#spectateModal .modal-fullscreen .modal-content { height: 100%; overflow: hidden; }
#spectateModal .modal-fullscreen .modal-header { flex: 0 0 auto; }
#spectateModal .modal-fullscreen .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
#spectateModal .modal-fullscreen .spectate-wager-layout {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}
#spectateModal .modal-fullscreen .spectate-video-wrap { min-height: 0; height: 100%; overflow: hidden; }
#spectateModal .modal-fullscreen #spectateVideo { height: 100%; object-fit: contain; }
#spectateModal .modal-fullscreen .wager-bar-side {
    width: clamp(76px, 11dvh, 160px);
    min-height: 0;
    overflow: hidden;
}
#spectateModal .modal-fullscreen .wager-bar-track { min-height: 0; }
#spectateModal .modal-fullscreen .wager-controls-bar,
#spectateModal .modal-fullscreen .wager-fee-note { flex: 0 0 auto; }

/* Keep the native picker and its full options; the closed control shows a short label. */
.broadcast-quality-control { position: relative; }
.spectator-speaker-queue:not([hidden]) { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 6px 10px; background: #20262d; color: #e9eef3; font-size: .8rem; flex-shrink: 0; }
.broadcast-quality-control .form-select { color: transparent; min-height: 36px; line-height: 1.5; }
.broadcast-quality-control .form-select option { color: #212529; background: #fff; }
.broadcast-quality-label { position: absolute; inset: 0 2.25rem 0 .5rem; display: flex; align-items: center; pointer-events: none; font-size: .875rem; line-height: 1.5; white-space: nowrap; color: var(--bs-body-color, #212529); }
.speaker-offer-urgent { animation: speaker-offer-pulse 1s ease-in-out infinite; }
@keyframes speaker-offer-pulse { 50% { background-color: #ffc107; border-color: #ffc107; color: #171717; box-shadow: 0 0 0 3px #ffc10755; } }
@media (prefers-reduced-motion: reduce) { .speaker-offer-urgent { animation: none; background-color: #ffc107; color: #171717; } }
.portal-offline {
    max-width: min(28rem, 90vw);
    padding: 2rem;
    border: 1px solid #637185;
    border-radius: 1rem;
    background: #182330;
    color: #fff;
    text-align: center;
    box-shadow: 0 1rem 4rem #0008;
}
.portal-offline::backdrop {
    background: #101823b3;
    backdrop-filter: blur(7px);
}

/* Daily challenges */
.daily-challenges-modal { border-top: 3px solid #d4af37; }
.daily-challenge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.daily-challenge-card { display: flex; flex-direction: column; min-width: 0; padding: 1rem; border: 1px solid var(--bs-border-color); border-radius: .75rem; background: var(--bs-body-bg); box-shadow: 0 .2rem .8rem rgba(0,0,0,.06); }
.daily-challenge-card.is-complete { border-color: rgba(25,135,84,.5); background: rgba(25,135,84,.05); }
.daily-challenge-category { align-self: flex-start; margin-bottom: .45rem; padding: .12rem .45rem; border-radius: 999px; background: rgba(212,175,55,.14); color: #806600; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.daily-challenge-name { margin: 0 0 .4rem; font-size: 1rem; font-weight: 700; }
.daily-challenge-description { flex: 1 1 auto; margin-bottom: .75rem; color: var(--bs-secondary-color); font-size: .82rem; line-height: 1.4; }
.daily-challenge-progress-label { margin-bottom: .3rem; font-size: .78rem; font-weight: 600; }
.daily-challenge-progress { height: .45rem; margin-bottom: .85rem; }
.daily-challenge-progress .progress-bar { background-color: #d4af37; }
.daily-challenge-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.daily-challenge-reward { color: #8b6c00; }
.call-streak-card { padding: .9rem 1rem; border: 1px solid rgba(220,53,69,.3); border-radius: .75rem; background: linear-gradient(135deg, rgba(220,53,69,.08), rgba(255,193,7,.09)); }
.call-streak-title { margin: 0 0 .2rem; font-size: 1rem; font-weight: 700; }
.call-streak-copy { color: var(--bs-secondary-color); font-size: .82rem; }
.call-streak-progress { height: .5rem; }
.call-streak-progress .progress-bar { background: linear-gradient(90deg, #dc3545, #ffc107); }
.call-streak-milestone-heading { display: flex; justify-content: space-between; gap: .75rem; margin-top: .8rem; color: var(--bs-secondary-color); font-size: .72rem; }
.call-streak-milestone-heading strong { color: inherit; }
.call-streak-milestone-track { position: relative; height: .7rem; margin: 1.35rem 1.35rem .15rem 0; border-radius: 999px; background: color-mix(in srgb, var(--bs-secondary-color) 20%, transparent); }
.call-streak-milestone-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #dc3545, #ffc107); transition: width .35s ease; }
.call-streak-milestone-current { position: absolute; z-index: 2; left: 0; top: -1.25rem; transform: translateX(-50%); color: var(--bs-body-color); font-size: .64rem; font-weight: 800; line-height: 1; white-space: nowrap; transition: left .35s ease; }
.call-streak-milestone-current::after { position: absolute; left: 50%; top: .78rem; width: 2px; height: .47rem; border-radius: 999px; background: #dc3545; content: ""; transform: translateX(-50%); }
.call-streak-milestone-reward { position: absolute; z-index: 1; right: -1.35rem; top: 50%; min-width: 2.7rem; padding: .15rem .3rem; transform: translate(50%, -50%); border: 2px solid #fff; border-radius: 999px; background: #d4af37; color: #241b00; box-shadow: 0 .15rem .45rem rgba(0,0,0,.2); font-size: .66rem; font-weight: 800; text-align: center; white-space: nowrap; }
.call-streak-milestone-scale { display: flex; justify-content: space-between; margin-right: 1.35rem; color: var(--bs-secondary-color); font-size: .66rem; }
.call-streak-repair { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .65rem .8rem; margin-top: .8rem; padding: .65rem .75rem; border: 1px solid rgba(255,193,7,.45); border-radius: .6rem; background: rgba(255,193,7,.09); font-size: .74rem; }
.call-streak-repair[hidden] { display: none; }
.call-streak-repair p { color: var(--bs-secondary-color); }
.call-streak-repair-status { grid-column: 1 / -1; color: var(--bs-danger); }
.call-streak-card.is-milestone-day { border-color: rgba(212,175,55,.75); box-shadow: 0 0 0 .18rem rgba(212,175,55,.12); }
#callStreakBadge { white-space: nowrap; }
@media (max-width: 767.98px) { .daily-challenge-grid { grid-template-columns: 1fr; } .call-streak-repair { grid-template-columns: 1fr; } .call-streak-repair-status { grid-column: 1; } }
@media (max-width: 767.98px) {
    .broadcast-frame-controls { grid-template-columns: auto 1fr; }
    .broadcast-frame-controls button { grid-column: 1 / -1; }
    .broadcast-frame-controls #broadcastFrameStatus { grid-column: 1 / -1; }
}
