.winner-card {
    position: fixed;
    top: 70px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(20, 10, 60, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    z-index: 10003;
    pointer-events: none;
    max-width: 260px;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.winner-card.show {
    opacity: 1;
    transform: translateX(0);
}

.winner-card-avatar {
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.winner-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.winner-card-name {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.winner-card-rank {
    color: #d4af37;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.winner-card-stats {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.winner-card-session {
    color: #4ade80;
    font-size: 11px;
}

.winner-card-total {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
}

.winner-card-tally {
    font-family: monospace;
    font-size: 7px;
    color: rgba(255, 255, 255, 0.65);
}

/* Mobile: full-size card overlaid on the room header, centered in the gap
   between the room name and the kviztali pill. Absolutely positioned so it
   never stretches the header; it descends from under the banner (#container
   clips overflow above its top edge). */
@media (max-width: 768px) {
    .quiz-header {
        position: relative; /* anchor for .winner-card--inline */
    }

    .winner-card--inline {
        position: absolute;
        top: 0;
        left: 50%;
        right: auto;
        z-index: 5; /* above #messages (positioned, z-index auto) */
        transform: translate(-50%, -120%);
    }

    .winner-card--inline.show {
        transform: translate(-50%, 0);
    }
}
