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

body {
    background: radial-gradient(ellipse at center, #0a0e27 0%, #000000 100%);
    overflow: hidden;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}

#gameCanvas {
    display: block;
    background: radial-gradient(ellipse at 30% 40%, rgba(25, 25, 60, 0.3) 0%, #000000 60%);
    box-shadow: 0 0 100px rgba(100, 100, 255, 0.4), inset 0 0 100px rgba(50, 0, 100, 0.2);
    border: 2px solid rgba(100, 150, 255, 0.3);
    border-radius: 4px;
}

#ui {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
}

/* ========== 새로운 통계 패널 디자인 ========== */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.95) 0%, rgba(5, 10, 30, 0.95) 100%);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    min-width: 180px;
    cursor: default;
}

.stat-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 212, 255, 0.7);
}

.stat-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
    animation: iconPulse 2s ease-in-out infinite;
}

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

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 212, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

/* 개별 스탯 색상 */
#score {
    border-color: rgba(0, 212, 255, 0.5);
}

#score:hover {
    border-color: rgba(0, 212, 255, 0.8);
}

#score .stat-icon {
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.8));
}

#score .stat-label {
    color: rgba(0, 212, 255, 0.9);
}

#health {
    border-color: rgba(0, 255, 136, 0.5);
}

#health:hover {
    border-color: rgba(0, 255, 136, 0.8);
}

#health .stat-icon {
    filter: drop-shadow(0 0 8px rgba(255, 0, 100, 0.8));
}

#health .stat-label {
    color: rgba(0, 255, 136, 0.9);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

#bombs {
    border-color: rgba(239, 68, 68, 0.5);
}

#bombs:hover {
    border-color: rgba(239, 68, 68, 0.8);
}

#bombs .stat-icon {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8));
}

#bombs .stat-label {
    color: rgba(239, 68, 68, 0.9);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

#coins {
    border-color: rgba(255, 170, 0, 0.5);
}

#coins:hover {
    border-color: rgba(255, 170, 0, 0.8);
}

#coins .stat-icon {
    filter: drop-shadow(0 0 8px rgba(255, 170, 0, 0.8));
}

#coins .stat-label {
    color: rgba(255, 170, 0, 0.9);
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

/* 상점 아이템 */
.shop-item {
    border-color: rgba(168, 85, 247, 0.5);
    cursor: pointer;
}

.shop-item:hover {
    border-color: rgba(168, 85, 247, 0.9);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 35px rgba(168, 85, 247, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.shop-item .stat-icon {
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8));
}

.shop-item .stat-label {
    color: rgba(168, 85, 247, 0.9);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.shop-item .stat-value {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

#shopButton::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#shopButton:hover::before {
    width: 300px;
    height: 300px;
}

#shopButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.2);
    border-color: rgba(102, 126, 234, 0.8);
}

#shopButton:active {
    transform: translateY(-1px);
}

/* 시작 화면 */
#startScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.95) 0%, rgba(5, 10, 40, 0.95) 100%);
    padding: 20px 35px;
    border: 3px solid #00d4ff;
    border-radius: 20px;
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.6), inset 0 0 20px rgba(0, 100, 200, 0.2);
    text-align: center;
    z-index: 300;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

#startScreen h1 {
    color: #00d4ff;
    font-size: 40px;
    margin-bottom: 8px;
    text-shadow: 0 0 30px #00d4ff, 0 0 50px rgba(0, 212, 255, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
    letter-spacing: 2px;
    font-weight: 900;
}

.subtitle {
    font-size: 16px;
    color: rgba(168, 85, 247, 0.9);
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

@keyframes titleGlow {
    0%, 100% { 
        text-shadow: 0 0 30px #00d4ff, 0 0 50px rgba(0, 212, 255, 0.5);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 40px #00d4ff, 0 0 70px rgba(0, 212, 255, 0.8), 0 0 100px rgba(100, 150, 255, 0.4);
        transform: scale(1.02);
    }
}

#startScreen .controls {
    margin: 12px 0;
    text-align: left;
}

#startScreen h2 {
    color: #ffff00;
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
}

