* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

/* Анимированный фон с искрами */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.03) 0%, transparent 30%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.01) 0px, rgba(255, 255, 255, 0.01) 1px, transparent 1px, transparent 10px);
    pointer-events: none;
    z-index: 0;
}

/* Падающие искры */
@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.spark {
    position: fixed;
    color: rgba(255, 215, 0, 0.3);
    font-size: 8px;
    pointer-events: none;
    z-index: 0;
    animation: fall 8s linear infinite;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Шапка с неоновым эффектом */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px;
    background: rgba(10, 10, 20, 0.7);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 215, 0, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 6s ease-in-out infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

header h1 {
    font-size: 4em;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

header h1 i {
    color: #ffd700;
    margin-right: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

.subtitle {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.subtitle span {
    padding: 10px 25px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 40px;
    font-size: 1em;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    cursor: default;
}

.subtitle span:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.subtitle i {
    margin-right: 8px;
    color: #ffd700;
}

/* Топ-3 игроков с улучшенным дизайном */
.top-players {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    perspective: 1000px;
}

.top-card {
    background: rgba(20, 20, 40, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 40px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    min-width: 280px;
    flex: 0 1 auto;
    transform-style: preserve-3d;
}

.top-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 30px 50px rgba(255, 215, 0, 0.2);
}

/* Золотой фон для первого места */
.top-card.first {
    order: 0;
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(40, 30, 10, 0.9), rgba(20, 15, 5, 0.9));
    border: 2px solid #ffd700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    z-index: 2;
}

.top-card.first:hover {
    transform: scale(1.1) translateY(-10px) rotateX(5deg);
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.5);
}

/* Серебряный фон */
.top-card.second {
    order: -1;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.9));
    border-color: #c0c0c0;
}

/* Бронзовый фон */
.top-card.third {
    order: 1;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.9), rgba(30, 20, 10, 0.9));
    border-color: #cd7f32;
}

