.versus-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(4, 7, 15, 0.88);
    backdrop-filter: blur(20px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.versus-overlay.revenge-mode { background: rgba(40, 0, 10, 0.92); }
.versus-card {
    background: linear-gradient(145deg, rgba(22, 28, 45, 0.95), rgba(11, 15, 25, 0.95));
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 24px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.15);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
.versus-card::before {
    content: 'VS';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 7rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    z-index: 0;
    font-style: italic;
    pointer-events: none;
}
.h2h-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}
.fighter { text-align: center; flex: 1; }
.fighter-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    margin: 0 auto 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    border: 2px solid;
}
.fighter.you .fighter-avatar { border-color: var(--accent-cyan); box-shadow: 0 0 20px rgba(0, 240, 255, 0.3); }
.fighter.rival .fighter-avatar { border-color: #ff0055; box-shadow: 0 0 20px rgba(255, 0, 85, 0.3); }
.fighter-name { font-size: 1rem; font-weight: 800; color: #fff; text-transform: uppercase; }
.fighter-pts { font-size: 1.5rem; font-weight: 900; margin-top: 4px; }
.fighter.you .fighter-pts { color: var(--accent-cyan); }
.fighter.rival .fighter-pts { color: #ff0055; }
.vs-badge {
    background: #fff; color: #000;
    font-weight: 900; padding: 6px 12px;
    border-radius: 8px; font-size: 1rem;
    transform: skewX(-10deg);
}
.vs-progress-wrap {
    position: relative; z-index: 1;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
}
.vs-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-neon));
    width: 0%;
    transition: width 0.6s ease;
}
.vs-progress-label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    margin-bottom: 12px;
}
.vs-stats-box {
    position: relative; z-index: 1;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 12px;
}
.vs-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-muted);
}
.vs-stat-row b { color: #fff; text-align: right; }
.mission-box {
    background: rgba(0,0,0,0.35);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
}
.mission-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.mission-logic { font-size: 1rem; color: #fff; line-height: 1.5; }
.mission-logic span { color: var(--accent-neon); font-weight: bold; }
.vs-actions {
    position: relative; z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vs-actions select, .vs-actions label {
    font-size: 12px;
    color: var(--text-muted);
}
.vs-actions select {
    width: 100%;
    padding: 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
}
.vs-btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.vs-btn-row button {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}
#vs-btn-challenge { background: #ff0055; color: #fff; }
#vs-btn-chat { background: var(--accent-cyan); color: #000; }
.close-vs {
    position: absolute;
    top: 12px; right: 16px;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.5;
    z-index: 2;
}
.close-vs:hover { opacity: 1; color: #ff0055; }

.victory-overlay {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    animation: victoryFadeIn 0.5s ease;
}
@keyframes victoryFadeIn { from { opacity: 0; } to { opacity: 1; } }
.victory-content {
    position: relative; z-index: 2; text-align: center;
    background: linear-gradient(145deg, rgba(30,20,0,0.95), rgba(10,10,20,0.95));
    border: 2px solid #ffd700;
    border-radius: 24px; padding: 40px 36px;
    box-shadow: 0 0 80px rgba(255,215,0,0.4);
    animation: victoryPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 420px;
}
@keyframes victoryPop {
    0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.victory-crown { font-size: 4rem; animation: crownBounce 1s ease infinite alternate; }
@keyframes crownBounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }
.victory-content h2 { color: #ffd700; font-size: 1.8rem; margin: 12px 0 8px; text-shadow: 0 0 20px rgba(255,215,0,0.5); }
.victory-content p { color: #fff; font-size: 1rem; line-height: 1.5; }
.victory-burst {
    position: absolute; inset: 0;
    background: radial-gradient(circle at center, rgba(255,215,0,0.15) 0%, transparent 60%);
    animation: burstPulse 2s ease infinite;
}
@keyframes burstPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
#confettiCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

.victory-overlay.victory-belt-win {
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.22) 0%, rgba(0, 0, 0, 0.92) 55%);
    animation: beltVictoryFadeIn 0.6s ease;
}
@keyframes beltVictoryFadeIn {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: scale(1); }
}
.victory-overlay.victory-belt-win .victory-content {
    border-color: #ffd700;
    box-shadow: 0 0 120px rgba(255, 215, 0, 0.55), inset 0 0 40px rgba(255, 215, 0, 0.08);
    animation: beltVictoryPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes beltVictoryPop {
    0% { transform: scale(0.35) rotate(-8deg); opacity: 0; filter: brightness(2); }
    60% { transform: scale(1.06) rotate(2deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; filter: brightness(1); }
}
.victory-overlay.victory-belt-win .victory-crown {
    font-size: 5rem;
    animation: beltCrownPulse 1.2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.9));
}
@keyframes beltCrownPulse {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-16px) scale(1.12); }
}
.victory-overlay.victory-belt-win .victory-burst {
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 215, 0, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(255, 180, 0, 0.25) 0%, transparent 50%);
    animation: beltBurstSpin 3s linear infinite;
}
@keyframes beltBurstSpin {
    from { transform: rotate(0deg) scale(1); opacity: 0.7; }
    50% { opacity: 1; }
    to { transform: rotate(360deg) scale(1.08); opacity: 0.7; }
}
.victory-overlay.victory-belt-win .victory-content h2 {
    font-size: 2rem;
    letter-spacing: 0.04em;
    animation: beltTitleShine 2.4s ease-in-out infinite;
}
@keyframes beltTitleShine {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); color: #ffd700; }
    50% { text-shadow: 0 0 36px rgba(255, 255, 200, 0.95), 0 0 60px rgba(255, 215, 0, 0.45); color: #fff8dc; }
}
.victory-belt-tag {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.25), rgba(255, 140, 0, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.55);
    color: #ffd700;
    font-weight: 700;
    font-size: 0.95rem;
    animation: beltTagPop 0.8s ease 0.4s both;
}
@keyframes beltTagPop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.arena-list-header {
    align-items: flex-end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.arena-list-header h4 {
    margin: 0 0 4px;
}

.arena-list-header p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
}

