/* ============================================
   BROTHON LIVE — Fullscreen Quiz Experience
   Premium Unacademy-style live quiz UI
   ============================================ */

/* ─── Overlay ─── */
.brothon-fs {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #080810;
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', system-ui, sans-serif;
    animation: bfsIn 0.3s ease;
    overflow: hidden;
    color: #fff;
}

@keyframes bfsIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─── Header ─── */
.bfs-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.07), rgba(124, 58, 237, 0.05));
    border-bottom: 1px solid rgba(250, 204, 21, 0.12);
    flex-shrink: 0;
    min-height: 48px;
}

.bfs-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    color: #fbbf24;
    font-size: 1rem;
    white-space: nowrap;
}

.bfs-qinfo {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.bfs-timer-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 300px;
}

.bfs-timer-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fbbf24;
    min-width: 36px;
    text-align: right;
}

.bfs-timer-text.urgent {
    color: #ef4444;
    animation: bfsPulse 0.5s ease infinite alternate;
}

@keyframes bfsPulse {
    to {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.bfs-timer-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.bfs-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 3px;
    transition: width 1s linear;
}

.bfs-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.bfs-close:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ─── 3-Panel Body ─── */
.bfs-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ─── Leaderboard Panel ─── */
.bfs-lb {
    width: 200px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.015);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bfs-panel-title {
    padding: 0.7rem 0.8rem;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bfs-lb .bfs-panel-title {
    color: #fbbf24;
}

.bfs-lb-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
}

.bfs-lb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: background 0.3s;
    animation: bfsSlide 0.3s ease;
}

@keyframes bfsSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
}

.bfs-lb-item.me {
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.15);
}

.bfs-lb-rank {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.bfs-lb-name {
    flex: 1;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bfs-lb-score {
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bfs-lb-me {
    padding: 0.6rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(250, 204, 21, 0.03);
    flex-shrink: 0;
}

.bfs-lb-me-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.bfs-lb-me-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bfs-lb-me-rank {
    font-weight: 800;
    color: #fbbf24;
    font-size: 0.9rem;
}

.bfs-lb-me-score {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
}

/* ─── Quiz Panel (Center) ─── */
.bfs-quiz {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 1.5rem;
    min-width: 0;
}

.bfs-quiz-inner {
    width: 100%;
    max-width: 700px;
}

/* Waiting state */
.bfs-waiting {
    text-align: center;
    padding: 3rem 1rem;
}

.bfs-waiting-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    animation: bfsBounce 1.5s ease infinite;
}

@keyframes bfsBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.bfs-waiting-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    font-weight: 500;
}

/* Question */
.bfs-question-text {
    font-weight: 800;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

/* Image */
.bfs-image-wrap {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    cursor: zoom-in;
}

.bfs-image-wrap img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: contain;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.bfs-image-wrap:hover img {
    transform: scale(1.01);
}

.bfs-image-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 0.3rem;
}

/* Options */
.bfs-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.bfs-option {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 2px solid;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
    background: transparent;
    font-family: inherit;
    line-height: 1.4;
}

.bfs-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bfs-option:active {
    transform: scale(0.98);
}

.bfs-opt-a {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.06);
}

.bfs-opt-a:hover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.bfs-opt-b {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.06);
}

.bfs-opt-b:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

.bfs-opt-c {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.06);
}

.bfs-opt-c:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.bfs-opt-d {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
}

.bfs-opt-d:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.bfs-opt-letter {
    font-weight: 800;
    margin-right: 0.3rem;
}

.bfs-opt-a .bfs-opt-letter {
    color: #22c55e;
}

.bfs-opt-b .bfs-opt-letter {
    color: #3b82f6;
}

.bfs-opt-c .bfs-opt-letter {
    color: #f59e0b;
}

.bfs-opt-d .bfs-opt-letter {
    color: #ef4444;
}

/* Skip */
.bfs-skip {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.bfs-skip:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
}

