/* Pretendard v1.3.9 (가변 글꼴: 파일 하나로 굵기 45~930). 로딩 화면에서 미리 받아 둠 (game-flow-ui.js runLoadingScreen)
   영어만 쓰니까 영어/숫자/기본 문장부호(— • … 등)만 남겨서 줄인 파일 (약 49KB, 원본 약 2MB). 한글은 없음
   라이선스: SIL OFL 1.1 (fonts/Pretendard-LICENSE.txt) */
@font-face {
font-family: "Pretendard Variable";
src: url("../fonts/PretendardVariable-Latin.woff2") format("woff2-variations"),
     url("../fonts/PretendardVariable-Latin.woff2") format("woff2");
font-weight: 45 930;
font-style: normal;
font-display: swap;
}

body {
margin: 0;
overflow: hidden;
background: #d0f0ff; /* 처음 바탕·상단바 색 = 로딩 화면 색. 로딩이 끝나면 game-flow-ui.js releasePageColor가 메인 화면 색으로 */
font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Pretendard JP Variable", "Pretendard JP", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple SD Gothic Neo", sans-serif;
touch-action: none;
width: 100vw;
height: 100vh;
padding: var(--safe-area-inset-top, env(safe-area-inset-top)) var(--safe-area-inset-right, env(safe-area-inset-right)) var(--safe-area-inset-bottom, env(safe-area-inset-bottom)) var(--safe-area-inset-left, env(safe-area-inset-left));
box-sizing: border-box;
user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-user-drag: none;
}
/* 드래그 막기는 안쪽 요소로 물려지지 않아서 모든 요소에 직접 걸어줌 (이미지/버튼 끌림 방지) */
*, *::before, *::after { -webkit-user-drag: none; }
/* 버튼을 누를 때 안드로이드/브라우저가 그리는 파란(회색) 네모 강조와 포커스 테두리를 모든 요소에서 끔
   (웹 페이지처럼 보여서 게임 몰입을 깸. 누름 효과는 각 버튼의 :active / .pressed가 따로 맡음) */
* { -webkit-tap-highlight-color: transparent; }
*:focus, *:focus-visible { outline: none; }

/* Unified UI Layout Applied */
/* Modern Premium HUD Layout */
#hud {
position: fixed;
top: calc(12px + var(--safe-area-inset-top, env(safe-area-inset-top)));
left: calc(16px + var(--safe-area-inset-left, env(safe-area-inset-left)));
right: calc(16px + var(--safe-area-inset-right, env(safe-area-inset-right)));
display: none;
align-items: center;
justify-content: space-between;
z-index: 100;
pointer-events: none;
}

/* @media (orientation: portrait) {
#hud {
    top: calc(12px + var(--safe-area-inset-top, env(safe-area-inset-top)));
}
} */

#timer-item {
display: none;
padding: 0px 16px;
font-size: 24px;
font-weight: 800;
letter-spacing: -1px;
color: #fff;
text-shadow: 0 2px 4px rgba(0,0,0,0.2);
font-variant-numeric: tabular-nums;
pointer-events: none;
font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Pretendard JP Variable", "Pretendard JP", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple SD Gothic Neo", sans-serif;
}

/* Speedline Effect for Penguin Sliding ✨ */
/* (예전 CSS 속도선 #speed-lines는 3D로 옮김: speed-lines-3d.js) */
/* 대시 모서리 빛: 큰 그라데이션 4개라서 GPU 레이어로 한 번만 그려 두고 나타나고 사라지기(opacity)만 함
   해상도 제한: 화면의 절반 크기(50vw×50vh)로 그린 뒤 2배로 늘려 덮음 (will-change: transform이라 늘린 뒤 다시 그리지 않음)
   → 기기 해상도(A32는 2.6배)로 화면 전체를 그리던 것보다 그림 크기가 1/4. 원래 흐릿한 그라데이션이라 눈으로 차이 거의 없음 */
#slide-corner-glow {
will-change: opacity, transform;
contain: strict;
position: fixed;
top: 0;
left: 0;
width: 50vw;
height: 50vh;
transform: scale(2);
transform-origin: 0 0;
pointer-events: none;
z-index: 4;
opacity: 0;
transition: opacity 0.2s ease-out;
background:
    radial-gradient(29vw 29vw at 0% 0%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 56%),
    radial-gradient(29vw 29vw at 100% 0%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 56%),
    radial-gradient(29vw 29vw at 0% 100%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 56%),
    radial-gradient(29vw 29vw at 100% 100%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 56%); /* 절반 크기라 58vw → 29vw */
}
#slide-corner-glow.active {
opacity: 0.75;
}
/* 악어 별 무적: 화면 가장자리가 악어 몸과 같은 무지개 색으로 은은하게 물듦 */
/* 나타나고 사라지는 건 바깥(opacity 전환 0.3초), 숨 쉬는 건 안쪽(::before)이 따로 맡음 → 서로 덮어쓰지 않음 */
/* 최적화: 테두리 그림은 빨강(색상 0)으로 한 번만 그려 두고, 색은 croc-rest.js가 filter: hue-rotate로 돌림
   (예전엔 색 변수(--star-hue)를 1초에 20번 바꿔서 화면 전체 그라데이션+그림자를 매번 처음부터 다시 그렸음.
    hue-rotate는 이미 그린 그림의 색만 GPU에서 바꿔서 훨씬 가벼움) */
/* 해상도 제한: 대시 모서리 빛과 같이 화면의 절반 크기로 그린 뒤 2배로 늘려 덮음 (색 돌리기 필터도 1/4 크기 그림에만 적용) */
#croc-star-edge {
position: fixed;
top: 0; left: 0;
width: 50vw; height: 50vh;
transform: scale(2);
transform-origin: 0 0;
pointer-events: none;
z-index: 4;
opacity: 0;
transition: opacity 0.3s ease-in-out;
will-change: opacity, filter, transform;
}
#croc-star-edge::before {
content: '';
position: absolute;
inset: 0;
background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0) 52%,
    hsla(0, 100%, 62%, 0.18) 74%,
    hsla(0, 100%, 66%, 0.55) 100%);
box-shadow: inset 0 0 14px 3px hsla(0, 100%, 70%, 0.55); /* 절반 크기라 28px 6px → 14px 3px */
animation: croc-star-edge-breath 0.9s ease-in-out infinite alternate;
will-change: opacity;
}
#croc-star-edge.active {
opacity: 1;
}
@keyframes croc-star-edge-breath {
from { opacity: 0.7; }
to { opacity: 1; }
}


#debug-info {
display: none;
/* 화면 전체 기준 가로 가운데 (예전: 게이지 오른쪽에 붙어 있었음) */
position: fixed; left: 50%; transform: translateX(-50%);
top: calc(20px + var(--safe-area-inset-top, env(safe-area-inset-top)));
white-space: nowrap;
background: rgba(0, 0, 0, 0.5);
color: #00ff00;
font-family: monospace;
font-size: 12px;
padding: 4px 8px;
border-radius: 8px;
/* 블러 없음 (디버그 표시) */
pointer-events: none;
}

/* Stat Row: Left side */
.stat-row {
width: 150px;
display: flex; flex-direction: column; gap: 6px;
padding: 10px 14px;
background: rgba(255, 255, 255, 0.1);
border-radius: 16px;
backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); /* 게이지 칸 (예전 12px). -webkit-: iOS 15~17 사파리/앱은 접두사 있어야 블러가 먹음 (메인화면 버튼과 같게) */
border: 1px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.gauge-item { display: flex; align-items: center; gap: 10px; width: 100%; }
.gauge-label {
width: 14px; display: flex; justify-content: center; align-items: center;
filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

.gauge-container {
flex-grow: 1; height: 5px; background: rgba(255,255,255,0.1);
border-radius: 10px; overflow: hidden; position: relative;
transform: translateZ(0);
}

.gauge-fill {
height: 100%; width: 100%; transition: none !important;
border-radius: 10px;
}

#hp-fill { background: #ff5252; }
#gauge-fill { background: #ffe066; }
#oxygen-fill { background: #00e5ff; }
#oxygen-item { display: none; }

/* Right HUD: Score + Pause */
#right-hud {
display: flex; align-items: center; gap: 0px;
pointer-events: auto;
}

#ui {
display: flex; align-items: center;
position: relative; /* 500m 알림을 점수 바로 아래에 띄우는 기준 */
padding: 6px 16px; border-radius: 18px;
pointer-events: none;
user-select: none;
-webkit-user-select: none;
-webkit-user-drag: none;
}

.score-box {
display: inline-block; /* 커졌다 돌아오는 효과가 먹게 */
transform-origin: right center;
font-size: 24px; font-weight: 800; letter-spacing: -1px;
color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.2);
font-variant-numeric: tabular-nums;
pointer-events: none;
user-select: none;
-webkit-user-select: none;
-webkit-user-drag: none;
}

