#stamina-bar {
    position: absolute;
    height: 12px;
    width: 180px;
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #444;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#stamina-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    transition: width 0.2s ease;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.3);
}

#health-bar {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 280px;
    height: 32px;
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
    border: 3px solid #333;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 8px 24px rgba(0,0,0,0.6),
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 0 0 1px rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

#health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        #00ff88 0%, 
        #00cc6a 25%, 
        #4CAF50 50%, 
        #66BB6A 75%, 
        #81C784 100%);
    border-radius: 13px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.3),
        inset 0 -1px 2px rgba(0,0,0,0.2),
        0 0 8px rgba(0, 255, 136, 0.3);
    position: relative;
    overflow: hidden;
}

#health-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 100%);
    animation: shimmer 3s infinite;
}

#health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(255,255,255,0.2) 0%, 
        transparent 50%, 
        rgba(0,0,0,0.1) 100%);
    border-radius: 13px;
}

#health-text {
    position: fixed;
    top: 28px;
    left: 28px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 
        0 0 8px rgba(0, 255, 136, 0.5),
        1px 1px 3px rgba(0,0,0,0.9);
    z-index: 10;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.inventory-box {
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    border: 2px solid #444;
    padding: 8px;
    position: absolute;
    top: 50%;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }
  
  .slot {
    width: 56px;
    height: 56px;
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 6px;
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
    transition: all 0.2s ease;
    cursor: pointer;
  }
  
  .slot:hover {
    border-color: #777;
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
    transform: scale(1.05);
  }
  
  .slot.active {
    border: 2px solid #ff6b6b;
    background: linear-gradient(135deg, #4a3a3a, #3a2a2a);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
  }
  
  .slot img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  }

@keyframes pulse {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}

@keyframes criticalGlow {
    0% { 
        box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), inset 0 -1px 2px rgba(0,0,0,0.2), 0 0 12px rgba(255, 0, 0, 0.6);
    }
    100% { 
        box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), inset 0 -1px 2px rgba(0,0,0,0.2), 0 0 20px rgba(255, 0, 0, 1);
    }
}

@keyframes healthBarShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.direction-arrow {
    animation: arrowPulse 2s infinite;
}

@keyframes arrowPulse {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
    }
}

#arrow-left {
    animation: arrowPulse 2s infinite, arrowSlideLeft 3s infinite;
}

#arrow-right {
    animation: arrowPulse 2s infinite, arrowSlideRight 3s infinite;
}

#arrow-up {
    animation: arrowPulse 2s infinite, arrowSlideUp 3s infinite;
}

#arrow-down {
    animation: arrowPulse 2s infinite, arrowSlideDown 3s infinite;
}

@keyframes arrowSlideLeft {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-5px); }
}

@keyframes arrowSlideRight {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(5px); }
}

@keyframes arrowSlideUp {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes arrowSlideDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(5px); }
}

.mobile-control {
    position: fixed;
    z-index: 1000;
    display: none;
}

#health-bar{
    bottom: 75px;top: auto;left: 50%;width: 180px;height: 12px; background-color: #333; border: 2px solid #fff; border-radius: 10px;transform: translate(-50%, 0);
}
#health-text{
    bottom: 77px;top: auto; left: 50%; color: white; font-size: 10px;transform: translate(-50%, 0); font-weight: bold;
}

@media (max-width: 900px) {
    .mobile-control {
        display: block;
    }
    
    #health-bar{
        top: auto !important;
   width: 120px !important;
   bottom: 30px !important;
   height: 12px !important;
   transform: translate(-50%, 0) !important;
   left: 50% !important;
}
#health-text{
    bottom: 32px !important;
    top: auto !important; 
    left: 50% !important; 
    font-size: 10px !important;
    transform: translate(-50%, 0) !important; 
}

    
    .inventory-box {
        top: 10px;
        right: 5px;
        transform: scale(0.7);
    }
    
    #health-bar {
        width: 180px;
        height: 20px;
        top: 5px;
        left: 5px;
    }
    
    #health-text {
        top: 12px;
        left: 12px;
        font-size: 12px;
    }
    
    #stamina-bar {
        width: 120px;
        height: 8px;
        bottom: 15px;
    }
    
    #joystick-base {
        width: 100px;
        height: 100px;
    }
    
    #joystick-knob {
        width: 40px;
        height: 40px;
    }
    
    #run-button {
        width: 50px;
        height: 50px;
    }
    
    #run-button span {
        font-size: 20px;
    }
    
    .inventory-box {
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    padding: 4px;
    top: 0%;
    gap: 5px;
}
#run-button {
    width: 50px !important;
    height: 50px !important;
}
#joystick-knob {
    width: 30px !important;
    height: 30px !important;
}
#joystick-base {
    width: 100px !important;
    height: 100px !important;
}
.slot {
    width: 25px;
    height: 25px;
}
}

#mobile-joystick {
    bottom: 10px;
    left: 10px;
}

#joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.3) 100%);
    border: 3px solid rgba(255,255,255,0.3);
    position: relative;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

#joystick-knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border: 2px solid rgba(255,255,255,0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.3);
    transition: all 0.1s ease;
    cursor: pointer;
}

#joystick-knob:active {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.2);
}

#mobile-run-btn {
    bottom: 10px;
    right: 10px;
}

#run-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ed573, #1dd1a1);
    border: 3px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 6px 24px rgba(46, 213, 115, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#run-button:active {
    transform: scale(0.95);
    box-shadow: 
        0 3px 12px rgba(46, 213, 115, 0.6),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

#run-button span {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.joystick-active #joystick-knob {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    box-shadow: 
        0 6px 20px rgba(255, 167, 38, 0.5),
        inset 0 2px 4px rgba(255,255,255,0.3);
}

.run-active #run-button {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    box-shadow: 
        0 6px 24px rgba(255, 215, 0, 0.6),
        inset 0 2px 4px rgba(255,255,255,0.3);
}
  