* {
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#dialogue-box {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    border-top: 3px solid #8A2BE2;
    transform: translateY(0);
    transition: transform 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(5px);
    min-height: 30vh;
}

#dialogue-box.hidden {
    transform: translateY(100%);
}

#speaker-name {
    font-size: 1.4em;
    font-weight: 900;
    color: #8A2BE2;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#dialogue-text {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 15px;
    min-height: 4.8em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#touch-indicator {
    text-align: center;
    font-size: 0.9em;
    color: #AAA;
    animation: pulse 1.5s infinite;
    padding: 5px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

#scene-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1em;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(3px);
}

#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-text {
    color: #8A2BE2;
    font-size: 2em;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
    animation: glow 2s infinite alternate;
}

.loading-subtext {
    color: #FFD700;
    font-size: 1.2em;
    margin-bottom: 30px;
}

@keyframes glow {
    from { text-shadow: 0 0 10px rgba(138, 43, 226, 0.5); }
    to { text-shadow: 0 0 20px rgba(138, 43, 226, 0.8); }
}

.loading-bar {
    width: 80%;
    max-width: 400px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #8A2BE2, #4B0082);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    #dialogue-box {
        padding: 15px;
        min-height: 25vh;
    }
    
    .loading-text {
        font-size: 1.5em;
    }
    
    #speaker-name {
        font-size: 1.2em;
    }
    
    #dialogue-text {
        font-size: 1em;
        min-height: 6em;
    }
    
    #scene-indicator {
        font-size: 0.9em;
        top: 10px;
        right: 10px;
        padding: 6px 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #dialogue-box {
        min-height: 22vh;
    }
}

@media (min-width: 1025px) {
    #game-container {
        max-width: 1200px;
        max-height: 800px;
        margin: 0 auto;
        position: relative;
        top: 50%;
        transform: translateY(-50%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        overflow: hidden;
    }
}
