@import url('https://fonts.googleapis.com/css2?family=Noto Sans KR&display=swap');

body {
    margin: 0;
    background: #050505;
    overflow: hidden;
    font-family: 'Noto Sans KR', sans-serif;
    touch-action: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    /* 클릭시 푸른색 깜빡임 제거 */
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* 금광 모드 스타일 */
#mine-timer-container {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 12px;
    background: #333;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #555;
}

#mine-timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f9d423, #ff4e50);
    transition: width 0.1s linear;
    position: relative;
}

/* 피버 구간 표시자 */
#mine-timer-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 33.33%;
    /* 15초 중 5초 구간 (약 33%) */
    height: 100%;
    border-right: 2px dashed rgba(255, 255, 255, 0.5);
    background: rgba(255, 78, 80, 0.2);
}

#mine-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    z-index: 5;
}

#mine-gold-display {
    position: absolute;
    top: 70px;
    font-size: 40px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#mine-click-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

#mine-center-icon {
    font-size: 120px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
    animation: bounce 1s infinite;
}

#fever-text {
    font-size: 28px;
    color: #ff4e50;
    font-weight: bold;
    margin-top: 10px;
    animation: fever-blink 0.3s infinite;
    text-shadow: 0 0 10px #000;
}

@keyframes fever-blink {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.mine-float {
    position: fixed;
    pointer-events: none;
    color: #FFD700;
    font-weight: bold;
    font-size: 30px;
    animation: mine-float-up 0.6s forwards;
    z-index: 1000;
    text-shadow: 2px 2px 5px #000;
}

@keyframes mine-float-up {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -150%) scale(1.5);
        opacity: 0;
    }
}

.shake {
    animation: mine-shake 0.05s infinite;
}

@keyframes mine-shake {
    0% {
        transform: translate(2px, 2px);
    }

    50% {
        transform: translate(-2px, -2px);
    }

    100% {
        transform: translate(2px, -2px);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.mine-particle {
    position: absolute;
    pointer-events: none;
    z-index: 3000;
    font-size: 24px;
    user-select: none;
    animation: coin-explode 0.8s ease-out forwards;
}

@keyframes coin-explode {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(20deg);
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0.5) rotate(var(--tr));
        opacity: 0;
    }
}

/* === 로딩 화면 === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.loading-container {
    width: 200px;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #444;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    transition: width 0.1s ease-out;
}

.loading-text {
    font-size: 14px;
    color: #aaa;
    letter-spacing: 1px;
}

/* === 전체 레이아웃 === */
#game-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* === 로비 화면 === */
#lobby-screen {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    flex-direction: column;
    align-items: center;
    z-index: 20;
    padding-top: 40px;
    box-sizing: border-box;
}

.main-title {
    font-size: 45px;
    font-weight: bold;
    color: #00d2ff;
    text-shadow: 0 0 20px #00d2ff;
    margin-bottom: 10px;
}

.sub-title {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* 골드 + 강화 버튼 가로 배치 */
.lobby-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.gold-badge {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #FFD700;
    padding: 8px 20px;
    border-radius: 20px;
    color: #FFD700;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    display: inline-block;
}

/* 스테이지 선택 슬라이더 */
.stage-selector {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    width: 90%;
    max-width: 600px;
    padding: 10px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.stage-card {
    min-width: 140px;
    height: 180px;
    background: #222;
    border: 2px solid #444;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    opacity: 0.6;
    background-size: cover;
    background-position: center;
}

.stage-card.unlocked {
    opacity: 1;
    border-color: #666;
}

.stage-card.selected {
    border-color: #00d2ff;
    box-shadow: 0 0 15px #00d2ff;
    transform: scale(1.05);
    background: #2a2a2a;
    background-size: cover;
    background-position: center;
    opacity: 1;
}

.stage-card.locked {
    opacity: 0.4;
    pointer-events: none;
    background: #111;
}

/* 모드 선택 카드 (금광 등) */
.mode-selector {
    display: flex;
    gap: 15px;
    width: 90%;
    max-width: 600px;
    margin-bottom: 20px;
    justify-content: flex-start;
}

.mode-card {
    min-width: 140px;
    height: 100px;
    background: #222;
    border: 2px solid #444;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    border-color: #FFD700;
    transform: translateY(-5px);
}

.mode-card.empty {
    opacity: 0.3;
    pointer-events: none;
    border-style: dashed;
}

.mode-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px #000;
    z-index: 2;
}

.mode-card-desc {
    font-size: 10px;
    color: #eee;
    text-shadow: 1px 1px 2px #000;
    z-index: 2;
}

.mode-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* 금광 배경 이미지 */
#mine-modal {
    background-size: cover !important;
    background-position: center !important;
}

