* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    font-family: 'Press Start 2P', cursive; 
    background: #ffffff;  /* 여백을 흰색으로 */
    overflow: hidden; 
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
    z-index: 1;
    overflow: hidden;
}

#game-container canvas {
    display: block;
    margin: 0 auto;
}

#ui { 
    position: fixed; 
    top: 5px; 
    left: 5px; 
    color: #333; 
    font-size: 8px; 
    z-index: 200; 
    text-shadow: 1px 1px 3px rgba(255,255,255,0.5); 
}

#ui > div { 
    margin-bottom: 4px; 
}

#expBarContainer { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 10px; 
    background: rgba(200, 200, 200, 0.8);
    z-index: 200;
    display: flex;
    align-items: center;
}

#expBar { 
    position: absolute;
    width: 100%; 
    height: 100%; 
    background: #ddd; 
    overflow: hidden; 
}

#exp-bar { 
    height: 100%; 
    background: linear-gradient(90deg, #0342E9, #00d4ff); 
    transition: width 0.3s ease; 
}

#expText {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    color: #333;
    font-size: 7px;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.5);
    pointer-events: none;
}

#joystickArea { 
    position: fixed; 
    bottom: 15px; 
    left: 10px; 
    width: 150px; 
    height: 150px; 
    z-index: 150;
}

#joystickBase {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: none;
}

#joystickStick {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.6);
    border: 2px solid rgba(0, 212, 255, 1);
    display: none;
}

#levelUpScreen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(255, 255, 255, 0.95); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 300; 
    overflow-y: auto; 
}

#levelUpScreen.active { 
    display: flex; 
}

.upgrade-container { 
    text-align: center; 
    padding: 10px; 
    max-width: 100%; 
}

.upgrade-container h1 { 
    font-size: 20px; 
    color: #0342E9; 
    margin-bottom: 20px; 
    text-shadow: 0 0 10px rgba(3, 66, 233, 0.3); 
}

.upgrade-options { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    justify-content: center; 
    align-items: center; 
}

.upgrade-card { 
    width: 90%; 
    max-width: 300px;
    background: rgba(245, 245, 245, 0.9); 
    border: 2px solid #0342E9; 
    border-radius: 8px; 
    padding: 15px; 
    cursor: pointer; 
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.upgrade-card:active { 
    transform: scale(0.95); 
    border-color: #00d4ff; 
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5); 
}

.upgrade-card h3 { 
    font-size: 10px; 
    color: #0342E9; 
    margin-bottom: 10px; 
}

.upgrade-card p { 
    font-size: 7px; 
    color: #333; 
    line-height: 1.4; 
}

#gameOver { 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    text-align: center; 
    color: #333; 
    display: none; 
    z-index: 200; 
    background: rgba(255, 255, 255, 0.95); 
    padding: 20px; 
    border: 2px solid #ff0000; 
    border-radius: 8px; 
    max-width: 90%; 
}

#gameOver h1 { 
    font-size: 24px; 
    color: #ff0000; 
    margin-bottom: 15px; 
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3); 
    animation: blink 1s infinite; 
}

#gameOver p { 
    font-size: 9px; 
    margin-bottom: 15px; 
    line-height: 1.8; 
    color: #333; 
}

.btn { 
    display: inline-block; 
    padding: 10px 20px; 
    background: #0342E9; 
    color: white; 
    text-decoration: none; 
    font-size: 9px; 
    border-radius: 5px; 
    transition: all 0.2s ease; 
    box-shadow: 0 3px 15px rgba(3, 66, 233, 0.5); 
    cursor: pointer; 
    margin: 5px; 
    border: none;
    touch-action: manipulation;
}

.btn:active { 
    background: #022a99; 
    transform: scale(0.95); 
}

#weaponInfo { 
    position: fixed; 
    bottom: 80px; 
    left: 5px; 
    color: #333; 
    font-size: 7px; 
    z-index: 100; 
    text-shadow: 1px 1px 3px rgba(255,255,255,0.5); 
}

#instructions { 
    position: fixed; 
    top: 5px; 
    right: 5px; 
    color: rgba(51,51,51,0.6); 
    font-size: 7px; 
    text-align: right; 
    z-index: 200; 
    text-shadow: 1px 1px 3px rgba(255,255,255,0.5); 
    line-height: 1.4; 
}

@keyframes blink { 
    0%, 50%, 100% { opacity: 1; } 
    25%, 75% { opacity: 0.5; } 
}
