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

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #000;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0;
    pointer-events: none;
    z-index: 10;
    max-width: 280px;
}

.hud-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    margin-bottom: 10px;
}

.hud-section h2 {
    color: #FFD700;
    text-align: center;
    font-size: 16px;
    text-shadow: 0 0 8px #FFD700, 0 0 15px #FFA500;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-bar label {
    color: #FFD700;
    font-weight: bold;
    min-width: 50px;
    font-size: 11px;
    text-shadow: 0 0 5px #FFD700;
}

.bar {
    position: relative;
    flex: 1;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #FFD700;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    transition: width 0.3s ease;
}

.health-bar .bar-fill {
    background: linear-gradient(90deg, #FF0000, #FF6B6B);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.energy-bar .bar-fill {
    background: linear-gradient(90deg, #00BFFF, #87CEEB);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.bar span {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 18px;
    color: white;
    font-weight: bold;
    font-size: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.score-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
    color: #FFD700;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 5px #FFD700;
}

.skills-panel-bottom {
    display: none;
}

.skill-grid {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.skill-card {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(75, 0, 130, 0.2));
    border: 2px solid rgba(138, 43, 226, 0.6);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    pointer-events: all;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.6);
    border-color: #DA70D6;
}

.skill-card.on-cooldown {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-card.insufficient-energy {
    opacity: 0.4;
    cursor: not-allowed;
    filter: brightness(0.5) saturate(0.3);
    border-color: rgba(0, 100, 200, 0.4);
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.3), rgba(0, 30, 80, 0.2));
}

.skill-card.insufficient-energy .skill-icon {
    filter: grayscale(0.7) brightness(0.6) drop-shadow(0 0 5px rgba(100, 150, 200, 0.3));
}

.skill-icon {
    font-size: 30px;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.skill-name {
    color: #FFF;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-cooldown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FF4444;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px #FF0000;
    display: none;
}

.skill-card.on-cooldown .skill-cooldown {
    display: block;
}

.skill-key {
    margin-top: 3px;
    color: #FFD700;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 2px 6px;
    display: inline-block;
}

.toggle-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.2));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    padding: 10px 20px;
    color: #FFD700;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    pointer-events: all;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.5), rgba(255, 165, 0, 0.3));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
}

.controls-info {
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.3), rgba(30, 30, 30, 0.2));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    max-height: 200px;
    overflow: hidden;
}

.controls-info.hidden {
    max-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    opacity: 0;
}

.controls-info h3 {
    color: #FFF;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.controls-info div {
    color: #DDD;
    font-size: 14px;
}

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

#start-screen.hidden {
    display: none;
}

.start-box {
    background: #FFFACD;
    border: 5px solid #FFD700;
    border-radius: 20px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4);
}

.start-title {
    color: #FF4500;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 3px;
}

.start-button {
    padding: 20px 60px;
    font-size: 32px;
    font-weight: bold;
    color: #FFFFFF;
    background: linear-gradient(135deg, #FF4500, #FF6347);
    border: 3px solid #8B0000;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 69, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: auto;
}

.start-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 69, 0, 0.6);
    background: linear-gradient(135deg, #FF6347, #FF4500);
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

#game-over.hidden {
    display: none;
}

#level-up-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 150;
    pointer-events: none;
    animation: levelUpFadeIn 0.5s ease-out;
}

#level-up-notification.hidden {
    display: none;
}

.level-up-content {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.level-up-text {
    color: #FFD700;
    font-size: 96px;
    font-weight: bold;
    text-shadow: 
        4px 4px 0px #000000,
        0 0 30px #FFD700,
        0 0 60px #FFA500;
    letter-spacing: 12px;
    margin: 0;
    animation: levelUpTextGlow 0.5s ease-in-out infinite alternate;
}

@keyframes levelUpFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}


@keyframes levelUpTextGlow {
    from {
        text-shadow: 
            3px 3px 0px #8B0000,
            0 0 20px #FFD700,
            0 0 40px #FFA500;
    }
    to {
        text-shadow: 
            3px 3px 0px #8B0000,
            0 0 30px #FFD700,
            0 0 60px #FFA500,
            0 0 80px #FF4500;
    }
}


#game-over h1 {
    color: #FF4444;
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 0 0 20px #FF0000;
}

#game-over p {
    color: #FFD700;
    font-size: 24px;
    margin: 15px 0;
    text-shadow: 0 0 10px #FFD700;
}

#restart-btn {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    color: #000;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    pointer-events: all;
}

#restart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

/* Mobile Controls */
.mobile-controls {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100;
    display: block !important;
    visibility: visible !important;
}

/* Joystick (Left Side) */
.joystick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    pointer-events: all;
    z-index: 9999;
}

.joystick-base {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));
    border: 6px solid #FFD700;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.9), 0 0 20px rgba(255, 215, 0, 0.7), inset 0 0 30px rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(5px);
}

.joystick-stick {
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #FFD700, #FFA500);
    border: 5px solid #FFFF00;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    touch-action: none;
    box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 50px rgba(255, 215, 0, 0.8);
    transition: all 0.1s ease;
}

.joystick-stick:active {
    background: radial-gradient(circle, rgba(255, 215, 0, 1), rgba(255, 165, 0, 0.8));
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

/* Skills Circle (Right Side) - Complete circle with center button */
.skills-diamond {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 200px;
    height: 200px;
    pointer-events: all;
}

.mobile-skill {
    position: absolute;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.4), rgba(75, 0, 130, 0.3));
    border: 3px solid rgba(138, 43, 226, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
    width: 60px;
    height: 60px;
}

.mobile-skill:active {
    transform: scale(0.9);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.7);
}

.mobile-skill.on-cooldown {
    opacity: 0.4;
    cursor: not-allowed;
}

.mobile-skill.insufficient-energy {
    opacity: 0.3;
    cursor: not-allowed;
    filter: brightness(0.5) saturate(0.3);
}

/* Center attack button - Large */
.mobile-skill.center {
    width: 75px;
    height: 75px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 69, 0, 0.5), rgba(255, 140, 0, 0.4));
    border-color: rgba(255, 69, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

.mobile-skill.center:active {
    transform: translate(-50%, -50%) scale(0.9);
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.8);
}

/* Arrange 4 skills in complete circle around center */
/* Skill 1 (Q) - Top (0 degrees) */
.mobile-skill.top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Skill 2 (W) - Right (90 degrees) */
.mobile-skill.left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* Skill 3 (E) - Bottom (180 degrees) */
.mobile-skill.right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

/* Skill 4 (R) - Left (270 degrees) */
.mobile-skill.bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.mobile-skill .skill-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.mobile-skill.center .skill-icon {
    font-size: 32px;
}

.skill-cooldown-mobile {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FF4444;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px #FF0000;
    display: none;
    pointer-events: none;
}

.mobile-skill.on-cooldown .skill-cooldown-mobile {
    display: block;
}

@media (max-width: 768px) {
    .skill-grid {
        flex-wrap: wrap;
    }
    
    .skill-card {
        flex: 1 1 45%;
    }
    
    .skills-panel-bottom {
        max-width: 90%;
        bottom: 10px;
    }
    
    .hud-section h2 {
        font-size: 20px;
    }
    
    .score-info {
        flex-direction: column;
        gap: 5px;
    }
}
