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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-image {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    animation: fadeIn 1s ease-in-out;
}

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

.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#gameCanvas {
    display: block;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    image-rendering: pixelated;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.top-bar {
    background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);
    padding: 15px 20px;
    border-bottom: 2px solid #8b0000;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.5);
    display: none;
}

.player-stats {
    display: flex;
    gap: 30px;
    align-items: center;
}

.stat-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: #888;
    font-weight: bold;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 24px;
    color: #ff6b35;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.health-bar {
    width: 200px;
    height: 25px;
    background: rgba(50, 0, 0, 0.8);
    border: 2px solid #8b0000;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc143c 0%, #8b0000 100%);
    transition: width 0.3s ease;
    width: 100%;
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.5);
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    z-index: 1;
}

.abilities-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 10px;
    pointer-events: all;
}

.ability {
    width: 60px;
    height: 60px;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid #8b0000;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.ability:hover {
    transform: translateY(-5px);
    border-color: #ff0000;
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.5);
}

.ability-icon {
    font-size: 28px;
}

.ability-key {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 10px;
    background: rgba(139, 0, 0, 0.8);
    padding: 2px 5px;
    border-radius: 3px;
}

.inventory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    background: rgba(20, 20, 20, 0.98);
    border: 3px solid #8b0000;
    border-radius: 15px;
    padding: 30px;
    pointer-events: all;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.8);
    display: none;
    z-index: 100;
}

.inventory.open {
    display: block;
}

.inventory-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #ff6b35;
    text-align: center;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.inventory-slot {
    width: 80px;
    height: 80px;
    background: rgba(50, 0, 0, 0.5);
    border: 2px solid #8b0000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-slot:hover {
    background: rgba(139, 0, 0, 0.7);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.inventory-slot.legendary {
    border-color: #ffa500;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.8);
}

.inventory-slot.rare {
    border-color: #0080ff;
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.8);
}

/* Ability Manager Modal */
.ability-manager {
    display: flex;
    gap: 40px;
    padding: 20px;
}

.ability-section {
    flex: 1;
}

.ability-section h2 {
    color: #ff6b35;
    margin-bottom: 15px;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.ability-inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border: 2px solid #8b0000;
    border-radius: 10px;
}

.ability-inventory-grid .inventory-slot {
    width: 70px;
    height: 70px;
    font-size: 32px;
    cursor: grab;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ability-inventory-grid .inventory-slot:active {
    cursor: grabbing;
}

.ability-level-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid #fff;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ability-hotbar {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #8b0000;
    border-radius: 10px;
}

.ability-hotbar-slot {
    width: 80px;
    height: 80px;
    background: rgba(50, 0, 0, 0.5);
    border: 3px solid #8b0000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    transition: all 0.2s;
}

.ability-hotbar-slot .ability-level-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
}

.ability-hotbar-slot.has-ability {
    border-color: #ff6b35;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.ability-hotbar-slot.drag-over {
    background: rgba(255, 107, 53, 0.3);
    border-color: #ff6b35;
    transform: scale(1.1);
}

.hotbar-key {
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 12px;
    background: rgba(139, 0, 0, 0.9);
    padding: 3px 7px;
    border-radius: 4px;
    font-weight: bold;
}

.ability-tooltip {
    position: fixed;
    background: linear-gradient(135deg, rgba(20, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.98) 100%);
    border: 3px solid #ff6b35;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 350px;
    min-width: 250px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4), inset 0 0 20px rgba(255, 107, 53, 0.1);
}

.tooltip-title {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(255, 107, 53, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    padding-bottom: 8px;
}

.tooltip-description {
    font-size: 14px;
    color: #ddd;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ability-slot {
    width: 60px;
    height: 60px;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid #8b0000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 32px;
}

.ability-slot .ability-key {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 10px;
    background: rgba(139, 0, 0, 0.8);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 1;
}

.ability-slot .ability-level-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
}