/* Feedback (answered/expired) */
.bfs-feedback {
    text-align: center;
    padding: 0.7rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.bfs-feedback.correct {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

.bfs-feedback.wrong {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.bfs-feedback.expired {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
}

/* Poll bars */
.bfs-poll-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.35rem;
    transition: all 0.3s;
}

.bfs-poll-item.correct {
    border-color: rgba(34, 197, 94, 0.25);
}

.bfs-poll-item.dimmed {
    opacity: 0.5;
}

.bfs-poll-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    z-index: 0;
}

.bfs-poll-fill.correct {
    background: rgba(34, 197, 94, 0.12);
}

.bfs-poll-fill.wrong {
    background: rgba(239, 68, 68, 0.06);
}

.bfs-poll-row {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bfs-poll-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

.bfs-poll-label.correct {
    color: #22c55e;
    font-weight: 700;
}

.bfs-poll-pct {
    font-weight: 700;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

.bfs-poll-pct.correct {
    color: #22c55e;
}

.bfs-poll-you {
    font-size: 0.62rem;
    font-weight: 800;
    color: #fbbf24;
    background: rgba(250, 204, 21, 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-left: 0.4rem;
}

/* Score footer */
.bfs-score-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.7rem;
    padding: 0.5rem 0.7rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.bfs-score-count {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
}

.bfs-score-xp {
    font-weight: 800;
    font-size: 0.88rem;
}

.bfs-score-xp.pos {
    color: #22c55e;
}

.bfs-score-xp.zero {
    color: rgba(255, 255, 255, 0.3);
}

/* ─── Chat Panel ─── */
.bfs-chat {
    width: 260px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.015);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bfs-chat .bfs-panel-title {
    color: #60a5fa;
}

.bfs-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bfs-chat-msg {
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    max-width: 92%;
    animation: bfsMsgIn 0.2s ease;
}

@keyframes bfsMsgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

.bfs-chat-msg.admin {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.bfs-chat-msg.student {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bfs-chat-msg.me {
    background: rgba(250, 204, 21, 0.05);
    border: 1px solid rgba(250, 204, 21, 0.1);
    align-self: flex-end;
}

.bfs-chat-name {
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.bfs-chat-name.admin {
    color: #60a5fa;
}

.bfs-chat-name.student {
    color: rgba(255, 255, 255, 0.35);
}

.bfs-chat-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-word;
}

.bfs-chat-time {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.15);
    text-align: right;
    margin-top: 0.1rem;
}

.bfs-chat-empty {
    text-align: center;
    padding: 2rem 0.5rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.82rem;
}

.bfs-chat-input {
    padding: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 0.35rem;
    align-items: flex-end;
}

.bfs-chat-input textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 70px;
    transition: border-color 0.2s;
    line-height: 1.35;
}

.bfs-chat-input textarea:focus {
    border-color: rgba(96, 165, 250, 0.4);
}

.bfs-chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.bfs-chat-send {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    color: #fff;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
    font-family: inherit;
    font-weight: 600;
}

.bfs-chat-send:hover {
    transform: scale(1.05);
}

.bfs-chat-send:active {
    transform: scale(0.95);
}

.bfs-chat-charcount {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.15);
    text-align: right;
    padding: 0 0.5rem 0.2rem;
}

/* ─── Image Zoom Overlay ─── */
.bfs-img-zoom {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: bfsZoomIn 0.2s ease;
    padding: 1rem;
}

@keyframes bfsZoomIn {
    from {
        opacity: 0;
    }
}

.bfs-img-zoom img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.bfs-img-zoom-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
    .bfs-header {
        padding: 0.4rem 0.6rem;
        gap: 0.5rem;
        min-height: 42px;
    }

    .bfs-logo {
        font-size: 0.85rem;
    }

    .bfs-timer-text {
        font-size: 1rem;
    }

    .bfs-close {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .bfs-body {
        flex-direction: column;
    }

    /* Leaderboard → horizontal strip */
    .bfs-lb {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        max-height: 44px;
        min-height: 44px;
    }

    .bfs-lb .bfs-panel-title {
        display: none;
    }

    .bfs-lb-list {
        display: flex;
        flex-direction: row;
        gap: 0.2rem;
        padding: 0.3rem 0.4rem;
        overflow-x: auto;
        overflow-y: hidden;
        flex: 1;
        align-items: center;
    }

    .bfs-lb-item {
        flex-shrink: 0;
        margin-bottom: 0;
        padding: 0.2rem 0.5rem;
        gap: 0.3rem;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.03);
    }

    .bfs-lb-rank {
        font-size: 0.8rem;
        width: 18px;
    }

    .bfs-lb-name {
        font-size: 0.7rem;
        max-width: 60px;
    }

    .bfs-lb-score {
        font-size: 0.72rem;
    }

    .bfs-lb-me {
        display: none;
    }

    /* Quiz → full width, less padding */
    .bfs-quiz {
        padding: 0.6rem;
        flex: 1;
        min-height: 0;
    }

    .bfs-question-text {
        font-size: 0.95rem;
    }

    .bfs-image-wrap img {
        max-height: 220px;
    }

    .bfs-options {
        gap: 0.4rem;
    }

    .bfs-option {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    /* Chat → fully handled by FAB overlay system below */

    .bfs-chat-send {
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
    }

    /* ─── Close X button (mobile only) ─── */
    .bfs-chat-close-x {
        display: inline-block !important;
    }

    /* ─── Chat → Hidden by default on mobile, slides up via FAB ─── */
    .bfs-chat {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 0;
        opacity: 0;
        border-left: none;
        border-top: none;
        border-radius: 16px 16px 0 0;
        background: rgba(15, 15, 25, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
        z-index: 10;
        transition: max-height 0.35s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.25s ease;
        overflow: hidden;
        pointer-events: none;
    }

    .bfs-chat.mobile-open {
        max-height: 55vh;
        opacity: 1;
        pointer-events: auto;
    }

    .bfs-chat .bfs-panel-title {
        cursor: pointer;
        padding: 0.6rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.82rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .bfs-chat-msgs {
        max-height: 35vh;
        padding: 0.5rem;
    }

    .bfs-chat-input {
        padding: 0.5rem 0.6rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .bfs-chat-input textarea {
        font-size: 0.82rem;
        padding: 0.5rem 0.65rem;
        min-height: 38px;
    }
}

/* ─── Floating Q&A Button (FAB) — Mobile Only ─── */
.bfs-chat-fab {
    display: none;
    /* Hidden on desktop */
}

.bfs-chat-close-x {
    display: none;
    /* Hidden on desktop */
}

/* ─── Chat Backdrop — Mobile Only ─── */
.bfs-chat-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .bfs-chat-fab {
        display: flex;
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 9;
        align-items: center;
        gap: 0.4rem;
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: #fff;
        border: none;
        padding: 0.65rem 1rem;
        border-radius: 50px;
        font-weight: 800;
        font-size: 0.85rem;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4), 0 0 30px rgba(59, 130, 246, 0.15);
        transition: all 0.3s ease;
        animation: bfsFabEntrance 0.5s ease;
        font-family: inherit;
    }

    @keyframes bfsFabEntrance {
        from {
            opacity: 0;
            transform: translateY(20px) scale(0.8);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .bfs-chat-fab:active {
        transform: scale(0.92);
    }

    .bfs-chat-fab.hidden {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.6);
    }

    .bfs-chat-fab.pulse {
        animation: bfsFabPulse 0.6s ease;
    }

    @keyframes bfsFabPulse {
        0% {
            transform: scale(1);
            box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
        }

        50% {
            transform: scale(1.15);
            box-shadow: 0 4px 30px rgba(59, 130, 246, 0.7);
        }

        100% {
            transform: scale(1);
            box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
        }
    }

    .bfs-chat-fab-icon {
        font-size: 1.1rem;
    }

    .bfs-chat-fab-label {
        font-weight: 800;
        letter-spacing: 0.3px;
    }

    .bfs-chat-fab-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 20px;
        height: 20px;
        background: #ef4444;
        border-radius: 50%;
        font-size: 0.65rem;
        font-weight: 800;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border: 2px solid rgba(15, 15, 25, 0.95);
        animation: bfsBadgePop 0.3s ease;
    }

    @keyframes bfsBadgePop {
        from {
            transform: scale(0);
        }

        to {
            transform: scale(1);
        }
    }

    /* Backdrop for mobile chat overlay */
    .bfs-chat-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 9;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        transition: opacity 0.3s ease;
        opacity: 0;
    }

    .bfs-chat-backdrop.active {
        display: block;
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════
   PODIUM CELEBRATION — Brothon Finish Screen
   ═══════════════════════════════════════════════ */

/* Confetti canvas overlay */
.bfs-confetti-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bfs-finish-wrap {
    text-align: center;
    padding: 1rem 0;
    position: relative;
    animation: bfsFadeUp 0.6s ease;
}

@keyframes bfsFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bfs-finish-title {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
}

.bfs-finish-subtitle {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
}

/* ─── Podium Container ─── */
.bfs-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 auto 1.5rem;
    max-width: 500px;
    height: 260px;
    position: relative;
    z-index: 1;
}

.bfs-podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
    max-width: 150px;
    opacity: 0;
    transform: translateY(40px);
}

/* Staggered reveal: 3rd → 2nd → 1st */
.bfs-podium-slot.rank-3 {
    animation: bfsPodiumReveal 0.6s 0.3s ease forwards;
}

.bfs-podium-slot.rank-2 {
    animation: bfsPodiumReveal 0.6s 0.7s ease forwards;
}

.bfs-podium-slot.rank-1 {
    animation: bfsPodiumReveal 0.8s 1.2s ease forwards;
}

@keyframes bfsPodiumReveal {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bfs-podium-avatar {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
}

.bfs-podium-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
    margin-bottom: 0.15rem;
}

.bfs-podium-score {
    font-weight: 800;
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}

/* Podium blocks */
.bfs-podium-block {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    position: relative;
    overflow: hidden;
}

/* Rank 1 — Gold */
.bfs-podium-slot.rank-1 .bfs-podium-block {
    height: 140px;
    background: linear-gradient(180deg, rgba(250, 204, 21, 0.2), rgba(250, 204, 21, 0.05));
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-bottom: none;
    color: #fbbf24;
    box-shadow: 0 0 40px rgba(250, 204, 21, 0.15), inset 0 1px 0 rgba(250, 204, 21, 0.2);
}

.bfs-podium-slot.rank-1 .bfs-podium-score {
    color: #fbbf24;
}

.bfs-podium-slot.rank-1 .bfs-podium-avatar {
    animation: bfsGoldGlow 2s ease infinite alternate;
}

@keyframes bfsGoldGlow {
    from {
        filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.3));
    }

    to {
        filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.6));
    }
}

