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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Menu principal */
#menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 160px;
}

.menu-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Items List */
.items-list-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.items-list-container h3 {
    font-size: 1.6em;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 300px;
}

.item-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.item-entry:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.item-entry:hover::after {
    content: attr(title);
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.item-icon {
    width: 40px;
    height: 40px;
    background-image: url('assets/items_icons.png');
    background-size: 120px 120px;
    image-rendering: pixelated;
}

/* Item sprite positions (40x40 sprites in a 3x3 grid) */
.item-icon[data-item="healthpack"] { background-position: 0 0; }
.item-icon[data-item="rocket"] { background-position: 0 -40px; }
.item-icon[data-item="bomb"] { background-position: 0 -80px; }
.item-icon[data-item="superboost"] { background-position: -40px 0; }
.item-icon[data-item="poisonslick"] { background-position: -40px -80px; }
.item-icon[data-item="lightning"] { background-position: -80px -40px; }
.item-icon[data-item="icebeam"] { background-position: -40px -40px; }
.item-icon[data-item="rotorshield"] { background-position: -80px 0; }
.item-icon[data-item="sideforce"] { background-position: -80px -80px; }

.item-name {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* Social Media Container */
.social-media-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 200px;
}

.social-media-container h3 {
    font-size: 1.6em;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #4ecdc4, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

.contact-email {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    letter-spacing: 1px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
}

.menu-container h1 {
    font-size: 3em;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-form {
    margin-bottom: 30px;
}

.menu-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
}

#pseudo {
    width: 300px;
    padding: 12px;
    margin: 0 auto 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    display: block;
}

#pseudo:focus {
    border-color: #4ecdc4;
    outline: none;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

#pseudo::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

button {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.4);
}

button:hover::before {
    transform: rotate(45deg) translateX(100%);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.controls-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 30px;
    border-radius: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}


.controls-info h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px rgba(147, 51, 234, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.controls-info h3::before,
.controls-info h3::after {
    content: '⚡';
    font-size: 1.2em;
    animation: iconPulse 2s ease-in-out infinite;
}

.controls-columns {
    display: flex;
    gap: 30px;
    justify-content: center;
    width: 100%;
}

.controls-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.controls-info p {
    margin: 0;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    user-select: none;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
}

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

.controls-info p:hover {
    transform: translateX(10px);
    background: rgba(147, 51, 234, 0.2);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.3);
}

.controls-info p:hover::before {
    left: 100%;
}

.control-key {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 70px;
    display: inline-block;
    text-align: center;
    box-shadow: 0 3px 10px rgba(147, 51, 234, 0.4);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.control-action {
    color: #fff;
    font-weight: 500;
    text-transform: capitalize;
    flex: 1;
    text-align: left;
}

/* Lobby */
.lobby-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    min-width: 400px;
    max-width: 1380px;
    margin: 0 auto;
}

/* New wrapper for side-by-side content */
.lobby-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    margin: 20px 0;
}

/* Left side content */
.lobby-left-content {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.room-code {
    font-size: 1.5em;
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Sélecteur de couleur dans le lobby */
.lobby-color-selector {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-align: center;
}

.lobby-color-selector label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #fff;
    opacity: 0.9;
}

.lobby-color-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lobby-color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.lobby-color-option:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.15);
}

.lobby-color-option.selected {
    border-color: #4ecdc4;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.6);
}

.lobby-color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

@keyframes colorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.1); }
}

@keyframes colorFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.players-list {
    margin: 20px 0;
    text-align: left;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Jeu */
#game {
    background: url('assets/ui_background.png') no-repeat center center;
    background-size: cover;
}

#gameCanvas {
    display: block;
    background: #2a2a2a;
    border-radius: 16px;
    border: 6px double #00ffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

#gameUI {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.item-slot {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #fff;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.minimap {
    width: 150px;
    height: 100px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #fff;
    border-radius: 10px;
    position: relative;
}

.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 100;
}

/* Résultats */
.results-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    min-width: 400px;
}

