/* Versus Mode Styles - Arcade / Fighting Game Aesthetic */

.vs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, #1a0b12 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    z-index: 6000;
    overflow-y: auto;
}

.vs-overlay--hidden {
    display: none !important;
}

/* SETUP SCREEN HEADER */
.vs-header {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.5);
    letter-spacing: 2px;
    font-style: italic;
}

/* SETUP SCREEN - SMASH BROS LAYOUT */
.vs-setup-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    padding: 20px 0;
}

.vs-roster-container {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    border: 4px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.vs-roster-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.vs-roster-item {
    width: 100px;
    height: 100px;
    background: #222;
    border: 3px solid #555;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
    user-select: none;
}

.vs-roster-item:hover {
    transform: scale(1.05);
    background: #333;
    border-color: #fceea7;
}

.vs-roster-item.selected-p1 {
    border-color: #ff0044;
    box-shadow: 0 0 15px rgba(255, 0, 68, 0.8);
    background: rgba(255, 0, 68, 0.2);
}

.vs-roster-item.selected-p2 {
    border-color: #00ccff;
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.8);
    background: rgba(0, 204, 255, 0.2);
}

.vs-roster-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.vs-roster-name {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    color: #eee;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.vs-teams-container {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

@media (max-width: 768px) {

    /* Scrollable page layout */
    .vs-setup-layout {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        padding-bottom: 30px;
    }

    /* Roster: fixed height, scrolls internally */
    .vs-roster-container {
        min-height: 250px;
        overflow-y: auto;
    }

    /* Stack team panels on top of each other — keep all desktop card styling */
    .vs-teams-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* Each panel goes full width, naturally keeps its desktop height */
    .vs-pick-panel {
        width: 100%;
        flex: none;
    }
}

.vs-pick-panel {
    background: rgba(20, 20, 20, 0.9);
    border: 4px solid #333;
    border-radius: 15px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.p1-panel {
    border-color: #ff0044;
}

.p2-panel {
    border-color: #00ccff;
}

.vs-pick-panel.active-picker {
    box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.1);
}

.vs-pick-panel.ready::before {
    content: 'READY';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 10;
}

.p1-panel.ready {
    box-shadow: inset 0 0 50px rgba(255, 0, 68, 0.3);
}

.p2-panel.ready {
    box-shadow: inset 0 0 50px rgba(0, 204, 255, 0.3);
}

.p-picker-status {
    background: #000;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 15px;
}

.p1-panel .p-picker-status {
    color: #ff0044;
}

.p2-panel .p-picker-status {
    color: #00ccff;
}

.pick-indicator {
    font-size: 0.8rem;
    color: #fff;
    margin-left: 10px;
    text-transform: uppercase;
}

.active-picker .pick-indicator::after {
    content: " (PICKING NOW)";
    color: #ffcc00;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.2;
    }
}

.p-char-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    background: #000;
    padding: 20px;
    border-radius: 10px;
}

.p-char-icon {
    font-size: 5rem;
    margin-bottom: 10px;
    line-height: 1;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.p-char-name {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
}

.vs-player-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    color: white;
    padding: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 15px;
}

.vs-player-input:focus {
    outline: none;
    border-color: #fff;
}

.vs-center-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    min-width: 150px;
    margin-bottom: 20px;
}

.vs-logo-smash {
    font-size: 4rem;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(135deg, #ff0000, #ffcc00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    line-height: 1;
}

.vs-btn-back {
    border-color: #666;
    color: #aaa;
    width: 100%;
}

.vs-btn-back:hover {
    border-color: #fff;
    color: #fff;
}

.vs-btn-ready {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #333;
    color: #fff;
    transition: all 0.2s;
}

.vs-btn-ready.active {
    background: #00E676;
    color: #000;
    box-shadow: 0 0 15px #00E676;
}

.vs-btn-start {
    padding: 20px 40px;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.5);
    transition: all 0.2s;
}

.vs-btn-start:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.vs-btn-start:not(:disabled):hover {
    transform: scale(1.05);
    background: #ff1a1a;
    box-shadow: 0 5px 25px rgba(255, 0, 0, 0.8);
}

/* MATCH SCREEN HUD */
.vs-match-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(20, 20, 20, 0.9);
    border-bottom: 3px solid #333;
    gap: 15px;
    position: relative;
}

