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

/* 고주사율 디스플레이 최적화 (120fps+ 지원) */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    padding: 15px;
    color: #fff;
    overflow-x: hidden;
}

/* 고성능 렌더링을 위한 GPU 가속 */
.nameplate,
.nameplate-glow,
.nameplate-aura,
.floating-particle,
.star,
.magpie {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 10px;
    padding-top: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite;
}

/* 이름표 + 미니 통계 wrapper */
.nameplate-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-right: 60px;
}

/* 미니 통계 (이상기 카드 옆) - PC에서 숨김 */
.mini-stats {
    display: none;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 70px;
}

.mini-label {
    font-size: 0.65rem;
    color: #aaa;
    font-weight: 500;
    margin-bottom: 2px;
}

.mini-value {
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 미니 통계 (스탯창 아래) - PC/모바일 공통 */
.mobile-mini-stats {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.mobile-mini-stats .mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 55px;
}

.mobile-mini-stats .mini-label {
    font-size: 0.55rem;
    color: #aaa;
    font-weight: 500;
}

.mobile-mini-stats .mini-value {
    font-size: 0.7rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* 상태 표시 컨테이너 (골드 + 방지권) */
.status-display {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
}

/* 보유 골드 표시 */
.gold-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 6px 12px;
    min-width: 100px;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    border-radius: 20px;
    box-shadow: 0 3px 12px rgba(243, 156, 18, 0.4);
    animation: goldPulse 2s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.gold-display.increase {
    animation: goldIncrease 0.5s ease;
}

.gold-display.decrease {
    animation: goldDecrease 0.5s ease;
}

@keyframes goldIncrease {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%); }
    100% { transform: scale(1); }
}

@keyframes goldDecrease {
    0% { transform: scale(1); }
    25% { transform: scale(0.95); background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
    100% { transform: scale(1); }
}

/* 방지권 표시 */
.protection-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 6px 12px;
    min-width: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.protection-display:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
}

.protection-icon {
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.protection-amount {
    font-size: 0.9rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 35px;
    text-align: right;
}

/* 전투 화폐 표시 - 1줄 2열 레이아웃 */
.battle-currency-display {
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.currency-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    min-width: 55px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.currency-item:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
}

.currency-icon {
    font-size: 0.9rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.currency-amount {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    min-width: 30px;
    text-align: right;
}

.main-content {
    position: relative;
}

.gold-icon {
    font-size: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.gold-amount {
    font-size: 0.9rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 70px;
    text-align: right;
    transition: all 0.1s ease;
}

@keyframes goldPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(243, 156, 18, 0.6);
    }
}

.game-area {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 이름표 스타일 */
.nameplate-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.nameplate {
    position: relative;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 40px 55px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 4px solid #7f8c8d;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    overflow: hidden;
    cursor: pointer;
}

.nameplate:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 30px currentColor;
}

.nameplate:active {
    transform: translateY(-3px) scale(1.01);
}

/* 이상기 배경 이미지 오버레이 */
.nameplate-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease, background-image 0.5s ease;
    border-radius: 16px;
    z-index: 0;
    pointer-events: none;
    filter: blur(1px);
}

.nameplate-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.3) 100%);
    border-radius: 16px;
}

/* 글로우 효과 - 레벨별 강화 */
.nameplate-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.5), transparent);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(15px);
}

.nameplate.enhanced .nameplate-glow {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

/* 레벨별 추가 효과 레이어 */
.nameplate.level-high .nameplate-glow {
    filter: blur(20px);
    box-shadow: 0 0 40px currentColor, 0 0 80px currentColor;
}

.nameplate.level-epic .nameplate-glow {
    filter: blur(25px);
    box-shadow: 0 0 50px currentColor, 0 0 100px currentColor, 0 0 150px currentColor;
}

.nameplate.level-legendary .nameplate-glow {
    filter: blur(30px);
    box-shadow: 0 0 60px currentColor, 0 0 120px currentColor, 0 0 180px currentColor;
    animation: glowPulse 1.5s ease-in-out infinite, glowRotate 4s linear infinite;
}

@keyframes glowRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
        filter: blur(15px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
        filter: blur(20px);
    }
}

/* 오라 효과 */
.nameplate-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    animation: auraRotate 3s linear infinite;
    pointer-events: none;
}

.nameplate.enhanced .nameplate-aura {
    opacity: 1;
}

@keyframes auraRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1.1);
        opacity: 0.3;
    }
}

/* 떠다니는 파티클 */
.nameplate-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}

.floating-particle {
    position: absolute;
    width: 3px;
    height: 20px;
    background: linear-gradient(to top, transparent, #ffd700, transparent);
    border-radius: 50%;
    opacity: 0;
    animation: floatUp 3s ease-in-out infinite;
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(1);
    }
}

/* 회전하는 테두리 - 기본 */
.nameplate::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        rgba(255, 215, 0, 0.8),
        rgba(255, 255, 255, 0.5),
        transparent
    );
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    filter: blur(4px);
}

.nameplate.enhanced::before {
    opacity: 1;
}

/* 고레벨 추가 회전 링 */
.nameplate.level-high::after,
.nameplate.level-epic::after,
.nameplate.level-legendary::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    background: conic-gradient(
        from 180deg,
        transparent,
        currentColor,
        transparent
    );
    border-radius: 25px;
    opacity: 0.6;
    z-index: -2;
    animation: borderRotate 2s linear infinite reverse;
    filter: blur(6px);
}

@keyframes borderRotate {
    0% {
        transform: rotate(0deg);
        filter: blur(4px);
    }
    50% {
        filter: blur(6px);
    }
    100% {
        transform: rotate(360deg);
        filter: blur(4px);
    }
}

/* 번개 효과 */
.nameplate::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    animation: lightning 4s ease-in-out infinite;
}

.nameplate.enhanced::after {
    opacity: 1;
}

@keyframes lightning {
    0%, 90%, 100% {
        opacity: 0;
        transform: translateX(-100%);
    }
    92% {
        opacity: 0.6;
        transform: translateX(100%);
    }
}

.nameplate-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.nameplate-level {
    font-size: 2rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.7);
    margin-bottom: 8px;
    animation: levelGlow 2s ease-in-out infinite;
}

@keyframes levelGlow {
    0%, 100% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.7);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 0 50px rgba(255, 215, 0, 0.9), 0 0 70px rgba(255, 215, 0, 0.6);
        transform: scale(1.05);
    }
}

.nameplate-rank {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 
                 0 0 20px currentColor,
                 0 0 30px currentColor;
    filter: drop-shadow(0 0 10px currentColor);
}

.nameplate-name {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

/* 등급별 소개 문구 */
.nameplate-description {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 1),
        0 2px 6px rgba(0, 0, 0, 0.8),
        0 0 12px rgba(0, 0, 0, 0.6);
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 5px 20px;
    letter-spacing: 1px;
    font-style: italic;
    transition: all 0.5s ease;
}

/* 등급별 문구 스타일 */
.nameplate-description.rank-common {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.nameplate-description.rank-general {
    color: #5dffca;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 15px rgba(26, 188, 156, 0.6);
}

.nameplate-description.rank-advanced {
    color: #7aff9e;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 18px rgba(46, 204, 113, 0.7);
}

.nameplate-description.rank-rare {
    color: #7ec8ff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(52, 152, 219, 0.8);
    font-weight: 700;
}

.nameplate-description.rank-hero {
    color: #d4a5ff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 22px rgba(155, 89, 182, 0.9);
    font-weight: 700;
}

.nameplate-description.rank-legend {
    color: #ff7b6b;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 25px rgba(231, 76, 60, 1);
    font-weight: 700;
    animation: legendGlow 2s ease-in-out infinite;
}

.nameplate-description.rank-myth {
    color: #ffb060;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 28px rgba(230, 126, 34, 1);
    font-weight: 800;
    animation: mythGlow 1.8s ease-in-out infinite;
}

.nameplate-description.rank-transcend {
    color: #ffe066;
    text-shadow: 
        0 0 20px rgba(255, 224, 102, 0.9),
        0 0 40px rgba(241, 196, 15, 0.7),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 800;
    animation: transcendPulse 2s ease-in-out infinite;
}

.nameplate-description.rank-immortal {
    color: #ff6b9d;
    text-shadow: 
        0 0 20px rgba(255, 107, 157, 0.9),
        0 0 40px rgba(255, 96, 144, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 800;
    animation: immortalPulse 1.5s ease-in-out infinite;
}

.nameplate-description.rank-celestial {
    color: #60e8ff;
    text-shadow: 
        0 0 20px rgba(96, 232, 255, 0.9),
        0 0 40px rgba(0, 210, 255, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    animation: celestialPulse 1.3s ease-in-out infinite;
}

.nameplate-description.rank-divine {
    color: #ff5080;
    text-shadow: 
        0 0 20px rgba(255, 80, 128, 0.9),
        0 0 40px rgba(255, 8, 68, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    animation: divinePulse 1.2s ease-in-out infinite;
}

.nameplate-description.rank-cosmic {
    color: #b87fff;
    text-shadow: 
        0 0 20px rgba(184, 127, 255, 0.9),
        0 0 40px rgba(142, 45, 226, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    animation: cosmicPulse 1s ease-in-out infinite;
}

/* 35단계: 차원의 경계를 허무는 초월자 */
.nameplate-description.rank-dimension35 {
    color: #60ff90;
    text-shadow: 
        0 0 20px rgba(96, 255, 144, 0.9),
        0 0 40px rgba(0, 242, 96, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    animation: dimensionPulse 0.8s ease-in-out infinite;
}

/* 36단계: 세계의 근원을 꿰뚫어 본 자 */
.nameplate-description.rank-dimension36 {
    color: #ff9090;
    text-shadow: 
        0 0 20px rgba(255, 144, 144, 0.9),
        0 0 40px rgba(255, 107, 107, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    animation: dimension36Pulse 0.7s ease-in-out infinite;
}

/* 37단계: 무한의 심연에서 귀환한 자 */
.nameplate-description.rank-dimension37 {
    color: #b87fff;
    text-shadow: 
        0 0 25px rgba(184, 127, 255, 0.9),
        0 0 50px rgba(142, 45, 226, 1),
        0 3px 6px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    animation: dimension37Pulse 0.6s ease-in-out infinite;
}

/* 38단계: 태초의 혼돈을 지배하는 영원 */
.nameplate-description.rank-ultimate38 {
    color: #ffe066;
    text-shadow: 
        0 0 30px rgba(255, 224, 102, 1),
        0 0 60px rgba(255, 215, 0, 1),
        0 3px 8px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    font-size: 0.88rem;
    letter-spacing: 1.5px;
    animation: ultimate38Pulse 0.5s ease-in-out infinite;
}

/* 39단계: 모든 운명의 끝에 서 있는 자 */
.nameplate-description.rank-ultimate39 {
    color: #ffffff;
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 1),
        0 0 60px rgba(255, 224, 102, 0.8),
        0 3px 8px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 2px;
    animation: ultimate39Pulse 0.4s ease-in-out infinite;
}

/* 40단계: ■■■존재 그 자체■■■ */
.nameplate-description.rank-ultimate40 {
    color: #ffffff;
    text-shadow: 
        0 0 35px rgba(255, 255, 255, 1),
        0 0 70px rgba(255, 215, 0, 1),
        0 0 100px rgba(255, 107, 157, 0.7),
        0 3px 10px rgba(0, 0, 0, 0.9);
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: 3px;
    animation: ultimate40Pulse 0.3s ease-in-out infinite;
}

@keyframes legendGlow {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

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

/* 새로운 펄스 애니메이션 (19강+) */
@keyframes transcendPulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.2);
    }
}

@keyframes immortalPulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.15);
        transform: scale(1.01);
    }
}

@keyframes celestialPulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.2);
    }
}

