/* ============================================================
   PVP LOBBY
   ============================================================ */

.pvp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    gap: 16px;
    max-width: 420px;
    margin: 0 auto;
    overflow-y: auto;
    max-height: 100vh;
    max-height: 100dvh;
}

.pvp-title {
    font-family: "Press Start 2P", monospace;
    font-size: 20px;
    color: #ff4444;
    text-shadow: 2px 2px 0 #000;
    margin: 0;
}

.pvp-subtitle {
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    color: #aaa;
    margin: 0;
}

/* Режим PvP */
.pvp-mode-select {
    display: flex;
    gap: 10px;
    width: 100%;
}

.pvp-mode-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: #1a1a2e;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-family: "Press Start 2P", monospace;
    color: #ccc;
}

.pvp-mode-card.active {
    border-color: #ff4444;
    background: #2a1a1a;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}

.pvp-mode-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pvp-mode-icon {
    font-size: 24px;
}

.pvp-mode-name {
    font-size: 10px;
    font-weight: bold;
}

.pvp-mode-desc {
    font-size: 7px;
    color: #888;
}

.pvp-mode-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff6600;
    color: #fff;
    font-size: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Press Start 2P", monospace;
}

/* Настройки матча */
.pvp-match-settings {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
}

.pvp-settings-title {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: #ffd700;
    margin: 0 0 10px 0;
    text-align: center;
}

.pvp-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pvp-setting-row:last-child {
    margin-bottom: 0;
}

.pvp-setting-label {
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    color: #aaa;
}

.pvp-setting-buttons {
    display: flex;
    gap: 4px;
}

.pvp-option-btn {
    padding: 6px 10px;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: #aaa;
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.pvp-option-btn.active {
    background: #ff4444;
    border-color: #ff6666;
    color: #fff;
}

.pvp-option-btn:hover:not(.active) {
    background: #333;
    color: #fff;
}

/* Выбор персонажей */
.pvp-character-select {
    width: 100%;
}

.pvp-fighters-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pvp-fighter-card {
    flex: 1;
    max-width: 150px;
    background: #111;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    position: relative;
}

.pvp-fighter-card.p1 {
    border-color: #4488ff;
}

.pvp-fighter-card.p2 {
    border-color: #ff4444;
}

.pvp-fighter-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.pvp-fighter-card.p1 .pvp-fighter-badge {
    background: #4488ff;
    color: #fff;
}

.pvp-fighter-card.p2 .pvp-fighter-badge {
    background: #ff4444;
    color: #fff;
}

.pvp-fighter-avatar {
    width: 60px;
    height: 60px;
    margin: 8px auto;
    image-rendering: pixelated;
}

.pvp-fighter-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.pvp-fighter-name {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: #fff;
    margin-bottom: 6px;
}

.pvp-fighter-controls {
    font-family: "Press Start 2P", monospace;
    font-size: 6px;
    color: #888;
    line-height: 1.8;
}

.pvp-key {
    display: inline-block;
    background: #333;
    color: #ffd700;
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid #555;
    font-size: 6px;
    margin: 0 1px;
}

.pvp-vs-badge {
    font-family: "Press Start 2P", monospace;
    font-size: 18px;
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    animation: pvpVsPulse 1.5s ease-in-out infinite;
}

@keyframes pvpVsPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Кнопка старта PvP */
.pvp-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    padding: 14px 20px;
    background: linear-gradient(180deg, #ff4444, #cc0000);
    border: 2px solid #ff6666;
    border-radius: 8px;
    color: #fff;
    font-family: "Press Start 2P", monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.pvp-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
}

.pvp-start-btn:active {
    transform: translateY(1px);
}

.pvp-start-icon {
    font-size: 20px;
}

/* ============================================================
   PVP HUD — поверх игры
   ============================================================ */

.pvp-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

.pvp-hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 12px;
    gap: 8px;
}

.pvp-hud-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pvp-hud-player.p2 {
    align-items: flex-end;
}

.pvp-hud-name {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    text-shadow: 1px 1px 0 #000;
}

