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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --gold: #ffd700;
    --gold-light: #ffe44d;
    --gold-dark: #b8960b;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #ffd700;
    --danger: #ff4444;
    --success: #44ff44;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at top center, rgba(255, 215, 0, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at bottom center, rgba(255, 215, 0, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(255, 180, 0, 0.04) 0%, transparent 25%),
        radial-gradient(circle at 80% 20%, rgba(255, 200, 0, 0.04) 0%, transparent 25%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(255, 215, 0, 0.01) 50px,
            rgba(255, 215, 0, 0.01) 51px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(255, 215, 0, 0.01) 50px,
            rgba(255, 215, 0, 0.01) 51px
        ),
        linear-gradient(180deg, #050505 0%, #0a0a0a 30%, #0d0d0d 50%, #0a0a0a 70%, #050505 100%);
    background-attachment: fixed;
}

.glow-text {
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                 0 0 20px rgba(255, 215, 0, 0.3),
                 0 0 30px rgba(255, 215, 0, 0.2);
    color: var(--gold);
}

.leaderboard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.last-update {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-row {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.player-row:hover {
    transform: translateX(8px);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.player-row.top-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), var(--bg-card));
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.player-row.top-2 {
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.2), var(--bg-card));
    border-color: #ff3232;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.15);
}

.player-row.top-3 {
    background: linear-gradient(135deg, rgba(50, 130, 255, 0.2), var(--bg-card));
    border-color: #3282ff;
    box-shadow: 0 0 20px rgba(50, 130, 255, 0.15);
}

.rank-position {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    width: 60px;
    text-align: center;
    color: var(--gold);
}

.crown {
    font-size: 2rem;
}

.tier-icon {
    width: 60px;
    height: 60px;
    margin-right: 16px;
}

.tier-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.player-name {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.tier-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-score {
    text-align: right;
}

.score-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
}

.score-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.no-players {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.footer {
    text-align: center;
    margin-top: 40px;
}

.admin-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.admin-link:hover {
    color: var(--gold);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Rajdhani', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
}

.form-group small {
    color: var(--gold);
    font-size: 0.75rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.btn-secondary:hover {
    border-color: var(--gold);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #ff6666;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-edit {
    background: var(--bg-secondary);
    color: var(--gold);
    border: 1px solid var(--gold);
}

.back-link {
    display: block;
    margin-top: 20px;
    color: var(--text-secondary);
    text-decoration: none;
}

.back-link:hover {
    color: var(--gold);
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-nav {
    display: flex;
    gap: 12px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.admin-section {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.admin-section h3 {
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
}

.tier-thresholds {
    grid-column: span 2;
}

.thresholds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.threshold-item {
    text-align: center;
}

.tier-img-small {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.threshold-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.threshold-item input {
    width: 100%;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
}

.players-list {
    grid-column: 1 / -1;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.players-header h3 {
    margin: 0;
}

.no-tier {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.no-tier-space {
    width: 60px;
    height: 60px;
    margin-right: 16px;
}

.players-table-wrapper {
    overflow-x: auto;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
}

.players-table th,
.players-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.players-table th {
    color: var(--gold);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.players-table tr:hover {
    background: rgba(255, 215, 0, 0.05);
}

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

.inline-form {
    display: inline;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close:hover {
    color: var(--gold);
}

.modal-content h3 {
    color: var(--gold);
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
}

.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.flash {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

.flash.success {
    background: rgba(68, 255, 68, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.flash.error {
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
    }
    
    .player-row {
        padding: 12px 16px;
    }
    
    .rank-position {
        width: 40px;
        font-size: 1.2rem;
    }
    
    .tier-icon {
        width: 45px;
        height: 45px;
    }
    
    .player-name {
        font-size: 1.1rem;
    }
    
    .score-value {
        font-size: 1.3rem;
    }
    
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tier-thresholds {
        grid-column: span 1;
    }
    
    .actions {
        flex-direction: column;
    }
}