@keyframes divinePulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.15);
        transform: scale(1.02);
    }
}

@keyframes cosmicPulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1) hue-rotate(0deg);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.2) hue-rotate(10deg);
    }
}

@keyframes dimensionPulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.25);
        transform: scale(1.02);
    }
}

@keyframes dimension36Pulse {
    0%, 100% { 
        opacity: 0.9; 
        filter: brightness(1) hue-rotate(0deg);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.2) hue-rotate(15deg);
        transform: scale(1.03);
    }
}

@keyframes dimension37Pulse {
    0%, 100% { 
        opacity: 0.85; 
        filter: brightness(1) saturate(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.3) saturate(1.2);
    }
}

@keyframes ultimate38Pulse {
    0%, 100% { 
        opacity: 0.85; 
        filter: brightness(1);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.4);
        transform: scale(1.04);
    }
}

@keyframes ultimate39Pulse {
    0%, 100% { 
        opacity: 0.85; 
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.5) saturate(1.3);
        transform: scale(1.05);
    }
}

@keyframes ultimate40Pulse {
    0%, 100% { 
        opacity: 0.8; 
        filter: brightness(1) saturate(1);
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        filter: brightness(1.6) saturate(1.5);
        transform: scale(1.08);
    }
}

@keyframes dimension36Shine {
    0% { background-position: 0% center; }
    100% { background-position: 400% center; }
}

@keyframes dimension37Shine {
    0% { background-position: 0% center; }
    100% { background-position: 500% center; }
}

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

@keyframes ultimate38Shine {
    0% { background-position: 0% center; }
    100% { background-position: 400% center; }
}

@keyframes ultimate39Shine {
    0% { background-position: 0% center; }
    100% { background-position: 600% center; }
}

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

@keyframes ultimate40Shine {
    0% { background-position: 0% center; }
    100% { background-position: 800% center; }
}

@keyframes ultimate40Pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.06); filter: brightness(1.2); }
}

/* 별 스타일 */
.nameplate-stars {
    display: grid;
    grid-template-columns: repeat(8, auto);
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-height: 60px;
    margin-top: 10px;
    max-width: 100%;
}

.star {
    font-size: 1.6rem;
    animation: starTwinkle 2s ease-in-out infinite;
    filter: drop-shadow(0 0 5px currentColor);
}

/* 첫 번째 줄 별 (1-8번) - 하단 마진 추가 */
.star:nth-child(-n+8) {
    margin-bottom: 5px;
}

/* 9번째 별부터 줄바꿈 */
.star:nth-child(9) {
    grid-column: 1;
}

.star:nth-child(2) {
    animation-delay: 0.2s;
}

.star:nth-child(3) {
    animation-delay: 0.4s;
}

.star:nth-child(4) {
    animation-delay: 0.6s;
}

.star:nth-child(5) {
    animation-delay: 0.8s;
}

.star:nth-child(6) {
    animation-delay: 1s;
}

.star:nth-child(7) {
    animation-delay: 1.2s;
}

.star:nth-child(8) {
    animation-delay: 1.4s;
}

.star:nth-child(9) {
    animation-delay: 1.6s;
}

.star:nth-child(10) {
    animation-delay: 1.8s;
}

.star:nth-child(11) {
    animation-delay: 2s;
}

.star:nth-child(12) {
    animation-delay: 2.2s;
}

.star:nth-child(13) {
    animation-delay: 2.4s;
}

.star:nth-child(14) {
    animation-delay: 2.6s;
}

.star:nth-child(15) {
    animation-delay: 2.8s;
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15) rotate(180deg);
    }
}

/* 고레벨 별 추가 효과 */
.nameplate.level-epic .star,
.nameplate.level-legendary .star {
    animation: starTwinkle 1.5s ease-in-out infinite, starFloat 3s ease-in-out infinite;
}

/* 능력치 표시 (방지권 아래) */
.nameplate-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
}

.stat-icon {
    font-size: 0.75rem;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.stat-value {
    font-size: 0.7rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    min-width: 28px;
}

@keyframes starFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
}

/* 강화 확률 표시 (카드 아래) */
.enhance-rates {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0 20px 0;
    padding: 18px 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.rate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    min-width: 90px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.rate-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rate-label {
    font-size: 0.8rem;
    color: #ddd;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.rate-value {
    font-size: 1.5rem;
    font-weight: 900;
    text-shadow: 0 2px 10px currentColor, 0 0 15px currentColor;
}

.rate-item.success .rate-value {
    color: #4caf50;
}

.rate-item.destroy .rate-value {
    color: #f44336;
}

.rate-item.maintain .rate-value {
    color: #2196f3;
}

/* 버튼 */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-cost,
.btn-price {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cost {
    color: #667eea;
}

.btn-price {
    color: #f1c40f;
}

.btn {
    padding: 20px;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    position: relative;
    overflow: hidden;
}

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

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-enhance {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-enhance:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-enhance:active {
    transform: translateY(-1px);
}

.btn-enhance:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sell {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-sell:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.6);
}

.btn-sell:active {
    transform: translateY(-1px);
}

.btn-sell:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 우하단 버튼 컨테이너 (랭킹 + 까치) */
.fixed-buttons-corner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 9998;
}

/* 랭킹 버튼 */
.btn-ranking-fixed {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4), 0 0 20px rgba(243, 156, 18, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rankingPulse 2s ease-in-out infinite;
}

.btn-ranking-fixed:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(243, 156, 18, 0.6), 0 0 30px rgba(243, 156, 18, 0.4);
}

.btn-ranking-fixed:active {
    transform: scale(0.95);
}

@keyframes rankingPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4), 0 0 20px rgba(243, 156, 18, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(243, 156, 18, 0.6), 0 0 30px rgba(243, 156, 18, 0.4);
    }
}

/* 까치 버튼 */
.btn-magpie-fixed {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4), 0 0 20px rgba(46, 204, 113, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: magpiePulse 2s ease-in-out infinite;
}

.btn-magpie-fixed:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(46, 204, 113, 0.6), 0 0 30px rgba(46, 204, 113, 0.4);
}

.btn-magpie-fixed:active {
    transform: scale(0.95);
}

@keyframes magpiePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4), 0 0 20px rgba(46, 204, 113, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(46, 204, 113, 0.6), 0 0 30px rgba(46, 204, 113, 0.4);
    }
}

/* 슬롯 버튼 */
.btn-slot-fixed {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4), 0 0 20px rgba(155, 89, 182, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slotPulse 2s ease-in-out infinite;
}

.btn-slot-fixed:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(155, 89, 182, 0.6), 0 0 30px rgba(155, 89, 182, 0.4);
}

.btn-slot-fixed:active {
    transform: scale(0.95);
}

@keyframes slotPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4), 0 0 20px rgba(155, 89, 182, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.6), 0 0 30px rgba(155, 89, 182, 0.4);
    }
}

/* 전투 버튼 */
.btn-battle-fixed {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4), 0 0 20px rgba(231, 76, 60, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: battlePulse 2s ease-in-out infinite;
}

.btn-battle-fixed:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.6), 0 0 30px rgba(231, 76, 60, 0.4);
}

.btn-battle-fixed:active {
    transform: scale(0.95);
}

@keyframes battlePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4), 0 0 20px rgba(231, 76, 60, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.6), 0 0 30px rgba(231, 76, 60, 0.4);
    }
}

/* ===== 이상기 슬롯 모달 ===== */
.slot-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.slot-modal-overlay.active {
    display: flex;
}

