/* ════════════════════════════════════════════════════════════════
   PAPER.IO 2 - UI & HUD
   ════════════════════════════════════════════════════════════════ */

#game-screen {
    background: #d4d4d4;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ════════════════════════════════════════════════════════════════
   HUD
   ════════════════════════════════════════════════════════════════ */

.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.hud > * {
    pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════
   SCORE JOUEUR
   ════════════════════════════════════════════════════════════════ */

.player-score {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.player-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.3rem;
}

.territory-percent {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.kills-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

/* ════════════════════════════════════════════════════════════════
   TIMER
   ════════════════════════════════════════════════════════════════ */

.timer {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════
   LEADERBOARD
   ════════════════════════════════════════════════════════════════ */

.leaderboard {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 1rem;
    pointer-events: none;
}

.leaderboard-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.8rem;
    text-align: center;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.leaderboard-rank {
    font-weight: 800;
    width: 20px;
    text-align: center;
}

.leaderboard-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.leaderboard-territory {
    font-weight: 800;
    color: var(--accent);
}

.leaderboard-item.player {
    background: rgba(0, 210, 255, 0.2);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    margin: -0.3rem -0.5rem;
}

/* ════════════════════════════════════════════════════════════════
   KILL FEED
   ════════════════════════════════════════════════════════════════ */

.kill-feed {
    position: absolute;
    top: 100px;
    left: 20px;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.kill-message {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border-left: 4px solid;
    animation: slideInLeft 0.3s ease;
}

/* ════════════════════════════════════════════════════════════════
   KILL BANNER
   ════════════════════════════════════════════════════════════════ */

.kill-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: killBannerPop 1.5s ease-out;
}

.kill-banner.hidden {
    display: none;
}

/* ════════════════════════════════════════════════════════════════
   POWERUP BAR
   ════════════════════════════════════════════════════════════════ */

.powerup-bar {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    pointer-events: none;
}

.powerup-active {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 0.6rem 1rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid;
    animation: popIn 0.3s ease;
}

.powerup-icon {
    font-size: 1.5rem;
}

.powerup-timer {
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
    min-width: 30px;
}

/* ════════════════════════════════════════════════════════════════
   MINIMAP
   ════════════════════════════════════════════════════════════════ */

.minimap-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 130px;
    height: 130px;
    background: #1a1a2e;
    border-radius: 8px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    pointer-events: none;
}

#minimap-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ════════════════════════════════════════════════════════════════
   DANGER BORDER
   ════════════════════════════════════════════════════════════════ */

.danger-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 10px solid rgba(231, 76, 60, 0.6);
    pointer-events: none;
    animation: dangerPulse 0.5s infinite;
}

.danger-border.hidden {
    display: none;
}

/* ════════════════════════════════════════════════════════════════
   XP BAR
   ════════════════════════════════════════════════════════════════ */

.xp-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.xp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3a7bd5 0%, #00d2ff 100%);
    transition: width 0.5s ease;
}

/* ════════════════════════════════════════════════════════════════
   JOYSTICK VIRTUEL
   ════════════════════════════════════════════════════════════════ */

.joystick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 130px;
    height: 130px;
    display: none;
    z-index: 100;
}

@media (hover: none) {
    .joystick-container {
        display: block;
    }
}

.joystick-base {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    touch-action: none;
}

.joystick-stick {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.8) 0%, rgba(58, 123, 213, 0.6) 100%);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ════════════════════════════════════════════════════════════════
   GAME OVER
   ════════════════════════════════════════════════════════════════ */

.gameover-container {
    max-width: 500px;
    width: 90%;
    padding: 2.5rem;
    background: var(--bg-panel);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: popIn 0.4s ease;
}

.gameover-emoji {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 0.6s ease;
}

.gameover-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.gameover-killer {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent);
}

.rewards {
    margin-bottom: 1.5rem;
}

.reward-item {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    margin-bottom: 0.8rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.achievements-unlocked {
    margin-bottom: 1.5rem;
}

.achievement-item {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideUp 0.5s ease;
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-info {
    flex: 1;
    text-align: left;
}

.achievement-name {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.achievement-reward {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}

.gameover-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

/* ════════════════════════════════════════════════════════════════
   MOBILE ADJUSTMENTS
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .player-score {
        top: 10px;
        padding: 0.8rem 1.5rem;
    }
    
    .territory-percent {
        font-size: 2rem;
    }
    
    .timer {
        top: 10px;
        left: 10px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .leaderboard {
        top: 10px;
        right: 10px;
        width: 160px;
        padding: 0.8rem;
    }
    
    .kill-feed {
        top: 80px;
        left: 10px;
        width: 200px;
    }
    
    .minimap-container {
        bottom: 170px;
        right: 10px;
        width: 110px;
        height: 110px;
    }
    
    .joystick-container {
        bottom: 20px;
        left: 20px;
        width: 110px;
        height: 110px;
    }
    
    .joystick-stick {
        width: 45px;
        height: 45px;
    }
}