#startScreen h3 {
    color: #ffaa00;
    font-size: 18px;
    margin: 15px 0 8px 0;
    text-align: center;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
    padding: 6px 12px;
    background: rgba(0, 100, 0, 0.3);
    border-radius: 5px;
    font-size: 14px;
}

.control-item .key {
    display: inline-block;
    background: linear-gradient(135deg, #00d4ff 0%, #0088cc 100%);
    color: #000;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    min-width: 85px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.control-item .desc {
    color: #fff;
    font-size: 14px;
    flex: 1;
    text-align: right;
}

#startScreen .tips {
    margin: 12px 0;
    padding: 10px;
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid #ffaa00;
    border-radius: 8px;
}

#startScreen .tips p {
    color: #fff;
    margin: 5px 0;
    font-size: 12px;
    text-align: left;
    line-height: 1.4;
}

/* 난이도 선택 */
#startScreen .difficulty {
    margin: 12px 0 8px 0;
}

#startScreen .difficulty h3 {
    color: #00ffff;
    font-size: 18px;
    margin-bottom: 10px;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.difficulty-btn {
    flex: 1;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff00;
    color: #fff;
    padding: 12px 8px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.difficulty-btn .diff-label {
    font-size: 24px;
    font-weight: bold;
}

.difficulty-btn .diff-desc {
    font-size: 12px;
    opacity: 0.8;
}

.difficulty-btn.easy {
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 200, 100, 0.05) 100%);
}

.difficulty-btn.easy:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 200, 100, 0.15) 100%);
    border-color: #00ff88;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 255, 136, 0.5), inset 0 0 20px rgba(0, 255, 136, 0.2);
}

.difficulty-btn.normal {
    border-color: #00d4ff;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 150, 200, 0.05) 100%);
}

.difficulty-btn.normal:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25) 0%, rgba(0, 150, 200, 0.15) 100%);
    border-color: #00d4ff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 212, 255, 0.5), inset 0 0 20px rgba(0, 212, 255, 0.2);
}

.difficulty-btn.hard {
    border-color: #ff0066;
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.1) 0%, rgba(200, 0, 80, 0.05) 100%);
}

.difficulty-btn.hard:hover {
    background: linear-gradient(135deg, rgba(255, 0, 102, 0.25) 0%, rgba(200, 0, 80, 0.15) 100%);
    border-color: #ff0066;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 0, 102, 0.5), inset 0 0 20px rgba(255, 0, 102, 0.2);
}

.difficulty-btn:active {
    transform: translateY(-2px);
}

.difficulty-btn.selected {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 20px rgba(0, 255, 255, 0.3);
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(40, 10, 20, 0.95) 0%, rgba(20, 5, 10, 0.95) 100%);
    padding: 45px 65px;
    border: 3px solid #ff0066;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 80px rgba(255, 0, 102, 0.6), inset 0 0 30px rgba(255, 0, 0, 0.2);
    backdrop-filter: blur(20px);
}

#gameOver h1 {
    color: #ff0000;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #ff0000;
}

#gameOver p {
    color: #fff;
    font-size: 24px;
    margin-bottom: 20px;
}

#gameOver button {
    background: #ff0000;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

#gameOver button:hover {
    background: #cc0000;
    box-shadow: 0 0 20px #ff0000;
}

.hidden {
    display: none !important;
}

/* 터미널 스타일 */
#terminal {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 500px;
    height: 400px;
    background: rgba(0, 20, 0, 0.95);
    border: 2px solid #00ff00;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    z-index: 200;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#terminalHeader {
    background: rgba(0, 100, 0, 0.8);
    padding: 10px 15px;
    border-bottom: 2px solid #00ff00;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #00ff00;
    font-weight: bold;
    border-radius: 6px 6px 0 0;
}

#closeTerminal {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 16px;
    transition: all 0.2s;
}

#closeTerminal:hover {
    background: #00ff00;
    color: #000;
}

#terminalOutput {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    color: #00ff00;
    font-size: 13px;
    line-height: 1.5;
}

#terminalOutput::-webkit-scrollbar {
    width: 8px;
}

#terminalOutput::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#terminalOutput::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

#terminalInputContainer {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #00ff00;
    background: rgba(0, 0, 0, 0.5);
}