.ranking {
    margin: 20px 0;
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.rank-position {
    font-weight: bold;
    font-size: 1.2em;
}

.rank-player {
    display: flex;
    align-items: center;
}

.rank-time {
    font-family: monospace;
}

@keyframes checkpointPulse {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) scale(1.1);
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes warningPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes lapDissolve {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0px);
    }
    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.1);
        filter: blur(2px);
    }
    99% {
        opacity: 0.01;
        transform: translate(-50%, -50%) scale(1.2);
        filter: blur(10px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
        filter: blur(10px);
        visibility: hidden;
    }
}

@keyframes lapZoom {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-5deg);
        opacity: 0;
        filter: blur(10px);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15) rotate(2deg);
        filter: blur(0px);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
}

/* Styles pour les nouvelles notifications */
.checkpoint-notification {
    pointer-events: none;
}

.lap-notification {
    pointer-events: none;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.time-warning {
    pointer-events: none;
}

/* Room sections wrapper */
.room-sections-wrapper {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

/* Styles pour le menu */
.menu-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.menu-section button {
    width: 200px;
    margin: 10px 0;
}

.menu-section h3 {
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
}

.join-code-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

#roomCodeInput {
    width: 120px;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 5px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
}

#roomCodeInput:focus {
    border-color: #4ecdc4;
    outline: none;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

#roomCodeInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: normal;
}

/* Styles pour le lobby */
.room-info {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.room-type {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #4ecdc4;
    font-weight: bold;
}

#roomCode {
    display: block !important;
    min-height: 60px !important;
    max-width: 250px !important;
}

.room-code {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 8px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    margin: 10px auto;
    text-align: center;
    min-width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.room-code::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.room-code.public {
    font-size: 2em;
    background: rgba(0, 150, 255, 0.3);
    border: 2px solid rgba(0, 150, 255, 0.6);
    letter-spacing: 5px;
    padding: 15px 30px;
}

/* Animations pour les notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Style de la notification de partage */
.room-share-info {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 350px;
    transition: all 0.3s ease;
}

.room-share-info:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.share-icon {
    font-size: 2em;
}

.share-text {
    flex: 1;
}

.share-text strong {
    color: #4ecdc4;
    font-size: 1.2em;
    letter-spacing: 2px;
}

.share-text small {
    opacity: 0.8;
    font-size: 0.9em;
}

/* Amélioration du style des codes publics */
.room-code.public {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a3aa 100%);
    font-size: 2.2em;
}

/* Tooltip au survol du code */
#roomCode {
    cursor: pointer;
    position: relative;
}

#roomCode:hover::after {
    content: "Cliquez pour copier";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.5em;
    letter-spacing: normal;
    white-space: nowrap;
}

/* Styles pour le timer de rematch */
.rematch-timer {
    border: 2px solid #ff6b6b;
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0%, 100% {
        border-color: #ff6b6b;
    }
    50% {
        border-color: #ffaa44;
    }
}

/* Amélioration du bouton de l'hôte */
#startGame.host-button {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    font-size: 1.1em;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

#startGame.host-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

/* Styles pour les votes de rematch */
.results-actions {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

#playAgain {
    position: relative;
    overflow: hidden;
}

#playAgain.voted {
    background: linear-gradient(45deg, #4ecdc4, #44a3aa);
}

#playAgain.voted::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

/* Indicateur d'hôte dans la liste des joueurs */
.player-item.is-host {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Badge d'hôte animé */
.host-badge {
    display: inline-block;
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Notification de changement d'hôte */
.host-change-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.9);
    color: #333;
    padding: 20px 40px;
    border-radius: 20px;
    font-size: 1.3em;
    font-weight: bold;
    z-index: 1000;
    animation: hostChangeZoom 0.6s ease-out;
}

@keyframes hostChangeZoom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* États du bouton démarrer selon le rôle */
.lobby-actions {
    margin-top: 30px;
    text-align: center;
}

#startGame.waiting {
    background: linear-gradient(45deg, #808080, #a0a0a0);
    cursor: wait;
}

#startGame.ready {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
}

/* Amélioration de l'affichage du statut dans le lobby */
.player-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.status-icon {
    font-size: 1.2em;
}

