/* ── Game result popup enhancements (shared across all board games) ──── */

/* Position-relative so the absolute share button lands correctly */
.result-popup-card {
    position: relative;
}

/* ── Share button ───────────────────────────────────────────────────── */
.result-share-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: .8rem;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.result-share-btn .share-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── Leaderboard section ────────────────────────────────────────────── */
.result-lb-section {
    width: 100%;
    margin: 10px 0 4px;
}

.result-lb-section[hidden] {
    display: none !important;
}

.result-lb-label {
    font-size: .75rem;
    color: var(--muted);
    text-align: center;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.result-lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-lb-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,.04);
    font-size: .83rem;
}

.result-lb-me {
    background: rgba(124, 92, 255, .1);
    border: 1px solid rgba(124, 92, 255, .2);
}

.result-lb-medal {
    font-size: .82rem;
    text-align: center;
}

.result-lb-name {
    text-align: left;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-lb-record {
    font-size: .74rem;
    color: var(--muted);
    white-space: nowrap;
}

/* Current player separator when outside top 3 */
.result-lb-you {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(124, 92, 255, .1);
    border: 1px solid rgba(124, 92, 255, .2);
    font-size: .83rem;
    margin-top: 6px;
}

.result-lb-you .result-lb-medal {
    font-weight: 700;
    color: var(--accent);
    font-size: .78rem;
}

.result-lb-empty {
    font-size: .8rem;
    color: var(--muted);
    text-align: center;
    margin: 6px 0 0;
    line-height: 1.5;
}

/* ── Quick nav box ──────────────────────────────────────────────────── */
.result-nav-box {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    padding: 18px 14px 12px;
    margin: 10px 0 4px;
}

.result-nav-label {
    position: absolute;
    top: -9px;
    left: 12px;
    background: var(--panel);
    padding: 0 6px;
    font-size: .7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap;
}

.result-nav-strip {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--line);
    font-size: .8rem;
    color: var(--muted);
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.result-nav-item:hover {
    border-color: var(--accent-2);
    color: var(--accent-2);
}

/* ── Actions row — allow wrapping for multiple buttons ──────────────── */
.result-popup-actions {
    flex-wrap: wrap !important;
    gap: 8px !important;
}

/* ── Download Replay — popup button ────────────────────────────────── */
.smg-replay-dl-btn {
    font-size: .8rem;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.smg-replay-dl-btn--locked {
    opacity: .55;
    cursor: pointer;
    position: relative;
}

.smg-replay-dl-btn--locked::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 38, 0.96);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #edf3ff;
    font-size: .72rem;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    z-index: 10;
}

.smg-replay-dl-btn--locked:hover::after {
    opacity: 1;
}

/* ── Download Replay — persistent hint bar (shown after game ends) ─── */
.smg-replay-hint-bar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px 4px;
    gap: 8px;
}

.smg-replay-hint-bar[hidden] {
    display: none;
}

.smg-replay-hint-btn {
    font-size: .8rem;
    padding: 6px 14px;
}

/* ── Static save-game bar (always present, above history panel) ──────── */
.smg-save-bar {
    display: flex;
    justify-content: center;
    padding: 6px 0 2px;
}

.smg-save-bar button:disabled {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}