.slot-modal-content {
    background: linear-gradient(145deg, #1e1e3f 0%, #2d2d5a 100%);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid rgba(155, 89, 182, 0.5);
    box-shadow: 0 0 50px rgba(155, 89, 182, 0.3);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.slot-header h2 {
    font-size: 1.5rem;
    color: #fff;
}

.btn-slot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-slot-close:hover {
    background: rgba(231, 76, 60, 0.5);
    transform: rotate(90deg);
}

.slot-info {
    text-align: center;
    margin-bottom: 20px;
    color: #aaa;
}

.slot-info p {
    margin: 5px 0;
}

.slot-warning {
    color: #f39c12 !important;
    font-weight: 600;
}

.slot-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.slot-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(155, 89, 182, 0.4);
    border-radius: 15px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.slot-item:hover {
    border-color: rgba(155, 89, 182, 0.8);
    background: rgba(155, 89, 182, 0.1);
}

.slot-item.filled {
    border-style: solid;
    border-color: rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.05);
}

.slot-empty {
    text-align: center;
    color: #666;
}

.slot-number {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
}

.slot-placeholder {
    font-size: 1rem;
    color: #555;
}

/* 슬롯 안의 미니 카드 */
.slot-card {
    width: 100%;
    padding: 10px;
    text-align: center;
}

.slot-card-level {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.slot-card-name {
    font-size: 0.9rem;
    color: #fff;
    margin: 5px 0;
}

.slot-card-job {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.8rem;
    margin: 5px 0;
}

.slot-card-stats {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 5px;
}

.slot-card-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    justify-content: center;
}

.btn-slot-action {
    padding: 5px 10px;
    font-size: 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-slot-retrieve {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-slot-retire {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-slot-action:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.slot-actions {
    text-align: center;
    margin-bottom: 15px;
}

.btn-slot-store {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-slot-store:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.4);
}

.btn-slot-store:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slot-current-info {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    color: #aaa;
}

.slot-current-info span {
    color: #ffd700;
    font-weight: 700;
}

/* ===== 전투 모달 ===== */
.battle-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.battle-modal-overlay.active {
    display: flex;
}

.battle-modal-content {
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 700px;
    background: linear-gradient(180deg, #0d0d1a 0%, #1a1a2e 50%, #0d0d1a 100%);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(231, 76, 60, 0.3);
    display: flex;
    flex-direction: column;
}

/* 전투 로비 */
.battle-lobby {
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.battle-header h2 {
    font-size: 1.8rem;
    color: #e74c3c;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

.btn-battle-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-battle-close:hover {
    background: rgba(231, 76, 60, 0.5);
}

.battle-resources {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.resource-icon {
    font-size: 1.3rem;
}

.resource-name {
    color: #aaa;
    font-size: 0.9rem;
}

.resource-value {
    color: #ffd700;
    font-weight: 700;
    font-size: 1.1rem;
}

.battle-party-section {
    flex: 1;
    margin-bottom: 20px;
}

.battle-party-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
}

.battle-party {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.party-member {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    min-width: 120px;
    transition: all 0.3s ease;
}

.party-member:hover {
    border-color: rgba(255, 215, 0, 0.6);
    transform: translateY(-5px);
}

.party-member-level {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffd700;
}

.party-member-job {
    font-size: 1.5rem;
    margin: 5px 0;
}

.party-member-name {
    font-size: 0.85rem;
    color: #aaa;
}

.party-empty {
    color: #555;
    padding: 40px;
    text-align: center;
}

.battle-record {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #aaa;
}

.battle-record strong {
    color: #f39c12;
    font-size: 1.3rem;
}

.btn-start-battle {
    width: 100%;
    padding: 18px;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-start-battle:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
}

.btn-start-battle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #555;
}

.battle-requirement {
    text-align: center;
    color: #e74c3c;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* 수학 시험지 애니메이션 (메인 상점용) */
@keyframes mathTestFlash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

@keyframes mathTestLevelUp {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.2);
        filter: brightness(2) saturate(1.5);
    }
    50% {
        transform: scale(1.15);
        filter: brightness(1.8) saturate(1.3);
    }
    75% {
        transform: scale(1.1);
        filter: brightness(1.5) saturate(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1) saturate(1);
    }
}

@keyframes mathFormulaFly0 {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + 150px), calc(-50% - 200px)) scale(1.5) rotate(360deg);
    }
}

@keyframes mathFormulaFly1 {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% - 150px), calc(-50% - 180px)) scale(1.5) rotate(-360deg);
    }
}

@keyframes mathFormulaFly2 {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + 180px), calc(-50% + 100px)) scale(1.5) rotate(720deg);
    }
}

@keyframes mathFormulaFly3 {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% - 180px), calc(-50% + 80px)) scale(1.5) rotate(-720deg);
    }
}