.terminalPrompt {
    color: #00ff00;
    margin-right: 8px;
    font-weight: bold;
}

#terminalInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    outline: none;
}

#terminalInput::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

.terminalLine {
    margin-bottom: 8px;
    word-wrap: break-word;
}

.terminalPromptLine {
    color: #00ffff;
}

.terminalError {
    color: #ff0000;
}

.terminalSuccess {
    color: #ffff00;
}

.terminalInfo {
    color: #00ff00;
}

#terminalToggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.2) 0%, rgba(50, 100, 200, 0.2) 100%);
    border: 2px solid #6496ff;
    border-radius: 50%;
    display: none; /* 기본적으로 숨김 */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s;
    z-index: 150;
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.3);
}

#terminalToggle.show {
    display: flex; /* Ctrl+Shift+D로 활성화 시에만 표시 */
}

#terminalToggle:hover {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.4) 0%, rgba(50, 100, 200, 0.4) 100%);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(100, 150, 255, 0.6);
}

#terminalToggle span {
    filter: brightness(1.5);
    text-shadow: 0 0 10px rgba(100, 150, 255, 0.8);
}

/* 상점 */
#shop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

#shopContent {
    background: linear-gradient(135deg, rgba(20, 40, 90, 0.95) 0%, rgba(30, 50, 100, 0.95) 100%);
    padding: 45px;
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 50px rgba(100, 150, 255, 0.3);
    border: 2px solid rgba(100, 150, 255, 0.4);
    max-width: 950px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

#shopContent h1 {
    text-align: center;
    color: white;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#shopBalance {
    text-align: center;
    font-size: 24px;
    color: #ffaa00;
    margin-bottom: 30px;
    font-weight: bold;
}

.ship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.ship-card {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ship-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: #00d4ff;
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.5), inset 0 0 30px rgba(0, 212, 255, 0.1);
}

.ship-card.owned {
    border-color: #00ff00;
}

.ship-card.selected {
    border-color: #ffaa00;
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.6);
}

.ship-preview {
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ship-preview::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.8) 100%);
}

/* 우주선 미리보기 애니메이션 */
.red-ship {
    background: radial-gradient(circle, #ff0000 0%, #990000 50%, transparent 70%);
    animation: shipGlow 2s infinite ease-in-out;
}

.blue-ship {
    background: radial-gradient(circle, #0088ff 0%, #0055aa 50%, transparent 70%);
    animation: shipGlow 2s infinite ease-in-out;
}

.black-ship {
    background: radial-gradient(circle, #ff0000 0%, #000000 50%, transparent 70%);
    animation: shipGlow 2s infinite ease-in-out;
}

@keyframes shipGlow {
    0%, 100% { box-shadow: 0 0 20px currentColor; }
    50% { box-shadow: 0 0 40px currentColor; }
}

.ship-card h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 10px;
}

.ship-card .ship-desc {
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 15px;
}

.ship-price {
    font-size: 20px;
    color: #ffaa00;
    font-weight: bold;
    margin-bottom: 15px;
}

.owned-badge {
    background: #00ff00;
    color: #000;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}

.ship-status {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}

.buy-btn, .select-btn {
    width: 100%;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.6);
}

.buy-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.select-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.select-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(56, 239, 125, 0.6);
}

.select-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#closeShop {
    width: 100%;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#closeShop:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========== 새로운 UI 디자인 ========== */

/* 제목 스타일 개선 */
#startScreen h1 {
    font-size: 56px !important;
    background: linear-gradient(135deg, #00d4ff, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    animation: pulseGlow 2s ease-in-out infinite;
}

.subtitle {
    font-size: 20px;
    color: rgba(168, 85, 247, 0.9);
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
    margin-top: -20px;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.8));
    }
}

/* UI 패널 재디자인 */
.ui-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.9) 0%, rgba(5, 10, 30, 0.9) 100%);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
}

.ui-row {
    display: flex;
    gap: 12px;
}

.ui-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ui-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.5);
    border-color: rgba(0, 212, 255, 0.6);
}

.ui-label {
    font-size: 20px;
}

