/* Main styles for Fortnite Campers Ranked */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e0033 0%, #110022 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-text {
    text-align: center;
    flex: 1;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mission Statement Banner */
.mission-banner {
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.15) 0%, rgba(0, 100, 0, 0.25) 100%);
    border-bottom: 2px solid rgba(34, 139, 34, 0.3);
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.mission-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.mission-content h2 {
    color: #90EE90;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mission-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    font-size: 14px;
    line-height: 1.2;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

.leaderboard {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    margin: 0 auto;
}

.leaderboard-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    display: grid;
    grid-template-columns: 60px 80px minmax(200px, max-content) 150px 200px;
    gap: 0.75rem;
    align-items: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 60px 80px minmax(200px, max-content) 150px 200px;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-row.unreal-row {
    background: linear-gradient(90deg, rgba(255, 140, 0, 0.1) 0%, transparent 100%);
    border-left: 4px solid #ff8c00;
}

.leaderboard-row.unreal-row:hover {
    background: linear-gradient(90deg, rgba(255, 140, 0, 0.2) 0%, rgba(255, 140, 0, 0.05) 100%);
}

.rank-position {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.rank-position.top-3 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.avatar-container {
    position: relative;
    display: inline-block;
}

.crown-icon {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    z-index: 1;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    cursor: pointer;
}

.player-avatar:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.unreal-row .player-avatar {
    border-color: #ff8c00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.player-name-row:hover .player-name {
    color: #667eea;
}

.profile-link {
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    margin-left: 0.5rem;
    transition: all 0.3s;
    opacity: 0.7;
}

.profile-link:hover {
    color: #667eea;
    opacity: 1;
    transform: scale(1.2);
}

.player-name {
    font-size: 1.1rem;
    font-weight: bold;
    transition: color 0.3s;
}

.rank-icon {
    width: 20px;
    height: 20px;
}

.player-rank {
    font-size: 0.9rem;
    color: #ccc;
}

.player-stats {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.highest-rank {
    font-size: 0.8rem;
    color: #ffd700;
    font-style: italic;
    margin-left: 8px;
}

.last-updated {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

.unreal-row .player-rank {
    color: #ff8c00;
}

.rank-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rank-badge {
    width: 30px;
    height: 30px;
}

.progress-section {
    text-align: right;
    min-width: 150px;
}

.global-rank {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff8c00, #ff4500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.global-rank-label {
    font-size: 0.7rem;
    color: #ff8c00;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    width: 150px;
    margin-left: auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 3px;
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-label {
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 0.25rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
}

footer {
    background: rgba(0, 0, 0, 0.5);
    text-align: center;
    padding: 1rem;
    color: #888;
}

.last-updated {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Rank change indicators */
.rank-change-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 0.25rem;
    opacity: 0;
    animation: fadeInScale 0.5s ease-out 0.3s forwards;
}

.rank-change.up {
    color: #4ade80;
}

.rank-change.down {
    color: #f87171;
}

.rank-change.same {
    color: #94a3b8;
}

.rank-change.new {
    color: #fbbf24;
}

.rank-arrow {
    font-size: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.rank-change.up .rank-arrow {
    animation: bounce-up 0.5s ease-out;
}

.rank-change.down .rank-arrow {
    animation: bounce-down 0.5s ease-out;
}

@keyframes bounce-up {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.rank-change-amount {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

.rank-change.up .rank-change-amount {
    background: rgba(74, 222, 128, 0.2);
}

.rank-change.down .rank-change-amount {
    background: rgba(248, 113, 113, 0.2);
}

.rank-change.new .rank-change-amount {
    background: rgba(251, 191, 36, 0.2);
}