/* Wanderer's Trail - Game Styles */

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

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

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

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(100, 200, 150, 0.5);
    letter-spacing: 4px;
    background: linear-gradient(90deg, #64c896, #4aa3df, #64c896);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #64c896, #4aa3df);
    border-radius: 4px;
    transition: width 0.3s ease-out;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1rem;
    opacity: 0.7;
    letter-spacing: 2px;
}

/* HUD Styles */
.game-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 100;
}

.hud-left, .hud-right {
    display: flex;
    gap: 15px;
}

.hud-item {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 25px;
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-item .icon {
    width: 24px;
    height: 24px;
}

/* Mobile Controls */
.mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 100;
}

@media (max-width: 768px), (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
}

.joystick-area {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    pointer-events: auto;
    position: relative;
}

.joystick-knob {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

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

.action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
}

.action-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* Dialogue Box */
.dialogue-box {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 700px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    padding: 20px 25px;
    color: #fff;
    border: 2px solid rgba(100, 200, 150, 0.5);
    z-index: 200;
    display: none;
}

.dialogue-box.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dialogue-speaker {
    color: #64c896;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.dialogue-text {
    font-size: 1rem;
    line-height: 1.6;
}

.dialogue-continue {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.8rem;
    opacity: 0.5;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 0.5; }
    51%, 100% { opacity: 0; }
}