.ui-value {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ========== 게임 컨트롤 버튼 (중앙 정렬) ========== */
.game-controls {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* 기본적으로 숨김 - 게임 시작 시에만 표시 */
    flex-direction: row;
    gap: 12px;
    z-index: 15;
    justify-content: center;
}

/* 게임 활성화 시 표시 */
.game-controls.active {
    display: flex;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.98) 0%, rgba(5, 10, 30, 0.98) 100%);
    border: 2px solid rgba(0, 212, 255, 0.6);
    border-radius: 14px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3), 
                inset 0 0 15px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(0, 212, 255, 0.15);
    backdrop-filter: blur(15px);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    min-width: 110px;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 48px rgba(0, 212, 255, 0.7), 
                inset 0 0 20px rgba(0, 0, 0, 0.5),
                0 0 80px rgba(0, 212, 255, 0.4);
    border-color: rgba(0, 212, 255, 1);
}

.control-btn:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 16px;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.8));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.btn-text {
    letter-spacing: 1.5px;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.8),
                 0 2px 4px rgba(0, 0, 0, 0.8);
}

.home-btn {
    border-color: rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, rgba(150, 50, 200, 0.25) 0%, rgba(100, 30, 150, 0.25) 100%),
                linear-gradient(135deg, rgba(10, 20, 60, 0.98) 0%, rgba(5, 10, 30, 0.98) 100%);
}

.home-btn:hover {
    border-color: rgba(168, 85, 247, 1);
    box-shadow: 0 12px 48px rgba(168, 85, 247, 0.8), 
                inset 0 0 20px rgba(150, 50, 200, 0.3),
                0 0 100px rgba(168, 85, 247, 0.5);
}

.home-btn .btn-icon {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.8));
}

.home-btn .btn-text {
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.8),
                 0 2px 4px rgba(0, 0, 0, 0.8);
}

.pause-btn {
    border-color: rgba(0, 212, 255, 0.6);
    background: linear-gradient(135deg, rgba(0, 100, 200, 0.25) 0%, rgba(0, 50, 150, 0.25) 100%),
                linear-gradient(135deg, rgba(10, 20, 60, 0.98) 0%, rgba(5, 10, 30, 0.98) 100%);
}

.pause-btn:hover {
    border-color: rgba(0, 212, 255, 1);
    box-shadow: 0 12px 48px rgba(0, 212, 255, 0.8), 
                inset 0 0 20px rgba(0, 100, 200, 0.3),
                0 0 100px rgba(0, 212, 255, 0.5);
}

.restart-btn {
    border-color: rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.25) 0%, rgba(150, 0, 0, 0.25) 100%),
                linear-gradient(135deg, rgba(10, 20, 60, 0.98) 0%, rgba(5, 10, 30, 0.98) 100%);
}

.restart-btn:hover {
    border-color: rgba(239, 68, 68, 1);
    box-shadow: 0 12px 48px rgba(239, 68, 68, 0.8), 
                inset 0 0 20px rgba(200, 0, 0, 0.3),
                0 0 100px rgba(239, 68, 68, 0.5);
}

.restart-btn .btn-icon {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.9));
}

.restart-btn .btn-text {
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.8),
                 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ========== 스테이지 표시 (상단 중앙) ========== */
#stageDisplay {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 35px;
    background: linear-gradient(135deg, 
        rgba(10, 20, 60, 0.98) 0%, 
        rgba(20, 10, 40, 0.98) 50%,
        rgba(30, 0, 50, 0.98) 100%);
    border: 3px solid transparent;
    border-radius: 20px;
    box-shadow: 
        0 0 30px rgba(138, 43, 226, 0.6),
        0 0 60px rgba(0, 212, 255, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    z-index: 100;
    overflow: hidden;
}

/* 보스 상태 표시 */
#bossStatus {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    animation: bossStatusSlideIn 0.5s ease-out;
}

@keyframes bossStatusSlideIn {
    from {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.boss-status-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 30px;
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.95) 0%, 
        rgba(70, 0, 0, 0.95) 100%);
    border: 3px solid #ff0000;
    border-radius: 15px;
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.6),
        0 0 60px rgba(255, 100, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    animation: bossPulse 2s ease-in-out infinite;
}

