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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background: #000;
    color: #fff;
}

#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#game-container {
    position: fixed;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

#image-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
}

#image-container.hidden {
    display: none;
}

#current-image,
#next-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

#next-image {
    opacity: 0;
    z-index: 10;
}

@keyframes annihilate {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        filter: brightness(3);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
        filter: brightness(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.annihilating {
    animation: annihilate 1s ease-in-out forwards;
}

.fading-in {
    animation: fadeIn 1s ease-in-out forwards;
}

#hud {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.stat-label {
    min-width: 60px;
    font-weight: bold;
}

.stat-bar {
    width: 150px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4169e1, #6495ed);
    transition: width 0.5s ease-in-out;
}

.bar-fill.health {
    background: linear-gradient(90deg, #dc143c, #ff6347);
}

#settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    align-items: center;
}

#lang-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

#lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.logout-btn {
    background: rgba(255, 0, 0, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 16px;
}

.logout-btn:hover {
    background: rgba(255, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.6);
}

#adventure-panel {
    position: fixed;
    bottom: 100px;
    left: 5%;
    width: 90%;
    height: auto;
    min-height: 60px;
    z-index: 150;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 30px;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#adventure-panel.hidden {
    display: none;
}

#adventure-panel.slide-up-animation {
    animation: slideUpFromBottom 0.8s ease-out forwards;
}

#adventure-panel.fade-out-up {
    animation: fadeOutDown 0.8s ease-in forwards;
}

@keyframes slideUpFromBottom {
    0% {
        opacity: 0;
        transform: translateY(100%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(100%);
    }
}

#adventure-text {
    font-size: 20px;
    line-height: 1.4;
    color: #fff;
    text-align: center;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 1);
    font-weight: 600;
    letter-spacing: 0.5px;
}

#controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#control-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

#action-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 300px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    animation: pulseHint 2s ease-in-out infinite;
}

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

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#voice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

#voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#voice-btn:active {
    transform: translateY(0);
}

#voice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#voice-btn.listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s infinite;
}

#voice-btn.loading {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

#voice-btn.loading .mic-icon,
#voice-btn.loading .btn-text {
    display: none;
}

#voice-btn.loading .loader {
    display: block;
}

.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(245, 87, 108, 0.8);
    }
}

.mic-icon {
    font-size: 24px;
}

#voice-status {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 14px;
}

#voice-status.hidden {
    display: none;
}

.stat-change {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    z-index: 9999;
    animation: floatUp 2s ease-out forwards;
    pointer-events: none;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 1);
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(1.5);
    }
}

.stat-change.positive {
    color: #4ade80;
}

.stat-change.negative {
    color: #ef4444;
}

@keyframes sway {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-1.5deg) scale(1.03); }
    50% { transform: rotate(0deg) scale(1.05); }
    75% { transform: rotate(1.5deg) scale(1.03); }
}

@keyframes flicker {
    0%, 100% { opacity: 1; filter: brightness(1) contrast(1); }
    20% { opacity: 0.85; filter: brightness(1.3) contrast(1.1); }
    40% { opacity: 0.95; filter: brightness(0.9) contrast(0.95); }
    60% { opacity: 0.9; filter: brightness(1.2) contrast(1.05); }
    80% { opacity: 0.88; filter: brightness(1.1) contrast(1.02); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 1; }
    25% { opacity: 0.7; }
    50% { opacity: 0.4; }
    75% { opacity: 0.7; }
}

@keyframes zoomPulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); }
    50% { transform: scale(1.15); }
    75% { transform: scale(1.05); }
}

#current-image.image-sway,
#next-image.image-sway {
    animation: sway 4s ease-in-out infinite !important;
}

#current-image.image-flicker,
#next-image.image-flicker {
    animation: flicker 3s ease-in-out infinite !important;
}

#current-image.image-fade,
#next-image.image-fade {
    animation: fadeInOut 3s ease-in-out infinite !important;
}

#current-image.image-zoom,
#next-image.image-zoom {
    animation: zoomPulse 3s ease-in-out infinite !important;
}