/* 전투 아레나 */
.battle-arena {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wave-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wave-label {
    font-size: 0.9rem;
    color: #888;
}

.wave-number {
    font-size: 2rem;
    font-weight: 900;
    color: #e74c3c;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

.enemy-count {
    color: #aaa;
    font-size: 1rem;
}

.enemy-count span:last-child {
    color: #e74c3c;
    font-weight: 700;
}

.btn-speed {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-speed:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-speed.active {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* 전투 필드 */
.arena-field {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.dungeon-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        #0a0a15 0%, 
        #151528 30%, 
        #1a1a35 50%,
        #0f0f20 70%,
        #050510 100%
    );
    z-index: 0;
}

.dungeon-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(75, 0, 130, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
}

.dungeon-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, transparent 0%, rgba(50, 50, 80, 0.3) 100%);
}

.enemy-zone {
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.ally-zone {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.effect-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* ===== 이상기 전투 카드 (아군) ===== */
/* ===== 전투 카드 스타일 (깔끔한 단색 카드) ===== */
.battle-card {
    position: relative;
    width: 110px;
    height: 155px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 
        0 0 25px var(--card-glow, rgba(255, 215, 0, 0.5)),
        0 8px 20px rgba(0, 0, 0, 0.6);
    animation: cardFloat 2s ease-in-out infinite;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: var(--card-bg, linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%));
}

.battle-card:hover {
    transform: scale(1.08);
    box-shadow: 
        0 0 40px var(--card-glow, rgba(255, 215, 0, 0.8)),
        0 10px 30px rgba(0, 0, 0, 0.7);
}

/* 전설+ 등급 테두리 효과 */
.battle-card.legendary {
    border: 3px solid transparent;
    background: 
        var(--card-bg, linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%)),
        linear-gradient(45deg, #ff0844, #ffb199, #ffd700, #ff0844);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    animation: cardFloat 2s ease-in-out infinite, legendaryGlow 2s ease-in-out infinite;
}

.battle-card.epic {
    border: 3px solid transparent;
    background: 
        var(--card-bg, linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%)),
        linear-gradient(45deg, #9333ea, #a855f7, #00d2ff, #9333ea);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    animation: cardFloat 2s ease-in-out infinite, epicGlow 2s ease-in-out infinite;
}

.battle-card.rare {
    border: 3px solid transparent;
    background: 
        var(--card-bg, linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%)),
        linear-gradient(45deg, #e74c3c, #f39c12, #e74c3c);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

@keyframes legendaryGlow {
    0%, 100% { box-shadow: 0 0 25px #ff0844, 0 0 50px rgba(255, 8, 68, 0.5); }
    50% { box-shadow: 0 0 35px #ffd700, 0 0 70px rgba(255, 215, 0, 0.7); }
}

@keyframes epicGlow {
    0%, 100% { box-shadow: 0 0 25px #9333ea, 0 0 50px rgba(147, 51, 234, 0.5); }
    50% { box-shadow: 0 0 35px #00d2ff, 0 0 70px rgba(0, 210, 255, 0.7); }
}

.battle-card-content {
    position: relative;
    z-index: 3;
    padding: 8px;
    text-align: center;
    height: calc(100% - 22px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.battle-card-job {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.3rem;
    padding: 5px 7px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

/* 강화 레벨 뱃지 */
.battle-card-level-badge {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 1),
        0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: levelPulse 1.5s ease-in-out infinite;
}

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

/* 등급 수식어 뱃지 */
.battle-card-grade-badge {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    margin-bottom: 2px;
    animation: gradeShine 2s ease-in-out infinite;
}

@keyframes gradeShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.battle-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.8);
    margin-top: 2px;
}

.battle-card-job-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 8px;
}

/* 카드 빛나는 효과 (고레벨) */
.battle-card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: cardShine 3s ease-in-out infinite;
    z-index: 4;
    pointer-events: none;
}

@keyframes cardShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.battle-card-hp {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: rgba(0, 0, 0, 0.7);
    z-index: 4;
}

.battle-card-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.battle-card-hp-fill.warning {
    background: linear-gradient(90deg, #f39c12, #e67e22);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.battle-card-hp-fill.danger {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    animation: hpDanger 0.5s ease-in-out infinite;
}

.battle-card-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

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

@keyframes hpDanger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 카드 공격 애니메이션 */
.battle-card.attacking {
    animation: cardAttack 0.4s ease-out;
}

@keyframes cardAttack {
    0% { transform: translateX(0); }
    30% { transform: translateX(-30px) scale(1.1); }
    60% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

/* 카드 피격 애니메이션 */
.battle-card.hit {
    animation: cardHit 0.3s ease-out;
}

@keyframes cardHit {
    0% { filter: brightness(1); transform: translateY(0); }
    30% { filter: brightness(2) hue-rotate(-30deg); transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    100% { filter: brightness(1); transform: translateY(0); }
}

/* 카드 사망 애니메이션 */
.battle-card.dead {
    animation: none !important;
    opacity: 0.3;
    filter: grayscale(100%);
    transform: scale(0.9);
}

@keyframes allyDeath {
    0% { opacity: 1; transform: scale(1); filter: grayscale(0%); }
    50% { filter: brightness(0.5) grayscale(50%); }
    100% { opacity: 0.3; transform: scale(0.9); filter: grayscale(100%); }
}

/* ===== 적 유닛 스타일 ===== */
.battle-unit {
    width: 80px;
    padding: 10px;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s ease;
    animation: unitFloat 2s ease-in-out infinite;
    position: relative;
}

.battle-unit.enemy {
    border-color: rgba(231, 76, 60, 0.5);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.battle-unit.enemy:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.4);
}

.battle-unit.boss {
    width: 110px;
    padding: 15px;
    border-color: rgba(255, 50, 50, 0.8);
    box-shadow: 
        0 0 30px rgba(255, 50, 50, 0.5),
        0 0 60px rgba(255, 50, 50, 0.2);
    animation: bossFloat 1.5s ease-in-out infinite;
    background: linear-gradient(145deg, #3a1a1a, #2a0a0a);
}

.battle-unit.boss::before {
    content: '👑';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    animation: crownBounce 1s ease-in-out infinite;
}

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

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

@keyframes bossFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.03); }
}

/* 적 피격 애니메이션 */
.battle-unit.hit {
    animation: enemyHit 0.3s ease-out;
}

@keyframes enemyHit {
    0% { transform: translateX(0); }
    25% { transform: translateX(10px) rotate(5deg); }
    50% { transform: translateX(-8px) rotate(-3deg); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* 적 공격 모션 */
.battle-unit.attacking {
    animation: enemyAttackMotion 0.3s ease-out;
}

@keyframes enemyAttackMotion {
    0% { transform: translateX(0) scale(1); }
    40% { transform: translateX(20px) scale(1.15); filter: brightness(1.3); }
    100% { transform: translateX(0) scale(1); }
}

/* 적 사망 애니메이션 */
@keyframes enemyDeath {
    0% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.5; transform: scale(1.2) rotate(10deg); filter: brightness(2); }
    100% { opacity: 0; transform: scale(0) rotate(45deg); }
}

.unit-level {
    font-size: 1.2rem;
    font-weight: 900;
    color: #ffd700;
}

.unit-icon {
    font-size: 1.8rem;
    margin: 5px 0;
}

.unit-job-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    padding: 3px;
}

.unit-hp-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.unit-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.unit-hp-fill.low {
    background: linear-gradient(90deg, #f44336, #ff5722);
    animation: hpLowPulse 0.5s ease-in-out infinite;
}

@keyframes hpLowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(244, 67, 54, 0.5); }
    50% { box-shadow: 0 0 15px rgba(244, 67, 54, 0.8); }
}

/* 몬스터 스타일 */
.monster-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.boss .monster-icon {
    font-size: 2.8rem;
    animation: bossIconPulse 1s ease-in-out infinite;
}

@keyframes bossIconPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(255, 50, 50, 0.5)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 15px rgba(255, 50, 50, 0.8)); }
}

.monster-name {
    font-size: 0.75rem;
    color: #ddd;
    margin-top: 3px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.boss .monster-name {
    color: #ff6b6b;
    font-size: 0.8rem;
}

/* 파티 체력바 */
.party-status {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.4);
}

.party-hp-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hp-label {
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
}

.hp-bar-container {
    flex: 1;
    height: 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.hp-bar-fill.healthy {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

.hp-bar-fill.warning {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.hp-bar-fill.danger {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.hp-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 전투 컨트롤 */
.battle-controls {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-buttons {
    display: flex;
    gap: 10px;
}

.btn-skill {
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-skill.warrior {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-skill.archer {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-skill.thief {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    color: white;
}

.btn-skill.mage {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-skill:hover:not(:disabled) {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-skill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-skill .cooldown {
    font-size: 0.75rem;
    opacity: 0.8;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.btn-auto-toggle {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-auto-toggle.active {
    background: #27ae60;
    border-color: #27ae60;
}

.btn-retreat {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7f8c8d, #636e72);
    border: none;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-retreat:hover {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* 전투 결과 */
.battle-result {
    padding: 40px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.battle-result h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.result-wave {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 30px;
}

.result-wave strong {
    display: block;
    font-size: 4rem;
    color: #e74c3c;
    text-shadow: 0 0 30px rgba(231, 76, 60, 0.5);
}

.result-rewards {
    background: rgba(0, 0, 0, 0.3);
    padding: 25px 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.result-rewards h3 {
    margin-bottom: 15px;
    color: #fff;
}

.reward-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

.reward-item:last-child {
    border-bottom: none;
}

.reward-item span:first-child {
    color: #aaa;
}

.reward-item span:last-child {
    color: #ffd700;
    font-weight: 700;
}

.btn-result-close {
    padding: 15px 50px;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-result-close:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.4);
}

/* 직업 선택 모달 */
.job-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.job-modal-overlay.active {
    display: flex;
}

.job-modal-content {
    background: linear-gradient(145deg, #1e1e3f 0%, #2d2d5a 100%);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.job-header {
    text-align: center;
    margin-bottom: 25px;
}

.job-header h2 {
    font-size: 1.8rem;
    color: #ffd700;
    margin-bottom: 10px;
}

.job-target {
    color: #aaa;
}

.job-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.job-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.job-card:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.job-card.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.job-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.job-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.job-desc {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 10px;
}

.job-skill {
    font-size: 0.9rem;
    color: #f39c12;
    padding: 5px 10px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 8px;
    display: inline-block;
    position: relative;
    cursor: help;
}

/* 스킬 툴팁 */
.job-skill[data-tooltip] {
    position: relative;
}

.job-skill[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(243, 156, 18, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.job-skill[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.job-skill[data-tooltip]:hover::before,
.job-skill[data-tooltip]:hover::after {
    opacity: 1;
}

.job-actions {
    text-align: center;
}

.btn-job-cancel {
    padding: 12px 30px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-job-cancel:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
}

/* 데미지 팝업 */
/* ===== 화려한 데미지 팝업 ===== */
.damage-popup {
    position: absolute;
    font-weight: 900;
    font-size: 1.4rem;
    pointer-events: none;
    animation: damageFloat 1s ease-out forwards;
    z-index: 100;
    text-shadow: 
        0 0 10px currentColor,
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 20px currentColor;
    font-family: 'Impact', sans-serif;
}

.damage-popup.damage {
    color: #ff4757;
    animation: damageFloatBounce 1s ease-out forwards;
}

.damage-popup.heal {
    color: #2ed573;
    text-shadow: 
        0 0 15px #2ed573,
        0 0 30px #2ed573,
        0 2px 4px rgba(0, 0, 0, 0.8);
    animation: healFloat 1s ease-out forwards;
}

.damage-popup.miss {
    color: #95a5a6;
    font-size: 1.2rem;
    font-style: italic;
    animation: missFloat 0.8s ease-out forwards;
}

.damage-popup.critical {
    color: #ffd700;
    font-size: 2.2rem;
    animation: criticalFloat 1.2s ease-out forwards;
    text-shadow: 
        0 0 20px #ffd700,
        0 0 40px #ff6b6b,
        0 0 60px #ff4757,
        0 4px 8px rgba(0, 0, 0, 0.9);
}

/* 데미지 팝업 - 튕기는 효과 */
@keyframes damageFloatBounce {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    20% {
        transform: translateY(-20px) scale(1.3);
    }
    40% {
        transform: translateY(-10px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-70px) scale(0.6);
    }
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.7);
    }
}

/* 치유 팝업 - 상승 효과 */
@keyframes healFloat {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translateY(0) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
}

/* 회피 팝업 */
@keyframes missFloat {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) translateX(20px);
    }
}

/* 크리티컬 팝업 - 화려한 폭발 효과 */
@keyframes criticalFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.3) rotate(-10deg);
    }
    15% {
        transform: translateY(-10px) scale(1.6) rotate(5deg);
    }
    30% {
        transform: translateY(-20px) scale(1.3) rotate(-3deg);
    }
    50% {
        transform: translateY(-35px) scale(1.5) rotate(2deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.5) rotate(0deg);
    }
}

/* ===== 화려한 공격 이펙트 ===== */
.attack-effect {
    position: absolute;
    pointer-events: none;
    z-index: 50;
}

/* 전사 슬래시 이펙트 - 강화 */
.slash-effect {
    width: 80px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(255, 100, 100, 0.9) 0%, rgba(255, 50, 50, 0.5) 30%, transparent 70%);
    animation: slashAnim 0.4s ease-out forwards;
}

.slash-effect-enhanced {
    position: absolute;
    font-size: 3rem;
    animation: slashEnhancedAnim 0.5s ease-out forwards;
    filter: drop-shadow(0 0 15px #ff6b6b) drop-shadow(0 0 30px #ff4757);
    z-index: 60;
}

@keyframes slashAnim {
    0% {
        opacity: 1;
        transform: scale(0.3) rotate(-30deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(15deg);
    }
    100% {
        opacity: 0;
        transform: scale(1.8) rotate(45deg);
    }
}

@keyframes slashEnhancedAnim {
    0% {
        opacity: 1;
        transform: scale(0.5) rotate(-45deg);
    }
    30% {
        opacity: 1;
        transform: scale(1.5) rotate(10deg);
    }
    100% {
        opacity: 0;
        transform: scale(2) rotate(30deg);
    }
}

/* 궁수 화살 이펙트 */
.arrow-effect {
    position: absolute;
    font-size: 1.8rem;
    color: #4caf50;
    animation: arrowFly 0.3s ease-in forwards;
    filter: drop-shadow(0 0 10px #4caf50);
    transform-origin: center;
    z-index: 60;
}

@keyframes arrowFly {
    0% {
        opacity: 1;
        transform: translateX(0) translateY(0) rotate(-90deg);
    }
    100% {
        opacity: 1;
        transform: translateX(var(--end-x)) translateY(var(--end-y)) rotate(-90deg);
    }
}

/* 도적 그림자 이펙트 */
.shadow-effect {
    position: absolute;
    font-size: 3rem;
    animation: shadowDash 0.4s ease-out forwards;
    filter: drop-shadow(0 0 20px rgba(100, 100, 100, 0.8));
    z-index: 60;
}

@keyframes shadowDash {
    0% {
        opacity: 0;
        transform: scale(0.3) translateX(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translateX(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateX(30px);
    }
}

.quick-slash {
    position: absolute;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: quickSlashAnim 0.2s ease-out forwards;
    z-index: 60;
}

@keyframes quickSlashAnim {
    0% {
        opacity: 1;
        transform: scaleX(0) rotate(var(--angle, 30deg));
    }
    50% {
        opacity: 1;
        transform: scaleX(1.5) rotate(var(--angle, 30deg));
    }
    100% {
        opacity: 0;
        transform: scaleX(0.5) rotate(var(--angle, 30deg));
    }
}

/* 마법사 마법 이펙트 */
.magic-effect {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(100, 150, 255, 0.9) 0%, rgba(150, 100, 255, 0.5) 40%, transparent 70%);
    border-radius: 50%;
    animation: magicAnim 0.6s ease-out forwards;
    box-shadow: 
        0 0 30px rgba(100, 150, 255, 0.8),
        0 0 60px rgba(150, 100, 255, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.3);
}

.magic-burst-effect {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(155, 89, 182, 0.9) 0%, rgba(52, 152, 219, 0.6) 40%, transparent 70%);
    animation: magicBurstAnim 0.6s ease-out forwards;
    box-shadow: 
        0 0 40px rgba(155, 89, 182, 0.8),
        0 0 80px rgba(52, 152, 219, 0.5);
    z-index: 60;
}

@keyframes magicAnim {
    0% {
        opacity: 1;
        transform: scale(0.2);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

@keyframes magicBurstAnim {
    0% {
        opacity: 1;
        transform: scale(0.3) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.4) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(2) rotate(360deg);
    }
}

/* 스파크 파티클 */
.spark-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: sparkFly 0.5s ease-out forwards;
    box-shadow: 0 0 10px currentColor;
    z-index: 55;
}

@keyframes sparkFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance))
        ) scale(0.3);
    }
}

/* 임팩트 이펙트 */
.impact-effect {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid;
    border-radius: 50%;
    animation: impactRing 0.4s ease-out forwards;
    z-index: 55;
}

@keyframes impactRing {
    0% {
        opacity: 1;
        transform: scale(0.3);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* 마법 폭발 플래시 */
.magic-explosion-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(155, 89, 182, 0.6) 0%, transparent 70%);
    animation: explosionFlash 0.6s ease-out forwards;
    z-index: 200;
    pointer-events: none;
}

@keyframes explosionFlash {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 마법진 효과 */
.magic-circle {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 3px solid rgba(155, 89, 182, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: magicCircleAnim 0.8s ease-out forwards;
    box-shadow: 
        0 0 30px rgba(155, 89, 182, 0.6),
        inset 0 0 30px rgba(155, 89, 182, 0.3);
    z-index: 100;
}

.magic-circle::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(155, 89, 182, 0.9);
    animation: starSpin 0.8s ease-out forwards;
}

@keyframes magicCircleAnim {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5) rotate(360deg);
    }
}

@keyframes starSpin {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2) rotate(360deg);
    }
}

/* 화면 흔들림 */
@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px) translateY(2px); }
    40% { transform: translateX(5px) translateY(-2px); }
    60% { transform: translateX(-3px) translateY(1px); }
    80% { transform: translateX(3px) translateY(-1px); }
}

@keyframes heavyShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px) translateY(5px) rotate(-1deg); }
    20% { transform: translateX(10px) translateY(-5px) rotate(1deg); }
    30% { transform: translateX(-8px) translateY(4px) rotate(-0.5deg); }
    40% { transform: translateX(8px) translateY(-4px) rotate(0.5deg); }
    50% { transform: translateX(-5px) translateY(2px); }
    60% { transform: translateX(5px) translateY(-2px); }
    70% { transform: translateX(-3px) translateY(1px); }
    80% { transform: translateX(3px) translateY(-1px); }
}

/* ===== 화려한 공격 이펙트 애니메이션 ===== */

/* 전사 슬래시 */
@keyframes warriorSlashAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--rotate, -45deg)) scaleX(0);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--rotate, -45deg)) scaleX(1.3);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--rotate, -45deg)) scaleX(0.5);
    }
}