/* 500점마다: 점수가 톡 커지며 금빛으로 반짝 (game-flow-ui.js showScoreMilestone) */
/* 최적화: 겹겹이 번지는 빛(text-shadow 4겹)을 숫자에서 떼어 뒤에 깔린 복사본(::after)에 고정해 두고,
   그 복사본은 나타났다 사라지기(opacity)만 함 → 0.7초 동안 매 프레임 빛을 다시 그리던 일이 없어짐
   (복사본 글자는 data-text, game-flow-ui.js updateUI가 점수와 같이 넣어 줌) */
.score-box { position: relative; }
.score-box.milestone-pop {
animation: score-milestone-pop 0.7s ease-out;
}
@keyframes score-milestone-pop {
0%   { transform: scale(1);   color: #fff; }
25%  { transform: scale(1.3); color: #fffbe6; }
100% { transform: scale(1);   color: #fff; }
}
/* 빛을 더한 것처럼 밝게: 가운데는 하얗게 달아오른 금빛 + 겹겹이 번지는 빛 (반짝일 때만 보임) */
.score-box::after {
content: attr(data-text);
position: absolute;
left: 0; top: 0;
z-index: -1;
color: #fffbe6;
text-shadow: 0 0 10px #ffe066; /* 1겹 (예전 4겹: 4px #fff3b0, 10px #ffe066, 22px #ffc233, 40px 주황 75%) */
opacity: 0;
display: none;
pointer-events: none;
will-change: opacity;
}
.score-box.milestone-pop::after {
display: block;
animation: score-milestone-glow 0.7s ease-out;
}
@keyframes score-milestone-glow {
0%   { opacity: 0; }
25%  { opacity: 1; }
100% { opacity: 0; }
}
/* [보관] 저사양 모드 전용 500m 반짝임 (2026-11-27, 지금은 평소 효과(빛 1겹)로 통일해서 안 씀. 다시 쓰려면 아래 주석을 풀면 됨)
( 저사양 모드 (지금은 settings.js Blur Effects를 끈 상태, body.no-blur): 빛 번짐(text-shadow) 없이, 톡 커지기는 그대로(GPU)
   금빛은 글자 색을 바꾸지 않고, 같은 글자를 노란색으로 쓴 복사본(::after)을 위에 겹쳐 나타났다 사라지게(opacity) 함
   → 색이 부드럽게 바뀌어 보이는데 글자를 다시 그리지 않음 (글자 색을 서서히 바꾸면 매 프레임 다시 그려 A32에서 렉) )
body.no-blur .score-box.milestone-pop {
animation: score-milestone-pop-scale 0.7s ease-out;
}
body.no-blur .score-box::after {
z-index: 1;                 ( 흰 글자 위에 겹침 )
color: #ffd54f;
text-shadow: 0 2px 4px rgba(0,0,0,0.2); ( 원래 점수 글자와 같은 그림자 )
}
@keyframes score-milestone-pop-scale {
0%   { transform: scale(1); }
25%  { transform: scale(1.3); }
100% { transform: scale(1); }
}*/



/* 500점마다: 점수 바로 아래 "500m" 흰 글자가 평행사변형 반투명 판 안에서 살짝 내려오며 나타났다 사라짐 */
#milestone-toast {
position: absolute;
top: 100%;
right: 16px;
font-size: 16px; font-weight: 800; letter-spacing: -0.5px;
/* 점수 반짝보다 덜 강조: 빛 없이 흰색 (그림자는 점수 숫자와 같게) */
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
padding: 2px 14px;           /* 뒤 평행사변형 판 안쪽 여백 */
z-index: 0;                  /* 뒤 판(::before)이 글자 뒤에 깔리게 */
white-space: nowrap;
opacity: 0;
pointer-events: none;
}
/* 글자 뒤 노란 둥근 사각형 배경 */
#milestone-toast::before {
content: '';
position: absolute;
inset: 0;
z-index: -1;
background: rgba(255, 223, 128, 0.4);
border-radius: 9999px;
/* 블러 없음 (500m 알림판, 예전 2px) */

}
#milestone-toast.show {
animation: score-milestone-toast 1.6s ease-out forwards;
}
@keyframes score-milestone-toast {
0%   { opacity: 0; transform: translateY(-8px); }
15%  { opacity: 1; transform: translateY(0); }
70%  { opacity: 1; transform: translateY(0); }
100% { opacity: 0; transform: translateY(6px); }
}

/* Collection Feedback */
@keyframes gauge-pulse {
0% { transform: scale(1); filter: brightness(1); }
50% { transform: scale(1.05); filter: brightness(1.5); }
100% { transform: scale(1); filter: brightness(1); }
}
.gauge-item.collect-flash { animation: gauge-pulse 0.4s ease-out; }

/* 게이지 부족 경고 (배고픔 / 산소 공통 규칙)
   - gauge-warn (30% 이하): 원래 색 그대로, 막대가 0.5초 박자로 깜빡임 */
/* 깜빡임은 진하기(opacity)만: 예전엔 brightness 필터도 같이 바꿨는데, 가장 밝을 때(50%) 막대가 거의 안 보여(10%) 효과가 없었음
   필터를 빼서 GPU만으로 처리 (게이지가 30% 이하인 동안 계속 도는 애니메이션이라 가볍게) */
@keyframes gauge-low-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.1; }
}
.gauge-item.gauge-warn .gauge-fill { animation: gauge-low-pulse 0.5s ease-in-out infinite; }

/* 부활 때 게이지 채우기: 순간 밝게 번쩍 → 쭉 빠르고 부드럽게 차오름 */
@keyframes gauge-refill-flash {
0% { filter: brightness(2.2); }
100% { filter: brightness(1); }
}
.gauge-item.gauge-refill .gauge-fill {
transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1) !important;
animation: gauge-refill-flash 0.7s ease-out;
}
/* 아이템(악어 하트/별): 한 번에 팍 차고 번쩍이기만 함 */
.gauge-item.gauge-pop .gauge-fill {
animation: gauge-refill-flash 0.7s ease-out;
}

/* HP Segments */
.segments {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
display: flex; pointer-events: none;
}
.segment-line { flex: 1; border-right: 1px solid rgba(255,255,255,0.4); }
.segment-line:last-child { border-right: none; }

/* Missile Warning */
#missile-warning {
display: none;
position: fixed;
width: 50px;
height: 50px;
background: rgba(255, 0, 0, 0.8);
border-radius: 50%;
z-index: 110;
justify-content: center;
align-items: center;
color: white;
font-weight: 900;
font-size: 30px;
animation: blink 0.3s infinite;
border: 3px solid white;
box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
pointer-events: none;
transform: translate(-50%, -50%); /* Center on the calculated point */
}

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

/* Pause Button Styles */
#pause-btn {
width: 32px; height: 32px;
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); /* 일시정지 버튼 (예전 12px) */
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex; justify-content: center; align-items: center;
cursor: pointer; pointer-events: auto;
transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
touch-action: none;
user-select: none;
-webkit-user-select: none;
-webkit-user-drag: none;
}
#pause-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.25); }

.pause-icon {
width: 14px; height: 14px;
display: flex; justify-content: space-between;
}
.pause-bar {
width: 4px; height: 100%;
background: white; border-radius: 4px;
}

#menu {
position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center; z-index: 20; width: 100%; max-width: 500px;
user-select: none; -webkit-user-select: none;
}

/* ===== 로딩 화면 (game-flow-ui.js runLoadingScreen) ===== */
/* 메인 화면과 같은 하늘색 바탕 + 같은 제목 글씨, 아래 얇은 막대가 차오름. 끝나면 스르륵 사라짐 */
/* fixed 대신 absolute (body가 스크롤 없이 화면 크기라 보이는 건 똑같음):
   iOS 26 사파리가 위쪽 fixed 요소 색(#d0f0ff)을 상단바에 잡고 로딩이 끝나도 안 바꿔서, fixed를 피함 */
#loading-screen {
position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 1000;
/* inset: 0이면 처음 화면 크기(주소창이 보일 때) 기준이라, 가로로 들고 주소창이 접히면 아래가 비었음
   100vh는 주소창이 접힌 때 크기라 주소창이 보이면 아래로 넘쳐서 막대가 가운데보다 내려가 보였음
   → 100dvh: 지금 실제로 보이는 높이 (주소창이 접히고 펴질 때마다 따라감). 못 알아듣는 옛 브라우저는 위 100vh */
