* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #1a2844 50%, #0a1628 100%);
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
}

.particle {
    position: fixed;
    pointer-events: none;
    animation: float 20s infinite;
    opacity: 0.3;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-100px) translateX(50px); }
    50% { transform: translateY(-50px) translateX(-50px); }
    75% { transform: translateY(-150px) translateX(30px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    padding: 20px 0;
    background: rgba(10, 22, 40, 0.98);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid #ffd700;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-family: 'Bebas Neue', 'Arial Black', sans-serif;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: #ffd700;
    text-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700;
    animation: glow 2s ease-in-out infinite;
    user-select: none;
    font-weight: 400;
    text-decoration: none;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700; }
    50% { text-shadow: 0 0 30px #ffd700, 0 0 60px #ffd700, 0 0 80px #ff8800; }
}

.back-btn {
    background: linear-gradient(135deg, #ffd700, #ff8800);
    color: #0a1628;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rubik', sans-serif;
    text-decoration: none;
    display: inline-block;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.leaderboard-content {
    padding: 40px 0;
    min-height: calc(100vh - 100px);
}

.page-title {
    font-family: 'Bebas Neue', 'Arial Black', sans-serif;
    font-size: clamp(1.8rem, 8vw, 4rem);
    text-align: center;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: slideDown 1s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-subtitle {
    text-align: center;
    font-size: 1.5em;
    color: #00d4ff;
    margin-bottom: 30px;
    font-weight: 700;
    animation: fadeIn 1s ease 0.3s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.filters-container {
    max-width: 600px;
    margin: 0 auto 40px;
    display: flex;
    gap: 20px;
    align-items: center;
    animation: fadeIn 1s ease 0.5s both;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-container {
    flex: 0 0 auto;
    min-width: 300px;
}

.district-filter {
    width: 100%;
    padding: 15px 40px 15px 20px;
    font-size: 1.1em;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 25px;
    background: rgba(26, 40, 68, 0.8);
    color: #fff;
    font-family: 'Rubik', sans-serif;
    transition: all 0.3s;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ffd700" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

.district-filter:hover {
    border-color: rgba(255, 215, 0, 0.5);
}

.district-filter:focus {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.district-filter option {
    background: #0a1628;
    color: #fff;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2em;
    color: #00d4ff;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.leaderboard-container {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(26, 40, 68, 0.8), rgba(10, 22, 40, 0.9));
    border-radius: 25px;
    padding: 40px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.8s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 100px 1fr 200px;
    gap: 20px;
    padding: 20px 30px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    margin-bottom: 20px;
    font-weight: 900;
    color: #ffd700;
    font-size: 1.1em;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 100px 1fr 200px;
    gap: 20px;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.leaderboard-item:hover::before {
    left: 100%;
}

.leaderboard-item:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 136, 0, 0.08));
    border-color: #ffd700;
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.08));
    border-color: #c0c0c0;
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.08));
    border-color: #cd7f32;
}

.rank {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', 'Arial Black', sans-serif;
    font-size: 2em;
    font-weight: 900;
    color: #ffd700;
    position: relative;
    z-index: 1;
}

.rank.top-1 { color: #ffd700; }
.rank.top-2 { color: #c0c0c0; }
.rank.top-3 { color: #cd7f32; }

.player-name {
    font-size: 1.3em;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.district-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #00d4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.3em;
    color: #aaa;
}

.no-data p {
    font-weight: 700;
    color: #ffd700;
}

.error-state {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.3em;
    color: #ff4444;
    font-weight: 700;
}

@media (max-width: 768px) {
    /* Отключаем летающие эмодзи на мобильных */
    .particle {
        display: none !important;
    }

    /* Отключаем все свечения текста на мобильных */
    * {
        text-shadow: none !important;
    }

    .container { padding: 0 12px; }
    .leaderboard-container { padding: 20px 12px; }
    
    .logo {
        text-shadow: none;
        animation: none;
    }
    
    .leaderboard-header { display: none; }
    
    .leaderboard-item {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 18px;
    }
    
    .rank {
        font-size: 2em;
        justify-content: flex-start;
    }
    
    .rank::before {
        content: 'Место: ';
        font-size: 0.5em;
        color: #ffd700;
        font-family: 'Rubik', sans-serif;
        margin-right: 8px;
        font-weight: 700;
    }
    
    .player-name {
        font-size: 1.2em;
        display: block;
        line-height: 1.4;
    }
    
    .player-name::before {
        content: 'ФИО: ';
        color: #aaa;
        font-size: 0.8em;
        display: block;
        margin-bottom: 5px;
    }
    
    .district-name {
        font-size: 1.1em;
        justify-content: flex-start;
    }
    
    .district-name::before {
        content: 'Участок: ';
        color: #aaa;
        font-size: 0.9em;
        margin-right: 8px;
    }
}