/* 충격파 확장 */
@keyframes shockwaveExpand {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.5);
    }
}

/* 고급 스파크 비행 */
@keyframes advancedSparkFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--endX)), calc(-50% + var(--endY))) scale(0.2);
    }
}

/* 금속 파편 비행 */
@keyframes metalShardFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--endX)), calc(-50% + var(--endY))) rotate(var(--rotation)) scale(0.3);
    }
}

/* 궁수 화살 비행 */
@keyframes archerArrowFly {
    0% {
        opacity: 1;
        width: 0;
    }
    50% {
        opacity: 1;
        width: 80px;
    }
    100% {
        opacity: 0;
        width: 40px;
    }
}

/* 궁수 트레일 페이드 */
@keyframes trailFade {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* 궁수 폭발 */
@keyframes archerBurstAnim {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* 도적 잔상 페이드 */
@keyframes afterimageFade {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

/* 도적 슬래시 */
@keyframes thiefSlashAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scaleX(0);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scaleX(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scaleX(0.3);
    }
}

/* 도적 최종 슬래시 */
@keyframes thiefFinalSlash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-30deg) scaleX(0) scaleY(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-30deg) scaleX(1.5) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-30deg) scaleX(0.5) scaleY(2);
    }
}

/* 마법사 마법진 회전 */
@keyframes mageCircleSpin {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(0deg) scale(0.3);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(180deg) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(720deg) scale(1.5);
    }
}

/* 마법사 별 */
@keyframes mageStar {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2) rotate(360deg);
    }
}

/* 마법사 빔 발사 */
@keyframes mageBeamShoot {
    0% {
        opacity: 0;
        height: 0;
    }
    30% {
        opacity: 1;
        height: 100px;
    }
    100% {
        opacity: 0;
        height: 150px;
    }
}

/* 마법사 충격파 */
@keyframes mageShockwave {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

/* 정보 패널 */
.info-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.info-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 0.8rem;
    color: #bbb;
    font-weight: 500;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.info-value.success-rate {
    color: #4caf50;
}

.info-value.destroy-rate {
    color: #f44336;
}

.info-value.maintain-rate {
    color: #2196f3;
}

.info-value.gold {
    color: #ffd700;
}

/* 로그 */
.log-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.log-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    font-weight: 700;
    font-size: 0.95rem;
}

.log-content {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
}