.status-text {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Animation pour le bouton prêt */
@keyframes readyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

#startGame:not(:disabled):not(.waiting) {
    animation: readyPulse 2s ease-in-out infinite;
}

/* Notifications de jeu */
.game-notification {
    pointer-events: none;
}

/* Styles pour les notifications de fin */
.finish-notification {
    display: flex;
    gap: 15px;
    align-items: center;
}

.finish-position {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffd700;
}

.finish-player {
    flex: 1;
}

.finish-time {
    font-family: monospace;
    font-size: 1.1em;
}

/* Message personnel de fin */
.personal-finish {
    pointer-events: none;
}

.finish-position-big {
    font-size: 3em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
}

.finish-time-big {
    font-size: 2em;
    font-family: monospace;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes finishZoom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Animation pour les notifications */
@keyframes notificationSlide {
    0% {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Sélecteur de maps */
.map-selector {
    flex: 1;
    min-width: 647px;
    max-width: 647px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    height: fit-content;
    transition: opacity 0.3s ease;
}

/* Style for non-host view */
.map-selector[style*="pointer-events: none"] {
    position: relative;
}

.map-selector[style*="pointer-events: none"]::after {
    content: "Only host can select";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffaa00;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1em;
    z-index: 10;
    pointer-events: none;
}

.map-selector h3 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2em;
}

.map-selector-container {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    flex: 1;
    overflow: hidden;
}

.map-item {
    position: relative;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
}

.map-item:hover {
    transform: scale(1.05);
    border-color: #4ecdc4;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.5);
}

.map-item.selected {
    border-color: #ffd700;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.6);
}

.map-item.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ffd700;
    color: #000;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.map-thumbnail {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
    background-size: cover;
    background-position: center;
}

.map-name {
    padding: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.9em;
    text-align: center;
    font-weight: bold;
}

.map-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.map-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #4ecdc4;
    transform: scale(1.1);
}

.map-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.map-nav-btn:disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Animation de chargement des maps */
@keyframes mapFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.map-item {
    animation: mapFadeIn 0.3s ease-out;
}

/* Placeholder quand pas d'image */
.map-thumbnail.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2em;
}

/* Style spécifique pour la map random */
.map-thumbnail.random-map {
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    font-size: 3em;
    font-weight: bold;
    animation: randomMapPulse 2s ease-in-out infinite;
}

@keyframes randomMapPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
    }
}

/* Animation pulse pour la sélection */
@keyframes mapPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

.map-item.pulse {
    animation: mapPulse 0.5s ease-out;
}


/* Écran d'accueil */
.splash-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.splash-title {
    font-size: 5em;
    margin-bottom: 50px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.play-button {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    border: none;
    padding: 30px 80px;
    border-radius: 50px;
    color: white;
    font-size: 2.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.3);
    animation: buttonFloat 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

@keyframes buttonFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(147, 51, 234, 0.5);
}

.play-button:hover::before {
    transform: rotate(45deg) translateX(100%);
}

.play-button:active {
    transform: scale(0.95);
}

.splash-subtitle {
    margin-top: 30px;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.8;
}

/* Overlay sombre pour améliorer la lisibilité */
.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* Masquer la vidéo quand on est sur l'écran de jeu */
#game:not(.hidden) ~ .background-video {
    display: none;
}

/* Contrôle de volume global */
.volume-control {
    position: fixed;
    bottom: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    transform: scale(0.85);
}

/* Masquer sur l'écran d'accueil */
#splash:not(.hidden) ~ .volume-control {
    display: none;
}

.volume-control:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(78, 205, 196, 0.5);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
}

.volume-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.volume-slider {
    width: 80px;
    height: 18px; /* Augmenter la hauteur pour avoir plus d'espace */
    -webkit-appearance: none;
    appearance: none;
    background: transparent; /* Fond transparent */
    outline: none;
    cursor: pointer;
    position: relative;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Style du curseur */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4ecdc4;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Solution : utiliser transform pour centrer */
    margin-top: -5px; /* (hauteur thumb - hauteur track) / 2 = (16 - 6) / 2 = 5 */
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4ecdc4;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #45b7d1;
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(78, 205, 196, 0.6);
}