/* Rank 2 — Silver */
.bfs-podium-slot.rank-2 .bfs-podium-block {
    height: 100px;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.12), rgba(192, 192, 192, 0.03));
    border: 1px solid rgba(192, 192, 192, 0.2);
    border-bottom: none;
    color: #c0c0c0;
    box-shadow: 0 0 24px rgba(192, 192, 192, 0.08);
}

.bfs-podium-slot.rank-2 .bfs-podium-score {
    color: #c0c0c0;
}

.bfs-podium-slot.rank-2 .bfs-podium-avatar {
    animation: bfsSilverShimmer 3s ease infinite alternate;
}

@keyframes bfsSilverShimmer {
    from {
        filter: drop-shadow(0 0 4px rgba(192, 192, 192, 0.2));
    }

    to {
        filter: drop-shadow(0 0 12px rgba(192, 192, 192, 0.4));
    }
}

/* Rank 3 — Bronze */
.bfs-podium-slot.rank-3 .bfs-podium-block {
    height: 70px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.12), rgba(205, 127, 50, 0.03));
    border: 1px solid rgba(205, 127, 50, 0.2);
    border-bottom: none;
    color: #cd7f32;
    box-shadow: 0 0 16px rgba(205, 127, 50, 0.06);
}

.bfs-podium-slot.rank-3 .bfs-podium-score {
    color: #cd7f32;
}