/* Login Form */
.login-form {
    padding: 20px;
}

.login-input {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    background: rgba(20, 0, 0, 0.8);
    border: 2px solid #8b0000;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.login-input::placeholder {
    color: #888;
}

.controls-info {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    color: #888;
    border: 1px solid #333;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 50px;
    border: 3px solid #8b0000;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.8);
}

.game-over h1 {
    font-size: 48px;
    color: #dc143c;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
}

.game-over p {
    font-size: 24px;
    margin: 15px 0;
    color: #ff6b35;
}

.game-over button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 20px;
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    color: white;
    border: 2px solid #8b0000;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 2px;
    transition: all 0.3s;
    pointer-events: all;
}

.game-over button:hover {
    background: linear-gradient(135deg, #ff0000 0%, #dc143c 100%);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
}

.hidden {
    display: none;
}

.damage-number {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 2px 2px 4px #000;
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
    z-index: 50;
}

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

.critical {
    color: #ffff00 !important;
    font-size: 32px !important;
    text-shadow: 0 0 10px #ffff00;
}

.tutorial {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999; /* Très haut pour être au-dessus de tout */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.tutorial-content {
    background: linear-gradient(135deg, #1a0000 0%, #0a0a0a 100%);
    border: 3px solid #8b0000;
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.8);
}

.tutorial-content h1 {
    font-size: 32px;
    color: #dc143c;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
}

.tutorial-content h2 {
    font-size: 20px;
    color: #ff6b35;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tutorial-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(139, 0, 0, 0.3);
}

.tutorial-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #ccc;
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-item {
    font-size: 16px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.key {
    background: rgba(139, 0, 0, 0.5);
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: bold;
    color: #ff6b35;
    border: 1px solid #8b0000;
    min-width: 80px;
    text-align: center;
}

.enemy-types {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 16px;
}

.enemy-types div {
    color: #ccc;
}

.start-button {
    width: 100%;
    margin-top: 30px;
    padding: 20px;
    font-size: 24px;
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    color: white;
    border: 3px solid #ff0000;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 3px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.start-button:hover {
    background: linear-gradient(135deg, #ff0000 0%, #dc143c 100%);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
}

/* Lobby Style */
.lobby {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: all;
}

#lobbyCanvas {
    display: block;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    width: 100%;
    height: 100%;
}

.lobby-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.lobby-title {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 54px;
    color: #dc143c;
    text-align: center;
    text-shadow: 0 0 30px rgba(220, 20, 60, 1);
    letter-spacing: 5px;
    animation: pulse 2s ease-in-out infinite;
    white-space: nowrap;
    z-index: 1; /* Le plus bas pour être derrière tout */
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 0 0 30px rgba(220, 20, 60, 0.8);
    }
    50% {
        text-shadow: 0 0 50px rgba(220, 20, 60, 1);
    }
}

.lobby-buttons {
    pointer-events: all;
}

.play-button {
    position: absolute;
    bottom: 50px;
    right: 50px;
}

.tutorial-button {
    position: absolute;
    bottom: 180px;
    right: 50px;
}

.stats-button {
    position: absolute;
    top: 150px;
    left: 50px;
}

.lobby-button {
    width: 400px;
    padding: 25px 40px;
    font-size: 28px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(10, 10, 10, 0.9) 100%);
    color: white;
    border: 3px solid #8b0000;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 3px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.lobby-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(139, 0, 0, 0.8);
    border-color: #ff0000;
}

.play-button:hover {
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
}

.tutorial-button:hover {
    background: linear-gradient(135deg, #0066cc 0%, #003d7a 100%);
    border-color: #0080ff;
    box-shadow: 0 10px 40px rgba(0, 128, 255, 0.6);
}

.stats-button:hover {
    background: linear-gradient(135deg, #ff8c00 0%, #cc6f00 100%);
    border-color: #ffa500;
    box-shadow: 0 10px 40px rgba(255, 165, 0, 0.6);
}

.button-icon {
    font-size: 36px;
}

.button-text {
    font-size: 24px;
}

/* Modal Style */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, #1a0000 0%, #0a0a0a 100%);
    border: 3px solid #8b0000;
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.8);
    position: relative;
}

.modal-content h1 {
    font-size: 32px;
    color: #dc143c;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 40px;
    font-weight: bold;
    color: #ff6b35;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.close-button:hover {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    transform: scale(1.2);
}

/* Account Button */
.account-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(10, 10, 10, 0.9) 100%);
    border: 3px solid #8b0000;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    pointer-events: all;
    z-index: 10;
}