@keyframes bossPulse {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(255, 0, 0, 0.6),
            0 0 60px rgba(255, 100, 0, 0.4),
            inset 0 0 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(255, 0, 0, 0.8),
            0 0 80px rgba(255, 100, 0, 0.6),
            inset 0 0 25px rgba(0, 0, 0, 0.5);
    }
}

.boss-icon {
    font-size: 32px;
    animation: bossIconBounce 1s ease-in-out infinite;
}

@keyframes bossIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.boss-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.boss-name {
    font-size: 20px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.boss-subtitle {
    font-size: 12px;
    color: #ffaaaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#stageDisplay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(135deg, 
        rgba(138, 43, 226, 0.8),
        rgba(0, 212, 255, 0.8),
        rgba(255, 0, 255, 0.6));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.stage-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 15px rgba(138, 43, 226, 1))
            drop-shadow(0 0 25px rgba(0, 212, 255, 0.8));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(138, 43, 226, 1))
                drop-shadow(0 0 25px rgba(0, 212, 255, 0.8));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(138, 43, 226, 1))
                drop-shadow(0 0 35px rgba(0, 212, 255, 1));
    }
}

.stage-text {
    font-size: 20px;
    font-weight: 700;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.8),
                 0 0 10px rgba(138, 43, 226, 0.6),
                 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

#stageNumber {
    color: #00d4ff;
    font-size: 26px;
    font-weight: 900;
    text-shadow: 0 0 25px rgba(0, 212, 255, 1),
                 0 0 15px rgba(138, 43, 226, 0.8),
                 0 0 40px rgba(255, 255, 255, 0.6);
    animation: numberGlow 2s ease-in-out infinite;
}

@keyframes numberGlow {
    0%, 100% {
        text-shadow: 0 0 25px rgba(0, 212, 255, 1),
                     0 0 15px rgba(138, 43, 226, 0.8),
                     0 0 40px rgba(255, 255, 255, 0.6);
    }
    50% {
        text-shadow: 0 0 35px rgba(0, 212, 255, 1),
                     0 0 25px rgba(138, 43, 226, 1),
                     0 0 50px rgba(255, 255, 255, 0.8);
    }
}

/* 재시작 확인 모달 */
#restartModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.98) 0%, rgba(5, 10, 30, 0.98) 100%);
    padding: 40px 50px;
    border-radius: 20px;
    border: 3px solid rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-content h2 {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 28px;
    color: #00d4ff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.modal-content p {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.confirm-btn, .cancel-btn {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
}

.confirm-btn {
    background: linear-gradient(135deg, rgba(0, 200, 100, 0.3), rgba(0, 150, 80, 0.3));
    border-color: #00ff88;
    color: #00ff88;
}

.confirm-btn:hover {
    background: linear-gradient(135deg, rgba(0, 200, 100, 0.5), rgba(0, 150, 80, 0.5));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
    transform: scale(1.05);
}

.cancel-btn {
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.3), rgba(150, 0, 0, 0.3));
    border-color: #ff4444;
    color: #ff4444;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.5), rgba(150, 0, 0, 0.5));
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
    transform: scale(1.05);
}

/* 승리 화면 */
#victoryScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#victoryContent, .victory-content {
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.98) 0%, rgba(5, 10, 30, 0.98) 100%);
    padding: 60px 80px;
    border-radius: 30px;
    border: 4px solid rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 100px rgba(255, 215, 0, 0.6), 
                inset 0 0 50px rgba(255, 215, 0, 0.1),
                0 0 200px rgba(255, 215, 0, 0.3);
    text-align: center;
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 100px rgba(255, 215, 0, 0.6), 
                    inset 0 0 50px rgba(255, 215, 0, 0.1),
                    0 0 200px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 120px rgba(255, 215, 0, 0.8), 
                    inset 0 0 60px rgba(255, 215, 0, 0.2),
                    0 0 250px rgba(255, 215, 0, 0.4);
    }
}

#victoryContent h1, .victory-content h1 {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 1),
                 0 0 60px rgba(255, 215, 0, 0.8),
                 0 0 90px rgba(255, 215, 0, 0.6);
    animation: victoryTextGlow 1.5s ease-in-out infinite;
}