#mine-fever-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.fever-active #mine-fever-overlay {
    opacity: 1;
    animation: fever-bg-blink 0.15s infinite alternate;
}

@keyframes fever-bg-blink {
    from {
        background-color: rgba(255, 0, 0, 0.3);
    }

    to {
        background-color: rgba(255, 215, 0, 0.3);
    }
}

.st-num {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.st-reward {
    font-size: 12px;
    color: #FFD700;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
}

.st-lock-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

/* 전투시작 버튼 중앙 배치 */
.lobby-footer {
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-battle {
    width: 200px;
    height: 50px;
    font-size: 20px;
    background: #FFD700;
    color: #000;
    border-radius: 50px;
    font-weight: bold;
    transition: 0.2s;
    cursor: pointer;
    box-shadow: 0 0 20px #FFD700;
    margin-bottom: 30px;
}

.lobby-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 강화 버튼 및 알림 도트 */
.btn-upgrade {
    position: relative;
    padding: 12px 25px;
    font-size: 16px;
    background: #00d2ff;
    color: #000;
    border-radius: 50px;
    font-weight: bold;
}

.noti-dot {
    display: none;
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ff0000;
    border: 2px solid #222;
    border-radius: 50%;
    box-shadow: 0 0 5px #ff0000;
}

.btn-settings {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    background: none;
    color: #fff;
    z-index: 25;
    transition: transform 0.3s;
}

.btn-settings:hover {
    transform: rotate(90deg);
}

.settings-modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: #222;
    border: 2px solid #555;
    border-radius: 15px;
    padding: 20px;
    z-index: 100;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.settings-row {
    margin-bottom: 20px;
    text-align: left;
}

.settings-label {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 5px;
    display: block;
}

.volume-slider {
    width: 100%;
    height: 6px;
    accent-color: #00d2ff;
    cursor: pointer;
}

.btn-reset-data {
    width: 100%;
    padding: 10px;
    background: #ff4444;
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 10px;
}

.btn-close-settings {
    margin-top: 15px;
    background: #444;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
}

/* 인게임 UI */
#top-hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

#wave-container {
    flex: 1;
}

#center-stats {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#top-right-btns {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

#wave-info {
    color: #FFD700;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

#exp-container {
    width: 130px;
    height: 7px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #555;
    margin-top: 5px;
}

#exp-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
}

#level-text {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* 인게임 골드 표시 */
#ingame-gold {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #FFD700;
    padding: 4px 10px;
    border-radius: 12px;
    color: #FFD700;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
}

/* 샌드위치 배치: 무기 HUD를 최하단, 성벽과 마법사를 그 위로 */
#weapon-hud {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: auto;
    /* Allow content to define height */
    min-height: 100px;
    background: #1a1a1a;
    border-top: 2px solid #444;
    display: flex;
    flex-direction: column;
    /* Stack HP bar on top */
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 0;
    pointer-events: auto;
    z-index: 20;
    box-sizing: border-box;
}

.weapon-slot {
    width: 55px;
    height: 55px;
    background: #222;
    border: 1px solid #555;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    cursor: pointer;
}

.weapon-slot.active {
    opacity: 1;
    border-color: #888;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* 성벽 체력바 - 모바일 가림 방지를 위해 위치 상향 조정 */
#wall-hp-container {
    position: relative;
    width: 95%;
    height: 14px;
    background: #222;
    border: 1px solid #555;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 5px;
}

#wall-hp-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #cc0000);
    transition: width 0.2s;
}

/* 방어벽(Shield) 바 추가 */
#shield-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #0081a7);
    opacity: 0.8;
    transition: width 0.2s;
}