.account-button:hover {
    transform: scale(1.1);
    border-color: #ff0000;
    box-shadow: 0 10px 40px rgba(139, 0, 0, 0.8);
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
}

.music-button {
    position: absolute;
    top: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(10, 10, 10, 0.9) 100%);
    border: 3px solid #8b0000;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.music-button:hover {
    transform: scale(1.1);
    border-color: #ff0000;
    box-shadow: 0 10px 40px rgba(139, 0, 0, 0.8);
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
}

.bug-button {
    position: absolute;
    top: 160px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4400 0%, #aa2200 100%);
    border: 3px solid #ff5522;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(255, 68, 0, 0.5);
    z-index: 1000;
}

.bug-button:hover {
    transform: scale(1.1);
    border-color: #ff6633;
    box-shadow: 0 10px 40px rgba(255, 68, 0, 0.8);
    background: linear-gradient(135deg, #ff5522 0%, #ff4400 100%);
}

/* Profile Panel (sidebar) */
.profile-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, #1a0000 0%, #0a0a0a 100%);
    border-left: 3px solid #8b0000;
    box-shadow: -5px 0 30px rgba(139, 0, 0, 0.8);
    z-index: 250;
    transition: right 0.3s ease;
    overflow-y: auto;
    pointer-events: all;
}

.profile-panel.open {
    right: 0;
}

.profile-panel-header {
    background: rgba(139, 0, 0, 0.3);
    padding: 20px;
    border-bottom: 2px solid #8b0000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-panel-header h2 {
    color: #ff6b35;
    font-size: 24px;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.close-panel-button {
    font-size: 32px;
    font-weight: bold;
    color: #ff6b35;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.close-panel-button:hover {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    transform: scale(1.2);
}

.profile-panel-content {
    padding: 30px 20px;
}

.profile-info {
    background: rgba(139, 0, 0, 0.1);
    border: 2px solid #8b0000;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.profile-field {
    margin-bottom: 20px;
}

.profile-field label {
    display: block;
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 1px;
}

.profile-field span {
    display: block;
    color: #ff6b35;
    font-size: 18px;
    font-weight: bold;
}

.profile-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(20, 0, 0, 0.8);
    border: 2px solid #8b0000;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

.profile-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.5);
}

.profile-save-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff8800 0%, #cc6600 100%);
    border: 2px solid #ff8800;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.profile-save-button:hover {
    background: linear-gradient(135deg, #ffa500 0%, #ff8800 100%);
    box-shadow: 0 5px 20px rgba(255, 165, 0, 0.6);
    transform: translateY(-2px);
}

.profile-stats {
    background: rgba(139, 0, 0, 0.1);
    border: 2px solid #8b0000;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.profile-stats h3 {
    color: #ff6b35;
    font-size: 18px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.profile-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
    color: #ccc;
    font-size: 14px;
}

.profile-stat-item:last-child {
    border-bottom: none;
}

.profile-stat-item span:last-child {
    color: #ff6b35;
    font-weight: bold;
}

.profile-settings-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #444444 0%, #222222 100%);
    border: 2px solid #666666;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-settings-button:hover {
    background: linear-gradient(135deg, #666666 0%, #444444 100%);
    box-shadow: 0 5px 20px rgba(100, 100, 100, 0.6);
    transform: translateY(-2px);
}