background: #d0f0ff; /* 연한 하늘색 (잠깐 #5fa8e6 → #3f97e4였다가 다시 원래대로) */
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
user-select: none; -webkit-user-select: none;
transition: opacity 0.4s ease;
}
#loading-screen.done { opacity: 0; pointer-events: none; }
.loading-title {
font-size: 56px; font-weight: 900; letter-spacing: -3px; line-height: 0.95;
color: white; text-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.loading-bar { width: 160px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.45); overflow: hidden; }
.loading-fill { width: 0%; height: 100%; border-radius: 3px; background: white; transition: width 0.25s ease-out; }

#menu h1 {
font-size: 80px; margin: 0; font-weight: 900; letter-spacing: -4px;
margin-bottom: 32px; /* 부제를 빼서 제목과 CLASSIC/EXTREME 스위치 사이를 띄움 */
line-height: 0.95;
color: white;
text-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 웹 체험판 DEMO 배지 (WEB_MODE, settings.js): 제목 오른쪽 위에 살짝 걸친 작은 하얀 알약
   CLASSIC/EXTREME 스위치의 하얀 바와 같은 재질 (하얀 바탕 + 남색 글씨 + 같은 그림자)
   제목 글씨 위치는 그대로 (배지는 absolute라 가운데 정렬에 안 끼어듦) */
#menu h1 .menu-title { position: relative; display: inline-block; }
#demo-badge {
position: absolute; top: -2px; right: -10px;
transform: translateX(50%); /* 오른쪽 끝에 반쯤 걸침 (기울이면 유치해 보여서 반듯하게, 예전 rotate 8deg) */
padding: 4px 9px 4px 11px; /* 왼쪽이 2px 더: 마지막 글자 뒤 자간만큼 보정해서 가운데로 */
border-radius: 100px;
background: white; color: #12324d;
font-size: 12px; font-weight: 800; letter-spacing: 2px; line-height: 1;
text-shadow: none;
box-shadow: 0 4px 14px rgba(20, 70, 115, 0.22);
}

/* 부제: 은은하게 비치는 흰색 + 양옆 얇은 선 장식 */
#menu p {
display: flex; align-items: center; justify-content: center; gap: 14px;
font-size: 12px; color: rgba(255, 255, 255, 0.7); margin: 16px 0 36px;
letter-spacing: 6px; font-weight: 500;
padding-left: 6px; /* 마지막 글자 뒤 자간만큼 보정해서 정확히 가운데로 */
}
#menu p::before,
#menu p::after {
content: '';
width: 28px; height: 1.5px; border-radius: 2px;
background: rgba(255, 255, 255, 0.7); /* 글자와 같은 투명도 */
}

.menu-btns {
display: flex; flex-direction: column; align-items: center; gap: 20px;
width: 100%;
}
/* 메인 메뉴만 간격을 좁혀 가운데로 모음 (일시정지 메뉴의 .menu-btns는 그대로) */
#menu .menu-btns { gap: 16px; }

/* Mode Switcher Pill */
/* 반투명 판에 남색을 살짝 섞어서 하늘 배경과 구분 + 안 고른 쪽 글씨도 잘 읽히게 */
.mode-selection {
/* 두 칸을 같은 너비로 → 하얀 바가 정확히 반 칸씩 미끄러짐 */
display: grid; grid-template-columns: 1fr 1fr;
position: relative;
background: rgba(20, 70, 115, 0.16); padding: 4px;
border-radius: 100px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.35);
box-shadow: 0 4px 16px rgba(20, 70, 115, 0.12);
margin-bottom: 5px;
}
/* 미끄러지는 하얀 바: 익스트림이면 오른쪽 칸으로 (#menu.extreme은 setMenuSubMode가 붙임) */
.mode-selection::before {
content: '';
position: absolute;
top: 4px; bottom: 4px; left: 4px;
width: calc(50% - 4px);
background: white;
border-radius: 100px;
box-shadow: 0 4px 14px rgba(20, 70, 115, 0.22);
transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
#menu.extreme .mode-selection::before {
transform: translateX(100%);
}
/* 처음 켤 때 저장된 모드 복원: 미끄러짐·글자색 전환 없이 바로 */
#menu.no-anim .mode-selection::before,
#menu.no-anim .mode-opt {
transition: none;
}
.mode-opt {
position: relative; z-index: 1; /* 글자가 하얀 바 위에 보이게 */
text-align: center;
padding: 8px 24px; border-radius: 100px; font-size: 13px; font-weight: 800;
color: rgba(255,255,255,0.85); cursor: pointer; transition: all 0.3s;
letter-spacing: 1.5px;
text-shadow: 0 1px 3px rgba(20, 70, 115, 0.35);
-webkit-tap-highlight-color: transparent; /* 폰 기본 회색 탭 깜빡임 끄기 */
}
/* 누르고 있는 동안만 안 고른 쪽 글자가 하얗게 빛남 (누를 땐 빠르게 켜지게 0.1초, 예전 0.08초) */
.mode-opt:not(.active):active { color: #fff; transition-duration: 0.1s; }
.mode-opt.active {
color: #12324d; text-shadow: none; /* 배경은 미끄러지는 바(::before)가 맡음 */
}

/* Character Selection Cards */
.char-grid {
display: flex; gap: 16px; width: 100%; justify-content: center;
}
.char-card {
width: 158px; aspect-ratio: 0.95; /* 약 158 × 166px */
background: rgba(255,255,255,0.1); border-radius: 30px;
border: 1px solid rgba(255,255,255,0.15); /* 블러 없음 (캐릭터 카드, 예전 15px) */
display: flex; flex-direction: column; align-items: center; justify-content: center;
cursor: pointer; transition: box-shadow 0.1s ease-out;
position: relative; overflow: hidden;
-webkit-tap-highlight-color: transparent; /* 폰 기본 회색 탭 깜빡임 끄기 */
isolation: isolate; /* 아래 .card-wipe(z-index -1)가 카드 바탕 위에 깔리게 */
opacity: 0.9; /* 뒤 메인 화면 풍경이 살짝 비쳐 보이게 (카드 전체: 배경·글자·메달 같이) */
}

/* 모드 바꿀 때: 새 배경이 스위치 바와 같은 방향으로 카드를 쓸고 지나감
   - 카드 배경은 바로 새 테마로 바뀌고, 그 위에 "옛날 배경" 막을 덮은 뒤 바가 가는 쪽으로 잘라냄
   - 막은 카드 바탕 바로 위, 눈송이·물결·글자·메달 아래 (z-index -1)
   - 클래스는 game-flow-ui.js setMenuSubMode가 붙임
   최적화: 예전엔 clip-path로 잘라냈는데, clip-path 애니메이션은 GPU가 혼자 못 해서 매 프레임 카드를 다시 그려 뚝뚝 끊겼음
   → 바깥 막(.card-wipe, 넘치는 부분 숨김)은 바 방향으로 밀고, 안쪽 배경(.card-wipe-inner)은 반대로 같은 만큼 밀어
     배경은 제자리에 있고 잘린 가장자리만 움직이는 것처럼 보이게 함 (transform만 써서 GPU가 처리, 보이는 건 같음) */
.card-wipe {
    display: none;
    position: absolute; inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    will-change: transform;
}
.card-wipe-inner {
    position: absolute; inset: 0;
    background: var(--bg-extreme);         /* 클래식으로 돌아올 때 덮는 옛날(익스트림) 배경 */
    will-change: transform;
}
#menu.extreme .card-wipe-inner {
    background: var(--bg-classic);         /* 익스트림으로 갈 때 덮는 옛날(클래식) 배경 */
}
.char-card.wipe-to-extreme .card-wipe,
.char-card.wipe-to-classic .card-wipe,
.char-card.wipe-hold .card-wipe { /* wipe-hold: 쓸기 시작 직전 한 화면 동안 옛날 배경을 그대로 덮어 둠 (game-flow-ui.js) */
    display: block;
}
.char-card.wipe-to-extreme .card-wipe       { animation: card-wipe-ltr-outer 0.4s cubic-bezier(0.25, 1, 0.5, 1) both; } /* 스위치 바와 같은 속도·곡선 */
.char-card.wipe-to-extreme .card-wipe-inner { animation: card-wipe-ltr-inner 0.4s cubic-bezier(0.25, 1, 0.5, 1) both; }
.char-card.wipe-to-classic .card-wipe       { animation: card-wipe-rtl-outer 0.4s cubic-bezier(0.25, 1, 0.5, 1) both; }
.char-card.wipe-to-classic .card-wipe-inner { animation: card-wipe-rtl-inner 0.4s cubic-bezier(0.25, 1, 0.5, 1) both; }
/* 바가 지나가는 쪽 카드부터: 익스트림(→)이면 악어가, 클래식(←)이면 펭귄이 살짝 늦게 (바깥/안쪽 같이) */
#card-croc.wipe-to-extreme .card-wipe,
#card-croc.wipe-to-extreme .card-wipe-inner,
#card-penguin.wipe-to-classic .card-wipe,
#card-penguin.wipe-to-classic .card-wipe-inner {
    animation-delay: 0.06s;
}
/* 옛날 배경이 왼쪽부터 잘려 나감 → 새 배경이 왼→오로 들어옴 */
@keyframes card-wipe-ltr-outer { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes card-wipe-ltr-inner { from { transform: translateX(0); } to { transform: translateX(-100%); } }
/* 오→왼 */
@keyframes card-wipe-rtl-outer { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes card-wipe-rtl-inner { from { transform: translateX(0); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .card-wipe { display: none !important; }
}

#card-penguin {
    /* 인게임 펭귄 클래식 하늘색에 맞춤 (game-flow-ui.js classicPenguinSkyStops: 0x74baf0 → 0x3f97e4)
       위는 옅은 하늘빛, 아래로 갈수록 맑은 파랑 → 흰 글씨가 잘 보임 (예전: 청록빛 #b3e5fc → #7fd0f6) */
    --bg-classic: linear-gradient(180deg, #92cdf5 0%, #6ab4ee 45%, #3f92de 100%);
    background: var(--bg-classic);
    border-color: #8fc8f2;
    position: relative;
    overflow: hidden;
}
#card-penguin .char-stat {
    color: rgba(255, 255, 255, 0.9);
}
#card-penguin::before {
    content: ''; position: absolute; top: -50px; left: 10%; width: 8px; height: 8px; background: white; border-radius: 50%; opacity: 0.8; 
    animation: snow-fall 4s linear infinite;
    box-shadow: 40px 20px 0 -2px white, 80px 50px 0 -1px white, -20px 40px 0 -3px white, 110px 10px 0 -2px white;
    filter: blur(1px);
}
#card-penguin::after {
    content: ''; position: absolute; top: -80px; left: 20%; width: 6px; height: 6px; background: white; border-radius: 50%; opacity: 0.6; 
    animation: snow-fall 6s linear infinite 2s;
    box-shadow: 50px 30px 0 -1px white, 10px 70px 0 -2px white, -30px 90px 0 -3px white, 90px 20px 0 -1px white;
    filter: blur(1px);
}