.volume-slider::-moz-range-thumb:hover {
    background: #45b7d1;
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(78, 205, 196, 0.6);
}

/* Barre de progression */
.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: linear-gradient(to right, 
        #4ecdc4 0%, 
        #4ecdc4 var(--volume-percent, 30%), 
        rgba(255, 255, 255, 0.2) var(--volume-percent, 30%), 
        rgba(255, 255, 255, 0.2) 100%);
    border-radius: 3px;
    position: relative;
}

/* Style pour Firefox */
.volume-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Progress pour Firefox */
.volume-slider::-moz-range-progress {
    height: 6px;
    background: #4ecdc4;
    border-radius: 3px;
}

/* Ajustement supplémentaire pour Chrome */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .volume-slider {
        height: 16px; /* Réduire la hauteur totale sur Chrome */
    }
}

.mute-button {
    background: none;
    border: none;
    padding: 5px;
    margin: 0;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.mute-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* État muté */
.volume-control.muted .volume-icon {
    opacity: 0.4;
}

.volume-control.muted .volume-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.volume-control.muted .mute-button {
    color: #ff6b6b;
}

/* Écran de chargement */
#loading {
    position: relative;
    background: #000;
}

.loading-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.loading-container {
    text-align: center;
    z-index: 10;
}

.loading-text {
    font-size: 3em;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(78, 205, 196, 0.8),
        0 0 20px rgba(78, 205, 196, 0.6),
        0 0 30px rgba(78, 205, 196, 0.4),
        0 0 40px rgba(147, 51, 234, 0.6);
    letter-spacing: 5px;
    margin-bottom: 40px;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.loading-bar-container {
    position: relative;
    width: 400px;
    height: 30px;
    margin: 0 auto 20px;
}

.loading-bar-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 15px;
    overflow: hidden;
}

.loading-bar-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
}

.loading-bar-fill {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 0%;
    height: calc(100% - 4px);
    background: linear-gradient(90deg, 
        #9333ea 0%, 
        #ec4899 50%, 
        #4ecdc4 100%);
    border-radius: 13px;
    transition: width 0.1s ease-out;
    box-shadow: 
        0 0 10px rgba(236, 72, 153, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.loading-bar-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(
        ellipse at center,
        rgba(236, 72, 153, 0.3) 0%,
        transparent 70%
    );
    opacity: 0;
    animation: loadingGlow 2s ease-in-out infinite;
}

@keyframes loadingGlow {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.loading-percentage {
    font-size: 1.5em;
    font-weight: bold;
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.8);
    font-family: 'Courier New', monospace;
}

/* Animation de scanlines pour l'effet rétro */
.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* Effet de distorsion chromatic aberration */
.loading-text::before,
.loading-text::after {
    content: 'LOADING...';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loading-text::before {
    animation: glitch-1 2.5s infinite;
    color: #ff00ff;
    z-index: -1;
}

.loading-text::after {
    animation: glitch-2 2.5s infinite;
    color: #00ffff;
    z-index: -1;
}

@keyframes glitch-1 {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    60% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(-2px, 2px);
    }
}

/* Infos de la map dans l'écran de chargement */
.loading-map-info {
    margin-top: 40px;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading-map-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 
        0 0 10px rgba(236, 72, 153, 0.8),
        0 0 20px rgba(147, 51, 234, 0.6);
}

.loading-map-thumbnail {
    width: 300px;
    height: 200px;
    margin: 0 auto;
    border-radius: 15px;
    border: 3px solid rgba(78, 205, 196, 0.6);
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #000;
    box-shadow: 
        0 0 30px rgba(78, 205, 196, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Effet de scan sur le thumbnail */
.loading-map-thumbnail::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        0deg,
        transparent 0%,
        rgba(78, 205, 196, 0.3) 50%,
        transparent 100%
    );
    animation: thumbnailScan 3s linear infinite;
}

@keyframes thumbnailScan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(200%);
    }
}

/* Placeholder si pas d'image */
.loading-map-thumbnail.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    color: rgba(255, 255, 255, 0.3);
}