.log-content::-webkit-scrollbar {
    width: 6px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.log-entry {
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    animation: logSlideIn 0.3s ease;
    line-height: 1.4;
}

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

.log-success {
    background: rgba(76, 175, 80, 0.2);
    border-left: 3px solid #4caf50;
    color: #4caf50;
}

.log-fail {
    background: rgba(244, 67, 54, 0.2);
    border-left: 3px solid #f44336;
    color: #f44336;
}

.log-info {
    background: rgba(33, 150, 243, 0.2);
    border-left: 3px solid #2196f3;
    color: #64b5f6;
}

.log-destroy {
    background: rgba(231, 76, 60, 0.3);
    border-left: 3px solid #e74c3c;
    color: #e74c3c;
    font-weight: 600;
}

/* 저장 버튼 (화면 왼쪽 위 고정) */
.save-button-fixed {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.6);
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.btn-save:active {
    transform: translateY(0);
}

.btn-save.saved {
    background: linear-gradient(135deg, #16a085 0%, #1abc9c 100%);
    animation: savePulse 0.5s ease;
}

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

.save-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.save-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.save-info {
    font-size: 0.75rem;
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.save-info.show {
    opacity: 1;
}

.save-info.success {
    background: rgba(39, 174, 96, 0.8);
}

/* 초기화 버튼 (로그 컨테이너 아래) */
.btn-reset {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.btn-reset:active {
    transform: translateY(0);
}

.reset-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.reset-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.log-destroy {
    background: rgba(156, 39, 176, 0.2);
    border-left: 3px solid #9c27b0;
    color: #ba68c8;
}



/* 아이템 상점 */
.shop-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
}

.shop-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    font-weight: 700;
    font-size: 0.95rem;
}

.shop-items {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.item-desc {
    font-size: 0.75rem;
    color: #bbb;
}

.btn-buy {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-buy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.5);
}

.btn-buy:disabled {
    background: linear-gradient(135deg, #555 0%, #444 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

.item-price::before {
    content: '💰 ';
}

/* 10개 묶음 구매 버튼 */
.btn-buy-bulk {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-buy-bulk:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.5);
}

.btn-buy-bulk:disabled {
    background: linear-gradient(135deg, #555 0%, #444 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

/* 과학 논문 구매 버튼 */
.btn-buy-paper {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-buy-paper:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

/* 골드 부족 시 */
.btn-buy-paper:disabled:not(.purchased) {
    background: linear-gradient(135deg, #555 0%, #444 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

/* 구매 완료 시 */
.btn-buy-paper.purchased {
    background: linear-gradient(135deg, #16a085 0%, #1abc9c 100%) !important;
    cursor: default !important;
    transform: none !important;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3) !important;
    opacity: 1 !important;
    pointer-events: none;
}

.btn-buy-paper.purchased .item-price {
    display: none;
}

.btn-buy-paper.purchased::after {
    content: '구매완료';
    color: white;
    font-weight: 700;
}

/* 고창빈의 수학 시험지 - 특별 아이템 */
.shop-item-special {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2) 0%, rgba(142, 68, 173, 0.3) 100%);
    border: 2px solid #9b59b6;
    animation: specialItemGlow 2s ease-in-out infinite;
}

@keyframes specialItemGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(155, 89, 182, 0.3); }
    50% { box-shadow: 0 0 25px rgba(155, 89, 182, 0.6); }
}

.shop-item-special .item-name {
    color: #d4a5ff;
    text-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

.shop-item-special .item-desc {
    color: #f1c40f;
    font-weight: 600;
}

/* 수학 시험지 구매 버튼 */
.btn-buy-math {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    min-width: 110px;
    padding: 10px 12px;
}

.btn-buy-math:hover:not(:disabled) {
    background: linear-gradient(135deg, #a66bbe 0%, #9b59b6 100%);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.6);
    transform: scale(1.05);
}

.btn-buy-math:disabled {
    background: linear-gradient(135deg, #555 0%, #444 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
    pointer-events: none;
}

/* 두 줄 가격 표시 */
.item-price-dual {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.item-price-dual span {
    white-space: nowrap;
}

/* 고급 토글 스위치 컨테이너 */
.protection-toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* 고급 토글 스위치 (크기 축소) */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 28px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.toggle-switch:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(0, 0, 0, 0.3);
}

.toggle-slider {
    position: absolute;
    left: 2px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.toggle-status {
    position: absolute;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #95a5a6;
    transition: all 0.4s ease;
    z-index: 1;
}

/* 토글 활성화 상태 */
.toggle-switch.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 15px rgba(102, 126, 234, 0.4);
}

.toggle-switch.active .toggle-slider {
    left: calc(100% - 24px);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.5), 0 0 12px rgba(255, 215, 0, 0.3);
}

.toggle-switch.active .toggle-status {
    right: auto;
    left: 8px;
    color: #fff;
}

/* 토글 스위치 글로우 효과 */
.toggle-switch.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.5;
    animation: toggleGlow 2s ease-in-out infinite;
}

@keyframes toggleGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* 까치 스타일 */
#magpieContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

.magpie {
    position: absolute;
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    will-change: transform;
}

.magpie.flipped .magpie-sprite {
    transform: scaleX(-1);
}

/* 까치가 flipped 상태일 때도 위치 유지 */
.magpie.flipped {
    /* transform은 JS에서 translate로 위치 설정, sprite만 반전 */
}

.magpie.flipped .diamond-halo,
.magpie.flipped .diamond-sparkle {
    transform: scaleX(-1);
}

/* 까치 도트 그래픽 - CSS로 생성 */
.magpie-sprite {
    position: relative;
    width: 48px;
    height: 48px;
}

.magpie-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 날개 펄럭임 애니메이션 - 프레임 전환 */
.frame-1 {
    opacity: 1;
    animation: wingFlap1 0.3s infinite;
}

.frame-2 {
    opacity: 0;
    animation: wingFlap2 0.3s infinite;
}

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

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

.pixel {
    position: absolute;
    width: 3px;
    height: 3px;
}

/* 까치 말풍선 */
.magpie-speech {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: speechBounce 0.5s ease;
    z-index: 10;
}

/* 까치가 반전되더라도 말풍선은 정상 방향 유지 */
.magpie.flipped .magpie-speech {
    transform: translateX(-50%) scaleX(1);
}

.magpie-speech::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

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

/* 반전된 까치의 말풍선 애니메이션 */
.magpie.flipped .magpie-speech {
    animation: speechBounceFlipped 0.5s ease;
}

@keyframes speechBounceFlipped {
    0%, 100% {
        transform: translateX(-50%) scaleX(1) translateY(0);
    }
    50% {
        transform: translateX(-50%) scaleX(1) translateY(-5px);
    }
}

/* 모바일 반응형 - 랭킹 & 슬롯 & 전투 & 까치 버튼 */
@media (max-width: 768px) {
    .fixed-buttons-corner {
        bottom: 15px;
        right: 15px;
        gap: 10px;
        flex-wrap: wrap;
        max-width: 120px;
        justify-content: flex-end;
    }
    
    .btn-ranking-fixed,
    .btn-slot-fixed,
    .btn-battle-fixed,
    .btn-magpie-fixed {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    /* 슬롯 모달 모바일 */
    .slot-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .slot-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .slot-item {
        min-height: 140px;
    }
    
    /* 전투 모달 모바일 */
    .battle-modal-content {
        max-height: 100%;
        border-radius: 0;
    }
    
    .battle-resources {
        flex-direction: column;
        gap: 10px;
    }
    
    .battle-party {
        gap: 10px;
    }
    
    .party-member {
        min-width: 90px;
        padding: 10px;
    }
    
    .arena-field {
        min-height: 250px;
    }
    
    /* 적과 아군 구역 배치 조정 */
    .enemy-zone {
        left: 5%;
        gap: 10px;
        flex-wrap: wrap;
        max-width: 45%;
    }
    
    .ally-zone {
        right: 5%;
        gap: 10px;
        flex-wrap: wrap;
        max-width: 45%;
    }
    
    /* 전투 카드 크기 축소 (모바일) */
    .battle-card {
        width: 75px;
        height: 105px;
        border-radius: 10px;
    }
    
    .battle-card-content {
        padding: 5px;
    }
    
    .battle-card-level-badge {
        font-size: 1.2rem;
        padding: 2px 8px;
    }
    
    .battle-card-grade-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    
    .battle-card-title {
        font-size: 0.8rem;
    }
    
    .battle-card-job-name {
        font-size: 0.6rem;
        padding: 1px 5px;
    }
    
    .battle-card-hp {
        height: 14px;
    }
    
    .battle-card-hp-text {
        font-size: 0.6rem;
    }
    
    /* 적 유닛 크기 축소 (모바일) */
    .battle-unit {
        width: 55px;
        padding: 6px;
    }
    
    .battle-unit.boss {
        width: 70px;
        padding: 10px;
    }
    
    .unit-level {
        font-size: 0.9rem;
    }
    
    .unit-icon {
        font-size: 1.3rem;
    }
    
    .monster-icon {
        font-size: 1.4rem;
    }
    
    .boss .monster-icon {
        font-size: 2rem;
    }
    
    .monster-name {
        font-size: 0.65rem;
    }
    
    .boss .monster-name {
        font-size: 0.7rem;
    }
    
    .battle-controls {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .skill-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-skill {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* 직업 선택 모바일 */
    .job-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .job-list {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .job-card {
        padding: 15px;
    }
    
    .job-icon {
        font-size: 2rem;
    }
    
    .job-name {
        font-size: 1rem;
    }
    
    .job-desc {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .fixed-buttons-corner {
        bottom: 10px;
        right: 10px;
        gap: 8px;
        max-width: 100px;
    }
    
    .btn-ranking-fixed,
    .btn-slot-fixed,
    .btn-battle-fixed,
    .btn-magpie-fixed {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .slot-header h2 {
        font-size: 1.2rem;
    }
    
    .battle-header h2 {
        font-size: 1.4rem;
    }
    
    .wave-number {
        font-size: 1.5rem;
    }
    
    /* 매우 작은 모바일 화면 조정 */
    .arena-field {
        min-height: 220px;
    }
    
    .enemy-zone {
        left: 2%;
        gap: 8px;
        max-width: 48%;
    }
    
    .ally-zone {
        right: 2%;
        gap: 8px;
        max-width: 48%;
    }
    
    /* 전투 카드 더 축소 */
    .battle-card {
        width: 65px;
        height: 90px;
        border-radius: 8px;
    }
    
    .battle-card-content {
        padding: 4px;
    }
    
    .battle-card-level-badge {
        font-size: 1rem;
        padding: 2px 6px;
    }
    
    .battle-card-grade-badge {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
    
    .battle-card-title {
        font-size: 0.7rem;
    }
    
    .battle-card-job-name {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
    
    .battle-card-hp {
        height: 12px;
    }
    
    .battle-card-hp-text {
        font-size: 0.55rem;
    }
    
    /* 적 유닛 더 축소 */
    .battle-unit {
        width: 48px;
        padding: 5px;
    }
    
    .battle-unit.boss {
        width: 60px;
        padding: 8px;
    }
    
    .unit-level {
        font-size: 0.8rem;
    }
    
    .unit-icon {
        font-size: 1.1rem;
    }
    
    .monster-icon {
        font-size: 1.2rem;
    }
    
    .boss .monster-icon {
        font-size: 1.6rem;
    }
    
    .monster-name {
        font-size: 0.6rem;
    }
    
    .boss .monster-name {
        font-size: 0.65rem;
    }
    
    .unit-icon {
        font-size: 1.2rem;
    }
    
    .job-list {
        grid-template-columns: 1fr;
    }
}

/* 파티클 캔버스 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 강화 애니메이션 - 연속 클릭 최적화 */
@keyframes enhanceSuccess {
    0% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 0 transparent);
    }
    30% {
        transform: scale(1.12);
        filter: brightness(1.8) drop-shadow(0 0 30px rgba(255, 215, 0, 1));
    }
    60% {
        transform: scale(1.05);
        filter: brightness(1.4) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
    100% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 0 transparent);
    }
}

@keyframes enhanceFail {
    0% {
        transform: translateX(0);
        filter: brightness(1);
    }
    10% {
        transform: translateX(-8px);
        filter: brightness(0.7) sepia(0.3);
    }
    20% {
        transform: translateX(8px);
        filter: brightness(0.6) sepia(0.5);
    }
    30% {
        transform: translateX(-6px);
        filter: brightness(0.7) sepia(0.4);
    }
    40% {
        transform: translateX(6px);
        filter: brightness(0.8) sepia(0.3);
    }
    50% {
        transform: translateX(-4px);
        filter: brightness(0.85) sepia(0.2);
    }
    60% {
        transform: translateX(4px);
        filter: brightness(0.9) sepia(0.1);
    }
    70% {
        transform: translateX(-2px);
        filter: brightness(0.95);
    }
    80% {
        transform: translateX(2px);
        filter: brightness(0.97);
    }
    100% {
        transform: translateX(0);
        filter: brightness(1);
    }
}

@keyframes enhanceDestroy {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
    15% {
        transform: scale(1.05) rotate(-3deg);
        opacity: 0.9;
        filter: brightness(1.3) hue-rotate(0deg);
    }
    30% {
        transform: scale(0.95) rotate(3deg);
        opacity: 0.7;
        filter: brightness(0.8) hue-rotate(30deg);
    }
    45% {
        transform: scale(1.02) rotate(-2deg);
        opacity: 0.5;
        filter: brightness(0.5) hue-rotate(60deg);
    }
    60% {
        transform: scale(0.9) rotate(2deg);
        opacity: 0.3;
        filter: brightness(0.3) hue-rotate(90deg);
    }
    75% {
        transform: scale(0.85) rotate(0deg);
        opacity: 0.2;
        filter: brightness(0.2) hue-rotate(120deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

/* 파괴 시 깨지는 파편 효과 */
@keyframes shatter {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3) rotate(720deg);
    }
}

/* 애니메이션 클래스 - 연속 적용 지원 */
.nameplate.success {
    animation: enhanceSuccess 0.5s ease forwards;
}

.nameplate.fail {
    animation: enhanceFail 0.4s ease forwards;
}

.nameplate.destroy {
    animation: enhanceDestroy 0.6s ease forwards;
}

.nameplate.protection {
    animation: enhanceProtection 0.8s ease forwards;
}

/* 방지권 사용 애니메이션 */
@keyframes enhanceProtection {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.08);
        filter: brightness(1.5) drop-shadow(0 0 20px gold);
    }
    50% {
        transform: scale(0.95);
        filter: brightness(1.3) drop-shadow(0 0 15px gold);
    }
    75% {
        transform: scale(1.05);
        filter: brightness(1.4) drop-shadow(0 0 25px gold);
    }
}

/* 파괴 효과 오버레이 */
.destroy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(231, 76, 60, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    animation: destroyFlash 0.6s ease;
}

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

/* 방지권 사용 오버레이 */
.protection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(255, 237, 78, 0.15) 50%, transparent 100%);
    pointer-events: none;
    z-index: 9998;
    animation: protectionFlash 0.8s ease;
}

@keyframes protectionFlash {
    0%, 100% {
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    60% {
        opacity: 0.7;
    }
}

/* 방지권 방어막 효과 */
.protection-shield {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(255, 215, 0, 0.8);
    border-radius: 20px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 215, 0, 0.3);
    animation: protectionShield 0.8s ease forwards;
    pointer-events: none;
}

@keyframes protectionShield {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* 방지권 빔 효과 */
@keyframes protectionBeam {
    0% {
        opacity: 0;
        height: 0;
    }
    50% {
        opacity: 1;
        height: 200px;
    }
    100% {
        opacity: 0;
        height: 250px;
    }
}

/* 방지권 파티클 효과 */
@keyframes protectionParticle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.3);
    }
}

/* 애니메이션 재시작을 위한 none 클래스 */
.nameplate.anim-none {
    animation: none !important;
}

/* 반응형 - 태블릿 */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
    
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-content, .side-content {
        width: 100%;
    }
    
    .magpie {
        width: 40px;
        height: 40px;
    }
    
    .magpie-sprite {
        width: 40px;
        height: 40px;
    }
    
    .magpie-frame {
        width: 40px;
        height: 40px;
    }
}

/* 카드 확대 모달 오버레이 */
.card-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

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

/* 확대된 카드 컨테이너 */
.card-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8);
    animation: zoomIn 0.3s ease forwards;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 확대된 카드 스타일 */
.nameplate.zoomed {
    padding: 70px 100px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.9), 0 0 150px currentColor;
    cursor: default;
    pointer-events: none;
    transform: scale(1.8);
}

.nameplate.zoomed .nameplate-level {
    font-size: 4rem;
}

.nameplate.zoomed .nameplate-rank {
    font-size: 2rem;
    letter-spacing: 6px;
}

.nameplate.zoomed .nameplate-name {
    font-size: 3rem;
}

.nameplate.zoomed .star {
    font-size: 3rem;
}

.nameplate.zoomed .nameplate-stars {
    gap: 8px;
}

/* 닫기 안내 텍스트 */
.close-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    animation: hintPulse 2s ease-in-out infinite;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 24px;
    border-radius: 25px;
}

/* ===== 닉네임 입력 모달 ===== */
.nickname-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nickname-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.nickname-modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 35px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    max-width: 450px;
    width: 90%;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.nickname-modal-content h2 {
    color: #f1c40f;
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(241, 196, 15, 0.5);
}

.nickname-warning {
    color: #e74c3c;
    font-size: 0.95rem;
    margin-bottom: 25px;
    font-weight: 600;
    background: rgba(231, 76, 60, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.nickname-modal-content input {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    margin-bottom: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.nickname-modal-content input:focus {
    outline: none;
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.3);
}

.nickname-buttons {
    display: flex;
    gap: 12px;
}

.btn-nickname-cancel,
.btn-nickname-confirm {
    flex: 1;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-nickname-cancel {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
}

.btn-nickname-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
}

.btn-nickname-confirm {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-nickname-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

/* ===== 랭킹 모달 ===== */
.ranking-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ranking-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.ranking-modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.ranking-header h2 {
    color: #f1c40f;
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 2px 10px rgba(241, 196, 15, 0.5);
}

.btn-ranking-close {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-ranking-close:hover {
    background: #e74c3c;
    transform: rotate(90deg);
}

.ranking-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-show-my-rank,
.btn-submit-rank {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.btn-show-my-rank {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.btn-show-my-rank:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.btn-submit-rank {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-submit-rank:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.ranking-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.ranking-list::-webkit-scrollbar {
    width: 8px;
}

.ranking-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    padding: 40px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.rank-item:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateX(5px);
}

.rank-item.my-rank {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.2);
}

/* 1~3등 특별 스타일 */
.rank-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(218, 165, 32, 0.25) 100%);
    border: 2px solid #ffd700;
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.4);
}

.rank-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.25) 0%, rgba(169, 169, 169, 0.25) 100%);
    border: 2px solid #c0c0c0;
    box-shadow: 0 6px 30px rgba(192, 192, 192, 0.4);
}