.vs-team-hud {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vs-hud-name {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.vs-hud-artist {
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}

/* SCORE DISPLAY */
.vs-score-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.vs-score-pts {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.6);
    line-height: 1;
    transition: transform 0.2s ease;
}

.vs-score-label {
    font-size: 1rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vs-songs-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.vs-round-indicator {
    font-size: 2rem;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    text-transform: uppercase;
    white-space: nowrap;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
    .vs-match-hud {
        flex-direction: column;
        gap: 20px;
    }

    .vs-round-indicator {
        position: static;
        transform: none;
        order: -1;
    }
}

/* Team B HUD right-aligned */
#vsHudTeamB {
    align-items: flex-end;
    text-align: right;
}

#vsHudTeamB .vs-score-display {
    justify-content: flex-end;
}

#vsHudTeamB .vs-songs-badge {
    text-align: right;
}

/* MATCH ARENA */
.vs-arena {
    width: 100%;
    max-width: 1200px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    /* needed for flex children to shrink/grow properly */
}

/* Match screen root layout */
#versusMatchScreen {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
}

/* The HUD bar should be full-width */
.vs-match-hud {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 15px 30px;
}

/* Give the arena breathing room */
.vs-arena {
    padding: 0 20px 20px;
    box-sizing: border-box;
}

.vs-turn-banner {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0000;
    color: #fff;
    text-align: center;
    padding: 15px;
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 8px;
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

.vs-video-container {
    width: 100%;
    min-height: 300px;
    aspect-ratio: 16/9;
    background: #000;
    border: 4px solid #333;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Make the player div and any iframe fill the container completely */
#vsYoutubePlayer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#vsYoutubePlayer iframe {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border: none;
}

.vs-reveal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.vs-reveal-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--jeopardy-gold);
    text-align: center;
    margin-bottom: 20px;
}

/* VOTING PANEL */
.vs-voting-panel {
    background: rgba(20, 20, 20, 0.8);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #333;
    text-align: center;
}

.vs-voting-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .vs-voting-buttons {
        flex-direction: column;
    }
}

.btn-vote {
    flex: 1;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-vote:active {
    transform: scale(0.95);
}

.btn-vote-weak {
    background: #555;
    color: #fff;
}

.btn-vote-fire {
    background: #ff9800;
    color: #fff;
}

.btn-vote-legendary {
    background: #ff0000;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.vs-hype-meter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-hype {
    background: #9c27b0;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0 20px;
    height: 50px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-hype:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.4);
}

.btn-hype:disabled {
    background: #444;
    box-shadow: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.hype-bar-bg {
    flex: 1;
    height: 20px;
    background: #222;
    border-radius: 10px;
    overflow: hidden;
}

.hype-bar-fill {
    height: 100%;
    width: 0%;
    background: #9c27b0;
    transition: width 0.1s;
}

/* POINTS FLOATER & KO */
.points-floater {
    position: absolute;
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -200%) scale(1.6);
        opacity: 0;
    }
}

/* Score pulse when points are earned */
.score-pulse .vs-score-pts {
    animation: scorePulse 0.4s ease-out;
}

@keyframes scorePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
        color: #fff;
    }

    100% {
        transform: scale(1);
    }
}

.ko-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: flashKO 0.3s;
}

@keyframes flashKO {
    0% {
        background: rgba(255, 0, 0, 0.9);
    }

    100% {
        background: rgba(0, 0, 0, 0.9);
    }
}

.ko-text {
    font-size: 8rem;
    font-weight: 900;
    color: #ff0000;
    text-transform: uppercase;
    text-shadow: 0 0 30px #ff0000;
    margin-bottom: 20px;
    font-style: italic;
    transform: rotate(-10deg);
}

.winner-card {
    background: #111;
    border: 4px solid var(--jeopardy-gold);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

.winner-card h2 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 10px;
}

.winner-stats {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 30px;
}

.winner-score-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.winner-score-item {
    text-align: center;
}

.winner-score-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.winner-score-val {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.winner-score-sub {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.winner-score-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: #555;
}

.ko-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.score-pulse {
    animation: none;
    /* handled on child .vs-score-pts */
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}