/* Hint text */
.loading-hint {
    margin-top: 15px;
    font-size: 1em;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-style: italic;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
    animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Effet de lueur pulsante sur le thumbnail */
.loading-map-thumbnail {
    animation: thumbnailPulse 2s ease-in-out infinite;
}

@keyframes thumbnailPulse {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(78, 205, 196, 0.5),
            inset 0 0 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 
            0 0 50px rgba(78, 205, 196, 0.8),
            inset 0 0 30px rgba(0, 0, 0, 0.7);
    }
}

/* Transition de sortie de l'écran de chargement */
#loading.fade-out {
    animation: loadingFadeOut 0.8s ease-out forwards;
}

@keyframes loadingFadeOut {
    0% {
        opacity: 1;
        filter: blur(0px) brightness(1);
    }
    50% {
        opacity: 1;
        filter: blur(0px) brightness(1.5);
    }
    100% {
        opacity: 0;
        filter: blur(10px) brightness(2);
        transform: scale(1.1);
    }
}

/* Effet de flash blanc pour la transition */
.loading-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9) 0%, rgba(78, 205, 196, 0.6) 50%, transparent 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

.loading-flash.active {
    animation: flashEffect 0.6s ease-out;
}

@keyframes flashEffect {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Transition d'entrée pour l'écran de jeu */
#game.fade-in {
    animation: gameFadeIn 1s ease-out;
}

@keyframes gameFadeIn {
    0% {
        opacity: 0;
        filter: brightness(2) contrast(1.2);
        transform: scale(1.05);
    }
    50% {
        opacity: 0.5;
        filter: brightness(1.5) contrast(1.1);
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        filter: brightness(1) contrast(1);
        transform: scale(1);
    }
}

/* Effet de glitch pour la transition */
#loading.fade-out .loading-container {
    animation: glitchTransition 0.8s ease-out;
}

@keyframes glitchTransition {
    0%, 100% {
        transform: translate(0);
    }
    10% {
        transform: translate(-2px, 2px);
    }
    20% {
        transform: translate(2px, -2px);
    }
    30% {
        transform: translate(-1px, 1px);
    }
    40% {
        transform: translate(1px, -1px);
    }
    50% {
        transform: translate(-2px, 0) scale(1.02);
    }
    60% {
        transform: translate(2px, 0) scale(1.02);
    }
    70% {
        transform: translate(0, -2px) scale(1.01);
    }
    80% {
        transform: translate(0, 2px) scale(1.01);
    }
}

/* Animations pour le système d'HP - À ajouter dans style.css */

/* Animation des indicateurs de dégâts */
@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -150%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -250%);
    }
}

/* Animation de mort */
@keyframes deathZoom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Animation de respawn */
@keyframes respawnPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
}

/* Styles pour les notifications de dégâts */
.damage-indicator {
    font-family: 'Arial Black', sans-serif;
    user-select: none;
}

.death-notification {
    user-select: none;
}

.death-title {
    letter-spacing: 3px;
    animation: deathShake 0.5s ease-out;
}

@keyframes deathShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

.respawn-notification {
    letter-spacing: 2px;
    user-select: none;
}

/* Effet de pulsation pour la barre d'HP faible */
@keyframes hpCritical {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 68, 68, 1);
    }
}

/* Appliquer l'animation quand HP < 30% */
.health-bar-critical {
    animation: hpCritical 1s ease-in-out infinite;
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -150%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -250%);
    }
}

@keyframes deathZoom {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes respawnPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
}

@keyframes deathShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

/* Styles pour l'animation casino des objets */
@keyframes itemSlotSpin {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

/* Effet de super boost */
@keyframes superBoostGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 165, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 165, 0, 1);
    }
}

/* Animation de projectile */
@keyframes projectilePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Flash d'écran pour les hits */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    animation: screenFlashFade 0.3s ease-out;
}

@keyframes screenFlashFade {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
    }
}

/* Notification de dégâts */
.damage-indicator {
    font-family: 'Arial Black', sans-serif;
    user-select: none;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px currentColor;
}

