@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap');

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

body {
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, #2F4F4F 0%, #556B2F 50%, #2F4F4F 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Fog Animation */
.fog-layer {
    position: fixed;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 20%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

#fog-layer-1 {
    animation: fogDrift1 20s infinite linear;
}

#fog-layer-2 {
    animation: fogDrift2 30s infinite linear;
    opacity: 0.6;
}

#fog-layer-3 {
    animation: fogDrift3 25s infinite linear;
    opacity: 0.4;
}

@keyframes fogDrift1 {
    0% { transform: translateX(-10%) translateY(-10%) rotate(0deg); }
    100% { transform: translateX(10%) translateY(10%) rotate(360deg); }
}

@keyframes fogDrift2 {
    0% { transform: translateX(5%) translateY(5%) rotate(0deg); }
    100% { transform: translateX(-5%) translateY(-5%) rotate(-360deg); }
}

@keyframes fogDrift3 {
    0% { transform: translateX(-5%) translateY(10%) rotate(0deg); }
    100% { transform: translateX(15%) translateY(-10%) rotate(180deg); }
}

.game-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(47, 79, 79, 0.9);
    border: 6px solid #8B7355;
    border-radius: 20px;
    box-shadow: 
        0 0 30px rgba(0,0,0,0.8),
        inset 0 0 20px rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #8B7355 0%, #654321 100%);
    border-radius: 15px;
    border: 2px solid #DDA0DD;
}

.game-title {
    color: #FFD700;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.game-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #696969 0%, #2F4F4F 100%);
    color: #F5F5DC;
    border: 2px solid #DDA0DD;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: linear-gradient(135deg, #2F4F4F 0%, #556B2F 100%);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
    font-weight: bold;
}

.weather-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #87CEEB 0%, #4682B4 100%);
    color: white;
    border: 2px solid #DDA0DD;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weather-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.main-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-area {
    position: relative;
    flex: 1;
}

#canvas {
    border: 4px solid #8B7355;
    border-radius: 10px;
    background: linear-gradient(135deg, #87CEEB 0%, #556B2F 100%);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.health-display, .artifacts-counter {
    background: rgba(139, 115, 85, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #DDA0DD;
    color: #F5F5DC;
    font-size: 16px;
    font-weight: bold;
}

.mini-map {
    background: rgba(139, 115, 85, 0.9);
    padding: 5px;
    border-radius: 8px;
    border: 2px solid #DDA0DD;
}

#minimap {
    border-radius: 4px;
    image-rendering: pixelated;
}

.controls-panel {
    width: 250px;
    background: linear-gradient(135deg, #8B7355 0%, #654321 100%);
    border: 3px solid #DDA0DD;
    border-radius: 15px;
    padding: 20px;
    color: #F5F5DC;
}

.movement-guide h3 {
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
}

.key-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.key-row {
    display: flex;
    gap: 5px;
}

.key-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #696969 0%, #2F4F4F 100%);
    border: 2px solid #DDA0DD;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: #F5F5DC;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 10px;
    background: linear-gradient(135deg, #556B2F 0%, #228B22 100%);
    color: white;
    border: 2px solid #DDA0DD;
    border-radius: 8px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.editor-tools {
    margin-top: 20px;
}

.editor-tools h3 {
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
}

.tile-category {
    margin-bottom: 15px;
}

.tile-category h4 {
    color: #DDA0DD;
    margin-bottom: 8px;
    font-size: 14px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.tile-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #696969 0%, #2F4F4F 100%);
    border: 2px solid #DDA0DD;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile-btn:hover {
    transform: scale(1.1);
}

.tile-btn.selected {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: #8B4513;
}

.editor-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-actions button {
    padding: 8px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border: 2px solid #DDA0DD;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-actions button:hover {
    transform: translateY(-1px);
}

.progress-bar {
    margin-top: 20px;
    background: rgba(47, 79, 79, 0.8);
    border: 2px solid #DDA0DD;
    border-radius: 10px;
    padding: 5px;
    position: relative;
    height: 30px;
}

.progress-fill {
    background: linear-gradient(90deg, #228B22 0%, #32CD32 50%, #FFD700 100%);
    height: 100%;
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #F5F5DC;
    font-weight: bold;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 15px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .controls-panel {
        width: 100%;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    #canvas {
        width: 100%;
        height: auto;
    }
}

/* Celtic knot decorations */
.game-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #DDA0DD, #8B7355, #DDA0DD, #8B7355);
    border-radius: 23px;
    z-index: -1;
}

/* Atmospheric animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.artifact-icon {
    animation: float 3s ease-in-out infinite;
}