/* Buzzbii Text Roulette — page styles (bb-tr-*) */

.bb-tr-page {
    background: var(--bb-tr-surface, #f3f4f6);
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.bb-tr-page.page-margin {
    margin-left: 0;
    margin-right: 0;
}

.bb-tr-page .bb-tr-body-wrap {
    background: transparent;
    box-shadow: none;
    padding: 0 !important;
    margin-left: 0;
    margin-right: 0;
}

.bb-tr-inner {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 12px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .bb-tr-inner {
        padding: 0 16px;
    }
}

/* Hero */
.bb-tr-hero {
    position: relative;
    background: linear-gradient(135deg, #a84849 0%, #7a2e2f 55%, #5c2223 100%);
    color: #ffffff;
    padding: 32px 0 40px;
    overflow: hidden;
}

.bb-tr-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 82% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.bb-tr-hero-inner {
    position: relative;
    z-index: 1;
}

.bb-tr-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.bb-tr-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bb-tr-hero-badge span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bb-tr-online, #22c55e);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
    animation: bb-tr-pulse 1.8s ease-in-out infinite;
}

@keyframes bb-tr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.bb-tr-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bb-tr-hero p {
    margin: 0;
    opacity: 0.92;
    font-size: 15px;
    max-width: 560px;
    line-height: 1.5;
}

.bb-tr-sound-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.bb-tr-sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.bb-tr-sound-toggle[aria-pressed="false"] .bb-tr-sound-on,
.bb-tr-sound-toggle[aria-pressed="true"] .bb-tr-sound-off {
    display: none;
}

.bb-tr-sound-label {
    display: none;
}

@media (min-width: 768px) {
    .bb-tr-sound-label {
        display: inline;
    }
}

/* Layout */
.bb-tr-body-wrap {
    padding-top: 24px;
    padding-bottom: 40px;
}

.bb-tr-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

@media (min-width: 992px) {
    .bb-tr-layout {
        grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    }
}

.bb-tr-main-col,
.bb-tr-side-col {
    min-width: 0;
}

/* Cards */
.bb-tr-card {
    background: var(--bb-tr-bg, #ffffff);
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    border-radius: var(--bb-tr-radius, 16px);
    box-shadow: var(--bb-tr-shadow, 0 4px 24px rgba(17, 24, 39, 0.06));
}

.bb-tr-card-head {
    margin-bottom: 20px;
}

.bb-tr-card-head h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-card-head p {
    margin: 0;
    font-size: 14px;
    color: var(--bb-tr-muted, #6b7280);
    line-height: 1.5;
}

.bb-tr-lobby-card {
    padding: 24px;
    margin-top: 0;
}

/* Ads — policy spacing (120px+ from action buttons) */
.bb-tr-ad-zone--top {
    margin-top: 8px;
    margin-bottom: 120px;
    min-height: 250px;
}

.bb-tr-ad-zone--side {
    margin-bottom: 24px;
    min-height: 250px;
}

.bb-tr-page:not(.bb-tr-state-lobby) .bb-tr-ad-zone,
.bb-tr-page.bb-tr-state-searching .bb-tr-ad-zone,
.bb-tr-page.bb-tr-state-connected .bb-tr-ad-zone,
.bb-tr-page.bb-tr-state-partner-left .bb-tr-ad-zone,
.bb-tr-page:not(.bb-tr-state-lobby) .bb-tr-discovery,
.bb-tr-page:not(.bb-tr-state-lobby) .bb-tr-side-groups {
    display: none;
}

@media (max-width: 767px) {
    .bb-tr-page:not(.bb-tr-state-lobby) .bb-tr-ad-zone--top,
    .bb-tr-page.bb-tr-state-searching .bb-tr-ad-zone--top,
    .bb-tr-page.bb-tr-state-connected .bb-tr-ad-zone--top {
        display: none !important;
    }
}

.bb-tr-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

/* Form */
.bb-tr-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bb-tr-field label,
.bb-tr-field legend {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-field input[type="text"],
.bb-tr-field textarea,
.bb-tr-compose textarea,
.bb-tr-modal-panel textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--bb-tr-text, #111827);
    background: var(--bb-tr-bg, #ffffff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bb-tr-field input[type="text"]:focus,
.bb-tr-field textarea:focus,
.bb-tr-compose textarea:focus,
.bb-tr-modal-panel textarea:focus {
    outline: none;
    border-color: var(--bb-tr-accent, #a84849);
    box-shadow: 0 0 0 3px var(--bb-tr-accent-soft, rgba(168, 72, 73, 0.12));
}

.bb-tr-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--bb-tr-danger, #ef4444);
    min-height: 16px;
}

.bb-tr-field--inline {
    border: 0;
    padding: 0;
    margin: 0;
}

.bb-tr-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bb-tr-pill {
    margin: 0;
    cursor: pointer;
}

.bb-tr-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bb-tr-pill span {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    background: #fafafa;
    font-size: 13px;
    font-weight: 600;
    color: var(--bb-tr-text, #111827);
    transition: all 0.2s ease;
}

.bb-tr-pill input:checked + span,
.bb-tr-pill input:focus-visible + span {
    background: var(--bb-tr-accent, #a84849);
    border-color: var(--bb-tr-accent, #a84849);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(168, 72, 73, 0.28);
}

.bb-tr-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--bb-tr-text, #111827);
    cursor: pointer;
}

.bb-tr-checkbox input {
    margin-top: 3px;
    flex-shrink: 0;
}

.bb-tr-lobby-footnote {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--bb-tr-border, #e5e7eb);
    font-size: 12px;
    color: var(--bb-tr-muted, #6b7280);
    line-height: 1.5;
}

/* Buttons */
.bb-tr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.bb-tr-btn--primary {
    background: linear-gradient(135deg, var(--bb-tr-accent, #a84849), var(--bb-tr-accent-dark, #8b3a3b));
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(168, 72, 73, 0.28);
}

.bb-tr-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(168, 72, 73, 0.34);
}

.bb-tr-btn--ghost {
    background: transparent;
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    color: var(--bb-tr-text, #111827) !important;
}

.bb-tr-btn--ghost:hover {
    background: #fafafa;
}

.bb-tr-btn--danger {
    background: var(--bb-tr-danger, #ef4444);
    color: #ffffff !important;
}

.bb-tr-btn--danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--bb-tr-danger, #ef4444) !important;
}

.bb-tr-btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.bb-tr-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* State visibility */
.bb-tr-page.bb-tr-state-searching .bb-tr-lobby,
.bb-tr-page.bb-tr-state-connected .bb-tr-lobby,
.bb-tr-page.bb-tr-state-partner-left .bb-tr-lobby {
    display: none;
}

.bb-tr-page.bb-tr-state-lobby .bb-tr-chat-wrap {
    display: none !important;
}

.bb-tr-page.bb-tr-state-searching .bb-tr-chat-wrap,
.bb-tr-page.bb-tr-state-connected .bb-tr-chat-wrap,
.bb-tr-page.bb-tr-state-partner-left .bb-tr-chat-wrap {
    display: block !important;
}

.bb-tr-chat-wrap {
    position: relative;
    margin-top: 24px;
}

.bb-tr-chat-card {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: min(72vh, 680px);
    padding: 0;
    overflow: hidden;
}

@media (max-width: 767px) {
    .bb-tr-page.bb-tr-state-connected .bb-tr-hero,
    .bb-tr-page.bb-tr-state-searching .bb-tr-hero,
    .bb-tr-page.bb-tr-state-partner-left .bb-tr-hero {
        padding: 20px 0 24px;
    }

    .bb-tr-page.bb-tr-state-connected .bb-tr-side-col,
    .bb-tr-page.bb-tr-state-searching .bb-tr-side-col,
    .bb-tr-page.bb-tr-state-partner-left .bb-tr-side-col {
        display: none;
    }

    .bb-tr-page.bb-tr-state-connected .bb-tr-chat-card {
        min-height: calc(100vh - 180px);
        max-height: none;
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }
}

/* Chat header */
.bb-tr-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--bb-tr-border, #e5e7eb);
    background: linear-gradient(180deg, #fafafa 0%, var(--bb-tr-bg, #ffffff) 100%);
}

.bb-tr-partner-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bb-tr-partner-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--bb-tr-accent, #a84849), var(--bb-tr-accent-dark, #8b3a3b));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(168, 72, 73, 0.28);
    position: relative;
}

.bb-tr-partner-avatar::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.35);
    animation: bb-tr-pulse 2s ease-in-out infinite;
}

.bb-tr-partner-info {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.bb-tr-partner-label {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bb-tr-muted, #6b7280);
}

.bb-tr-partner-info strong {
    font-size: 16px;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-gender-badge {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bb-tr-accent-soft, rgba(168, 72, 73, 0.12));
    font-size: 11px;
    font-weight: 700;
    color: var(--bb-tr-accent-dark, #8b3a3b);
    text-transform: capitalize;
}

.bb-tr-online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bb-tr-online, #22c55e);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
    animation: bb-tr-pulse 1.8s ease-in-out infinite;
}

/* Messages */
.bb-tr-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bb-tr-bg, #ffffff);
}

.bb-tr-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.bb-tr-msg--self {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--bb-tr-accent, #a84849), var(--bb-tr-accent-dark, #8b3a3b));
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.bb-tr-msg--partner {
    align-self: flex-start;
    background: #f3f4f6;
    color: var(--bb-tr-text, #111827);
    border-bottom-left-radius: 4px;
}

.bb-tr-msg-time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.72;
}

.bb-tr-msg--system {
    align-self: center;
    max-width: 100%;
    background: transparent;
    color: var(--bb-tr-muted, #6b7280);
    font-size: 12px;
    text-align: center;
    padding: 4px 0;
}

/* Typing */
.bb-tr-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px 8px;
    font-size: 12px;
    color: var(--bb-tr-muted, #6b7280);
}

.bb-tr-typing-dots span {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 3px;
    border-radius: 50%;
    background: var(--bb-tr-muted, #6b7280);
    animation: bb-tr-typing 1.2s infinite ease-in-out;
}

.bb-tr-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.bb-tr-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bb-tr-typing {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* Compose */
.bb-tr-compose {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--bb-tr-border, #e5e7eb);
    background: var(--bb-tr-bg, #ffffff);
}

.bb-tr-compose textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
}

.bb-tr-chat-actions {
    display: flex;
    gap: 10px;
    padding: 0 18px 18px;
}

/* Overlays */
.bb-tr-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(4px);
    border-radius: var(--bb-tr-radius, 16px);
}

.bb-tr-searching-inner,
.bb-tr-partner-left-inner {
    text-align: center;
    padding: 28px 24px;
    max-width: 360px;
}

.bb-tr-searching-inner h3,
.bb-tr-partner-left-inner h3 {
    margin: 18px 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.bb-tr-searching-inner p,
.bb-tr-partner-left-inner p {
    margin: 0 0 18px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.5;
}

.bb-tr-radar {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto;
}

.bb-tr-radar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    animation: bb-tr-radar 2.4s ease-out infinite;
}

.bb-tr-radar-ring--2 { animation-delay: 0.8s; }
.bb-tr-radar-ring--3 { animation-delay: 1.6s; }

.bb-tr-radar-core {
    position: absolute;
    inset: 36%;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

@keyframes bb-tr-radar {
    0% { transform: scale(0.35); opacity: 0.9; }
    100% { transform: scale(1.2); opacity: 0; }
}

.bb-tr-partner-left-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.bb-tr-partner-left-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Sidebar */
.bb-tr-side-card {
    background: var(--bb-tr-bg, #ffffff);
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    border-radius: var(--bb-tr-radius, 16px);
    padding: 20px;
    box-shadow: var(--bb-tr-shadow, 0 4px 24px rgba(17, 24, 39, 0.06));
}

.bb-tr-side-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-tips {
    margin: 0;
    padding-left: 18px;
    color: var(--bb-tr-muted, #6b7280);
    font-size: 13px;
    line-height: 1.55;
}

.bb-tr-tips li + li {
    margin-top: 8px;
}

.bb-tr-side-groups {
    margin-top: 16px;
}

.bb-tr-side-groups-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bb-tr-side-groups-head h3 {
    margin: 0;
}

.bb-tr-side-groups-head a {
    font-size: 12px;
    font-weight: 700;
    color: var(--bb-tr-accent, #a84849);
    text-decoration: none;
}

.bb-tr-side-groups-head a:hover {
    text-decoration: underline;
}

.bb-tr-side-groups-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bb-tr-side-groups-list li + li {
    margin-top: 10px;
}

.bb-tr-side-group-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.bb-tr-side-group-link:hover {
    background: var(--bb-tr-surface, #f3f4f6);
}

.bb-tr-side-group-avatar {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bb-tr-surface, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-tr-side-group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bb-tr-side-group-avatar--empty {
    color: var(--bb-tr-muted, #6b7280);
}

.bb-tr-side-group-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bb-tr-side-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--bb-tr-text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-tr-side-group-meta {
    font-size: 12px;
    color: var(--bb-tr-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Banned */
.bb-tr-banned {
    text-align: center;
    padding: 56px 24px;
    background: var(--bb-tr-bg, #ffffff);
    border: 1px dashed var(--bb-tr-border, #e5e7eb);
    border-radius: var(--bb-tr-radius, 16px);
    margin-top: 24px;
}

.bb-tr-banned-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bb-tr-danger, #ef4444);
}

.bb-tr-banned h2 {
    margin: 0 0 8px;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-banned p {
    margin: 0;
    color: var(--bb-tr-muted, #6b7280);
}

/* Modal */
.bb-tr-modal[hidden],
.bb-tr-overlay[hidden],
.bb-tr-chat-wrap[hidden] {
    display: none !important;
}

.bb-tr-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bb-tr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

.bb-tr-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--bb-tr-bg, #ffffff);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.bb-tr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bb-tr-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-modal-panel label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.bb-tr-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* Toast */
.bb-tr-toast-wrap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10060;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.bb-tr-toast {
    pointer-events: auto;
    min-width: 220px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    animation: bb-tr-toast-in 0.25s ease;
}

.bb-tr-toast--error {
    background: #991b1b;
}

@keyframes bb-tr-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bb-tr-disclaimer {
    margin-top: 32px;
    padding: 16px 20px;
    border-radius: 10px;
    background: var(--bb-tr-bg, #ffffff);
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    font-size: 12px;
    color: var(--bb-tr-muted, #6b7280);
    text-align: center;
    line-height: 1.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Discovery rail (lobby) */
.bb-tr-discovery {
    margin-top: 36px;
    padding: 24px;
    border-radius: var(--bb-tr-radius, 16px);
    background: var(--bb-tr-bg, #ffffff);
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

.bb-tr-discovery-head {
    margin-bottom: 22px;
}

.bb-tr-discovery-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-discovery-head p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--bb-tr-muted, #6b7280);
}

.bb-tr-discovery-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 992px) {
    .bb-tr-discovery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.bb-tr-discovery-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bb-tr-discovery-block-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--bb-tr-text, #111827);
}

.bb-tr-discovery-block-head a {
    font-size: 13px;
    font-weight: 600;
    color: var(--bb-tr-accent, #a84849);
    text-decoration: none;
}

.bb-tr-discovery-block-head a:hover {
    text-decoration: underline;
}

.bb-tr-discovery-cards {
    display: grid;
    gap: 12px;
}

.bb-tr-discovery-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--bb-tr-border, #e5e7eb);
    background: var(--bb-tr-surface, #f9fafb);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bb-tr-discovery-card:hover {
    border-color: rgba(168, 72, 73, 0.35);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
    transform: translateY(-1px);
}

.bb-tr-discovery-thumb {
    position: relative;
    width: 84px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.bb-tr-discovery-thumb--square {
    width: 56px;
    height: 56px;
}

.bb-tr-discovery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bb-tr-discovery-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.bb-tr-discovery-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-tr-discovery-live {
    position: absolute;
    left: 6px;
    top: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bb-tr-discovery-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bb-tr-discovery-meta,
.bb-tr-discovery-sub {
    font-size: 12px;
    color: var(--bb-tr-muted, #6b7280);
    line-height: 1.35;
}

.bb-tr-discovery-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--bb-tr-text, #111827);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bb-tr-discovery-card--game,
.bb-tr-discovery-card--group {
    grid-template-columns: 56px minmax(0, 1fr);
}

@media (max-width: 767px) {
    .bb-tr-discovery {
        margin-top: 28px;
        padding: 18px 14px;
    }

    .bb-tr-discovery-head h2 {
        font-size: 19px;
    }
}

/* Night mode */
body.night-mode .bb-tr-card,
body.night-mode .bb-tr-side-card,
body.night-mode .bb-tr-banned,
body.night-mode .bb-tr-disclaimer,
body.night-mode .bb-tr-discovery,
body.night-mode .bb-tr-modal-panel {
    background: #1f2937;
    border-color: #374151;
}

body.night-mode .bb-tr-pill span {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

body.night-mode .bb-tr-msg--partner {
    background: #374151;
    color: #f3f4f6;
}

body.night-mode .bb-tr-chat-header {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
}

body.night-mode .bb-tr-btn--ghost {
    border-color: #4b5563;
    color: #f3f4f6 !important;
}

body.night-mode .bb-tr-btn--ghost:hover {
    background: #374151;
}

body.night-mode .bb-tr-discovery-card {
    background: #111827;
    border-color: #374151;
}

body.night-mode .bb-tr-discovery-title {
    color: #f3f4f6;
}