.crown {
    font-size: 3.5em;
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.first .crown i {
    color: #ffd700;
    text-shadow: 0 0 20px #ffd700;
}

.second .crown i {
    color: #c0c0c0;
}

.third .crown i {
    color: #cd7f32;
}

.avatar-large {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8em;
    font-weight: bold;
    color: white;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border: 4px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.top-card:hover .avatar-large {
    transform: scale(1.05);
    border-color: currentColor;
}

.first .avatar-large {
    border-color: #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #f1c40f, #e67e22);
}

.player-name-large {
    font-size: 1.8em;
    font-weight: bold;
    margin: 15px 0 5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.player-stats-large {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    color: rgba(255, 255, 255, 0.9);
}

.player-stats-large span {
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    font-size: 0.95em;
}

.win-rate {
    background: rgba(255, 215, 0, 0.2) !important;
    padding: 8px 20px !important;
    border-radius: 25px;
    font-weight: bold;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.player-score-large {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin: 15px 0 5px;
    font-family: 'Orbitron', monospace;
}

/* Список всех игроков */
.players-list {
    background: rgba(10, 10, 20, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 35px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    flex-wrap: wrap;
    gap: 20px;
}

.list-header h2 {
    font-size: 2em;
    background: linear-gradient(135deg, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.list-header h2 i {
    margin-right: 10px;
    color: #ffd700;
    -webkit-text-fill-color: #ffd700;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 215, 0, 0.5);
    transition: color 0.3s ease;
}

.search-box input {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 40px;
    padding: 14px 25px 14px 50px;
    color: white;
    font-size: 1em;
    width: 280px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(0, 0, 0, 0.5);
    width: 350px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.search-box input:focus + i {
    color: #ffd700;
}

/* Карточка игрока */
.player-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
    flex-wrap: wrap;
    gap: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.player-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.player-item:hover::before {
    left: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.player-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 20px;
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
}

/* Задержки анимации для каждого элемента */
.player-item:nth-child(1) { animation-delay: 0.1s; }
.player-item:nth-child(2) { animation-delay: 0.2s; }
.player-item:nth-child(3) { animation-delay: 0.3s; }
.player-item:nth-child(4) { animation-delay: 0.4s; }
.player-item:nth-child(5) { animation-delay: 0.5s; }
.player-item:nth-child(6) { animation-delay: 0.6s; }
.player-item:nth-child(7) { animation-delay: 0.7s; }
.player-item:nth-child(8) { animation-delay: 0.8s; }
.player-item:nth-child(9) { animation-delay: 0.9s; }
.player-item:nth-child(10) { animation-delay: 1s; }

.rank {
    font-size: 1.8em;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Orbitron', monospace;
}

.rank-1, .rank-2, .rank-3 {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    position: relative;
}

.rank-1::after, .rank-2::after, .rank-3::after {
    content: '👑';
    position: absolute;
    font-size: 0.6em;
    top: -10px;
    right: -5px;
    filter: drop-shadow(0 2px 5px gold);
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.4em;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.player-item:hover .player-avatar {
    transform: scale(1.1);
    border-color: #ffd700;
}

.player-info {
    flex: 2;
    min-width: 220px;
}

.player-name {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-status {
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.player-status.inactive {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border-color: #e74c3c;
}

.player-meta {
    display: flex;
    gap: 20px;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.7);
}

.player-meta i {
    margin-right: 5px;
    color: #ffd700;
    width: 16px;
}

/* Блок с бонусами - улучшенный */
.player-bonuses {
    flex: 3;
    min-width: 340px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.bonus-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bonus-row:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

.bonus-icon {
    width: 24px;
    text-align: center;
    font-size: 1.1em;
}

.bonus-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.bonus-value {
    font-weight: bold;
    color: #ffd700;
    font-size: 1em;
    margin-left: auto;
    min-width: 30px;
    text-align: right;
    font-family: 'Orbitron', monospace;
}

/* Цвета для иконок */
.bonus-icon.win { color: #ffd700; }
.bonus-icon.don { color: #ff6b6b; text-shadow: 0 0 10px #ff6b6b; }
.bonus-icon.sheriff { color: #4ecdc4; text-shadow: 0 0 10px #4ecdc4; }
.bonus-icon.doctor { color: #96ceb4; text-shadow: 0 0 10px #96ceb4; }
.bonus-icon.kill { color: #e74c3c; text-shadow: 0 0 10px #e74c3c; }
.bonus-icon.accusation { color: #f39c12; text-shadow: 0 0 10px #f39c12; }
.bonus-icon.vote { color: #2ecc71; text-shadow: 0 0 10px #2ecc71; }
.bonus-icon.best { color: #9b59b6; text-shadow: 0 0 10px #9b59b6; }

.player-rating {
    text-align: right;
    min-width: 140px;
}

.rating-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffd700;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rating-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.medal {
    font-size: 1.8em;
    margin-left: 10px;
    filter: drop-shadow(0 2px 5px rgba(255, 215, 0, 0.5));
    animation: medalGlow 2s ease-in-out infinite;
}

@keyframes medalGlow {
    0%, 100% { filter: drop-shadow(0 2px 5px rgba(255, 215, 0, 0.3)); }
    50% { filter: drop-shadow(0 2px 15px rgba(255, 215, 0, 0.8)); }
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 30px;
    padding: 20px;
    max-width: 450px; /* было 700px */
    width: 95%;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    transform: scale(0.9);
    animation: modalAppear 0.3s ease forwards;
}

@keyframes modalAppear {
    to {
        transform: scale(1);
    }
}

#modal-content .avatar-large {
    width: 70px !important;
    height: 70px !important;
    font-size: 1.8em !important;
    margin: 0 auto 15px !important;
}

#modal-content div[style*="font-size:2em"] {
    font-size: 1.5em !important;
}

#modal-content div[style*="gap:20px"] {
    gap: 10px !important;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.modal-header h2 {
    font-size: 1.5em;
    background: linear-gradient(135deg, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.close-modal {
    font-size: 2.5em;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    line-height: 1;
}

.close-modal:hover {
    color: #ffd700;
    transform: rotate(90deg);
}

.modal-player-info {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 30px;
}

.modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.modal-player-stats {
    flex: 1;
}

.modal-player-name {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.modal-player-details {
    display: flex;
    gap: 20px;
    color: rgba(255, 255, 255, 0.7);
}

/* Детальный блок бонусов */
.bonus-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.bonus-detail-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.bonus-detail-row:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateX(10px);
}

.bonus-detail-icon {
    width: 30px;
    font-size: 1.3em;
    text-align: center;
}


.bonus-detail-label {
    flex: 1;
    font-size: 1em;
    font-weight: 500;
}

.bonus-detail-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffd700;
    font-family: 'Orbitron', monospace;
    min-width: 50px;
    text-align: right;
}

/* Победы по командам в модальном окне */
.modal-content h4 {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.modal-content div[style*="justify-content: space-around"] {
    font-size: 0.95em !important;
    margin-top: 5px;
}

/* Состояния загрузки и ошибки */
.loading, .error {
    text-align: center;
    padding: 80px;
}

.loading i {
    font-size: 4em;
    color: #ffd700;
    margin-bottom: 20px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error i {
    font-size: 4em;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.error p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
}

.error button {
    padding: 15px 35px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.error button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .player-bonuses {
        grid-template-columns: 1fr;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.8em;
    }
    
    .top-players {
        gap: 20px;
    }
    
    .top-card {
        min-width: 260px;
    }
    
    .top-card.first {
        order: 0;
        transform: scale(1.05);
    }
    
    .top-card.first:hover {
        transform: scale(1.05) translateY(-10px);
    }
    
    .top-card.second {
        order: 1;
    }
    
    .top-card.third {
        order: 2;
    }
    
    .player-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .player-bonuses {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }
    
    .player-rating {
        text-align: left;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 20px;
    }
    
    .progress-bar {
        width: 150px;
    }
    
    .modal-player-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2.2em;
    }
    
    .subtitle span {
        width: 100%;
    }
    
    .player-bonuses {
        grid-template-columns: 1fr;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .search-box input:focus {
        width: 100%;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .bonus-detail-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .bonus-detail-value {
        width: 100%;
        text-align: left;
        margin-left: 50px;
    }
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff6b6b, #ffd700);
}