#card-croc {
    --bg-classic: linear-gradient(180deg, #00acc1 0%, #002f33 100%);
    background: var(--bg-classic);
    border-color: #00838f;
    position: relative;
    overflow: hidden;
}
#card-croc::before {
    /* 물결 무늬: 무늬를 옮기던(background-position, 매 프레임 다시 그림) 것을 판째 미는(transform, GPU) 방식으로
       판을 왼쪽으로 28.28px 더 넓혀 두고 그만큼 오른쪽으로 밀었다 돌아옴 (무늬 위치는 예전과 같게 28.28px 맞춰 둠) */
    content: ''; position: absolute; top: 0; left: -28.28px; right: 0; bottom: 0;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 20px, transparent 20px, transparent 40px);
    background-size: 56.57px 56.57px; /* Diagonal repeat period: 40px * sqrt(2) */
    background-position: 28.28px 0;
    pointer-events: none;
    will-change: transform;
    animation: water-flow 3s ease-in-out infinite alternate;
}
#card-croc::after {
    content: ''; position: absolute; bottom: -20px; left: 20%; width: 12px; height: 12px; 
    border: 1.5px solid rgba(255,255,255,0.4); border-radius: 50%; opacity: 0; 
    animation: bubble-rise 8s linear infinite;
    box-shadow: 
        inset -2px -2px 4px rgba(255,255,255,0.2), 
        30px 40px 0 -2px rgba(255,255,255,0.3), 
        -15px 80px 0 -4px rgba(255,255,255,0.2), 
        50px 120px 0 -1px rgba(255,255,255,0.4),
        10px 170px 0 -3px rgba(255,255,255,0.3),
        -25px 220px 0 -2px rgba(255,255,255,0.2),
        40px 270px 0 -4px rgba(255,255,255,0.3);
}

/* ===== 익스트림 테마 카드 (game-flow-ui.js setMenuSubMode가 #menu에 .extreme을 붙임) ===== */

/* 펭귄: 인게임 익스트림 노을과 같은 색 (game-flow-ui.js extremePenguinSkyStops)
   위 차분한 보랏빛 #6c6297 → 분홍빛 #a983ad → #ec9a90 → 수평선 주황 #ffa07c, 바닥엔 인게임 해처럼 흰 중심 + 노랑 + 주황 후광 (눈은 그대로)
   (예전: 위 하늘색 #87ceeb → 산호 주황 #ff8f77) */
/* 익스트림 배경은 변수로 늘 들고 있음 → 클래식일 때도 .card-wipe가 꺼내 쓸 수 있게 */
#card-penguin {
    --bg-extreme:
        radial-gradient(circle at 50% 108%, /* 해 중심을 카드 바닥보다 살짝 아래로 → 지평선에 가라앉은 느낌 */
            rgba(255, 249, 224, 0.8) 0%,
            rgba(255, 230, 100, 0.48) 12%,
            rgba(255, 196, 90, 0.3) 20%,
            rgba(255, 150, 50, 0.16) 29%,
            rgba(255, 100, 50, 0) 46%),
        /* 해에서 넓게 번지는 옅은 노을빛 */
        radial-gradient(ellipse 140% 70% at 50% 100%,
            rgba(255, 168, 120, 0.32) 0%,
            rgba(255, 168, 120, 0.1) 45%,
            rgba(255, 168, 120, 0) 75%),
        /* 바탕: 카드 아래 바깥(해 쪽)을 중심으로 한 큰 타원 → 색 경계가 아치처럼 휨
           수평선 주황 → 산호 분홍 → 장밋빛 보라 → 차분한 보랏빛 (인게임 하늘 순서 그대로) */
        radial-gradient(ellipse 160% 125% at 50% 115%,
            #ffa07c 0%,
            #f99d84 14%,
            #ec9a90 27%,
            #cf8fa0 41%,
            #a983ad 56%,
            #8b74a4 74%,
            #6c6297 100%);
}
#menu.extreme #card-penguin {
    background: var(--bg-extreme);
    border-color: #a48cc0; /* 보랏빛 테두리 */
}

/* 악어 익스트림: 클래식 색(#00acc1 → #002f33)을 아주 살짝만 어둡게 — 흐린 날 느낌 */
#card-croc {
    --bg-extreme: linear-gradient(180deg, #009cb0 0%, #00292d 100%);
}
#menu.extreme #card-croc {
    background: var(--bg-extreme);
}

/* 악어: 클래식 카드와 똑같고(색·물결 무늬 그대로), 기포(::after) 자리만 비스듬한 빗줄기로 */
#menu.extreme #card-croc::after { display: none; }
/* 빗줄기 3겹: 가까운 비(굵고 진하고 빠름) / 중간 / 먼 비(가늘고 옅고 느림)
   겹마다 타일 크기를 서로 안 맞게(80×160, 67×131, 53×97) + 줄마다 길이·진하기 제각각 → 무늬가 겹쳐도 반복이 잘 안 보임
   최적화: 예전엔 한 판(::after)의 배경 3겹을 background-position으로 내려서 매 프레임 카드를 다시 그렸음
   → 겹마다 따로 판(.card-rain i)을 두고, 판을 타일 한 칸만큼 위로 늘린 뒤 한 칸씩 내려 반복(transform, GPU)
     속도는 예전과 같음: 가까운 비 약 356px/초(160px를 0.45초), 중간 약 270px/초(131px), 먼 비 약 200px/초(97px)
     (중간·먼 비는 한 칸 내려가는 시간이 같아서 둘 다 0.4846초) */