/* Settings Panel */
.settings-section {
    background: rgba(139, 0, 0, 0.1);
    border: 2px solid #8b0000;
    border-radius: 10px;
    padding: 20px;
}

.settings-section h3 {
    color: #ff6b35;
    font-size: 18px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.volume-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.volume-control label {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.volume-control input[type="range"] {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, #8b0000 0%, #dc143c 100%);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    transition: all 0.3s;
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 0, 0, 1);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    transition: all 0.3s;
    border: none;
}

.volume-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(255, 0, 0, 1);
}

.volume-control span {
    color: #ff6b35;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

.settings-credits-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4a4a8b 0%, #2a2a5a 100%);
    border: 2px solid #4a4a8b;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

.settings-credits-button:hover {
    background: linear-gradient(135deg, #6a6aab 0%, #4a4a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 74, 139, 0.5);
}

.controls-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid #8b0000;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    transition: all 0.2s;
}

.control-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.control-action {
    color: #aaa;
    font-size: 16px;
}

.control-key {
    color: #ff6b35;
    font-weight: bold;
    font-size: 16px;
    background: rgba(139, 0, 0, 0.3);
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid #8b0000;
    text-shadow: 0 0 5px rgba(255, 107, 53, 0.5);
}

.remap-button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #8b0000;
    color: #ff6b35;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    margin-left: 10px;
}

.remap-button:hover {
    background: rgba(139, 0, 0, 0.5);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.8);
}

.settings-logout-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8b0000 0%, #4a0000 100%);
    border: 2px solid #8b0000;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.settings-logout-button:hover {
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    box-shadow: 0 5px 20px rgba(220, 20, 60, 0.6);
    transform: translateY(-2px);
}

.settings-delete-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #660000 0%, #330000 100%);
    border: 2px solid #660000;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-delete-button:hover {
    background: linear-gradient(135deg, #990000 0%, #660000 100%);
    box-shadow: 0 5px 20px rgba(153, 0, 0, 0.8);
    transform: translateY(-2px);
}

/* Credits Modal Styles */
.credits-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.credits-container {
    position: relative;
    width: 70%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #1a0000 0%, #0a0a0a 100%);
    border: 3px solid #8b0000;
    border-radius: 20px;
    padding: 30px;
    padding-top: 60px;
    box-shadow: 0 10px 50px rgba(139, 0, 0, 0.8);
    z-index: 1000000 !important;
}

.credits-close-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(139, 0, 0, 0.8);
    border: 2px solid #8b0000;
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: bold;
    line-height: 1;
}

.credits-close-button:hover {
    background: #8b0000;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(139, 0, 0, 1);
}

.credits-content {
    text-align: center;
}

.credits-title {
    font-size: 0.1px;
    color: #ff0000;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    margin-bottom: 40px;
    animation: pulse 2s infinite;
    position: relative;
    z-index: 1000001 !important;
}

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

.credits-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.credits-item {
    background: rgba(139, 0, 0, 0.2);
    border: 2px solid #8b0000;
    border-radius: 15px;
    padding: 18px;
    transition: all 0.3s;
}

.credits-item:hover {
    background: rgba(139, 0, 0, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.5);
}

.credits-item h2 {
    font-size: 20px;
    color: #ff6b35;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
}

.credits-item p {
    font-size: 16px;
    color: #fff;
    font-weight: bold;
}

.credits-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #8b0000;
    color: #999;
    font-size: 14px;
}

.credits-footer p {
    margin: 10px 0;
}

