/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 0;
    color: white;
    padding: 10px 16px;
    display: none;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title i {
    color: #ffd700;
    animation: crown-glow 2s ease-in-out infinite alternate;
}

@keyframes crown-glow {
    from { filter: drop-shadow(0 0 5px #ffd700); }
    to { filter: drop-shadow(0 0 20px #ffd700); }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Контейнер сравнения */
.vs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: start;
    margin: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Карточки людей */
.person-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: none;
    border: none;
    position: relative;
    overflow: visible;
    height: auto;
}

.person-card::before { display: none; }

.person-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.person-card.winner {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.person-card.winner::before {
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

.person-info {
    display: block;
    margin: 0;
}

/* Фото */
.photo-container {
    position: relative;
    margin: 10px auto 0;
    width: 100%;
    max-width: 680px;
    height: auto;
    max-height: 88vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: none;
}

.photo {
    width: 100%;
    height: auto;
    max-height: 88vh;
    object-fit: contain;
    display: none;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.photo.loaded {
    display: block;
}

.photo-placeholder.hidden {
    display: none;
}

/* Детали */
.details {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0;
    text-align: center;
}

.name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #fff;
    line-height: 1.2;
}

.details .info-row,
.details .vk-link { display: none; }

.info-row i {
    width: 16px;
    color: #667eea;
}

.vk-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    transition: all 0.2s ease;
}

.vk-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* VS разделитель */
.vs-divider {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
    pointer-events: none;
}

.vs-text {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    background: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 3px solid #667eea;
}

.vs-line {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 1px;
}

/* Кнопки действий */
.action-buttons {
    position: static;
    display: flex;
    gap: 10px;
    padding: 12px 0 20px;
    z-index: 3;
}

/* Плавающая кнопка скипа */
.skip-overlay {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 100;
}

.skip-both-btn {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 26px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.skip-both-btn:hover {
    background: #667eea;
    color: #fff;
}

/* Плавающая кнопка ТОПа */
.top-overlay {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 100;
}

.top-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffd700;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(6px);
}

.top-btn:hover {
    background: rgba(0, 0, 0, 0.65);
}

.vote-btn, .add-to-history-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.vote-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.vote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.add-to-history-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.add-to-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.vote-btn:active, .add-to-history-btn:active {
    transform: translateY(0);
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Контролы */
.controls {
    display: none;
}

.new-battle-btn, .history-btn {
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.new-battle-btn:hover, .history-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Статистика */
.stats {
    display: none;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Анимации загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .photo-placeholder {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .vs-container {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }
    
    .vs-divider { display: none; }
    
    .vs-text {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .vs-line {
        width: 40px;
        height: 2px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .container {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .person-card {
        padding: 0;
    }
    
    .photo-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .name {
        font-size: 1.2rem;
    }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: #f44336;
}

/* Панель истории */
.history-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.history-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-history-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-history-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.history-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.history-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.history-item-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
}

.history-item-info {
    flex: 1;
}

.history-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.history-item-details {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    gap: 15px;
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-from-history-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-from-history-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.history-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Адаптивность для панели истории */
@media (max-width: 768px) {
    .history-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .history-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .history-item-details {
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .new-battle-btn, .history-btn {
        width: 200px;
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
}

/* Админская панель */
#admin-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.admin-panel-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.admin-info i {
    color: #ffd700;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.admin-select-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.admin-select-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

/* Адаптивность админской панели */
@media (max-width: 768px) {
    #admin-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 12px 15px;
    }
    
    .admin-panel-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .admin-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .admin-btn, .admin-select-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}