.arena-list-filters {
    align-items: flex-end;
    display: flex;
    gap: 10px;
}

.arena-list-filters label {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 700;
    gap: 5px;
    min-width: 140px;
    text-transform: uppercase;
}

.arena-list-filters .form-control {
    padding: 8px 10px;
}

.arena-pagination {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.arena-page-link {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    text-decoration: none;
}

.arena-page-link:not(.disabled):hover {
    background: rgba(0, 240, 255, 0.08);
}

.arena-page-link.disabled {
    color: rgba(148, 163, 184, 0.55);
    cursor: default;
}

@media (max-width: 768px) {
    .arena-list-header,
    .arena-list-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .arena-list-filters label {
        min-width: 0;
        width: 100%;
    }

    .versus-overlay {
        align-items: flex-start;
        padding: 10px;
        overflow-y: auto;
    }
    .versus-card {
        max-width: none;
        width: 100%;
        max-height: none;
        min-height: auto;
        padding: 18px 14px;
        border-radius: 18px;
        margin: 8px 0 18px;
    }
    .versus-card::before {
        font-size: 4rem;
        top: 82px;
    }
    .close-vs {
        top: 8px;
        right: 12px;
        font-size: 1.25rem;
    }
    .h2h-container {
        margin-bottom: 12px;
        gap: 8px;
    }
    .fighter-avatar {
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
        margin-bottom: 6px;
    }
    .fighter-name {
        font-size: 0.78rem;
        line-height: 1.2;
    }
    .fighter-pts {
        font-size: 1rem;
    }
    .vs-badge {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    .vs-progress-wrap {
        height: 8px;
        margin-bottom: 8px;
    }
    .vs-progress-label {
        margin-bottom: 8px;
        font-size: 10px;
    }
    .vs-stats-box {
        padding: 8px 10px;
        margin-bottom: 10px;
        font-size: 11px;
    }
    .vs-stat-row {
        flex-direction: column;
        gap: 2px;
        padding: 4px 0;
    }
    .vs-stat-row b {
        text-align: left;
    }
    .mission-box {
        padding: 10px;
        margin-bottom: 10px;
    }
    .mission-title {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }
    .mission-logic {
        font-size: 0.86rem;
    }
    .vs-actions {
        gap: 8px;
    }
    .vs-actions select {
        padding: 9px;
    }
    .vs-btn-row {
        flex-direction: column;
    }
    .vs-btn-row button {
        width: 100%;
        min-width: 0;
        padding: 11px;
    }
    .victory-content {
        width: calc(100% - 24px);
        padding: 28px 18px;
        border-radius: 18px;
    }
    .victory-crown {
        font-size: 3rem;
    }
    .victory-content h2 {
        font-size: 1.35rem;
    }
}

/* --- Duel detail modal --- */
.duel-list-row,
.duel-open-card.duel-list-row {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
}
.duel-open-card.duel-list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.duel-list-row:hover,
.duel-open-card.duel-list-row:hover {
    background: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.15);
}
.duel-list-hint {
    margin-left: auto;
    color: var(--accent-cyan);
    font-weight: 700;
    opacity: 0.6;
}
.duel-list-row:hover .duel-list-hint { opacity: 1; }
.duel-list-meta,
.duel-list-score { color: var(--text-muted); font-size: 12px; }
.duel-list-score { color: var(--accent-cyan); font-weight: 700; }
.duel-list-winner { color: #ffd700; font-size: 12px; }
.arena-player-link {
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}
.arena-player-link:hover,
.arena-player-link:focus-visible {
    background: rgba(0, 240, 255, 0.1);
    outline: none;
}
.arena-player-link .user-with-avatar-name {
    text-decoration: underline;
    text-decoration-color: rgba(0, 240, 255, 0.35);
    text-underline-offset: 2px;
}
.duel-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.duel-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 100060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 7, 15, 0.88);
    backdrop-filter: blur(10px);
}
.duel-detail-card {
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(8, 12, 22, 0.98));
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.duel-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.duel-detail-header h3 { margin: 0 0 6px; font-size: 1.15rem; }
.duel-detail-meta { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.duel-detail-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 18px;
}
.duel-detail-fighter {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}
.duel-detail-fighter.challenger { border-color: rgba(0, 240, 255, 0.2); }
.duel-detail-fighter.opponent { border-color: rgba(255, 0, 85, 0.2); }
.duel-detail-fighter-name {
    display: block;
    margin: 8px 0 4px;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    text-decoration: underline;
    text-decoration-color: rgba(0,240,255,0.35);
}
.duel-detail-duel-score { font-size: 2rem; font-weight: 900; color: var(--accent-cyan); line-height: 1; }
.duel-detail-status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(0,240,255,0.12);
    color: var(--accent-cyan);
}
.duel-detail-needs { margin-top: 8px; font-size: 12px; line-height: 1.45; }
.duel-detail-needs.leading { color: var(--accent-neon); }
.duel-detail-needs.trailing { color: #f59e0b; }
.duel-detail-needs.won { color: #ffd700; }
.duel-detail-needs.lost { color: #ef4444; }
.duel-detail-section { margin-bottom: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.duel-detail-section h4 { margin: 0 0 10px; font-size: 13px; color: var(--accent-cyan); }
.duel-match-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
}
.duel-match-row:last-child { border-bottom: none; }
.duel-match-label { font-weight: 600; }
.duel-match-sub { color: var(--text-muted); font-size: 11px; }
.duel-match-pts { font-weight: 800; color: var(--accent-cyan); white-space: nowrap; }
.duel-timeline-item { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px; color: var(--text-muted); }
.duel-timeline-item strong { color: #e2e8f0; font-weight: 600; }
.duel-detail-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.duel-detail-stat { padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.03); font-size: 12px; }
.duel-detail-stat span { display: block; color: var(--text-muted); margin-bottom: 4px; }
.duel-detail-stat b { font-size: 14px; color: #fff; }
.duel-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 640px) {
    .duel-detail-scoreboard { grid-template-columns: 1fr; }
    .duel-detail-vs-mid { order: -1; text-align: center; padding: 8px 0; }
}