.card-rain { display: none; }
#menu.extreme .card-rain {
    display: block;
    position: absolute;
    top: 0; bottom: 0;
    left: -24px; right: -24px; /* 기울여도 양옆이 비지 않게 넓힘 */
    transform: skewX(-9deg);
    pointer-events: none;
}
.card-rain i {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    will-change: transform;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
.card-rain i:nth-child(1) {
    top: -160px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='160'%3E%3Cg stroke='white' stroke-width='0.9' stroke-linecap='round'%3E%3Cpath d='M9 6v14' stroke-opacity='0.42'/%3E%3Cpath d='M52 41v10' stroke-opacity='0.32'/%3E%3Cpath d='M31 77v15' stroke-opacity='0.4'/%3E%3Cpath d='M70 102v11' stroke-opacity='0.3'/%3E%3Cpath d='M17 128v12' stroke-opacity='0.36'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 80px 160px;
    animation-name: rain-step-1; animation-duration: 0.45s;
}
.card-rain i:nth-child(2) {
    top: -131px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='67' height='131'%3E%3Cg stroke='white' stroke-width='0.75' stroke-linecap='round'%3E%3Cpath d='M6 18v10' stroke-opacity='0.28'/%3E%3Cpath d='M44 51v8' stroke-opacity='0.22'/%3E%3Cpath d='M25 88v11' stroke-opacity='0.3'/%3E%3Cpath d='M58 117v8' stroke-opacity='0.24'/%3E%3C/g%3E%3C/svg%3E") 23px 41px / 67px 131px;
    animation-name: rain-step-2; animation-duration: 0.4846s;
}
.card-rain i:nth-child(3) {
    top: -97px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='53' height='97'%3E%3Cg stroke='white' stroke-width='0.6' stroke-linecap='round'%3E%3Cpath d='M12 9v7' stroke-opacity='0.18'/%3E%3Cpath d='M38 43v6' stroke-opacity='0.15'/%3E%3Cpath d='M27 74v7' stroke-opacity='0.2'/%3E%3C/g%3E%3C/svg%3E") 11px 17px / 53px 97px;
    animation-name: rain-step-3; animation-duration: 0.4846s;
}
@keyframes rain-step-1 { from { transform: translateY(0); } to { transform: translateY(160px); } }
@keyframes rain-step-2 { from { transform: translateY(0); } to { transform: translateY(131px); } }
@keyframes rain-step-3 { from { transform: translateY(0); } to { transform: translateY(97px); } }

@keyframes water-flow {
    0% { transform: translateX(0); }
    100% { transform: translateX(28.28px); } /* Half a period for smooth oscillation */
}

@keyframes snow-fall {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(250px) translateX(20px); }
}
@keyframes bubble-rise {
    0% { transform: translateY(0); opacity: 0; }
    5% { opacity: 0.6; }
    95% { opacity: 0.6; }
    100% { transform: translateY(-300px); opacity: 0; }
}

/* 가로로 눕힌 폰처럼 화면 높이가 낮을 때: 제목·여백·카드를 한 단계 더 줄여 안 잘리게 */
@media (max-height: 430px) {
    #menu p { margin: 12px 0 22px; }
    #menu h1 { margin-bottom: 24px; } /* 낮은 화면: 제목 아래 간격도 조금 좁게 */
    #menu .menu-btns { gap: 14px; }
    .char-card { aspect-ratio: 1.05; }
}

.char-emoji { display: none; }

/* 누르고 있는 동안만 하얀 반투명 막 (안쪽 그림자라 눈송이·기포·글자는 그 위에 그대로 보임) */
.char-card:active { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.25); }

.char-emoji { font-size: 44px; margin-bottom: 8px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); }
.char-name { font-size: 16px; font-weight: 900; letter-spacing: 1px; color: white; margin-bottom: 2px; }
.char-stat { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 4px; }

/* 익스트림 잠긴 카드 (game-flow-ui.js updateMenuHighscores): 카드는 그대로, 위에 반투명 검은 막 + 풀리는 조건 */
/* 누르면 살짝 흔들림 */
.card-lock {
    display: flex; position: absolute; inset: 0; z-index: 5;
    border-radius: inherit; /* 막을 카드와 같은 둥근 모서리로: 서서히 나타나고 사라지는(opacity) 동안 폰 브라우저가 막을 따로 그리면서
                               카드의 overflow:hidden 둥근 자르기를 놓쳐서 네모 모서리가 카드 밖으로 삐져나와 보였음
                               (예전엔 카드에 블러가 있어서 늘 잘렸는데, 성능 작업 때 카드 블러를 빼면서 드러남) */
    background: rgba(0, 0, 0, 0.4);
    align-items: center; justify-content: center; text-align: center;
    color: white; font-size: 14px; font-weight: 700; line-height: 1.3;
    /* 잠기거나 풀릴 때 막이 서서히 깔리고 걷힘 (카드 배경이 바뀌는 속도와 같게) */
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}
.char-card.locked .card-lock { opacity: 1; }
/* 잠기면 이름/기록/메달은 아예 숨김 (막과 같은 속도로 서서히) */
.char-card .char-name, .char-card .char-stat, .char-card .char-medal-icon { transition: opacity 0.4s ease; }
.char-card.locked .char-name, .char-card.locked .char-stat, .char-card.locked .char-medal-icon { opacity: 0; }
/* 처음 켤 때 복원(game-flow-ui.js setMenuSubMode instant)은 서서히 없이 바로 */
#menu.no-anim .card-lock,
#menu.no-anim .char-name, #menu.no-anim .char-stat, #menu.no-anim .char-medal-icon { transition: none; }
.char-card.locked:active { box-shadow: none; }
.char-card.shake { animation: card-locked-shake 0.35s ease-in-out; }
@keyframes card-locked-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

.char-medal-icon { position: absolute; top: 12px; right: 12px; font-size: 18px; line-height: 0; }
.char-medal-icon svg { display: block; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.22)); } /* 카드에서 살짝 떠 보이게 */

/* ===== 금메달 전용 효과 (game-flow-ui.js getMenuMedalSvg / .is-gold) ===== */
/* 1. 둘레 금빛 후광이 숨 쉬듯 */
.char-medal-icon.is-gold svg {
    overflow: visible;
    animation: medal-gold-glow 2.4s ease-in-out infinite alternate;
}
@keyframes medal-gold-glow {
    from { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 2px rgba(255, 213, 79, 0.45)); }
    to   { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 6px rgba(255, 213, 79, 0.95)); }
}
/* 2. 빛줄기가 원판 위를 스윽 (3.2초 중 앞 0.9초만 지나가고 나머지는 쉼) */
.medal-shine {
    animation: medal-shine-sweep 3.2s ease-in-out infinite;
}
@keyframes medal-shine-sweep {
    0%        { transform: translateX(-10px); }
    28%, 100% { transform: translateX(10px); }
}
/* 3. 십자 반짝이 두 개가 번갈아 */
.medal-sparkle {
    transform-box: fill-box;
    transform-origin: center;
    animation: medal-sparkle-twinkle 1.6s ease-in-out infinite;
}
.medal-sparkle-2 { animation-delay: 0.8s; }
@keyframes medal-sparkle-twinkle {
    0%, 100% { opacity: 0;    transform: scale(0.3) rotate(0deg); }
    50%      { opacity: 0.95; transform: scale(1)   rotate(45deg); }
}
/* '동작 줄이기' 설정한 사람은 움직임 없이 */
@media (prefers-reduced-motion: reduce) {
    .char-medal-icon.is-gold svg,
    .medal-shine,
    .medal-sparkle { animation: none; }
    .medal-sparkle { opacity: 0; }
}

button {
padding: 14px 40px; font-size: 18px; cursor: pointer; border-radius: 20px;
border: 1px solid rgba(255,255,255,0.15);
transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
font-weight: 700; letter-spacing: 1px; width: 220px;
backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.btn-time {
width: 100px; padding: 12px 0;
background: rgba(255, 255, 255, 0.1);
color: white;
}
.btn-time:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); }

.btn-penguin {
background: rgba(255, 255, 255, 0.9); color: #000;
border: none; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.btn-penguin:hover {
transform: translateY(-5px); background: #fff;
box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.btn-crocodile {
background: rgba(0, 0, 0, 0.3); color: rgba(255,255,255,0.8);
border: 1px solid rgba(255,255,255,0.1);
}
.btn-crocodile:hover {
background: rgba(76, 175, 80, 0.2); color: #4caf50;
border-color: rgba(76, 175, 80, 0.4); transform: scale(1.02);
}

/* Menu Utility Buttons */
#menu-utils { display: block; }
.menu-util-btn {
position: fixed;
width: 44px;
height: 44px;
background: rgba(20, 70, 115, 0.14);
backdrop-filter: blur(10px); /* 업적/설정 버튼 (예전 12px) */
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.35);
border-radius: 14px;
box-shadow: 0 4px 14px rgba(20, 70, 115, 0.12);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
font-size: 20px;
z-index: 150; /* Above everything */
transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
pointer-events: auto;
}
.menu-util-btn:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.25); }
#menu-utils svg { opacity: 0.95; filter: drop-shadow(0 1px 2px rgba(20, 70, 115, 0.3)); }

#btn-settings {
top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top))); right: calc(16px + var(--safe-area-inset-right, env(safe-area-inset-right)));
border-radius: 50%; /* 완전한 원형 */
}

/* [테스트용] 기록 초기화 버튼 (settings.js, DEV_MODE일 때만): 홈페이지 버튼 왼쪽, 같은 크기의 원
   한 번 누르면 빨갛게(.armed) → 2.5초 안에 한 번 더 누르면 지움 */