.pvp-hud-player.p1 .pvp-hud-name { color: #4488ff; }
.pvp-hud-player.p2 .pvp-hud-name { color: #ff4444; }

.pvp-hud-hp-bar {
    width: 100%;
    height: 12px;
    background: #333;
    border: 1px solid #555;
    border-radius: 2px;
    overflow: hidden;
}

.pvp-hud-hp-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.pvp-hud-hp-fill.p1-hp {
    background: linear-gradient(180deg, #66aaff, #4488ff);
}

.pvp-hud-hp-fill.p2-hp {
    background: linear-gradient(180deg, #ff6666, #ff4444);
    float: right;
}

.pvp-hud-rounds {
    display: flex;
    gap: 4px;
}

.pvp-hud-player.p2 .pvp-hud-rounds {
    flex-direction: row-reverse;
}

.pvp-round-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
}

.pvp-round-dot.won {
    background: #ffd700;
    border-color: #ffaa00;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.pvp-hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.pvp-hud-timer {
    font-family: "Press Start 2P", monospace;
    font-size: 16px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.pvp-hud-timer.warning {
    color: #ff4444;
    animation: pvpTimerPulse 0.5s ease-in-out infinite;
}

@keyframes pvpTimerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pvp-hud-round-num {
    font-family: "Press Start 2P", monospace;
    font-size: 7px;
    color: #aaa;
}

/* Комбо дисплей */
.pvp-combo-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1001; /* PvP combo display */
    pointer-events: none;
}

.pvp-combo-count {
    font-family: "Press Start 2P", monospace;
    font-size: 36px;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255, 215, 0, 0.5);
}

.pvp-combo-label {
    display: block;
    font-family: "Press Start 2P", monospace;
    font-size: 12px;
    color: #ff4444;
    text-shadow: 1px 1px 0 #000;
}

/* ============================================================
   PVP ROUND SPLASH
   ============================================================ */

.pvp-round-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000; /* PvP splash */
}

.pvp-splash-text {
    font-family: "Press Start 2P", monospace;
    font-size: 28px;
    color: #fff;
    text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 255, 255, 0.3);
    animation: pvpSplashIn 0.5s ease-out;
}

.pvp-splash-sub {
    font-family: "Press Start 2P", monospace;
    font-size: 20px;
    color: #ff4444;
    text-shadow: 2px 2px 0 #000, 0 0 15px rgba(255, 68, 68, 0.5);
    animation: pvpSplashIn 0.5s ease-out 0.3s both;
}

@keyframes pvpSplashIn {
    from {
        transform: scale(3);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   PVP RESULT SCREEN
   ============================================================ */

.pvp-result-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000; /* PvP result */
}

.pvp-result-content {
    text-align: center;
    padding: 20px;
    max-width: 360px;
    width: 100%;
}

.pvp-result-title {
    font-family: "Press Start 2P", monospace;
    font-size: 24px;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 16px;
    animation: pvpResultBounce 0.6s ease-out;
}

@keyframes pvpResultBounce {
    0% { transform: translateY(-50px); opacity: 0; }
    60% { transform: translateY(10px); }
    100% { transform: translateY(0); opacity: 1; }
}

.pvp-result-winner {
    margin-bottom: 20px;
}

.pvp-result-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    image-rendering: pixelated;
}

.pvp-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.pvp-result-name {
    font-family: "Press Start 2P", monospace;
    font-size: 14px;
    color: #fff;
}

/* Статистика матча */
.pvp-result-stats {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.pvp-result-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #222;
}

.pvp-result-stat-row:last-child {
    border-bottom: none;
}

.pvp-stat-label {
    font-family: "Press Start 2P", monospace;
    font-size: 8px;
    color: #888;
    flex: 1;
    text-align: center;
}

.pvp-stat-p1 {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: #4488ff;
    width: 50px;
    text-align: center;
}

.pvp-stat-p2 {
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
    color: #ff4444;
    width: 50px;
    text-align: center;
}

.pvp-result-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================================
   PVP кнопка в главном меню
   ============================================================ */

.menu-btn.pvp-btn {
    background: linear-gradient(180deg, #ff4444, #aa0000);
    border: 2px solid #ff6666;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.menu-btn.pvp-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%
    );
    animation: pvpBtnShine 3s ease-in-out infinite;
}

@keyframes pvpBtnShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}