* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #4682B4 100%);
    overflow: hidden;
    user-select: none;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #1e6091 50%, #0f4c75 100%);
}

/* Interface utilisateur */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
}

.ui-overlay > * {
    pointer-events: auto;
}

/* Barre supérieure */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.4));
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.survival-stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: bold;
}

.stat .icon {
    font-size: 24px;
}

.bar {
    width: 100px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
}

.bar .fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 8px;
}

.health .fill { background: linear-gradient(90deg, #ff4757, #ff6b7a); }
.hunger .fill { background: linear-gradient(90deg, #ffa726, #ffcc80); }
.thirst .fill { background: linear-gradient(90deg, #42a5f5, #64b5f6); }

.game-info {
    text-align: right;
    color: white;
}

.time {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.weather {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.sail-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-top: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sail-icon {
    font-size: 16px;
    animation: sailWave 2s ease-in-out infinite;
}

.sail-effect {
    color: #4CAF50;
    font-weight: bold;
}

@keyframes sailWave {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* Barre d'inventaire */
.inventory-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
}

.hotbar {
    display: flex;
    gap: 5px;
}

.hotbar-slot {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.hotbar-slot:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.hotbar-slot.active {
    border-color: #ffd700;
    background: rgba(255,215,0,0.2);
    box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

.item-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.item-count {
    font-size: 10px;
    color: white;
    font-weight: bold;
}

.inventory-btn, .craft-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 14px;
}

.craft-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.inventory-btn:hover, .craft-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Panels */
.panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(0,0,0,0.8));
    border-radius: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(20px);
    width: 600px;
    max-height: 500px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    color: white;
}

.panel-header h3 {
    font-size: 20px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.panel-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Inventaire */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.inventory-slot {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inventory-slot:hover {
    background: rgba(255,255,255,0.2);
}

/* Craft */
.craft-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.craft-tab {
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.craft-tab.active {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border-color: #2196F3;
}

.craft-tab:hover:not(.active) {
    background: rgba(255,255,255,0.2);
}

.craft-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.craft-recipe {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.craft-recipe:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.craft-recipe.available {
    border-color: #4CAF50;
}

.craft-recipe-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.recipe-icon {
    font-size: 24px;
}

.recipe-name {
    font-weight: bold;
}

.craft-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 12px;
}

.ingredient {
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 5px;
}

/* Prompts d'action */
.action-prompts {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.action-prompt {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.05); }
}

/* Tutorial */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tutorial-content {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: white;
    padding: 40px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.tutorial-content h2 {
    margin-bottom: 20px;
    color: #4CAF50;
}

.tutorial-content p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.tutorial-content ul {
    text-align: left;
    margin-bottom: 30px;
}

.tutorial-content li {
    margin-bottom: 10px;
    padding-left: 10px;
}

#start-game {
    padding: 15px 30px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#start-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .inventory-bar {
        flex-direction: column;
        bottom: 10px;
    }
    
    .hotbar {
        order: 2;
    }
    
    .panel {
        width: 90vw;
        max-width: none;
    }
    
    .survival-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Game Over */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease-in;
}

.game-over-content {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: white;
    padding: 50px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
    animation: slideIn 0.5s ease-out;
}

.game-over-content h2 {
    margin-bottom: 20px;
    color: #ff4757;
    font-size: 2em;
}

.game-over-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.1em;
}

.game-over-content button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.game-over-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Styles pour le drag and drop */
.drag-preview {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 2px solid #4CAF50 !important;
    border-radius: 8px !important;
    padding: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

.dragging-from {
    opacity: 0.5 !important;
    transform: scale(0.95) !important;
    border: 2px dashed #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
}

.drop-target {
    border: 2px solid #4CAF50 !important;
    background: rgba(76, 175, 80, 0.2) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5) !important;
}

.hotbar-slot, .inventory-slot {
    transition: all 0.2s ease !important;
    user-select: none !important;
}

.hotbar-slot:hover, .inventory-slot:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hotbar-slot.has-item:hover, .inventory-slot:not(:empty):hover {
    border-color: #4CAF50;
}

/* Animation pour les objets déplacés */
@keyframes itemMoved {
    0% { transform: scale(1.2); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.item-moved {
    animation: itemMoved 0.3s ease-out;
} 