@keyframes victoryTextGlow {
    0%, 100% {
        text-shadow: 0 0 30px rgba(255, 215, 0, 1),
                     0 0 60px rgba(255, 215, 0, 0.8),
                     0 0 90px rgba(255, 215, 0, 0.6);
    }
    50% {
        text-shadow: 0 0 40px rgba(255, 215, 0, 1),
                     0 0 80px rgba(255, 215, 0, 1),
                     0 0 120px rgba(255, 215, 0, 0.8);
    }
}

.victory-message {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.victory-score {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.score-label {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 15px;
    font-weight: 600;
}

.score-value {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 64px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 1),
                 0 0 40px rgba(255, 215, 0, 0.8);
    animation: scoreFloat 2s ease-in-out infinite;
}

@keyframes scoreFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.victory-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.victory-btn {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid;
    letter-spacing: 1px;
}

.victory-btn.home-btn {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(139, 92, 246, 0.4));
    border-color: #a855f7;
    color: #ffffff;
}

.victory-btn.home-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(139, 92, 246, 0.6));
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.8);
    transform: scale(1.05);
}

.victory-btn.restart-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(220, 38, 38, 0.4));
    border-color: #ef4444;
    color: #ffffff;
}

.victory-btn.restart-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.6), rgba(220, 38, 38, 0.6));
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
    transform: scale(1.05);
}

/* 카운트다운 오버레이 */
#countdownOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#countdownNumber {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 120px;
    font-weight: 900;
    color: #00d4ff;
    text-shadow: 0 0 40px rgba(0, 212, 255, 1),
                 0 0 80px rgba(0, 212, 255, 0.8),
                 0 0 120px rgba(0, 212, 255, 0.6);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 일시정지 오버레이 */
#pauseOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.pause-content {
    text-align: center;
    padding: 60px;
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.95) 0%, rgba(5, 10, 30, 0.95) 100%);
    border: 3px solid rgba(0, 212, 255, 0.5);
    border-radius: 30px;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.5);
}

.pause-content h1 {
    font-size: 48px;
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    margin-bottom: 40px;
}

.pause-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.resume-btn, .restart-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resume-btn {
    background: linear-gradient(135deg, #00d4ff, #00a8cc);
    border-color: #00d4ff;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.5);
}

.resume-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.7);
}

.restart-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: white;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5);
}

.restart-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.7);
}

/* 스테이지 메시지 */

#stageMessage p {
    font-size: 24px;
    color: rgba(0, 212, 255, 0.9);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

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

/* Footer */
.game-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    text-align: center;
    z-index: 5;
}

.footer-content p {
    font-size: 14px;
    color: rgba(0, 212, 255, 0.8);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    letter-spacing: 1px;
}

.footer-content strong {
    color: rgba(168, 85, 247, 0.9);
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
}

/* 스토리 화면 */
#storyIntro, #storyOutro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0, 0, 30, 0.98), 
        rgba(10, 0, 40, 0.98),
        rgba(20, 0, 50, 0.98));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow: hidden;
}

#storyIntro::before, #storyOutro::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(0, 212, 255, 0.1) 0%, 
        transparent 50%);
    animation: storyGlow 8s ease-in-out infinite;
}

@keyframes storyGlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(10%, 10%) scale(1.1);
        opacity: 0.6;
    }
}

.story-content {
    max-width: 800px;
    width: 90%;
    padding: 50px;
    text-align: left;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.2),
                inset 0 0 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.story-title {
    font-size: 52px;
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 1),
                 0 0 60px rgba(138, 43, 226, 0.6);
    margin-bottom: 50px;
    text-align: center;
    animation: titlePulse 3s ease-in-out infinite;
    letter-spacing: 3px;
}

@keyframes titlePulse {
    0%, 100% {
        text-shadow: 0 0 30px rgba(0, 212, 255, 1),
                     0 0 60px rgba(138, 43, 226, 0.6);
    }
    50% {
        text-shadow: 0 0 40px rgba(0, 212, 255, 1),
                     0 0 80px rgba(138, 43, 226, 0.8),
                     0 0 100px rgba(255, 0, 255, 0.4);
    }
}