.death-notification {
    user-select: none;
}

.death-title {
    letter-spacing: 3px;
}

.respawn-notification {
    letter-spacing: 2px;
    user-select: none;
}

/* Effet de pulsation pour la barre d'HP faible */
@keyframes hpCritical {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 68, 68, 1);
    }
}

/* Animation des boîtes d'objets */
@keyframes itemBoxFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
    }
}

@keyframes itemBoxGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
}

/* Effet de stun */
@keyframes stunStars {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animation d'explosion de projectile */
@keyframes explosionRing {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Interface d'objet dans le canvas */
.item-slot-active {
    animation: itemSlotGlow 1s ease-in-out infinite;
}

@keyframes itemSlotGlow {
    0%, 100% {
        border-color: #ffd700;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% {
        border-color: #ffed4e;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

/* Room Browser Styles */
.room-browser-content {
    width: 800px;
    max-width: 90vw;
}

.rooms-list {
    min-height: 540px;
    max-height: 540px;
    overflow-y: hidden;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.room-entry {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.room-entry::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;
}

.room-entry:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.15) 100%);
    transform: translateX(5px);
    border-color: rgba(78, 205, 196, 0.5);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.2);
}

.room-entry:hover::before {
    left: 100%;
}

.room-info-details {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-left: 20px;
    margin-right: 0;
}

.room-host {
    font-size: 1.1em;
    font-weight: bold;
    min-width: 130px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.room-map {
    font-size: 0.95em;
    color: #4ecdc4;
    min-width: 110px;
    text-transform: capitalize;
    font-weight: 500;
}

.room-map-thumbnail {
    width: 90px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(78, 205, 196, 0.3);
    flex-shrink: 0;
}

.room-map-thumbnail.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2em;
}

.room-players {
    font-size: 0.95em;
    color: #fff;
    min-width: 80px;
    text-align: center;
    background: rgba(78, 205, 196, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(78, 205, 196, 0.3);
    font-weight: 600;
    margin: 0 25px;
}

.room-join-btn {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.room-join-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.room-join-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5);
}

.room-join-btn:hover::before {
    transform: rotate(45deg) translateX(100%);
}

.room-join-btn:disabled {
    background: linear-gradient(45deg, #666, #555);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.rooms-empty {
    text-align: center;
    padding: 80px 40px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2em;
    font-weight: 500;
}

.room-browser-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn-action {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.4);
}

.btn-action:hover::before {
    transform: rotate(45deg) translateX(100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #ff5252, #ff4444);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    backdrop-filter: blur(5px);
}

.pagination-btn {
    background: rgba(78, 205, 196, 0.1);
    color: #4ecdc4;
    border: 2px solid rgba(78, 205, 196, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.2);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: #666;
    border-color: rgba(255, 255, 255, 0.1);
}

.pagination-info {
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Custom Alert Modal */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.custom-alert {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    animation: alertSlideIn 0.3s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.custom-alert-content p {
    color: white;
    font-size: 18px;
    margin-bottom: 25px;
    font-weight: 500;
}

.alert-ok-btn {
    background: linear-gradient(45deg, #9333ea, #ec4899);
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert-ok-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.alert-ok-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.4);
}

.alert-ok-btn:hover::before {
    transform: rotate(45deg) translateX(100%);
}

@keyframes alertSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Lobby Chat Styles */
.lobby-chat {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 2px solid rgba(78, 205, 196, 0.3);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.lobby-chat h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.7);
}

.chat-message {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

.chat-message.own-message {
    background: rgba(78, 205, 196, 0.2);
    margin-left: 20px;
}

.chat-message.system-message {
    background: rgba(255, 165, 0, 0.2);
    text-align: center;
    font-style: italic;
    color: #ffaa00;
}

.chat-message .message-author {
    font-weight: bold;
    margin-right: 5px;
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    display: inline;
}

.chat-message .message-text {
    color: #fff;
    font-size: 0.95em;
    display: inline;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(255, 255, 255, 0.15);
}

.chat-send-btn {
    padding: 10px 15px;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.chat-send-btn:active {
    transform: translateY(0);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