#btn-homepage {
top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top))); right: calc(16px + 44px + 10px + var(--safe-area-inset-right, env(safe-area-inset-right)));
border-radius: 50%;
-webkit-tap-highlight-color: transparent;
}
#btn-reset-records {
top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top))); right: calc(16px + (44px + 10px) * 2 + var(--safe-area-inset-right, env(safe-area-inset-right)));
border-radius: 50%;
}
/* 웹 체험판 스토어 버튼 (WEB_MODE, settings.js): 홈페이지(site/style.css .store-logo)와 같은 검은 버튼 + 로고 + 글씨
   메인화면 오른쪽 아래에 가로로 나란히 (2026-12-01 세로 → 가로. 낮은 폰 화면에서 캐릭터 카드와 겹치는지 확인 필요)
   위 왼쪽 업적 / 위 오른쪽 설정과 같은 16px 여백. 홈페이지보다 한 단계 작게 (높이 56 → 44, 글씨 17 → 15, 로고 24 → 20) */
#menu-stores {
position: fixed; z-index: 150;
bottom: calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
right: calc(16px + var(--safe-area-inset-right, env(safe-area-inset-right)));
display: flex; flex-direction: row; align-items: stretch; gap: 8px;
pointer-events: auto;
}
#menu-stores .store-logo {
display: flex; align-items: center; gap: 8px;
justify-content: center; /* 두 버튼 폭은 긴 쪽(Google Play)에 맞춰지니, 짧은 App Store는 로고+글씨를 가운데로 */
height: 44px; padding: 0 18px 0 14px; box-sizing: border-box;
border-radius: 15px; /* 게임 안 버튼들·홈페이지와 같은 15px */
background: #000; color: #fff; text-decoration: none;
font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
box-shadow: 0 6px 16px rgba(15, 34, 51, 0.18);
transition: transform 0.12s ease;
-webkit-tap-highlight-color: transparent;
}
#menu-stores .store-logo:active { transform: scale(1.04); } /* 홈페이지와 같게 살짝 커짐 */
#menu-stores .store-logo img { display: block; height: 20px; width: auto; }

#btn-reset-records.armed { background: rgba(255,59,48,0.75); border-color: rgba(255,255,255,0.6); }

/* 도전과제 버튼: 설정 버튼과 같은 재질, 트로피 + 진행도가 들어가는 알약 모양 (왼쪽 위) */
#btn-achievements {
top: calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top))); left: calc(16px + var(--safe-area-inset-left, env(safe-area-inset-left)));
width: auto; padding: 0 16px 0 13px; gap: 7px;
border-radius: 22px;
}
/* 새로 달성했는데 아직 안 본 업적이 있을 때: 버튼 오른쪽 위 작은 빨간 점 (achievements.js) */
.ach-new-dot {
display: none; position: absolute; top: 1px; right: 3px;
width: 9px; height: 9px; border-radius: 50%;
background: #ff3b30;
box-shadow: 0 0 0 1.5px rgba(255,255,255,0.9); /* 반투명 파랑 위에서도 또렷하게 얇은 흰 테 */
}
.ach-new-dot.visible { display: block; }
#achievements-progress {
color: white; font-size: 15px; font-weight: 800; letter-spacing: 0.5px;
text-shadow: 0 1px 2px rgba(20, 70, 115, 0.3); /* 아이콘 그림자와 맞춤 */
}

/* 설정 창 (settings.js): 일시정지 메뉴와 같은 어두운 반투명 카드 */
/* 도전과제 창(achievements.js)도 같은 카드를 씀 */
#settings-overlay, #achievements-overlay {
display: none; position: fixed; inset: 0; z-index: 160;
background: rgba(0,0,0,0.25);
justify-content: center; align-items: center;
user-select: none; -webkit-user-select: none;
}
#settings-overlay.open, #achievements-overlay.open { display: flex; }
#settings-panel, #achievements-panel {
width: 80%; max-width: 280px; box-sizing: border-box;
background: rgba(0,0,0,0.85); padding: 24px 20px; border-radius: 40px; /* 위아래 24px 같게 (예전 아래 16px + Close 아래 여백 8px) */
backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
border: 1px solid rgba(255,255,255,0.1);
color: white; display: flex; flex-direction: column; align-items: center;
}
.settings-title { font-size: 18px; font-weight: 800; letter-spacing: 1px; margin-bottom: 10px; }
.settings-row {
width: 100%; display: flex; align-items: center; justify-content: space-between;
padding: 12px 6px; box-sizing: border-box; cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
.settings-row + .settings-row { border-top: 1px solid rgba(255,255,255,0.08); }
.settings-label { font-size: 15px; font-weight: 600; }
.settings-row input { display: none; }
.settings-arrow { font-size: 22px; line-height: 1; opacity: 0.6; padding-right: 4px; } /* Privacy Settings 줄 오른쪽 화살표 */
/* 스위치: 꺼짐 회색 / 켜짐 초록, 동그라미가 옆으로 미끄러짐 */
.settings-switch {
position: relative; width: 46px; height: 28px; flex-shrink: 0;
background: rgba(255,255,255,0.2); border-radius: 14px;
transition: background 0.2s;
}
.settings-switch::after {
content: ''; position: absolute; top: 3px; left: 3px;
width: 22px; height: 22px; border-radius: 50%; background: #fff;
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.settings-row input:checked + .settings-switch { background: #4cd964; }
.settings-row input:checked + .settings-switch::after { transform: translateX(18px); }

/* ===== 도전과제 창 (임시 모양) ===== */
#achievements-panel {
max-width: 320px; max-height: 85vh; /* 목록이 길면 창 안에서만 스크롤 */
}
.ach-summary { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 6px; box-sizing: border-box; }
.ach-summary-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
.ach-summary-fill { height: 100%; border-radius: 3px; background: #ffd600; }
.ach-summary-text { font-size: 13px; font-weight: 800; color: #ffd600; }
/* 자체 스크롤 (achievements.js): 브라우저 스크롤 대신 내용을 직접 옮김 */
.ach-list {
width: 100%; flex: 1; min-height: 0;
position: relative; overflow: hidden;
touch-action: none; cursor: grab;
}
.ach-list:active { cursor: grabbing; }
#ach-track { will-change: transform; }
/* 오른쪽 얇은 막대: 움직일 때만 보였다가 사라짐 */
.ach-scrollbar {
position: absolute; top: 0; right: 0; width: 3px; border-radius: 2px;
background: rgba(255,255,255,0.35);
opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.ach-scrollbar.visible { opacity: 1; transition-duration: 0.1s; }
.ach-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; }
.ach-item + .ach-item { border-top: 1px solid rgba(255,255,255,0.08); }
.ach-icon {
width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
background: rgba(255,255,255,0.08);
}
/* 투명도는 fill 색이 아니라 svg 전체에 한 번만: 아이콘 조각(부리/머리 등)이 겹친 곳이 더 진해 보이지 않게 */
.ach-icon svg { fill: white; opacity: 0.3; }
.ach-text { flex: 1; min-width: 0; text-align: left; }
.ach-name { font-size: 14px; font-weight: 700; }
.ach-desc { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }
/* 개수 현황 (1 / 50): 설명 아랫줄, 설명과 같은 글씨 */
.ach-count { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 1px; }
/* 달성한 것: 노란 트로피, 안 한 것: 흐리게 */
.ach-item.done .ach-icon { background: rgba(255,214,0,0.16); }
.ach-item.done .ach-icon svg { fill: #ffd600; opacity: 1; }
.ach-item:not(.done) .ach-name { color: rgba(255,255,255,0.6); }

/* ===== 도전과제 달성 알림 (achievements.js) ===== */
/* 화면 위 가운데, 모든 창보다 위. 화면 터치는 막지 않음. 위에서 스르륵 내려왔다가 올라가며 사라짐 */
#ach-toast {
position: fixed; top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top))); left: 50%; z-index: 300;
display: flex; align-items: center; gap: 12px;
padding: 8px 20px 8px 8px; border-radius: 30px;
background: rgba(0,0,0,0.8);
backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); /* 업적 달성 알림: 다른 창들과 같은 15px 블러 다시 넣음 (설정에서 블러 끄면 빠짐) */
border: 1px solid rgba(255,214,0,0.3);
box-shadow: 0 8px 24px rgba(0,0,0,0.2);
color: white; white-space: nowrap;
pointer-events: none; user-select: none; -webkit-user-select: none;
opacity: 0; transform: translate(-50%, -20px);
transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#ach-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* [잠시 꺼 둠 2026-11-30: 웹은 PC 전용, 아래 #mobile-block] 원래 규칙 (안쪽 주석은 괄호로 바꿔 둠)
( 웹 체험판 가로 안내 (index.html #rotate-overlay): 폰(손가락 터치)을 세로로 들었을 때만 화면 전체를 덮음
   로딩 화면(1000)보다 위. 폰 그림이 세로 → 가로로 눕는 걸 반복 )
#rotate-overlay {
display: none; position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 2000; ( 높이는 로딩 화면과 같은 방식 (100dvh) ) ( fixed 대신 absolute: 로딩 화면처럼 아이폰 사파리 상단바 색에 끼어들지 않게 (body가 스크롤 없는 화면 크기라 보이는 건 같음) )
flex-direction: column; align-items: center; justify-content: center; gap: 10px;
background: #d0f0ff; ( 로딩 화면과 같은 연한 하늘색 (잠깐 파랑이었다가 다시 원래대로) )
color: white; text-align: center;
user-select: none; -webkit-user-select: none;
}
@media (orientation: portrait) and (pointer: coarse) {
    body.web-mode #rotate-overlay { display: flex; }
}
.rotate-phone {
width: 72px; height: 72px; margin-bottom: 10px;
fill: none; stroke: white; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
filter: drop-shadow(0 4px 10px rgba(20, 70, 115, 0.25));
animation: rotate-phone-turn 2.4s ease-in-out infinite;
}
@keyframes rotate-phone-turn {
0%, 20%   { transform: rotate(0deg); }
50%, 80%  { transform: rotate(-90deg); }
100%      { transform: rotate(0deg); }
}
.rotate-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; text-shadow: 0 4px 14px rgba(20, 70, 115, 0.2); }
.rotate-sub { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
@media (prefers-reduced-motion: reduce) {
    .rotate-phone { animation: none; transform: rotate(-90deg); }
}
*/
/* 웹 체험판은 PC 전용 (index.html #mobile-block): 폰·태블릿이면 settings.js가 body.mobile-blocked를 붙여서 화면 전체를 덮음
   로딩 화면(1000)보다 위. 예전 가로 안내 화면과 같은 연한 하늘색 + 흰 글씨 */
#mobile-block {
display: none; position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 2000; /* fixed 대신 absolute: 아이폰 사파리 상단바 색에 끼어들지 않게 */
flex-direction: column; align-items: center; justify-content: center; gap: 10px;
padding: 0 28px; box-sizing: border-box;
background: #d0f0ff;
color: white; text-align: center;
user-select: none; -webkit-user-select: none;
}
body.mobile-blocked #mobile-block { display: flex; }
/* 안내 화면이 떠 있으면 나머지(게임 화면·메뉴·로딩 화면)는 다 숨김: 아이패드 등에서 100dvh가 실제 화면보다 짧게 잡혀
   밑에 게임 화면이 비쳐 보이던 것 → 남는 곳엔 같은 하늘색 바탕(body)만 보임 */