.bfs-podium-slot.rank-3 .bfs-podium-avatar {
    animation: bfsBronzeGlow 3s ease infinite alternate;
}

@keyframes bfsBronzeGlow {
    from {
        filter: drop-shadow(0 0 3px rgba(205, 127, 50, 0.15));
    }

    to {
        filter: drop-shadow(0 0 10px rgba(205, 127, 50, 0.35));
    }
}

/* ─── Your Rank Card ─── */
.bfs-your-rank {
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    animation: bfsRankCardIn 0.6s 1.8s ease forwards;
    position: relative;
    z-index: 1;
}

@keyframes bfsRankCardIn {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.bfs-your-rank.top3 {
    background: rgba(250, 204, 21, 0.04);
    border-color: rgba(250, 204, 21, 0.15);
    box-shadow: 0 4px 24px rgba(250, 204, 21, 0.06);
}

.bfs-rank-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.4rem;
}

.bfs-rank-number {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.bfs-rank-number.gold {
    color: #fbbf24;
}

.bfs-rank-number.silver {
    color: #c0c0c0;
}

.bfs-rank-number.bronze {
    color: #cd7f32;
}

.bfs-rank-number.default {
    color: #fff;
}

.bfs-rank-detail {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

.bfs-rank-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.6rem;
    justify-content: center;
}

.bfs-rank-stat {
    text-align: center;
}

.bfs-rank-stat-value {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
}

.bfs-rank-stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
}