#wall-hp-text {
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px #000;
    line-height: 1;
    margin-bottom: 2px;
    pointer-events: none;
}

/* 플레이어 마법사 - 성벽 높이와 연동하여 조정 */
#player-wizard {
    position: absolute;
    bottom: 175px;
    /* Above HUD and collision line */
    font-size: 33px;
    /* 35px * 0.95 */
    z-index: 16;
    pointer-events: none;
}


.in-btn {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    pointer-events: auto;
}

.modal-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    backdrop-filter: blur(3px);
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 85%;
    max-width: 400px;
}

.card {
    background: #252525;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    position: relative;
}

/* 등급별 카드 디자인 */
.card.common {
    border-color: #a0a0a0;
    box-shadow: inset 0 0 10px rgba(160, 160, 160, 0.1);
}

.card.rare {
    border-color: #00d2ff;
    box-shadow: inset 0 0 15px rgba(0, 210, 255, 0.2);
}

.card.epic {
    border-color: #d000ff;
    box-shadow: inset 0 0 15px rgba(208, 0, 255, 0.2);
}

.card.legendary {
    border-color: #ffd700;
    background: linear-gradient(135deg, #2a2a2a, #3a2a00);
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.3);
    animation: legendary-pulse 2s infinite alternate;
}

@keyframes legendary-pulse {
    from {
        box-shadow: 0 0 15px #ffd700;
    }

    to {
        box-shadow: 0 0 30px #ffd700;
    }
}

.rarity-tag {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    border-bottom-left-radius: 8px;
    color: #000;
}

.card.common .rarity-tag {
    background: #a0a0a0;
}

.card.rare .rarity-tag {
    background: #00d2ff;
}

.card.epic .rarity-tag {
    background: #d000ff;
    color: #fff;
}

.card.legendary .rarity-tag {
    background: #ffd700;
}

.mine-btn-lobby {
    width: 85%;
    max-width: 300px;
    background: linear-gradient(135deg, #3a2a00, #1a1a1a);
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 10px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.mine-btn-lobby:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 90%;
    max-width: 500px;
}

.select-card {
    background: #222;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    text-align: center;
    color: #fff;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.select-card:hover {
    border-color: #FFD700;
    transform: translateY(-5px);
}

.sel-stats {
    font-size: 11px;
    color: #aaa;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-top: 5px;
}

.stat-val {
    color: #00d2ff;
    font-weight: bold;
}

/* 상점 아이템 */
.shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #222;
    border: 1px solid #333;
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 5px;
}

.shop-info {
    flex: 1;
    margin-left: 10px;
}

.shop-stat-row {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.arrow {
    color: #aaa;
    margin: 0 5px;
}

.current-val {
    font-size: 13px;
    color: #FFD700;
}

/* === 카드형 상점 UI (가로형 리스트) === */
.shop-category-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 95%;
    max-width: 500px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.shop-cat-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 5px 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.shop-cat-card:hover {
    border-color: #FFD700;
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.shop-cat-card .cat-icon {
    font-size: 32px;
}

.shop-cat-card .cat-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.shop-cat-card .cat-lv-badge {
    font-size: 11px;
    color: #aaa;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
}

.shop-cat-card.global-card {
    flex-direction: row;
    justify-content: space-between;
    padding: 15px 20px;
}

.global-card-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 70px;
}

.shop-global-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 11px;
    color: #eee;
    text-align: left;
    gap: 4px;
    box-sizing: border-box;
    flex-grow: 1;
    margin-left: 15px;
}

.shop-global-summary .sum-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.shop-global-summary .sum-val {
    color: #FFD700;
    font-weight: bold;
}

.cat-stat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 5px;
    width: 100%;
}

.cat-stat-line {
    font-size: 11px;
    color: #aaa;
    text-align: left;
    padding-left: 5px;
}

.text-center {
    text-align: center;
}