.rank-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.25) 0%, rgba(184, 115, 51, 0.25) 100%);
    border: 2px solid #cd7f32;
    box-shadow: 0 6px 30px rgba(205, 127, 50, 0.4);
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
    color: #ecf0f1;
}

.rank-1 .rank-number {
    color: #ffd700;
    font-size: 1.8rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.rank-2 .rank-number {
    color: #c0c0c0;
    font-size: 1.7rem;
    text-shadow: 0 0 15px rgba(192, 192, 192, 0.8);
}

.rank-3 .rank-number {
    color: #cd7f32;
    font-size: 1.6rem;
    text-shadow: 0 0 15px rgba(205, 127, 50, 0.8);
}

.rank-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-nickname-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rank-nickname {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ecf0f1;
}

.rank-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-style: italic;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-level {
    font-size: 1rem;
    color: #f1c40f;
    font-weight: 600;
}

.rank-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    font-size: 0.85rem;
}

.rank-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.rank-stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin-bottom: 3px;
}

.rank-stat-value {
    color: #f39c12;
    font-weight: 600;
}

.empty-ranking {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    padding: 60px 20px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .ranking-modal-content {
        padding: 20px;
        max-height: 90vh;
    }
    
    .ranking-header h2 {
        font-size: 1.5rem;
    }
    
    .rank-item {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .rank-number {
        font-size: 1.2rem;
        min-width: 35px;
    }
    
    .rank-1 .rank-number {
        font-size: 1.5rem;
    }
    
    .rank-2 .rank-number {
        font-size: 1.4rem;
    }
    
    .rank-3 .rank-number {
        font-size: 1.3rem;
    }
    
    .rank-nickname {
        font-size: 1rem;
    }
    
    .rank-level {
        font-size: 0.9rem;
    }
    
    .rank-stats {
        gap: 5px;
        font-size: 0.75rem;
    }
    
    .rank-stat {
        padding: 4px;
    }
    
    .rank-message {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .nickname-modal-content {
        padding: 25px 30px;
    }
    
    .nickname-modal-content h2 {
        font-size: 1.5rem;
    }
}
    backdrop-filter: blur(5px);
}

@keyframes hintPulse {
    0%, 100% {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .nameplate.zoomed {
        padding: 50px 70px;
        transform: scale(1.3);
    }
    
    .nameplate.zoomed .nameplate-level {
        font-size: 3rem;
    }
    
    .nameplate.zoomed .nameplate-rank {
        font-size: 1.5rem;
    }
    
    .nameplate.zoomed .nameplate-name {
        font-size: 2.2rem;
    }
    
    .nameplate.zoomed .star {
        font-size: 2.2rem;
    }
    
    .close-hint {
        font-size: 0.9rem;
        padding: 10px 20px;
        bottom: 20px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 1.6rem;
        margin-bottom: 8px;
        padding-top: 5px;
    }
    
    /* 모바일 상태 표시 */
    .status-display {
        top: 8px;
        right: 8px;
        gap: 3px;
    }
    
    .gold-display {
        padding: 4px 8px;
        min-width: 70px;
    }
    
    .gold-icon {
        font-size: 0.8rem;
    }
    
    .gold-amount {
        font-size: 0.7rem;
        min-width: 35px;
    }
    
    .protection-display {
        padding: 4px 8px;
        min-width: 50px;
    }
    
    .protection-icon {
        font-size: 0.8rem;
    }
    
    .protection-amount {
        font-size: 0.7rem;
        min-width: 25px;
        text-align: right;
    }
    
    /* 모바일 전투 화폐 */
    .battle-currency-display {
        gap: 3px;
    }
    
    .currency-item {
        padding: 3px 6px;
        min-width: 45px;
    }
    
    .currency-icon {
        font-size: 0.75rem;
    }
    
    .currency-amount {
        font-size: 0.6rem;
        min-width: 22px;
    }
    
    /* 모바일 토글 스위치 */
    .protection-toggle-container {
        padding: 10px 12px;
    }
    
    .toggle-label {
        font-size: 0.8rem;
    }
    
    .toggle-switch {
        width: 70px;
        height: 32px;
    }
    
    .toggle-slider {
        width: 24px;
        height: 24px;
    }
    
    .toggle-switch.active .toggle-slider {
        left: calc(100% - 27px);
    }
    
    .toggle-status {
        font-size: 0.6rem;
    }
    
    /* 모바일에서 미니 통계 */
    .nameplate-wrapper {
        flex-direction: column;
        gap: 15px;
        margin-top: 0;
        margin-right: 0;
        align-items: flex-start;
        padding-right: 80px;
        padding-left: 0;
        margin-left: 25px;
    }
    
    .nameplate-container {
        transform: scale(0.9);
        transform-origin: left center;
    }
    
    .mini-stats {
        display: none;
    }
    
    /* 모바일에서 미니 통계 크기 조정 */
    .mobile-mini-stats .mini-stat {
        padding: 4px 8px;
        min-width: 50px;
    }
    
    .mobile-mini-stats .mini-label {
        font-size: 0.5rem;
    }
    
    .mobile-mini-stats .mini-value {
        font-size: 0.65rem;
    }
    
    .mini-stat {
        padding: 5px 8px;
        min-width: 55px;
    }
    
    .mini-label {
        font-size: 0.55rem;
    }
    
    .mini-value {
        font-size: 0.75rem;
    }

    .game-area {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .main-content {
        gap: 12px;
    }
    
    /* 모바일 강화 확률 */
    .enhance-rates {
        gap: 10px;
        padding: 14px 18px;
        margin: 16px 0;
    }
    
    .rate-item {
        padding: 10px 14px;
        min-width: 75px;
    }
    
    .rate-label {
        font-size: 0.7rem;
    }
    
    .rate-value {
        font-size: 1.3rem;
    }

    .nameplate {
        padding: 16px 20px;
        min-width: 180px;
    }

    .nameplate-level {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .nameplate-rank {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    /* 버튼 가격 표시 */
    .btn-cost,
    .btn-price {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .nameplate-name {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }
    
    .nameplate-description {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }
    
    .nameplate-stars {
        min-height: 20px;
        margin-top: 5px;
    }
    
    .star {
        font-size: 1.2rem;
    }
    
    /* 모바일 능력치 표시 */
    .nameplate-stats {
        padding: 5px 8px;
        gap: 3px;
    }
    
    .stat-item {
        padding: 2px 4px;
    }
    
    .stat-icon {
        font-size: 0.65rem;
    }
    
    .stat-value {
        font-size: 0.6rem;
        min-width: 24px;
    }

    .info-panel {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .info-item {
        padding: 8px 6px;
    }
    
    .info-label {
        font-size: 0.65rem;
    }
    
    .info-value {
        font-size: 0.9rem;
    }

    .btn {
        padding: 12px;
        font-size: 1rem;
    }

    .log-content {
        max-height: 80px;
    }
    
    .log-entry {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .shop-container {
        margin-top: 10px;
    }
    
    .shop-header {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .shop-items {
        padding: 8px;
        gap: 8px;
    }
    
    .item-name {
        font-size: 0.8rem;
    }
    
    .item-desc {
        font-size: 0.65rem;
    }
    
    .btn-buy {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    /* 768px에서 토글 관련 스타일은 이미 위에 정의됨 */
    
    .magpie {
        width: 42px;
        height: 42px;
    }
    
    .magpie-sprite {
        width: 42px;
        height: 42px;
    }
    
    .magpie-frame {
        width: 42px;
        height: 42px;
    }
    
    /* 모바일에서 픽셀 크기 증가 */
    .magpie .pixel {
        width: 2.5px;
        height: 2.5px;
    }
    
    .magpie-speech {
        font-size: 12px;
        padding: 6px 10px;
        top: -45px;
    }
    
    /* 모바일 저장 버튼 */
    .save-button-fixed {
        top: 10px;
        left: 10px;
        gap: 6px;
    }
    
    .btn-save {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 5px;
    }
    
    .save-icon {
        font-size: 1rem;
    }
    
    .save-text {
        display: none;
    }
    
    .save-info {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    
    /* 모바일 초기화 버튼 */
    .btn-reset {
        padding: 10px 16px;
        font-size: 0.85rem;
        margin-top: 8px;
    }
    
    .reset-icon {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }
    
    /* 초소형 상태 표시 */
    .status-display {
        top: 8px;
        right: 8px;
        gap: 5px;
    }
    
    .gold-display {
        padding: 4px 8px;
    }
    
    .gold-icon {
        font-size: 0.75rem;
    }
    
    .gold-amount {
        font-size: 0.7rem;
        min-width: 40px;
        padding-top: 2px;
    }
    
    .protection-display {
        padding: 4px 8px;
    }
    
    .protection-icon {
        font-size: 0.75rem;
    }
    
    .protection-amount {
        font-size: 0.7rem;
        min-width: 40px;
        text-align: right;
        padding-top: 2px;
    }
    
    /* 초소형 능력치 */
    .nameplate-stats {
        padding: 4px 6px;
        gap: 2px;
    }
    
    .stat-item {
        padding: 2px 3px;
    }
    
    .stat-icon {
        font-size: 0.6rem;
    }
    
    .stat-value {
        font-size: 0.55rem;
        min-width: 20px;
    }
    
    /* 초소형 토글 스위치 */
    .protection-toggle-container {
        padding: 6px 8px;
        gap: 8px;
        margin-bottom: 3px;
    }
    
    .toggle-label {
        font-size: 0.75rem;
        text-align: center;
    }
    
    .toggle-switch {
        width: 65px;
        height: 28px;
        margin: 0 auto;
    }
    
    .toggle-slider {
        width: 22px;
        height: 22px;
    }
    
    .toggle-switch.active .toggle-slider {
        left: calc(100% - 25px);
    }
    
    .toggle-status {
        font-size: 0.55rem;
    }
    
    /* 초소형 모바일에서 미니 통계 */
    .nameplate-wrapper {
        gap: 12px;
        margin-top: 0;
        margin-right: 0;
        flex-direction: column;
        padding-right: 70px;
        align-items: flex-start;
        padding-left: 0;
        margin-left: 20px;
    }
    
    .nameplate-container {
        transform: scale(0.85);
        transform-origin: left center;
    }
    
    .nameplate {
        padding: 14px 18px;
        min-width: 160px;
    }
    
    /* 초소형 모바일 재화 표시 */
    .gold-display {
        padding: 3px 6px;
        min-width: 60px;
    }
    
    .gold-icon {
        font-size: 0.75rem;
    }
    
    .gold-amount {
        font-size: 0.65rem;
        min-width: 30px;
    }
    
    .protection-display {
        padding: 3px 6px;
        min-width: 45px;
    }
    
    .protection-icon {
        font-size: 0.75rem;
    }
    
    .protection-amount {
        font-size: 0.65rem;
        min-width: 20px;
    }
    
    .currency-item {
        padding: 2px 5px;
        min-width: 40px;
    }
    
    .currency-icon {
        font-size: 0.7rem;
    }
    
    .currency-amount {
        font-size: 0.55rem;
        min-width: 18px;
    }
    
    .mini-stats {
        display: none;
    }
    
    .mobile-mini-stats .mini-stat {
        padding: 3px 6px;
        min-width: 45px;
    }
    
    .mobile-mini-stats .mini-label {
        font-size: 0.45rem;
    }
    
    .mobile-mini-stats .mini-value {
        font-size: 0.6rem;
    }
    
    .mini-stat {
        padding: 4px 6px;
        min-width: 48px;
    }
    
    .mini-label {
        font-size: 0.5rem;
    }
    
    .mini-value {
        font-size: 0.7rem;
    }
    
    .game-area {
        padding: 10px;
        gap: 10px;
    }
    
    .main-content {
        gap: 10px;
    }
    
    .nameplate {
        padding: 15px 20px;
    }

    .nameplate-level {
        font-size: 1.2rem;
    }

    .nameplate-name {
        font-size: 1.4rem;
    }
    
    .nameplate-description {
        font-size: 0.6rem;
        margin-bottom: 6px;
        letter-spacing: 0.5px;
    }
    
    .nameplate-stars {
        gap: 3px;
        min-height: 50px;
    }
    
    .star {
        font-size: 1rem;
    }

    .info-panel {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    
    .info-item {
        padding: 6px 4px;
    }
    
    .info-label {
        font-size: 0.55rem;
    }

    .info-value {
        font-size: 0.8rem;
    }
    
    /* 초소형 강화 확률 */
    .enhance-rates {
        gap: 8px;
        padding: 12px 15px;
        margin: 14px 0;
    }
    
    .rate-item {
        padding: 8px 12px;
        min-width: 70px;
    }
    
    .rate-label {
        font-size: 0.65rem;
    }
    
    .rate-value {
        font-size: 1.2rem;
    }
    
    .button-group {
        gap: 8px;
    }
    
    .btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .log-container {
        max-height: 150px;
    }
    
    /* 초소형 저장 버튼 */
    .save-button-fixed {
        top: 8px;
        left: 8px;
        gap: 5px;
    }
    
    .btn-save {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .save-icon {
        font-size: 0.9rem;
    }
    
    .save-text {
        display: none;
    }
    
    .save-info {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    /* 초소형 초기화 버튼 */
    .btn-reset {
        padding: 8px 14px;
        font-size: 0.8rem;
        gap: 6px;
        margin-top: 8px;
    }
    
    .reset-icon {
        font-size: 0.95rem;
    }
    
    .reset-text {
        font-size: 0.75rem;
    }
    
    .shop-container {
        margin-top: 8px;
    }
    
    .shop-item {
        padding: 8px;
    }
    
    .magpie {
        width: 36px;
        height: 36px;
    }
    
    .magpie-sprite {
        width: 36px;
        height: 36px;
    }
    
    .magpie-frame {
        width: 36px;
        height: 36px;
    }
    
    /* 초소형에서 픽셀 크기 증가 */
    .magpie .pixel {
        width: 2.25px;
        height: 2.25px;
    }
    
    .magpie-speech {
        font-size: 11px;
        padding: 5px 8px;
        top: -40px;
    }
}