body.mobile-blocked > *:not(#mobile-block):not(script) { display: none !important; }
.mobile-block-icon {
width: 72px; height: 72px; margin-bottom: 10px;
fill: none; stroke: white; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
filter: drop-shadow(0 4px 10px rgba(20, 70, 115, 0.25));
}
.mobile-block-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; text-shadow: 0 4px 14px rgba(20, 70, 115, 0.2); }
.mobile-block-sub { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.85); max-width: 320px; line-height: 1.4; }
/* 웹 체험판 안내 알림 (game-flow-ui.js showMenuToast): 악어 카드를 누르면 "Only available in the app"
   업적 알림과 같은 자리·재질·움직임 (검은 알약, 위에서 내려옴). 테두리만 금색 대신 옅은 흰색, 글씨만 한 줄 */
#menu-toast {
position: fixed; top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top))); left: 50%; z-index: 300;
padding: 12px 22px; border-radius: 30px;
background: rgba(0,0,0,0.8);
backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); /* 업적 알림과 같게 */
border: 1px solid rgba(255,255,255,0.15);
box-shadow: 0 8px 24px rgba(0,0,0,0.2);
color: white; font-size: 14px; font-weight: 700; white-space: nowrap;
pointer-events: none; user-select: none; -webkit-user-select: none;
opacity: 0; transform: translate(-50%, -20px);
transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
#menu-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ach-toast-icon {
width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
background: rgba(255,214,0,0.16);
display: flex; align-items: center; justify-content: center;
}
.ach-toast-icon svg { fill: #ffd600; }
.ach-toast-label { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: #ffd600; }
.ach-toast-name { font-size: 15px; font-weight: 800; margin-top: 1px; }

/* 설정/업적 창 Close 버튼: 기본 버튼(18px)보다 작게, 높이도 살짝 낮게
   여백은 위 12px만 (.btn-pause-menu의 위아래 8px을 덮어씀). 창 아래 끝은 창 안쪽 여백 24px
   → 설정: 마지막 스위치 줄 안쪽 12px + 12px = 약 24px, 제목 쪽과 창 아래 끝(24px)과 비슷 */
#settings-panel .settings-close, #achievements-panel .settings-close {
margin: 12px 0 0; font-size: 16px; padding-top: 11px; padding-bottom: 11px;
}
/* 실험: 광고 + 게임오버를 하나의 긴 창으로 합침. 창 모양(배경/흐림/테두리/둥글기 40px)은 예전 #game-over 것을 여기로 옮김
   [여백 위아래 24 / 좌우 32] 광고 300x250 [사이 32] 정보+버튼 220 → 창 전체 약 618 x 300 (여백·사이 40이면 642: 너무 넓었음)
   사이를 여백보다 넓게: 광고와 버튼이 가까우면 실수로 광고를 누르기 쉬움 (구분선은 별로라 뺌)
   (예전: 광고 칸 340x290 검은 박스 + 사이 20px + 게임오버 창 따로, width 95% / max-width 680px) */
#game-over-screen {
display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
z-index: 30;
justify-content: center; align-items: center; gap: 32px;
background: rgba(0,0,0,0.85); border-radius: 40px;
backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
border: 1px solid rgba(255,255,255,0.1);
padding: 24px 32px;
pointer-events: auto;
}
/* 웹 체험판(광고 자리 없이 정보+Restart만): 창 여백을 상하좌우 40px로 (settings.js가 body에 web-mode 붙임) */
body.web-mode #game-over-screen { padding: 40px; }

/* 광고 자리: 배너(300x250) 크기 그대로, 따로 검은 박스 없음 (예전 340x290 + 검정 배경 + 둥글기 24px + 안쪽 20px) */
#over-ad {
width: 300px; height: 250px;
/* 광고가 안 나올 때도 자리가 보이게 아주 옅은 칸 (배너가 뜨면 위에 덮임) */
background: rgba(255,255,255,0.05); /* 둥글기 없음: 실제 배너처럼 각진 네모 */
display: flex; align-items: center; justify-content: center;
color: rgba(255,255,255,0.2); font-size: 12px; font-weight: 800; letter-spacing: 2px;
pointer-events: auto;
flex-shrink: 0;
box-sizing: border-box;
}

#game-over {
/* 실험: 창 모양은 바깥(#game-over-screen)이 맡음. 여기는 정보+버튼 묶음만 (폭 = 버튼 220px)
   (따로 창일 때: 배경 0.85 + 흐림 15px + 테두리 + 둥글기 40px + 여백 위 32 / 좌우 40 / 아래 40) */
display: flex; flex-direction: column;
align-items: center; text-align: center; color: white;
user-select: none; -webkit-user-select: none;
pointer-events: auto;
}

/* 게임오버 캡션 (gameover-caption.js): 화면 위 가운데, 배경 없이 글씨만 왼쪽으로 흘러감 */
#over-caption {
display: none; position: fixed; top: calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top))); left: 50%; z-index: 30;
transform: translateX(-50%);
width: 480px; max-width: calc(100% - 32px); height: 28px;
pointer-events: none; user-select: none; -webkit-user-select: none;
}
#over-caption.visible { display: block; }
/* 글씨가 지나가는 칸: 양 끝에서 글씨만 부드럽게 흐려짐 (배경 알약은 그대로) */
#over-caption-track {
position: relative; width: 100%; height: 100%; overflow: hidden;
-webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
#over-caption-text {
position: absolute; top: 0; left: 0; height: 28px; line-height: 28px;
white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
color: rgba(255,255,255,0.85);
text-shadow: 0 1px 3px rgba(0,0,0,0.35); /* 배경이 없어서 밝은 하늘/눈 위에서도 읽히게 옅은 그림자만 */
will-change: transform;
}
/* 반복되는 멘트 사이 구분 점 */
.over-caption-sep { display: inline-block; margin: 0 18px; opacity: 0.5; }
/* 멘트+구분 점 한 묶음 길이(--to)만큼 왼쪽으로 가면 처음으로: 다음 묶음이 같은 자리라 이음매가 안 보임 */
@keyframes over-caption-scroll {
from { transform: translateX(0); }
to { transform: translateX(var(--to)); }
}

/* Game Reward Overlay */
#game-reward {
display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center; color: white; z-index: 30;
width: 85%; max-width: 340px; user-select: none; -webkit-user-select: none;
background: rgba(0,0,0,0.85); padding: 12px 16px; border-radius: 40px;
backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
}