.story-text {
    margin-bottom: 50px;
    padding: 20px;
    border-left: 3px solid rgba(0, 212, 255, 0.5);
    background: linear-gradient(90deg, 
        rgba(0, 212, 255, 0.05) 0%,
        transparent 100%);
}

.story-line {
    font-size: 18px;
    color: #fff;
    line-height: 2;
    margin-bottom: 15px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    padding-left: 15px;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8),
                 0 0 10px rgba(0, 212, 255, 0.3);
    animation: lineSlideIn 0.6s ease-out forwards, textGlitch 0.1s ease-in-out;
}

/* 타이핑 중 글리치 효과 */
@keyframes textGlitch {
    0%, 100% {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8),
                     0 0 10px rgba(0, 212, 255, 0.3);
    }
    25% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8),
                     -2px 0 10px rgba(255, 0, 255, 0.5);
    }
    50% {
        text-shadow: -2px 2px 4px rgba(0, 0, 0, 0.8),
                     2px 0 10px rgba(0, 255, 255, 0.5);
    }
    75% {
        text-shadow: 2px -2px 4px rgba(0, 0, 0, 0.8),
                     0 2px 10px rgba(255, 255, 0, 0.5);
    }
}

.story-line::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #00d4ff;
    opacity: 0;
    animation: arrowFade 0.8s ease-out 0.3s forwards;
}

@keyframes lineSlideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes arrowFade {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.story-btn {
    background: linear-gradient(135deg, #00d4ff, #8a2be2);
    color: #fff;
    border: 2px solid rgba(0, 212, 255, 0.6);
    padding: 18px 60px;
    border-radius: 15px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4),
                0 0 40px rgba(138, 43, 226, 0.3);
    animation: btnPulse 2s ease-in-out infinite;
    display: block;
    margin: 0 auto;
}

.story-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.story-btn:hover::before {
    width: 300px;
    height: 300px;
}

.story-btn:hover {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.8),
                0 0 60px rgba(138, 43, 226, 0.6),
                0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 212, 255, 1);
}

@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.4),
                    0 0 40px rgba(138, 43, 226, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.6),
                    0 0 60px rgba(138, 43, 226, 0.5);
    }
}

/* 승리 모달 */
.victory-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.victory-modal.show {
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, rgba(10, 20, 60, 0.98), rgba(20, 10, 40, 0.98));
    border: 3px solid rgba(0, 212, 255, 0.6);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.8),
                0 0 120px rgba(138, 43, 226, 0.6);
    animation: modalSlideIn 0.8s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header h2 {
    font-size: 36px;
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 1);
    margin-bottom: 30px;
    animation: modalPulse 2s ease-in-out infinite;
}

@keyframes modalPulse {
    0%, 100% {
        text-shadow: 0 0 30px rgba(0, 212, 255, 1);
    }
    50% {
        text-shadow: 0 0 50px rgba(0, 212, 255, 1),
                     0 0 80px rgba(138, 43, 226, 0.8);
    }
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 35px;
}

.modal-stat {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(138, 43, 226, 0.1));
    padding: 20px 30px;
    border-radius: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    transition: all 0.3s;
}

.modal-stat:hover {
    transform: scale(1.05);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.modal-stat .stat-icon {
    font-size: 48px;
    margin-right: 25px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.modal-stat .stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.modal-stat .stat-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.modal-stat .stat-number {
    font-size: 42px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 1),
                 0 0 40px rgba(255, 215, 0, 0.6);
    animation: numberCountGlow 1.5s ease-out;
}

@keyframes numberCountGlow {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.score-stat {
    border-color: rgba(0, 212, 255, 0.4);
}

.coins-stat {
    border-color: rgba(255, 215, 0, 0.4);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.modal-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid;
    letter-spacing: 1px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(139, 92, 246, 0.4));
    border-color: #a855f7;
    color: #ffffff;
}

.modal-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(139, 92, 246, 0.6));
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.8);
    transform: scale(1.05);
}

.home-modal-btn {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(139, 92, 246, 0.4));
    border-color: #a855f7;
}

.home-modal-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(139, 92, 246, 0.6));
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.8);
}