/* Crown for rank 1 */
.bfs-crown {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    animation: bfsCrownBounce 1s 1.5s ease infinite;
}

@keyframes bfsCrownBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }

    25% {
        transform: translateX(-50%) translateY(-4px) rotate(-3deg);
    }

    75% {
        transform: translateX(-50%) translateY(-4px) rotate(3deg);
    }
}

/* ─── Mobile Podium ─── */
@media (max-width: 768px) {
    .bfs-finish-title {
        font-size: 1.2rem;
    }

    .bfs-finish-subtitle {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .bfs-podium {
        height: 200px;
        gap: 0.3rem;
    }

    .bfs-podium-avatar {
        font-size: 1.6rem;
    }

    .bfs-podium-name {
        font-size: 0.68rem;
        max-width: 80px;
    }

    .bfs-podium-score {
        font-size: 0.65rem;
    }

    .bfs-podium-block {
        font-size: 1.5rem;
    }

    .bfs-podium-slot.rank-1 .bfs-podium-block {
        height: 105px;
    }

    .bfs-podium-slot.rank-2 .bfs-podium-block {
        height: 75px;
    }

    .bfs-podium-slot.rank-3 .bfs-podium-block {
        height: 50px;
    }

    .bfs-your-rank {
        padding: 0.8rem;
    }

    .bfs-rank-number {
        font-size: 1.8rem;
    }
}

/* ─── Scrollbar Styling ─── */
.bfs-lb-list::-webkit-scrollbar,
.bfs-chat-msgs::-webkit-scrollbar,
.bfs-quiz::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.bfs-lb-list::-webkit-scrollbar-track,
.bfs-chat-msgs::-webkit-scrollbar-track,
.bfs-quiz::-webkit-scrollbar-track {
    background: transparent;
}

.bfs-lb-list::-webkit-scrollbar-thumb,
.bfs-chat-msgs::-webkit-scrollbar-thumb,
.bfs-quiz::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}