#game-reward h1 {
font-size: 32px; margin: 0; font-weight: 900; letter-spacing: -1px;
color: #ffd600;
}

.reward-msg {
font-size: 12px; margin: 10px 0; color: #fff; font-weight: 600; line-height: 1.4;
}

/* 보상 그림 (index.html의 reward.jpeg 부분과 함께 주석 처리)
.reward-img-box {
width: 100%;
margin-bottom: 12px; display: flex; align-items: center; justify-content: center;
}

.reward-img {
width: 75%; height: auto;
}
*/

.over-stats {
/* 세로 여백 (게임오버 창): 세 묶음으로 나눔
   [사유 → 2px → 최고 기록] → 6px → [현재 점수] → 16px → [Continue → 12px → Restart]
   (숫자는 위아래로 글자 꼬리 자리만큼 비어 보여서, 눈으로는 약 15px / 23px: 점수는 정보 쪽에 붙고 버튼과는 확실히 떨어짐)
   글씨 줄 높이를 직접 정해서(16px / 36px) 눈에 보이는 간격이 숫자와 거의 같게 */
margin-bottom: 16px;
padding: 0 12px;
/* 창 폭 꽉 채움: 안 그러면 점수/하이스코어 글씨 폭만큼만 넓어서, 흐르는 사유 칸이 좁게 재졌다가 나중에 넓어지며 오른쪽에서 글씨가 툭 나타남 */
align-self: stretch; box-sizing: border-box;
}

.reward-over-stats {
margin-top: 0;
padding: 0;
}

.over-label { font-size: 12px; line-height: 16px; color: rgba(255,255,255,0.4); letter-spacing: 2px; }
/* 정보 묶음 (사유 + 최고 기록) ↔ 현재 점수 */
.over-meta { margin-bottom: 6px; } /* 예전 10px: 숫자 위 빈 공간까지 더해 점수→버튼 간격과 비슷해 보였음 */
/* 죽은 사유: 회색 대신 게임오버 빨강(#ff5252) 쪽으로 아주 옅게 물든 색, 글자 간격은 살짝 좁혀 단정하게 */
#over-reason {
margin: 0 auto 2px; /* 아래: 최고 기록 줄과 붙여서 한 묶음 (.over-meta) */
width: 160px; /* 흐르는 칸 폭 (예전 창 폭 꽉 채움 236px은 너무 길었음), 가운데 정렬 */
color: rgba(255,150,140,0.7); font-weight: 600; letter-spacing: 1px;
/* 흐르는 칸 (gameover-caption.js showGameOverReason): 양 끝에서 글씨가 부드럽게 흐려짐 */
position: relative; overflow: hidden; height: 16px;
-webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
#over-reason-text {
position: absolute; top: 0; left: 0; height: 16px; line-height: 16px;
white-space: nowrap; will-change: transform;
}
.over-reason-sep { display: inline-block; margin: 0 12px; opacity: 0.5; }
/* 하이스코어 줄 (player-collision.js): 괄호·배지 없이 글씨만. "HIGHSCORE"는 흐린 흰색, 숫자만 흰색 굵게
   새 기록("NEW SCORE!")도 같은 흐린 흰색 (예전 노란 글씨) */
#highscore-label { font-weight: 700; color: rgba(255,255,255,0.45); }
#highscore-label .hs-value { font-weight: 800; } /* 색은 HIGHSCORE 글씨와 같게 (예전 흰색: 현재 점수와 같은 흰색이라 겹쳐 보였음), 굵기만 살짝 */
.over-value { font-size: 32px; line-height: 36px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.reward-over-value { font-size: 20px; }

.btn-restart {
background: #fff; color: #000; border: none; width: 220px;
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
/* hover 효과 없음, 누르는 동안만 아주 살짝 커짐 */
.btn-restart:active { transform: scale(1.03); transition-duration: 0.2s; } /* 예전 0.1초 */

.btn-revive {
background: #ffd600; color: #000; border: none; width: 220px;
margin-bottom: 12px; font-size: 16px;
box-shadow: 0 8px 15px rgba(255,214,0,0.2);
display: none; /* Initially hidden, shown via JS */
}
/* hover 효과 없음, 누르는 동안만 살짝 커지고 밝아짐 (비활성일 땐 반응 없음) */
.btn-revive:not(:disabled):active { background: #ffea00; transform: scale(1.05); transition-duration: 0.2s; } /* 예전 0.1초 */
.btn-revive:disabled { background: #555; color: #aaa; transform: none; box-shadow: none; cursor: default; }
/* Continue 밑에 작은 글씨로 광고 안내 */
.btn-revive .revive-sub { display: block; font-size: 11px; font-weight: 500; opacity: 0.65; margin-top: 2px; }
.btn-revive .revive-sub.revive-sub-error { color: #777; opacity: 1; } /* 영상 광고 실패 안내 (player-collision.js showReviveAdError) */
/* 게임오버 창 안 Continue/Restart: 일시정지·설정 버튼과 같은 15px 둥글기 (기본 button 20px) */
#game-over .btn-revive, #game-over .btn-restart { border-radius: 15px; }
/* Restart 글씨를 Continue와 같은 16px로 (예전 기본 18px): 위아래 두 버튼이 한 쌍으로 보이게 */
#game-over .btn-restart { font-size: 16px; }
/* 누를 때 커지는 정도도 둘 다 같게 (Continue 예전 1.05) */
#game-over .btn-revive:not(:disabled):active { transform: scale(1.03); }

/* Pause Menu Overlay */
#pause-menu {
display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center; color: white; z-index: 70;
/* 폭 고정 안 함: 버튼(220px) + 좌우 여백 40px으로 창 크기가 정해짐 → 적힌 여백 = 눈에 보이는 여백
   (예전 width 80% / max-width 280px + 좌우 16px: 버튼 양옆이 30px씩 더 비어서 약 47px로 보였음) */
user-select: none; -webkit-user-select: none;
background: rgba(0,0,0,0.85); padding: 32px 40px; border-radius: 40px;
backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.1);
}

.btn-pause-menu {
background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.1);
width: 220px; margin: 8px 0; border-radius: 15px;
/* 이미 흐려진 창 위에 있어서 버튼 자체 흐림은 끔 (흐림이 두 겹이면 둥근 테두리가 깨져 보일 수 있음) */
backdrop-filter: none; -webkit-backdrop-filter: none;
transition: background 0.2s ease-out; /* 배경만 (크기 변화 없음), 예전 0.1초 */
-webkit-tap-highlight-color: transparent; /* 폰 기본 회색 탭 깜빡임 끄기 */
}
/* 누르고 있는 동안만 배경이 밝아짐 */
.btn-pause-menu:active { background: rgba(255,255,255,0.2); }
.btn-exit { color: #ff5252; border-color: rgba(255,82,82,0.2); }

/* Mobile Controls */
#game-controls {
display: none; position: fixed; bottom: 40px; left: 0; width: 100%;
padding: 0 calc(30px + var(--safe-area-inset-right, env(safe-area-inset-right))) 0 calc(30px + var(--safe-area-inset-left, env(safe-area-inset-left))); z-index: 50; pointer-events: none;
justify-content: space-between; align-items: flex-end;
box-sizing: border-box;
user-select: none; -webkit-user-select: none;
}
/* 조작 반전 (설정): 점프/잠수 버튼이 왼쪽, 방향키가 오른쪽 */
#game-controls.swapped { flex-direction: row-reverse; }
.ctrl-group-left { display: flex; gap: 20px; pointer-events: none; }
.ctrl-group-right { pointer-events: none; }
/* BLACK UI BUTTONS */
.game-ctrl-btn { width: 76px; height: 76px; background: rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; color: white; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: auto; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); -webkit-user-select: none; user-select: none; touch-action: none; transition: transform 0.1s, background 0.1s; position: relative; }
.game-ctrl-btn::after {
content: '';
position: absolute;
/* 손가락이 닿기 시작하는 범위: 버튼 밖 34px까지 (실제 어느 버튼인지는 game.js findCtrlButton이 거리로 정함, 예전 20px) */
top: -34px; left: -34px; right: -34px; bottom: -34px;
border-radius: 50%;
}
/* 아이콘은 터치를 안 받음 (버튼이 받게) */
.game-ctrl-btn svg { pointer-events: none; }
.game-ctrl-btn.pressed { background: rgba(0,0,0,0.2); transform: scale(0.95); border-color: rgba(255,255,255,0.25); }
#btn-jump { font-size: 24px; }

/* 블러 효과 끔 (settings.js Blur Effects, 약한 폰은 처음 켤 때 자동으로 꺼짐): 버튼/창 뒤 흐림 효과를 모두 끔 */
body.no-blur *, body.no-blur *::before, body.no-blur *::after {
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
}
