/* ========================================================
   클릭 대전쟁 (Click War) 모바일 & 프로덕션 최적화 스타일시트
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Noto+Sans+KR:wght@400;600;800;900&display=swap');

:root {
    --bg-main: #0b0f19;
    --card-bg: rgba(22, 29, 47, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
}

/* 모바일 더블탭 확대 방지 및 기본 제어 */
html, body {
    touch-action: manipulation; /* 더블탭 줌 차단 */
    -ms-touch-action: manipulation;
    -webkit-touch-callout: none; /* 롱프레스 컨텍스트 메뉴 차단 */
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* 터치 시 파란 박스 제거 */
    overscroll-behavior-y: contain; /* 당겨서 새로고침 방지 */
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

body {
    background-color: var(--bg-main);
    color: #f1f5f9;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(236, 72, 153, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.07) 0%, transparent 40%);
    background-attachment: fixed;
    padding-bottom: env(safe-area-inset-bottom);
}

/* 헤드라인 폰트 */
.font-display {
    font-family: 'Black Han Sans', 'Noto Sans KR', sans-serif;
    letter-spacing: -0.5px;
}

/* 파티클 캔버스 */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    contain: strict;
}

/* 글래스모피즘 카드 */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    contain: content;
}

/* 메인 캐릭터 클릭 영역 */
.character-box {
    position: relative;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.06s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.character-box:active {
    transform: scale(0.93) rotate(-1deg);
}

.character-box.pop-active {
    transform: scale(1.11) rotate(1deg);
}

/* 캐릭터 입/표정 제어 */
.char-mouth-open {
    display: none;
}

.is-popped .char-mouth-closed {
    display: none;
}

.is-popped .char-mouth-open {
    display: block;
}

/* 도지 레이저 */
.char-laser {
    display: none;
    filter: drop-shadow(0 0 6px #ef4444);
}

.is-popped .char-laser {
    display: block;
}

/* 화면 흔들림(Screen Shake) 효과 */
.shake-active {
    animation: screen-shake 0.12s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screen-shake {
    20%, 80% { transform: translate3d(2px, 1px, 0); }
    40%, 60% { transform: translate3d(-3px, -1px, 0); }
}

/* 피버 타임 테두리 광기 이펙트 */
body.fever-active #clicker-card {
    border-color: #f97316;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.5), inset 0 0 15px rgba(249, 115, 22, 0.25);
}

/* 랭킹 1위 번쩍임 */
.rank-first-glow {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(234, 179, 8, 0.45);
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.2);
}

/* 내 지역 하이라이트 */
.my-region-highlight {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(59, 130, 246, 0.14) 100%) !important;
    border: 1.5px solid rgba(6, 182, 212, 0.7) !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.fever-bar-fill {
    transition: width 0.08s ease-out;
}

.ranking-list-item {
    transition: transform 0.2s ease, background-color 0.15s;
    will-change: transform;
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 9999px;
}

.pulse-badge {
    animation: pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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