/* Shop Modal Styles */
.shop-balance {
    text-align: center;
    font-size: 24px;
    color: #ffd700;
    margin: 20px 0;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.shop-tab {
    padding: 12px 30px;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    border: 2px solid #00ff00;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-tab:hover {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.shop-tab.active {
    background: linear-gradient(135deg, #00ff00 0%, #00aa00 100%);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.shop-item {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 3px solid #00ff00;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 255, 0, 0.6);
}

.shop-item.purchased {
    border-color: #888;
    opacity: 0.6;
    cursor: not-allowed;
}

.shop-item.purchased:hover {
    transform: none;
    box-shadow: none;
}

.shop-item-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.shop-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #00ff00;
    margin-bottom: 8px;
}

.shop-item-desc {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 12px;
    min-height: 40px;
}

.shop-item-price {
    font-size: 20px;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 10px;
}

.shop-item-level {
    font-size: 14px;
    color: #00ffff;
    margin-bottom: 10px;
}

.shop-buy-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #00ff00 0%, #00aa00 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-buy-button:hover {
    background: linear-gradient(135deg, #00ff00 0%, #00ff00 100%);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    transform: scale(1.05);
}

.shop-buy-button:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Achievements Modal Styles */
.achievements-progress {
    text-align: center;
    font-size: 20px;
    color: #ffd700;
    margin: 15px 0 25px 0;
    font-weight: bold;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.achievement-item {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 3px solid #555;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.achievement-item.unlocked {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.achievement-icon {
    font-size: 48px;
    filter: grayscale(100%);
}

.achievement-item.unlocked .achievement-icon {
    filter: grayscale(0%);
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    color: #888;
    margin-bottom: 5px;
}

.achievement-item.unlocked .achievement-name {
    color: #ffd700;
}

.achievement-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.achievement-item.unlocked .achievement-desc {
    color: #aaa;
}

.achievement-reward {
    font-size: 14px;
    color: #00ff00;
    font-weight: bold;
}

.achievement-progress {
    font-size: 12px;
    color: #00ffff;
    margin-top: 5px;
}

.achievement-level {
    font-size: 12px;
    color: #ff8c00;
    margin-top: 5px;
    font-weight: bold;
}

.achievement-complete {
    font-size: 14px;
    color: #00ff00;
    font-weight: bold;
    margin-top: 5px;
}

.achievement-progress-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b0000 0%, #dc143c 100%);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.8);
}

.tiered-achievement {
    border-color: #ff8c00;
}

.tiered-achievement.max-level {
    border-color: #ffd700;
    background: linear-gradient(135deg, #2a2a00 0%, #1a1a00 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.tiered-achievement.max-level .achievement-icon {
    filter: grayscale(0%);
    animation: pulse 2s infinite;
}

.tiered-achievement.max-level .achievement-name {
    color: #ffd700;
    font-size: 20px;
}

/* Mode Selection Modal Styles */
.mode-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.mode-button {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 3px solid #00ff00;
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.mode-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.6);
    border-color: #00ffff;
}

.mode-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.mode-name {
    font-size: 24px;
    font-weight: bold;
    color: #00ff00;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.mode-desc {
    font-size: 16px;
    color: #aaa;
    line-height: 1.5;
}

/* Combo Display Styles */
.combo-display {
    position: fixed;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.95) 0%, rgba(255, 100, 0, 0.95) 100%);
    border: 3px solid #ff0000;
    border-radius: 15px;
    padding: 15px 30px;
    z-index: 1000;
    animation: pulse 0.5s ease-in-out infinite;
}

.combo-text {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #ff0000;
}

.combo-multiplier {
    font-size: 24px;
    color: #ffd700;
    margin-top: 5px;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
}

/* Boutons en jeu (côté gauche) */
.ingame-buttons {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: all;
    z-index: 100;
}

.ingame-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8b0000;
    border-radius: 8px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.5);
}

.ingame-btn:hover {
    background: rgba(139, 0, 0, 0.9);
    border-color: #ff0000;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.8);
}

/* Modal de Bienvenue */
.welcome-modal-content {
    max-width: 600px;
    text-align: center;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid #8b0000;
}

.welcome-message p {
    font-size: 20px;
    color: #fff;
    margin: 0;
    line-height: 1.6;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