/* --- 상점 상세 모달 --- */
.shop-detail-container {
    background: #1a1a1a;
    border: 2px solid #FFD700;
    border-radius: 20px;
    padding: 20px 15px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.shop-detail-header {
    text-align: center;
    width: 100%;
    border-bottom: 1px solid #333;
    margin-bottom: 15px;
}

/* 기존 아코디언 스타일 중 필요한 것들 유지 또는 호환 */
.cat-header-stats {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: #aaa;
}

.cat-stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.cat-stat-val {
    color: #FFD700;
}

#mine-result-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mine-result-gold {
    font-size: 80px;
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    font-weight: bold;
    margin: 20px 0;
    animation: result-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes result-pop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 전역 강화 구분 */
.shop-section-title {
    font-size: 18px;
    font-weight: bold;
    color: #00d2ff;
    margin: 15px 0 10px 0;
    text-align: center;
    border-bottom: 2px solid #444;
    padding-bottom: 8px;
}

/* 상세 정보 모달 */
#detail-modal-content {
    background: #222;
    border: 2px solid #555;
    border-radius: 12px;
    padding: 25px;
    width: 80%;
    max-width: 350px;
    position: relative;
    color: #fff;
    text-align: left;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
}

.detail-icon {
    font-size: 40px;
}

.detail-name {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
}

.detail-lv {
    font-size: 14px;
    color: #aaa;
    margin-left: 5px;
}

.detail-desc {
    font-size: 13px;
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.5;
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    background: #333;
    padding: 8px;
    border-radius: 4px;
}

.stat-label {
    color: #aaa;
}

.stat-val {
    font-weight: bold;
    color: #00d2ff;
}

/* 결과 화면 개선 */
#result-screen .main-title {
    font-size: 35px;
    margin-bottom: 15px;
}

#result-stars-display {
    font-size: 60px;
    margin: 15px 0 25px 0;
}

.gold-breakdown {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid #FFD700;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    width: 80%;
    max-width: 300px;
}

.gold-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 16px;
}

.gold-label {
    color: #aaa;
}

.gold-amount {
    color: #FFD700;
    font-weight: bold;
}

.gold-total {
    font-size: 20px;
    padding-top: 10px;
    border-top: 2px solid #FFD700;
    margin-top: 10px;
}

#touch-screen {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000 url('goldmine_defense.png') no-repeat center center;
    background-size: cover;
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#touch-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: -1;
}

.pulse-text {
    font-size: 24px;
    color: #fff;
    animation: pulse 1.5s infinite;
    margin-top: 20px;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* 별 애니메이션 추가 */
.star-item {
    display: inline-block;
    opacity: 0;
    transform: scale(3) translateY(-100px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-item.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    text-shadow: 0 0 15px #FFD700, 0 0 30px #FFD700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

/* 결과 화면 무기 통계 스타일 */
.weapon-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #fff;
    margin-bottom: 4px;
    padding: 2px 5px;
}

.weapon-stat-row span:last-child {
    font-weight: bold;
    color: #FFD700;
}

/* 알림 점 */
.noti-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background-color: #ff4444;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
    z-index: 5;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* 강화 컨트롤 */
.upgrade-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upgrade-cost-display {
    font-size: 13px;
    font-weight: bold;
    color: #FFD700;
    min-width: 60px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-control {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #444;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: 0.1s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-control:active {
    transform: scale(0.9);
}

.btn-control.plus {
    background: #00d2ff;
    color: #000;
}

.btn-control.minus {
    background: #3d3d3d;
    color: #fff;
}

.btn-control:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.sum-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 8px;
}

.sum-row {
    font-size: 10px;
    white-space: nowrap;
}

.sum-row .label {
    color: #aaa;
    margin-right: 4px;
}


/* 빌드 정보 패널 */
.build-info-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    background: rgba(10, 15, 25, 0.98);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 20px;
    z-index: 3000;
    color: #fff;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

.build-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.build-info-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.build-info-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 14px;
    color: #00d2ff;
    margin-bottom: 10px;
    font-weight: bold;
}

.build-info-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.build-info-weapon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.build-info-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #333;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.btn-build-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    color: #aaa;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-build-toggle:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: #00d2ff;
    color: #fff;
}

.btn-screenshot {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-screenshot:hover {
    background: rgba(0, 210, 255, 0.2);
    border-color: #00d2ff;
    transform: scale(1.1);
}