/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f0a 50%, #0d0805 100%);
    font-family: 'Determination Mono', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* 레이아웃 */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(64, 128, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(128, 64, 255, 0.1) 0%, transparent 50%);
    z-index: 1;
}

/* 메인 컨텐츠 */
.main-content {
    text-align: center;
    z-index: 3;
    position: relative;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2rem;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.7),
        0 0 10px rgba(255, 255, 255, 0.1);
    letter-spacing: 1px;
}

.alert-box {
    background: linear-gradient(145deg, #fff3cd 0%, #fef2c4 100%);
    border: 2px solid #f0c674;
    border-radius: 12px;
    padding: 2rem;
    max-width: 450px;
    margin: 0 auto;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.alert-heading {
    color: #8b6914;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(139, 105, 20, 0.3);
}

.alert-text {
    color: #6b4e03;
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

/* 캐릭터 */
.character-container {
    position: absolute;
    left: -250px;
    bottom: 15%;
    z-index: 2;
    transition: left 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lancer-sprite {
    width: 160px;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: 
        drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4))
        drop-shadow(0 0 10px rgba(74, 144, 226, 0.2));
    transition: filter 0.3s ease;
}

/* 말풍선 */
.speech-bubble {
    position: absolute;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #2d5aa0;
    border-radius: 25px;
    padding: 20px 30px;
    max-width: 380px;
    min-width: 280px;
    bottom: 100%;
    left: 80%;
    opacity: 0;
    z-index: 4;
    transform: translateX(-50%);
    transition: all 0.4s ease-in-out;
    box-shadow: 
        0 12px 40px rgba(45, 90, 160, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.speech-bubble.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 35%;
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 25px solid #2d5aa0;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.1));
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 35%;
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 22px solid #ffffff;
}

.speech-text {
    font-size: 18px;
    font-weight: 600;
    color: #1a365d;
    text-align: center;
    line-height: 1.6;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(26, 54, 93, 0.1);
}

/* 애니메이션 */
@keyframes walkIn {
    0% {
        left: -250px;
        transform: scaleX(1);
    }
    100% {
        left: 12%;
        transform: scaleX(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-12px);
    }
    60% {
        transform: translateX(-50%) translateY(-6px);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 애니메이션 클래스 */
.walk-animation {
    animation: walkIn 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bounce-animation {
    animation: bounce 2s ease-in-out infinite;
}

.fade-in-animation {
    animation: fadeInUp 1.2s ease-out forwards;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .speech-bubble {
        max-width: 340px;
        left: 45%;
        top: 20%;
    }
    
    .character-container {
        bottom: 18%;
    }
    
    .lancer-sprite {
        width: 140px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }
    
    .alert-box {
        max-width: 350px;
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .alert-heading {
        font-size: 1.2rem;
    }
    
    .alert-text {
        font-size: 1rem;
    }
    
    .character-container {
        bottom: 22%;
    }
    
    .lancer-sprite {
        width: 120px;
    }
    
    .speech-bubble {
        max-width: 300px;
        top: 15%;
        left: 50%;
        padding: 18px 25px;
        font-size: 16px;
    }
    
    .speech-bubble::before,
    .speech-bubble::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .alert-box {
        max-width: 280px;
        padding: 1.2rem;
    }
    
    .alert-heading {
        font-size: 1rem;
    }
    
    .alert-text {
        font-size: 0.9rem;
    }
    
    .character-container {
        bottom: 25%;
    }
    
    .lancer-sprite {
        width: 100px;
    }
    
    .speech-bubble {
        max-width: 260px;
        top: 12%;
        padding: 15px 20px;
        font-size: 14px;
        min-width: 200px;
    }
    
    .speech-text {
        font-size: 16px;
        line-height: 1.4;
    }
}

/* 특수 효과 */
.glow-effect {
    box-shadow: 
        0 0 20px rgba(74, 144, 226, 0.3),
        0 0 40px rgba(74, 144, 226, 0.1);
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #1a365d;
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .alert-box {
        background: linear-gradient(145deg, #2a2a2a 0%, #1f1f1f 100%);
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
    
    .alert-heading,
    .alert-text {
        color: #f0c674;
    }
}