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

body {
    font-family: 'Courier New', monospace;
    overflow: hidden;
    background: #87CEEB;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

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

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

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#instructions {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #8B4513;
    color: #fff;
    padding: 20px;
    border: 4px solid #000;
    border-top-color: #654321;
    border-left-color: #654321;
    border-bottom-color: #3D2817;
    border-right-color: #3D2817;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    max-width: 280px;
    box-shadow: 
        0 8px 0 #654321,
        0 8px 0 #000,
        0 12px 0 rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#instructions h2 {
    margin-bottom: 15px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#instructions p {
    margin: 8px 0;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#instructions strong {
    color: #FFD700;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#status {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #8B4513;
    color: #fff;
    padding: 20px;
    border: 4px solid #000;
    border-top-color: #654321;
    border-left-color: #654321;
    border-bottom-color: #3D2817;
    border-right-color: #3D2817;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    min-width: 280px;
    box-shadow: 
        0 8px 0 #654321,
        0 8px 0 #000,
        0 12px 0 rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#flowers-status {
    margin-bottom: 15px;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#stamina-container {
    margin-top: 15px;
}

#stamina-label {
    margin-bottom: 5px;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#stamina-bar {
    width: 100%;
    height: 20px;
    background: #654321;
    border: 2px solid #000;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

#stamina-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #00FF00, #90EE90);
    transition: width 0.1s linear;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

#flowers-count {
    color: #90EE90;
    font-weight: bold;
    font-size: 24px;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#game-over, #game-win {
    padding: 30px;
    margin-top: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    border: 4px solid #000;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
    box-shadow: 
        0 8px 0 rgba(0, 0, 0, 0.5),
        0 8px 0 #000,
        0 12px 0 rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    min-width: 400px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.end-game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.end-game-content h2 {
    margin: 0;
    font-size: 28px;
}

.end-game-content p {
    margin: 0;
    font-size: 18px;
    color: #FFD700;
}

.end-game-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.end-game-buttons .minecraft-button {
    font-size: 24px;
    padding: 15px 40px;
    min-width: 150px;
}

#game-over {
    background: #8B0000;
    color: #fff;
    border-top-color: #654321;
    border-left-color: #654321;
    border-bottom-color: #3D2817;
    border-right-color: #3D2817;
}

#game-win {
    background: #228B22;
    color: #fff;
    border-top-color: #32CD32;
    border-left-color: #32CD32;
    border-bottom-color: #006400;
    border-right-color: #006400;
}

.hidden {
    display: none !important;
}

#countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: none;
}

#countdown-text {
    font-family: 'Courier New', monospace;
    font-size: 120px;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 
        4px 4px 0px #000,
        -2px -2px 0px #000,
        2px -2px 0px #000,
        -2px 2px 0px #000,
        0 0 20px rgba(255, 215, 0, 0.8);
    text-align: center;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Menu style Minecraft */
#menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #5F9EA0 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

#menu.menu-hidden {
    opacity: 0;
    pointer-events: none;
}

#menu-content {
    text-align: center;
}

#menu-title {
    font-family: 'Courier New', monospace;
    font-size: 64px;
    color: #fff;
    text-shadow: 
        4px 4px 0px #000,
        -2px -2px 0px #000,
        2px -2px 0px #000,
        -2px 2px 0px #000;
    margin-bottom: 50px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.minecraft-button {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    padding: 20px 60px;
    background: #8B4513;
    color: #fff;
    border: 4px solid #000;
    border-top-color: #654321;
    border-left-color: #654321;
    border-bottom-color: #3D2817;
    border-right-color: #3D2817;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 
        0 8px 0 #654321,
        0 8px 0 #000,
        0 12px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.minecraft-button:hover {
    background: #9B5523;
    transform: translateY(2px);
    box-shadow: 
        0 6px 0 #654321,
        0 6px 0 #000,
        0 10px 0 rgba(0, 0, 0, 0.3);
}

.minecraft-button:active {
    transform: translateY(4px);
    box-shadow: 
        0 4px 0 #654321,
        0 4px 0 #000,
        0 8px 0 rgba(0, 0, 0, 0.3);
}

#blood-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#blood-overlay.show {
    opacity: 1;
    background: radial-gradient(circle at 50% 50%, 
        rgba(139, 0, 0, 0.6) 0%, 
        rgba(139, 0, 0, 0.4) 30%, 
        rgba(139, 0, 0, 0.2) 60%, 
        transparent 100%);
}

#blood-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 0, 0, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 0, 0, 0.2) 0%, transparent 70%);
    animation: bloodPulse 0.5s ease-in-out infinite;
}

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

/* Styles pour l'authentification */
.auth-screen {
    background: rgba(139, 69, 19, 0.9);
    padding: 40px;
    border: 4px solid #000;
    border-top-color: #654321;
    border-left-color: #654321;
    border-bottom-color: #3D2817;
    border-right-color: #3D2817;
    box-shadow: 
        0 8px 0 #654321,
        0 8px 0 #000,
        0 12px 0 rgba(0, 0, 0, 0.3);
    min-width: 350px;
    max-width: 400px;
    margin: 0 auto;
}

.auth-screen h2 {
    font-family: 'Courier New', monospace;
    font-size: 32px;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-screen form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-screen input {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    padding: 15px;
    background: #654321;
    color: #fff;
    border: 3px solid #000;
    border-top-color: #3D2817;
    border-left-color: #3D2817;
    border-bottom-color: #8B4513;
    border-right-color: #8B4513;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.auth-screen input::placeholder {
    color: #aaa;
    text-transform: none;
}

.auth-screen input:focus {
    outline: none;
    background: #754421;
    border-color: #FFD700;
}

.auth-screen button {
    margin-top: 10px;
}

.auth-switch {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

.auth-switch a {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.error-message {
    background: #8B0000;
    color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border: 3px solid #000;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#game-menu {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

#game-menu-content {
    text-align: center;
    flex: 0 0 auto;
}

#game-menu-content p {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#game-menu #welcome-message {
    margin-bottom: 15px;
}

#game-menu #highscore-display {
    margin-bottom: 20px;
    color: #FFD700;
}

#current-username {
    color: #FFD700;
    font-weight: bold;
}

#current-highscore {
    color: #90EE90;
    font-weight: bold;
    font-size: 28px;
}

#scoreboard {
    background: rgba(139, 69, 19, 0.9);
    padding: 20px;
    border: 4px solid #000;
    border-top-color: #654321;
    border-left-color: #654321;
    border-bottom-color: #3D2817;
    border-right-color: #3D2817;
    box-shadow: 
        0 8px 0 #654321,
        0 8px 0 #000,
        0 12px 0 rgba(0, 0, 0, 0.3);
    width: 350px;
    flex-shrink: 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#scoreboard h3 {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    color: #FFD700;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#scoreboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scoreboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(101, 67, 33, 0.8);
    border: 2px solid #000;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #fff;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

.scoreboard-rank {
    color: #FFD700;
    font-weight: bold;
    min-width: 30px;
}

.scoreboard-username {
    flex: 1;
    text-align: left;
    margin-left: 10px;
    color: #fff;
}

.scoreboard-score {
    color: #90EE90;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.scoreboard-empty {
    text-align: center;
    color: #aaa;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 20px;
    text-shadow: 
        1px 1px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000;
}

#game-menu button {
    margin: 10px;
    display: block;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

#logout-button {
    background: #8B0000;
    font-size: 24px;
    padding: 15px 40px;
}

#logout-button:hover {
    background: #9B1010;
}

