/* ── 폰트 변수 (여기서 일괄 관리) ──────────────────────────────
   --font-display : 제목·HUD 수치·버튼 등 영문 UI (sci-fi 느낌)
   --font-body    : 본문·설명·한글 혼용 텍스트
   --font-mono    : 코드·ID 등 고정폭 텍스트
   ─────────────────────────────────────────────────────────── */
:root {
  --font-display : 'Orbitron', sans-serif;
  --font-body    : 'Inter', 'SUIT', 'Pretendard', 'Noto Sans KR', sans-serif;
  --font-mono    : 'Courier New', Courier, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #101f45, #03050e 55%, #010204 100%);
  font-family: var(--font-body);

  /* 모바일 브라우저 기본 제스처/선택 동작 차단 */
  -webkit-touch-callout: none; /* iOS 길게 누르기 컨텍스트 메뉴 */
  -webkit-user-select: none;   /* Safari 텍스트 선택 */
  user-select: none;
  touch-action: manipulation;  /* 더블탭 줌 차단, 단일탭/스크롤은 허용 */
}

#app {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* Three.js가 모든 터치 직접 처리 */
}

/* ── 인트로 재생 중: 모든 UI 패널 숨김 ─────────────────────── */
.game-hud,
.settings-panel,
#top-hud,
#bottom-hud,
#mobile-hud {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.intro-playing .game-hud,
body.intro-playing .settings-panel,
body.intro-playing #top-hud,
body.intro-playing #bottom-hud,
body.intro-playing #mobile-hud {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.settings-panel {
  display: none;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  width: min(320px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(8, 12, 26, 0.72);
  backdrop-filter: blur(10px);
  color: #e4eeff;
}

.settings-panel.admin-visible {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.panel-collapse-btn {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #a9c2ee;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s;
}
.panel-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.panel-body.collapsed,
.game-hud__body.collapsed {
  display: none;
}

.settings-panel .panel-body {
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.panel-header-title.hidden {
  display: none;
}

/* 접힌 상태의 설정 패널: 아이콘 버튼만 보이게 최소 너비로 */
.settings-panel:has(.panel-body.collapsed) {
  width: auto;
  min-width: unset;
  padding: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.settings-panel:has(.panel-body.collapsed) .panel-header {
  margin-bottom: 0;
}

.settings-panel:has(.panel-body.collapsed) .panel-collapse-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  padding: 4px;
  color: rgba(255, 100, 100, 0.85);
}

.settings-panel:has(.panel-body.collapsed) .panel-collapse-btn:hover {
  background: transparent;
  color: #ff6060;
}

.panel-triangles {
  margin-bottom: 10px;
  color: #b8cbef;
  font-size: 12px;
}

.panel-rows {
  display: grid;
  gap: 8px;
}

.panel-row {
  display: grid;
  gap: 4px;
}

.panel-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-label {
  font-size: 12px;
  font-family: var(--font-display);
  color: #dce9ff;
}

.panel-value {
  font-size: 12px;
  color: #a9c2ee;
  font-variant-numeric: tabular-nums;
}

.panel-slider {
  width: 100%;
  margin: 0;
}

.panel-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.panel-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #7fb0ff;
}

.panel-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #c8daff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}

.panel-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.panel-perf {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.panel-perf-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-family: var(--font-display);
  color: #c7d9fa;
  font-weight: 600;
}

.panel-perf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  font-size: 12px;
  color: #a9c2ee;
  font-variant-numeric: tabular-nums;
}

/* ── 상단 중앙 통합 HUD (하트 + 지뢰/깃발/시간) ─────────── */
#top-hud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.top-hud__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 10px 20px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(8, 12, 26, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* 하트 행 */
.top-hud__hearts {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  order: 2;
}

/* 구분선 제거 */
.top-hud__inner::after {
  display: none;
}

/* 통계 행 */
.top-hud__stats-row {
  display: flex;
  align-items: center;
  gap: 4px;
  order: 0;
}

.top-hud__stat {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 8px;
}

.top-hud__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.75;
}

.top-hud__val {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #b8d0ff;
  min-width: 18px;
  text-align: left;
}

/* 지뢰 아이콘: 주황 계열 */
#top-stat-mines .top-hud__icon { color: #ffaa55; }
#top-stat-mines .top-hud__val  { color: #ffcc88; }

/* 깃발 아이콘: 청록 계열 */
#top-stat-flags .top-hud__icon { color: #55ddaa; }
#top-stat-flags .top-hud__val  { color: #88eebb; }

/* 시간 아이콘: 파랑 계열 */
#top-stat-timer .top-hud__icon { color: #7ab4ff; }
#top-stat-timer .top-hud__val  { color: #b0cfff; }
#top-stat-timer.win .top-hud__val  { color: #66ee88; }
#top-stat-timer.lose .top-hud__val { color: #ff6644; }

/* 구분점 */
.top-hud__sep {
  display: none;
}

/* 하트 */
.lbar-heart {
  display: block;
  width: 26px;
  height: 26px;
  transition: opacity 0.3s, filter 0.3s, transform 0.2s;
}

/* SVG 하트를 mask로 렌더링 */
.lbar-heart::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.593c-5.63-5.539-11-10.297-11-14.402 0-3.791 3.068-5.191 5.281-5.191 1.312 0 4.151.501 5.719 4.457 1.59-3.968 4.464-4.447 5.726-4.447 2.54 0 5.274 1.621 5.274 5.181 0 4.069-5.136 8.625-11 14.402z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.593c-5.63-5.539-11-10.297-11-14.402 0-3.791 3.068-5.191 5.281-5.191 1.312 0 4.151.501 5.719 4.457 1.59-3.968 4.464-4.447 5.726-4.447 2.54 0 5.274 1.621 5.274 5.181 0 4.069-5.136 8.625-11 14.402z'/%3E%3C/svg%3E") no-repeat center / contain;
  background-color: currentColor;
}

.lbar-heart.alive {
  color: #ff3d6e;
  filter: drop-shadow(0 0 5px rgba(255, 61, 110, 0.7));
}

.lbar-heart.dead {
  color: #2a3448;
  opacity: 0.5;
  filter: none;
}

.lbar-heart.hit {
  animation: heart-hit 0.5s ease-out forwards;
}

@keyframes heart-hit {
  0%   { transform: scale(1.5); color: #ffaa33; filter: drop-shadow(0 0 10px rgba(255,170,51,0.9)); }
  60%  { transform: scale(0.8); }
  100% { transform: scale(1);   color: #2a3448; opacity: 0.5; filter: none; }
}

.top-hud__inner.shake {
  animation: lbar-shake 0.45s ease-out;
}

@keyframes lbar-shake {
  0%  { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100%{ transform: translateX(0); }
}

/* ── AD 하트 (광고 시청으로 복구 가능한 슬롯) ─────────────────── */
/* ── AD +1 하트 버튼 (Top HUD / 데스크탑) ──────────────────────── */
.lbar-ad-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 2px 6px;
  border: none;
  border-radius: 7px;
  background: rgba(30, 36, 60, 0.85);
  border: 1px solid rgba(255, 60, 80, 0.4);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  line-height: 1.3;
  animation: ad-btn-pulse 2.2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(255,60,80,0.3);
  /* #top-hud 의 pointer-events:none 을 버튼에서만 해제 */
  pointer-events: auto;
}
.lbar-ad-btn__heart {
  color: #ff3d5e;
  font-size: 11px;
}
@keyframes ad-btn-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255,60,80,0.25); }
  50%       { box-shadow: 0 0 10px rgba(255,60,80,0.6); }
}

/* ── 하트 획득 팝업 애니메이션 ────────────────────────────────── */
.lbar-heart.gained {
  animation: heart-gained 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes heart-gained {
  0%   { transform: scale(0);   opacity: 0; color: #ff3d6e; filter: drop-shadow(0 0 22px rgba(255,61,110,1)); }
  55%  { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; color: #ff3d6e; filter: drop-shadow(0 0 5px rgba(255,61,110,0.7)); }
}

/* ── AD 하트 확인 팝업 오버레이 ───────────────────────────────── */
/* ══════════════════════════════════════════════════════════════
   AD HEART / PREMIUM HEART 팝업 — 게임 공통 팝업 스타일 통일
   ══════════════════════════════════════════════════════════════ */
#ad-heart-overlay,
#ad-heart-granted-overlay,
#premium-heart-overlay,
#last-chance-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3100;
  background: rgba(0, 2, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
#ad-heart-overlay.visible,
#ad-heart-granted-overlay.visible,
#premium-heart-overlay.visible,
#last-chance-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── 팝업 카드 공통 ──────────────────────────────────────────── */
.ad-heart-popup {
  width: min(320px, calc(100vw - 32px));
  padding: 28px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(6, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  text-align: center;
  animation: ad-popup-in 0.22s ease both;
}
@keyframes ad-popup-in {
  from { transform: scale(0.93) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* 구분선 */
.ad-heart-popup::before {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto 20px;
}

/* ── 아이콘 ──────────────────────────────────────────────────── */
.ad-heart-popup__icon {
  font-size: 38px;
  margin-bottom: 10px;
  display: block;
  animation: ad-icon-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s both;
}
@keyframes ad-icon-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── 제목 ──────────────────────────────────────────────────── */
.ad-heart-popup__title {
  font-size: 18px;
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d4eaff;
  text-shadow: 0 0 16px rgba(100, 160, 255, 0.4);
  margin-bottom: 8px;
}

/* ── 본문 ──────────────────────────────────────────────────── */
.ad-heart-popup__body {
  font-size: 13px;
  color: rgba(180, 200, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 4px;
  white-space: pre-line;
}

/* ── 횟수 표시 ─────────────────────────────────────────────── */
.ad-heart-popup__count {
  font-size: 11px;
  color: rgba(140, 165, 220, 0.45);
  margin-bottom: 20px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

/* ── 버튼 행 ───────────────────────────────────────────────── */
.ad-heart-popup__btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ad-heart-popup__btn-cancel {
  flex: 1;
  padding: 11px 8px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(180, 200, 240, 0.55);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ad-heart-popup__btn-cancel:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.ad-heart-popup__btn-watch {
  flex: 2;
  padding: 11px 8px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #c95e00 0%, #ff9500 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(200, 90, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ad-heart-popup__btn-watch:hover  { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(200,90,0,0.55); }
.ad-heart-popup__btn-watch:active { transform: translateY(0); }

.ad-heart-popup__btn-ok {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #1a3a7a 0%, #2a5cbf 100%);
  color: #d4eaff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(30, 80, 200, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ad-heart-popup__btn-ok:hover  { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(30,80,200,0.5); }
.ad-heart-popup__btn-ok:active { transform: translateY(0); }

/* ── 프리미엄 전용 변형 ───────────────────────────────────── */
.premium-heart-popup {
  border-color: rgba(255, 200, 50, 0.28);
}
.premium-heart-popup__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 200, 50, 0.3);
  background: rgba(255, 185, 20, 0.1);
  color: #f5c842;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.premium-heart-popup .ad-heart-popup__title {
  color: #f5c842;
  text-shadow: 0 0 16px rgba(240, 185, 0, 0.4);
}
.premium-heart-popup .ad-heart-popup__btn-ok {
  background: linear-gradient(135deg, #7a4f00 0%, #c8920a 100%);
  color: #fff8e0;
  box-shadow: 0 3px 14px rgba(180, 120, 0, 0.35);
}
.premium-heart-popup .ad-heart-popup__btn-ok:hover {
  box-shadow: 0 5px 18px rgba(180, 120, 0, 0.55);
}

/* ── Last Chance 팝업 ───────────────────────────────────────── */
.last-chance-popup .ad-heart-popup__icon {
  font-size: 2.8rem;
  animation: lc-shake 0.6s ease-in-out;
}
@keyframes lc-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px) rotate(-5deg); }
  40%       { transform: translateX(6px)  rotate(5deg);  }
  60%       { transform: translateX(-4px) rotate(-3deg); }
  80%       { transform: translateX(4px)  rotate(3deg);  }
}
.last-chance-popup .ad-heart-popup__title {
  color: #ff5c5c;
  text-shadow: 0 0 16px rgba(255, 80, 80, 0.45);
}
.last-chance-popup .ad-heart-popup__btn-watch {
  background: linear-gradient(135deg, #8b0000 0%, #e03030 100%);
  box-shadow: 0 3px 14px rgba(220, 50, 50, 0.4);
}
.last-chance-popup .ad-heart-popup__btn-watch:hover {
  box-shadow: 0 5px 18px rgba(220, 50, 50, 0.6);
}

/* 모바일 대응 */
@media (max-width: 480px) {
  #top-hud {
    bottom: 10px;
  }
  .top-hud__inner {
    padding: 8px 14px 6px;
    border-radius: 16px;
  }
  .lbar-heart {
    width: 22px;
    height: 22px;
  }
  .top-hud__hearts {
    gap: 4px;
    padding-bottom: 6px;
  }
  .top-hud__val {
    font-size: 13px;
  }
  .top-hud__icon {
    width: 13px;
    height: 13px;
  }
  .top-hud__stat {
    gap: 4px;
    padding: 1px 6px;
  }
}

/* ── 지뢰찾기 게임 HUD ─────────────────────────────────── */
.game-hud {
  position: fixed;
  top: max(16px, calc(env(safe-area-inset-top, 0px) + 8px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 10;
  padding: 0;
  border: none;
  background: transparent;
  user-select: none;
}

.game-hud__settings-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(180, 200, 255, 0.75);
  cursor: pointer;
  transition: color 0.15s;
}

.game-hud__settings-btn:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .settings-panel {
    bottom: 40px;
    top: auto;
    right: 12px;
    width: min(300px, calc(100vw - 24px));
  }
  .settings-panel .panel-body {
    max-height: calc(100vh - 120px);
  }
}

.game-hud__title.hidden {
  display: none;
}

.game-hud__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e4eeff;
}

/* ── 레벨 셀렉터 ─────────────────────────────────────────────── */
.level-selector {
  margin-bottom: 4px;
}

.level-selector__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.level-selector__title {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  color: #7a9bcc;
  letter-spacing: 0.08em;
}

.level-selector__info {
  font-size: 10px;
  font-family: var(--font-display);
  color: #5a7aaa;
  font-variant-numeric: tabular-nums;
}

.level-selector__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.level-selector__btn {
  position: relative;
  padding: 5px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #8aabcc;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
  line-height: 1;
}

.level-selector__btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #c8ddff;
}

.level-selector__btn.active {
  background: color-mix(in srgb, var(--lv-color, #4488ff) 22%, transparent);
  border-color: color-mix(in srgb, var(--lv-color, #4488ff) 70%, transparent);
  color: color-mix(in srgb, var(--lv-color, #88bbff) 90%, #fff);
  font-weight: 700;
  box-shadow: 0 0 6px color-mix(in srgb, var(--lv-color, #4488ff) 35%, transparent);
}

/* lv-color 없는 레벨(조명 없음) active 폴백 */
.level-selector__btn:not([style]).active {
  background: rgba(80, 120, 200, 0.22);
  border-color: rgba(100, 160, 255, 0.5);
  color: #a8c8ff;
}

/* 현재 플레이 중인 레벨 버튼 - 우상단 점 */
.level-selector__btn.current::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(100, 220, 255, 0.9);
  box-shadow: 0 0 5px rgba(80, 200, 255, 0.7);
}
.level-selector__btn.current.active::before {
  background: color-mix(in srgb, var(--lv-color, #4488ff) 100%, #fff);
  box-shadow: 0 0 6px color-mix(in srgb, var(--lv-color, #4488ff) 80%, transparent);
}

.game-hud__mode-group {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.game-hud__mode-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #8aabcc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.2;
}

.game-hud__mode-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #c8ddff;
}

.game-hud__mode-btn.active {
  border-color: rgba(100, 180, 255, 0.6);
  background: rgba(60, 120, 200, 0.35);
  color: #d4eaff;
}

/* 현재 플레이 중인 모드 버튼 - 우상단 점 */
.game-hud__mode-btn.current::before {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(100, 220, 255, 0.9);
  box-shadow: 0 0 5px rgba(80, 200, 255, 0.7);
}
.game-hud__mode-btn.current.active::before {
  background: rgba(130, 220, 255, 1);
  box-shadow: 0 0 7px rgba(100, 210, 255, 0.8);
}

.game-hud__mode-sub {
  font-size: 9px;
  font-weight: 400;
  color: inherit;
  opacity: 0.75;
}

.game-hud__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 8px;
}

.game-hud__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}

.game-hud__label {
  color: #dce9ff;
  font-size: 12px;
}


.game-hud__timer {
  font-size: 13px;
  font-weight: 600;
  color: #a9c2ee;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  transition: color 0.3s;
}
.game-hud__timer.win  { color: #66ee88; }
.game-hud__timer.lose { color: #ff6644; }

.game-hud__lives {
  display: flex;
  gap: 2px;
  align-items: center;
}

.game-hud__heart {
  font-size: 13px;
  line-height: 1;
  transition: color 0.25s, opacity 0.25s;
}

.game-hud__heart.alive { color: #ff4466; }
.game-hud__heart.dead  { color: #3a4458; opacity: 0.55; }


/* ── 점수 블록 ─────────────────────────────────────────────── */
.game-hud__score-block {
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  transition: border-color 0.3s, background 0.3s;
}
.game-hud__score-block.win {
  background: rgba(60, 180, 90, 0.12);
  border-color: rgba(100, 220, 120, 0.35);
}
.game-hud__score-block.lose {
  background: rgba(180, 50, 30, 0.12);
  border-color: rgba(220, 80, 60, 0.35);
}

.game-hud__score-label {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  color: rgba(180, 200, 240, 0.5);
  margin-bottom: 2px;
}

.game-hud__score-val {
  font-size: 22px;
  font-weight: 900;
  font-family: var(--font-display);
  color: #e8f4ff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
  transition: color 0.2s;
}
.game-hud__score-block.win  .game-hud__score-val { color: #66ee88; }
.game-hud__score-block.lose .game-hud__score-val { color: #ff6655; }

/* 점수 증감 플래시 애니메이션 */
@keyframes score-flash-up {
  0%   { color: #55ffaa; transform: scale(1.12); }
  100% { color: inherit;  transform: scale(1); }
}
@keyframes score-flash-down {
  0%   { color: #ff5544; transform: scale(0.95); }
  100% { color: inherit;  transform: scale(1); }
}
.game-hud__score-val.score-up   { animation: score-flash-up   0.4s ease-out forwards; }
.game-hud__score-val.score-down { animation: score-flash-down 0.4s ease-out forwards; }

.game-hud__score-breakdown {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}
.game-hud__score-breakdown span {
  font-size: 10px;
  color: rgba(160, 220, 160, 0.75);
  background: rgba(60, 180, 80, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
}
/* ── 콤보 플로팅 토스트 ───────────────────────────────────── */
.combo-float {
  position: fixed;
  transform: translate(-50%, -100%);
  pointer-events: none;
  z-index: 9999;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 200, 0, 0.2);
  color: #ffe066;
  border: 1px solid rgba(255, 200, 0, 0.4);
  text-shadow: 0 0 10px rgba(255, 220, 0, 0.7);
  animation: combo-float-up 1.4s ease-out forwards;
  white-space: nowrap;
}
.combo-float em { display: block; font-style: normal; font-size: 11px; opacity: 0.85; }
.combo-speed {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  vertical-align: middle;
  opacity: 0.9;
}
.combo-float--lv3 { color: #ffb347; border-color: rgba(255,179,71,0.45); background: rgba(255,150,0,0.2); text-shadow: 0 0 10px rgba(255,160,0,0.7); }
.combo-float--lv4 { color: #ff8c42; border-color: rgba(255,140,66,0.45); background: rgba(255,100,0,0.2); text-shadow: 0 0 10px rgba(255,120,0,0.7); }
.combo-float--lv5 { color: #ff5f5f; border-color: rgba(255,95,95,0.5);  background: rgba(255,50,50,0.2);  text-shadow: 0 0 12px rgba(255,80,80,0.8); }
.combo-float--hit {
  color: #ff4444;
  border-color: rgba(255,60,60,0.5);
  background: rgba(180,0,0,0.22);
  text-shadow: 0 0 12px rgba(255,60,60,0.8);
  z-index: 10000;
  animation: hit-float-up 1.5s ease-out forwards;
}
.hf-row { display: block; letter-spacing: 2px; margin-bottom: 2px; }
.hf-heart--alive { color: #ff5577; }
.hf-heart--empty { color: rgba(255,85,119,0.25); }
.hf-heart--die   {
  color: #ff5577;
  display: inline-block;
  animation: heart-die 0.55s ease-out forwards;
}
@keyframes heart-die {
  0%   { transform: scale(1);   opacity: 1; color: #ff5577; }
  40%  { transform: scale(1.5); opacity: 1; color: #ffee44; }
  100% { transform: scale(0);   opacity: 0; }
}
@keyframes combo-float-up {
  0%   { opacity: 0;   transform: translate(-50%, -80%);  }
  15%  { opacity: 1;   transform: translate(-50%, -110%); }
  70%  { opacity: 1;   transform: translate(-50%, -160%); }
  100% { opacity: 0;   transform: translate(-50%, -200%); }
}
@keyframes hit-float-up {
  0%   { opacity: 0;   transform: translate(-50%, -120%); }
  8%   { opacity: 1;   transform: translate(-50%, -160%); }
  80%  { opacity: 1;   transform: translate(-50%, -210%); }
  100% { opacity: 0;   transform: translate(-50%, -240%); }
}

.game-hud__reset {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(60, 100, 180, 0.3);
  color: #cce0ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}

.game-hud__reset:hover {
  background: rgba(80, 130, 220, 0.5);
  border-color: rgba(255, 255, 255, 0.38);
}

/* ── 게임 HUD 조명 색상 섹션 ─────────────────────────────────── */
.game-hud__glow-section {
  margin-top: 4px;
}

.game-hud__glow-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.game-hud__glow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.game-hud__glow-chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: radial-gradient(circle at 38% 36%, rgba(255,255,255,0.5) 0%, var(--chip-color, transparent) 60%);
  box-shadow: 0 0 5px var(--chip-color, transparent);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  flex-shrink: 0;
}

.game-hud__glow-chip:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.18);
}

.game-hud__glow-chip.active {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 7px var(--chip-color, rgba(255,255,255,0.4)),
              0 0 14px var(--chip-color, rgba(255,255,255,0.2));
  transform: scale(1.12);
}

.game-hud__glow-chip--none {
  background: rgba(30, 40, 60, 0.7);
  box-shadow: none;
  border-style: dashed;
}

/* ── 글로우 프리셋 컬러칩 ────────────────────────────────────── */
.panel-glow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.panel-glow-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  min-width: 34px;
}

.panel-glow-chip:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.panel-glow-chip.active {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
}

.panel-glow-chip__inner {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, rgba(255,255,255,0.55) 0%, var(--chip-color, transparent) 60%);
  box-shadow: 0 0 6px var(--chip-color, transparent), 0 0 12px var(--chip-color, transparent);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.panel-glow-chip--none .panel-glow-chip__inner {
  background: rgba(40, 50, 70, 0.7);
  box-shadow: none;
  border: 1px dashed rgba(255, 255, 255, 0.22);
}

.panel-glow-chip__label {
  font-size: 9px;
  color: rgba(180, 200, 240, 0.65);
  line-height: 1;
  white-space: nowrap;
}

.panel-glow-chip.active .panel-glow-chip__label {
  color: #d4eaff;
}

/* ── 강제 클리어 버튼 (설정 패널) ───────────────────────────── */
.panel-btn--force-clear {
  background: rgba(255, 80, 80, 0.12);
  border-color: rgba(255, 80, 80, 0.35);
  color: #ff8080;
}
.panel-btn--force-clear:hover {
  background: rgba(255, 80, 80, 0.28);
  border-color: rgba(255, 80, 80, 0.7);
}
.panel-btn--game-reset {
  background: rgba(160, 80, 80, 0.12);
  border-color: rgba(160, 80, 80, 0.35);
  color: #cc7777;
}
.panel-btn--game-reset:hover {
  background: rgba(160, 80, 80, 0.28);
  border-color: rgba(160, 80, 80, 0.7);
}
.panel-btn--all-clear {
  background: rgba(255, 190, 30, 0.1);
  border-color: rgba(255, 190, 30, 0.32);
  color: #f5c842;
}
.panel-btn--all-clear:hover {
  background: rgba(255, 190, 30, 0.22);
  border-color: rgba(255, 210, 60, 0.6);
}

/* ── 시작 연출 버튼 (설정 패널) ─────────────────────────────── */
.panel-btn--intro {
  background: rgba(255, 200, 50, 0.12);
  border-color: rgba(255, 200, 50, 0.35);
  color: #ffd060;
}
.panel-btn--intro:hover {
  background: rgba(255, 200, 50, 0.28);
  border-color: rgba(255, 200, 50, 0.7);
}
.panel-btn--copy {
  margin-top: 6px;
  background: rgba(80, 200, 120, 0.10);
  border-color: rgba(80, 200, 120, 0.30);
  color: #6ee09a;
}
.panel-btn--copy:hover {
  background: rgba(80, 200, 120, 0.24);
  border-color: rgba(80, 200, 120, 0.65);
}

/* ══════════════════════════════════════════════════════════════
   웰컴 스플래시 (최초 진입)
══════════════════════════════════════════════════════════════ */
#welcome-splash {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(20, 8, 4, 0.82) 0%, rgba(2, 4, 14, 0.96) 70%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 0;
  transition: opacity 0.9s ease;
  cursor: pointer;
}
#welcome-splash.visible {
  opacity: 1;
}
#welcome-splash.hiding {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* 배경 파티클 (떠다니는 작은 점들) */
.ws-bg-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ws-bg-particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 80, 30, 0.25);
  animation: ws-float linear infinite;
}
.ws-bg-particles span:nth-child(1) { width:  3px; height:  3px; left: 15%; top: 20%; animation-duration: 12s; animation-delay:  0s; }
.ws-bg-particles span:nth-child(2) { width:  2px; height:  2px; left: 75%; top: 35%; animation-duration:  9s; animation-delay: -3s; }
.ws-bg-particles span:nth-child(3) { width:  4px; height:  4px; left: 45%; top: 70%; animation-duration: 14s; animation-delay: -6s; background: rgba(255,200,40,0.2); }
.ws-bg-particles span:nth-child(4) { width:  2px; height:  2px; left: 85%; top: 15%; animation-duration: 10s; animation-delay: -2s; }
.ws-bg-particles span:nth-child(5) { width:  3px; height:  3px; left: 30%; top: 80%; animation-duration: 16s; animation-delay: -8s; background: rgba(255,200,40,0.2); }
.ws-bg-particles span:nth-child(6) { width:  2px; height:  2px; left: 60%; top: 55%; animation-duration: 11s; animation-delay: -4s; }

@keyframes ws-float {
  0%   { transform: translateY(0)   scale(1);   opacity: 0.6; }
  50%  { transform: translateY(-40px) scale(1.2); opacity: 1; }
  100% { transform: translateY(0)   scale(1);   opacity: 0.6; }
}

/* 카드 */
.ws-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(520px, calc(100vw - 32px));
  padding: 44px 48px 36px;
  border: 1px solid rgba(255, 80, 30, 0.28);
  border-radius: 24px;
  background: rgba(6, 4, 16, 0.88);
  box-shadow:
    0 0 80px rgba(255, 60, 20, 0.1),
    0 0 140px rgba(255, 40, 10, 0.06),
    0 12px 48px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 120, 60, 0.1);
  animation: ws-card-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes ws-card-in {
  from { transform: translateY(28px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* 카드 상단 레드 글로우 라인 */
.ws-card::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 80, 30, 0.7), transparent);
  border-radius: 999px;
}

/* 배경 글로우 원 */
.ws-card__glow {
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 60, 20, 0.14) 0%, transparent 70%);
  pointer-events: none;
  animation: ws-glow-pulse 3.5s ease-in-out infinite;
}
@keyframes ws-glow-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.2); }
}

/* 타이틀 영역 */
.ws-title-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.ws-icon-bomb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(255, 80, 30, 0.6));
  animation: ws-bomb-pulse 2.8s ease-in-out infinite;
}
@keyframes ws-bomb-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 80, 30, 0.6)); }
  50%       { filter: drop-shadow(0 0 22px rgba(255, 80, 30, 0.95)); }
}
.ws-game-title {
  margin: 0 0 4px;
  font-size: clamp(16px, 4vw, 26px);
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 100, 40, 0.55), 0 0 60px rgba(255, 60, 20, 0.25);
  line-height: 1.1;
  white-space: nowrap;
}
.ws-game-sub {
  margin: 0;
  font-size: 11px;
  font-family: var(--font-display);
  color: rgba(200, 170, 150, 0.65);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 구분선 */
.ws-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 80, 30, 0.3), transparent);
  margin: 20px 0;
}

/* 스토리 */
.ws-story {
  width: 100%;
  text-align: left;
}
.ws-story__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 60, 20, 0.15);
  border: 1px solid rgba(255, 60, 20, 0.35);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ff7755;
  margin-bottom: 14px;
}
.ws-story__text {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(210, 200, 195, 0.82);
}
.ws-story__text em {
  font-style: normal;
  color: #ff8866;
  font-weight: 600;
}
.ws-story__text--accent {
  color: rgba(240, 220, 200, 0.92);
  font-weight: 500;
}

/* 가이드 */
.ws-guide {
  width: 100%;
}
.ws-guide__title {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  color: rgba(180, 160, 150, 0.6);
  margin-bottom: 8px;
}
.ws-guide__summary {
  font-size: 11px;
  color: rgba(160, 185, 220, 0.55);
  line-height: 1.6;
  margin-bottom: 12px;
}
.ws-guide__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-guide__list li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ws-guide__key {
  flex-shrink: 0;
  min-width: 54px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c8d8f0;
  text-align: center;
}
.ws-guide__desc {
  font-size: 12.5px;
  color: rgba(190, 185, 180, 0.75);
  line-height: 1.4;
}

/* 클릭 안내 블링크 */
.ws-click-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(200, 190, 180, 0.55);
  text-transform: uppercase;
  animation: ws-hint-blink 1.6s ease-in-out infinite;
}
.ws-click-hint__dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 100, 50, 0.6);
  flex-shrink: 0;
}
@keyframes ws-hint-blink {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}
.ws-version {
  margin-top: 10px;
  font-size: 10px;
  color: rgba(180, 170, 160, 0.3);
  letter-spacing: 0.08em;
  text-align: center;
}

/* 모바일 */
@media (max-width: 480px) {
  .ws-card {
    padding: 32px 24px 28px;
    border-radius: 18px;
  }
  .ws-title-wrap { gap: 12px; }
  .ws-icon-bomb  { width: 44px; height: 44px; }
  .ws-story__text { font-size: 12.5px; }
}

/* ── 인트로 블러 레이어 ─────────────────────────────────────── */
#intro-blur {
  position: fixed;
  inset: 0;
  z-index: 90;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  background: rgba(2, 4, 14, 0);
  transition: backdrop-filter 1s ease, -webkit-backdrop-filter 1s ease, background 1s ease;
  pointer-events: none;
}
#intro-blur.visible {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  background: rgba(2, 4, 14, 0.45);
  pointer-events: auto;
}

/* ── 인트로 오버레이 ────────────────────────────────────────── */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 91;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
#intro-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── 인트로 카드 ────────────────────────────────────────────── */
.intro-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 44px 52px 40px;
  border: 1px solid rgba(255, 220, 80, 0.22);
  border-radius: 24px;
  background: rgba(6, 10, 26, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 0 60px rgba(255, 180, 40, 0.12),
    0 8px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  text-align: center;
  transform: translateY(0);
  animation: intro-card-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes intro-card-in {
  from { transform: translateY(32px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* 카드 상단 황금 글로우 라인 */
.intro-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 60, 0.7), transparent);
  border-radius: 999px;
}

/* 배경 글로우 원 */
.intro-card__glow {
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 40, 0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: intro-glow-pulse 3s ease-in-out infinite;
}

@keyframes intro-glow-pulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}

/* 별 아이콘 */
.intro-logo__star {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(255, 200, 40, 0.8));
  animation: intro-star-spin 6s linear infinite;
}

@keyframes intro-star-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 타이틀 */
.intro-logo__title {
  margin: 0 0 8px;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow:
    0 0 20px rgba(255, 210, 80, 0.6),
    0 0 60px rgba(255, 160, 40, 0.3);
  line-height: 1.1;
}

/* 서브타이틀 */
.intro-logo__sub {
  margin: 0 0 28px;
  font-size: 13px;
  font-family: var(--font-display);
  color: rgba(180, 200, 240, 0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* 구분선 */
.intro-card__divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 60, 0.45), transparent);
  margin-bottom: 28px;
}

/* Game Start 버튼 */
.intro-start-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border: 1px solid rgba(255, 200, 60, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 160, 30, 0.22), rgba(255, 220, 80, 0.14));
  color: #ffe080;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 20px rgba(255, 180, 40, 0.2);
  animation: intro-btn-pulse 2.4s ease-in-out infinite;
}

@keyframes intro-btn-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 180, 40, 0.2); }
  50%       { box-shadow: 0 0 36px rgba(255, 180, 40, 0.5), 0 0 60px rgba(255, 140, 20, 0.18); }
}

.intro-start-btn:hover {
  background: linear-gradient(135deg, rgba(255, 160, 30, 0.38), rgba(255, 220, 80, 0.28));
  border-color: rgba(255, 210, 80, 0.85);
  transform: scale(1.04);
  animation: none;
  box-shadow: 0 0 40px rgba(255, 190, 40, 0.55);
}

.intro-start-btn:active {
  transform: scale(0.97);
}

/* 모바일 대응 */
@media (max-width: 480px) {
  .intro-card {
    padding: 32px 28px 30px;
    margin: 0 16px;
    border-radius: 18px;
  }
  .intro-logo__star {
    width: 48px;
    height: 48px;
  }
  .intro-logo__sub {
    font-size: 11px;
  }
  .intro-start-btn {
    padding: 12px 28px;
    font-size: 14px;
  }
}

/* ─────────────────────────────────────────────────────────────
   설정 팝업 (중앙)
───────────────────────────────────────────────────────────── */
#settings-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 2, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

#settings-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-popup {
  width: min(340px, calc(100vw - 32px));
  padding: 24px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(6, 10, 26, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255,255,255,0.07);
  color: #e4eeff;
  animation: settings-popup-in 0.22s ease both;
}

@keyframes settings-popup-in {
  from { transform: scale(0.93) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.settings-popup__title {
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d4eaff;
  text-align: center;
  margin-bottom: 18px;
  text-shadow: 0 0 16px rgba(100, 160, 255, 0.4);
}

.settings-popup__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
  margin: 12px 0;
}

.settings-popup__section-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  color: rgba(180, 200, 255, 0.5);
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-left: 2px;
}

.game-hud__mode-group--3col {
  grid-template-columns: repeat(3, 1fr);
}

.settings-popup__glow-section {
  margin-top: 4px;
}

/* ── 설정팝업 조명 색상 프리뷰 버튼 ─────────────────────────── */
.settings-popup__glow-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #c8dcf8;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.settings-popup__glow-preview:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.28);
}
.settings-popup__glow-preview svg {
  margin-left: auto;
  opacity: 0.5;
  flex-shrink: 0;
}
.settings-popup__glow-swatch {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 38% 36%, rgba(255,255,255,0.55) 0%, var(--chip-color, transparent) 60%);
  box-shadow: 0 0 6px var(--chip-color, transparent);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.settings-popup__glow-swatch--none {
  background: rgba(30, 40, 60, 0.7);
  box-shadow: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
}
.settings-popup__glow-name {
  flex: 1;
  text-align: left;
}

/* ── Glow 색상 피커 팝업 ─────────────────────────────────────── */
#glow-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 2, 10, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}
#glow-picker-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.glow-picker-popup {
  width: min(320px, calc(100vw - 32px));
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(6, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.07);
  animation: settings-popup-in 0.2s ease both;
}
.glow-picker-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.glow-picker-popup__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.glow-picker-popup__close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  padding: 0;
}
.glow-picker-popup__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.glow-picker-popup__chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.glow-picker__chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.glow-picker__chip:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}
.glow-picker__chip.active {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 8px var(--chip-color, rgba(255,255,255,0.2));
}
.glow-picker__chip-swatch {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, rgba(255,255,255,0.55) 0%, var(--chip-color, transparent) 60%);
  box-shadow: 0 0 6px var(--chip-color, transparent), 0 0 12px var(--chip-color, transparent);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.glow-picker__chip-swatch--none {
  background: rgba(40, 50, 70, 0.7);
  box-shadow: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
}
.glow-picker__chip-label {
  font-size: 9px;
  color: rgba(180, 200, 240, 0.6);
  line-height: 1;
  white-space: nowrap;
}
.glow-picker__chip.active .glow-picker__chip-label {
  color: #d4eaff;
}

/* ── 설정 팝업 옵션 행 (Auto Rotate 등) ────────────────────── */
.settings-popup__option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px;
}
.settings-popup__option-label {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  color: rgba(180, 200, 255, 0.75);
  letter-spacing: 0.03em;
}

/* ── 토글 스위치 ──────────────────────────────────────────── */
.sp-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sp-toggle__track {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s, border-color 0.2s;
}
.sp-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s, background 0.2s;
}
.sp-toggle[aria-pressed="true"] .sp-toggle__track {
  background: rgba(70, 140, 255, 0.65);
  border-color: rgba(110, 170, 255, 0.65);
}
.sp-toggle[aria-pressed="true"] .sp-toggle__thumb {
  transform: translateX(16px);
  background: #fff;
}

/* ── 언어 선택 버튼 ───────────────────────────────────────── */
.sp-lang-btns {
  display: flex;
  gap: 5px;
}
.sp-lang-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(180, 200, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.sp-lang-btn:hover {
  background: rgba(70, 140, 255, 0.18);
  border-color: rgba(100, 170, 255, 0.4);
  color: #c8deff;
}
.sp-lang-btn.active {
  background: rgba(70, 140, 255, 0.5);
  border-color: rgba(110, 170, 255, 0.75);
  color: #fff;
  box-shadow: 0 0 8px rgba(70, 140, 255, 0.35);
}

.settings-popup__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.settings-popup__actions .game-hud__reset {
  flex: 1;
  margin-top: 0;
}

/* ── Player ID ── */
.settings-popup__playerid {
  margin-top: 0;
  padding: 0;
}

.settings-popup__playerid-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(160, 190, 255, 0.45);
  margin-bottom: 5px;
}

.settings-popup__playerid-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-popup__playerid-key {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #c8deff;
  text-shadow: 0 0 10px rgba(100, 160, 255, 0.35);
  user-select: all;
}

.settings-popup__playerid-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(180, 210, 255, 0.6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.settings-popup__playerid-copy:hover {
  background: rgba(80, 140, 255, 0.25);
  border-color: rgba(100, 170, 255, 0.45);
  color: #c0d8ff;
}

.settings-popup__playerid-copy.copied {
  background: rgba(60, 200, 120, 0.25);
  border-color: rgba(80, 220, 140, 0.5);
  color: #7eeab0;
}

/* ── 닉네임 영역 ──────────────────────────────────────────── */
.settings-popup__nickname-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}

.settings-popup__nickname-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.settings-popup__nickname-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.settings-popup__nickname-val {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e8f4ff;
  text-shadow: 0 0 12px rgba(120, 180, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.settings-popup__nickname-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(180, 210, 255, 0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-popup__nickname-edit-btn:hover {
  background: rgba(80, 140, 255, 0.25);
  border-color: rgba(100, 170, 255, 0.45);
  color: #c0d8ff;
}

.settings-popup__playerid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(180, 210, 255, 0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-popup__playerid-btn:hover {
  background: rgba(80, 140, 255, 0.25);
  border-color: rgba(100, 170, 255, 0.45);
  color: #c0d8ff;
}

/* ── Player ID 서브팝업 ─────────────────────────────────────── */
#playerid-overlay {
  position: fixed;
  inset: 0;
  z-index: 3700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

#playerid-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.playerid-popup {
  background: linear-gradient(160deg, rgba(14, 22, 45, 0.97) 0%, rgba(10, 16, 34, 0.97) 100%);
  border: 1px solid rgba(100, 150, 255, 0.22);
  border-radius: 18px;
  padding: 22px 22px 18px;
  width: min(320px, calc(100vw - 40px));
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(8px);
  transition: transform 0.18s;
}

#playerid-overlay.visible .playerid-popup {
  transform: translateY(0);
}

.playerid-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.playerid-popup__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c8deff;
}

.playerid-popup__close {
  background: none;
  border: none;
  color: rgba(180, 200, 255, 0.4);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.playerid-popup__close:hover {
  color: #c0d8ff;
  background: rgba(255, 255, 255, 0.08);
}

.playerid-popup__hint {
  font-size: 11px;
  color: rgba(160, 190, 255, 0.5);
  margin: 0 0 14px;
  line-height: 1.5;
}

.playerid-popup__row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

.playerid-popup__val {
  flex: 1;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #a8c4ff;
  word-break: break-all;
  line-height: 1.4;
}

.playerid-popup__copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(100, 160, 255, 0.3);
  border-radius: 8px;
  background: rgba(80, 130, 255, 0.15);
  color: #a0c4ff;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.playerid-popup__copy:hover,
.playerid-popup__copy.copied {
  background: rgba(80, 130, 255, 0.35);
  color: #c8deff;
}

/* ── 닉네임 수정 팝업 ──────────────────────────────────────── */
#nickname-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

#nickname-edit-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.nickname-edit-popup {
  background: linear-gradient(160deg, rgba(14, 22, 45, 0.97) 0%, rgba(10, 16, 34, 0.97) 100%);
  border: 1px solid rgba(100, 150, 255, 0.22);
  border-radius: 18px;
  padding: 22px 22px 18px;
  width: min(320px, calc(100vw - 40px));
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(8px);
  transition: transform 0.18s;
}

#nickname-edit-overlay.visible .nickname-edit-popup {
  transform: translateY(0);
}

.nickname-edit-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nickname-edit-popup__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c8deff;
}

.nickname-edit-popup__close {
  background: none;
  border: none;
  color: rgba(180, 200, 255, 0.4);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.nickname-edit-popup__close:hover {
  color: rgba(200, 220, 255, 0.85);
}

.nickname-edit-popup__input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(100, 160, 255, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e8f4ff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: #7ab4ff;
}

.nickname-edit-popup__input:focus {
  border-color: rgba(100, 170, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(80, 140, 255, 0.15);
}

.nickname-edit-popup__input.shake {
  animation: nick-input-shake 0.4s ease;
  border-color: rgba(255, 100, 100, 0.6);
}

@keyframes nick-input-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.nickname-edit-popup__hint {
  margin: 6px 0 0;
  font-size: 10px;
  color: rgba(160, 190, 255, 0.4);
  letter-spacing: 0.03em;
}

.nickname-edit-popup__btns {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.nickname-edit-popup__random-btn,
.nickname-edit-popup__save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.nickname-edit-popup__random-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(190, 215, 255, 0.75);
}

.nickname-edit-popup__random-btn:hover {
  background: rgba(100, 160, 255, 0.15);
  border-color: rgba(120, 180, 255, 0.35);
  color: #c8deff;
}

.nickname-edit-popup__save-btn {
  background: linear-gradient(135deg, rgba(60, 130, 255, 0.35) 0%, rgba(40, 100, 220, 0.3) 100%);
  border: 1px solid rgba(100, 170, 255, 0.45);
  color: #b8d8ff;
}

.nickname-edit-popup__save-btn:hover {
  background: linear-gradient(135deg, rgba(80, 150, 255, 0.5) 0%, rgba(60, 120, 240, 0.45) 100%);
  border-color: rgba(130, 190, 255, 0.65);
  color: #deeeff;
  box-shadow: 0 0 16px rgba(80, 140, 255, 0.25);
}

/* ── 설정팝업 Premium 구매 유도 버튼 ─────────────────────── */
.settings-popup__premium-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 0;
  border: 1px solid rgba(255, 195, 40, 0.38);
  border-radius: 11px;
  background: linear-gradient(135deg,
    rgba(255, 190, 30, 0.12) 0%,
    rgba(240, 130, 10, 0.08) 100%
  );
  color: #f5c842;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.15s, box-shadow 0.18s;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.settings-popup__premium-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}

.settings-popup__premium-btn:hover {
  background: linear-gradient(135deg,
    rgba(255, 190, 30, 0.22) 0%,
    rgba(240, 130, 10, 0.15) 100%
  );
  border-color: rgba(255, 210, 60, 0.6);
  color: #ffe066;
  box-shadow: 0 0 16px rgba(255, 170, 0, 0.2);
}

.settings-popup__about-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 7px 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  background: transparent;
  color: rgba(200, 185, 140, 0.5);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.15s;
  text-transform: uppercase;
}

.settings-popup__about-btn:hover {
  color: rgba(255, 220, 120, 0.85);
}

.settings-popup__continue-btn {
  flex: 1;
  padding: 6px 0;
  border: 1px solid rgba(100, 180, 255, 0.45);
  border-radius: 8px;
  background: rgba(60, 120, 220, 0.30);
  color: #b8d8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}

.settings-popup__continue-btn:hover {
  background: rgba(80, 150, 255, 0.48);
  border-color: rgba(140, 200, 255, 0.7);
}

/* ────────────────────────────────────────────────────────────
   결과 팝업 (Game Over / Clear)
───────────────────────────────────────────────────────────── */
#result-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  pointer-events: none;
  transition: background 0.4s, backdrop-filter 0.4s;
}
#result-overlay.visible {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
#result-overlay.visible.final {
  background: radial-gradient(ellipse at 50% 40%, rgba(20, 10, 60, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%);
  backdrop-filter: blur(8px);
}

.rp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 44px 36px;
  border-radius: 24px;
  min-width: 300px;
  max-width: 360px;
  width: 90%;
  overflow: hidden;
  animation: rp-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rp-card.win {
  background: linear-gradient(155deg, #0d1f12 0%, #0a1520 100%);
  border: 1.5px solid rgba(100, 220, 130, 0.35);
  box-shadow: 0 0 60px rgba(80, 200, 120, 0.25), 0 20px 60px rgba(0, 0, 0, 0.6);
}
.rp-card.win.final {
  background: linear-gradient(155deg, #0b1340 0%, #0d2232 40%, #130a30 100%);
  border: 1.5px solid rgba(140, 220, 255, 0.5);
  box-shadow:
    0 0 40px rgba(80, 180, 255, 0.4),
    0 0 80px rgba(180, 80, 255, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.7);
  animation: rp-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both,
             rp-win-pulse 3.5s 0.8s ease-in-out infinite alternate;
}
@keyframes rp-win-pulse {
  0%   { box-shadow: 0 0 40px rgba(80,180,255,0.4), 0 0 80px rgba(180,80,255,0.25), 0 20px 60px rgba(0,0,0,0.7); border-color: rgba(140,220,255,0.5); }
  33%  { box-shadow: 0 0 50px rgba(80,230,160,0.45), 0 0 90px rgba(40,200,255,0.3), 0 20px 60px rgba(0,0,0,0.7); border-color: rgba(80,230,170,0.6); }
  66%  { box-shadow: 0 0 50px rgba(210,140,255,0.45), 0 0 90px rgba(100,80,255,0.3), 0 20px 60px rgba(0,0,0,0.7); border-color: rgba(200,140,255,0.6); }
  100% { box-shadow: 0 0 50px rgba(255,200,80,0.4), 0 0 90px rgba(255,100,80,0.22), 0 20px 60px rgba(0,0,0,0.7); border-color: rgba(255,210,90,0.6); }
}
.rp-card.lose {
  background: linear-gradient(155deg, #1f0d0d 0%, #150a0a 100%);
  border: 1.5px solid rgba(220, 80, 80, 0.35);
  box-shadow: 0 0 60px rgba(220, 80, 80, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6);
}

@keyframes rp-appear {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.rp-card__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(100, 220, 130, 0.15) 0%, transparent 65%);
  pointer-events: none;
}
.rp-card.win.final .rp-card__glow {
  background:
    radial-gradient(ellipse at 25% 0%, rgba(80, 200, 255, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 0%, rgba(200, 100, 255, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(80, 240, 160, 0.12) 0%, transparent 55%);
  animation: rp-glow-shift 4s 1s ease-in-out infinite alternate;
}
@keyframes rp-glow-shift {
  0%   { background: radial-gradient(ellipse at 25% 0%, rgba(80,200,255,0.25) 0%, transparent 50%), radial-gradient(ellipse at 75% 0%, rgba(200,100,255,0.22) 0%, transparent 50%), radial-gradient(ellipse at 50% 100%, rgba(80,240,160,0.12) 0%, transparent 55%); }
  50%  { background: radial-gradient(ellipse at 50% 0%, rgba(80,240,160,0.28) 0%, transparent 55%), radial-gradient(ellipse at 80% 20%, rgba(255,200,80,0.18) 0%, transparent 45%), radial-gradient(ellipse at 20% 80%, rgba(80,160,255,0.1) 0%, transparent 50%); }
  100% { background: radial-gradient(ellipse at 20% 5%, rgba(210,140,255,0.25) 0%, transparent 50%), radial-gradient(ellipse at 65% 0%, rgba(80,210,255,0.22) 0%, transparent 50%), radial-gradient(ellipse at 50% 100%, rgba(255,160,80,0.1) 0%, transparent 55%); }
}

.rp-icon {
  font-size: 42px;
  margin-bottom: 10px;
  animation: rp-bounce 0.6s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes rp-bounce {
  from { opacity: 0; transform: scale(0.4) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.rp-title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.12em;
  animation: rp-fadein 0.5s 0.3s both;
}
.rp-card.win  .rp-title { color: #7ef5a0; text-shadow: 0 0 20px rgba(100, 240, 140, 0.6); }
.rp-card.win.final .rp-title {
  background: linear-gradient(120deg, #7ef5c8 0%, #a0d4ff 35%, #e0a0ff 65%, #ffe880 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(140, 220, 255, 0.7));
}
.rp-card.lose .rp-title { color: #f57e7e; text-shadow: 0 0 20px rgba(240, 100, 100, 0.5); }

.rp-sub {
  margin: 0 0 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
  animation: rp-fadein 0.5s 0.35s both;
}

.rp-score-main {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  animation: rp-score-pop 0.6s 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rp-card.win  .rp-score-main { color: #fff; }
.rp-card.lose .rp-score-main { color: rgba(255,255,255,0.75); }

@keyframes rp-score-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.rp-score-label {
  margin: 4px 0 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.35);
  animation: rp-fadein 0.5s 0.5s both;
}

.rp-breakdown {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: rp-fadein 0.5s 0.55s both;
}
.rp-bd-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.rp-bd-key { font-weight: 500; }
.rp-bd-val { font-weight: 700; color: rgba(255,255,255,0.8); }
.rp-bd-bonus { color: #8ef5a8; }

.rp-btn {
  padding: 13px 32px;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: rp-fadein 0.5s 0.65s both;
}
.rp-btn.win {
  background: linear-gradient(135deg, #4cde80, #21a355);
  color: #fff;
  box-shadow: 0 4px 20px rgba(60, 200, 100, 0.4);
}
.rp-card.win.final .rp-btn.win {
  background: linear-gradient(135deg, #00e5c8, #2277ff, #a855f7);
  box-shadow: 0 4px 24px rgba(80, 150, 255, 0.55), 0 0 40px rgba(160, 80, 255, 0.3);
  animation: rp-fadein 0.5s 0.65s both, rp-btn-shimmer 3s 1.2s ease-in-out infinite alternate;
}
@keyframes rp-btn-shimmer {
  0%   { box-shadow: 0 4px 24px rgba(80,150,255,0.55), 0 0 40px rgba(160,80,255,0.3); }
  50%  { box-shadow: 0 4px 28px rgba(0,220,180,0.6), 0 0 50px rgba(0,180,255,0.35); }
  100% { box-shadow: 0 4px 28px rgba(180,80,255,0.6), 0 0 50px rgba(120,60,255,0.4); }
}
.rp-btn.lose {
  background: linear-gradient(135deg, #e85555, #a01f1f);
  color: #fff;
  box-shadow: 0 4px 20px rgba(220, 60, 60, 0.4);
}
.rp-btn:hover  { transform: scale(1.04); }
.rp-btn:active { transform: scale(0.97); }
.rp-btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: none;
}
.rp-btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  transform: scale(1.04);
}

/* 다음 레벨 잠금 시 버튼 그룹 */
.rp-btn-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.rp-btn--next-locked {
  background: linear-gradient(135deg, rgba(255,190,30,0.25), rgba(240,130,10,0.18));
  border: 1px solid rgba(255,195,40,0.45);
  color: #f5c842;
  box-shadow: 0 0 16px rgba(255,170,0,0.15);
  flex: 1;
  padding: 13px 0;
}
.rp-btn--next-locked:hover {
  background: linear-gradient(135deg, rgba(255,190,30,0.38), rgba(240,130,10,0.28));
  border-color: rgba(255,210,60,0.65);
}
.rp-btn--restart-sub {
  background: linear-gradient(135deg, rgba(80,120,200,0.28), rgba(40,70,160,0.22));
  border: 1px solid rgba(120,160,255,0.4);
  color: rgba(160,200,255,0.9);
  box-shadow: 0 0 12px rgba(80,140,255,0.12);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
  padding: 13px 20px;
  white-space: nowrap;
}
.rp-btn--restart-sub:hover {
  background: linear-gradient(135deg, rgba(80,120,200,0.45), rgba(40,70,160,0.36));
  color: rgba(200,225,255,1);
  border-color: rgba(140,180,255,0.65);
  box-shadow: 0 0 18px rgba(80,140,255,0.22);
}
.rp-btn--change-mode {
  flex: 1;
  background: linear-gradient(135deg, rgba(80,120,200,0.28), rgba(40,70,160,0.22));
  border: 1px solid rgba(120,160,255,0.4);
  color: rgba(160,200,255,0.9);
  box-shadow: 0 0 12px rgba(80,140,255,0.12);
  font-size: 13px;
  font-weight: 700;
  padding: 13px 0;
  white-space: nowrap;
}
.rp-btn--change-mode:hover {
  background: linear-gradient(135deg, rgba(80,120,200,0.45), rgba(40,70,160,0.36));
  color: rgba(200,225,255,1);
  border-color: rgba(140,180,255,0.65);
  box-shadow: 0 0 18px rgba(80,140,255,0.22);
}
.rp-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

@keyframes rp-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .rp-card {
    padding: 32px 28px 30px;
    min-width: unset;
  }
  .rp-score-main { font-size: 38px; }
  .rp-title      { font-size: 24px; }
}

/* ── 하단 레벨 & 점수 HUD ──────────────────────────────────── */
#bottom-hud {
  position: fixed;
  top: max(16px, calc(env(safe-area-inset-top, 0px) + 8px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bottom-hud__title {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 0 10px rgba(120, 180, 255, 0.4);
  white-space: nowrap;
  line-height: 1;
}

.bottom-hud__level-tag {
  font-family: var(--font-display);
  color: #7dd3fc;
  text-shadow: 0 0 14px rgba(125, 211, 252, 0.7);
  transition: color 0.4s ease, text-shadow 0.4s ease;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.bottom-hud__score-val {
  font-size: 30px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: #e8f0ff;
  text-align: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(180, 220, 255, 0.35);
}

.bottom-hud__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(180, 210, 255, 0.6);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
  flex-shrink: 0;
}

.bottom-hud__view-btn:hover {
  background: rgba(80, 150, 255, 0.22);
  border-color: rgba(120, 180, 255, 0.55);
  color: #c8e4ff;
  transform: scale(1.12);
}

.bottom-hud__view-btn:active {
  transform: scale(0.94);
}

/* ── level start popup ────────────────────────────────── */
#level-start-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
#level-start-overlay.visible {
  display: flex;
  animation: lsp-fadein 0.3s ease;
}
@keyframes lsp-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lsp-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(320px, calc(100vw - 40px));
  padding: 36px 28px 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(6, 10, 24, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: lsp-slidein 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes lsp-slidein {
  from { transform: translateY(24px) scale(0.95); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.lsp-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lsp-accent, #4488ff) 0%, transparent 70%);
  opacity: 0.18;
  pointer-events: none;
}

.lsp-title {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  color: rgba(160, 190, 255, 0.6);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.lsp-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lsp-level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lsp-level-text {
  font-size: 28px;
  font-weight: 300;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: #dce8ff;
}
.lsp-level-text strong {
  font-weight: 800;
}

.lsp-difficulty {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.lsp-difficulty-sub {
  font-size: 11px;
  font-weight: 400;
  color: rgba(180, 210, 255, 0.5);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.lsp-start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 11px 32px;
  border: none;
  border-radius: 10px;
  background: rgba(80, 160, 255, 0.2);
  border: 1px solid rgba(80, 160, 255, 0.35);
  color: #a8d4ff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.lsp-start-btn:hover {
  background: rgba(80, 160, 255, 0.35);
  color: #fff;
  transform: scale(1.04);
}
.lsp-start-btn:active {
  transform: scale(0.97);
}

/* 버튼 그룹 (Continue + New Game 듀얼 레이아웃) */
.lsp-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.lsp-btn-group--dual {
  flex-direction: column;
  gap: 8px;
}
.lsp-btn-group--dual .lsp-continue-btn,
.lsp-btn-group--dual .lsp-start-btn {
  width: 100%;
  justify-content: center;
  margin-top: 0;
}

/* Continue 버튼 */
.lsp-continue-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 10px;
  background: rgba(80, 200, 140, 0.22);
  border: 1px solid rgba(80, 200, 140, 0.45);
  color: #88ffcc;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.lsp-continue-btn:hover {
  background: rgba(80, 200, 140, 0.38);
  color: #fff;
  transform: scale(1.04);
}
.lsp-continue-btn:active {
  transform: scale(0.97);
}

/* New Game 버튼 (Continue 있을 때 보조 스타일) */
.lsp-start-btn--secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(160, 190, 255, 0.55);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
}
.lsp-start-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(200, 220, 255, 0.9);
}

.lsp-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

.lsp-objectives {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}

.lsp-obj-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lsp-obj-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}
.lsp-obj-icon--map {
  color: rgba(120, 200, 255, 0.7);
  background: rgba(80, 160, 255, 0.1);
}
.lsp-obj-icon--bomb {
  color: rgba(255, 160, 80, 0.85);
  background: rgba(255, 120, 40, 0.1);
}

.lsp-obj-label {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: rgba(200, 220, 255, 0.55);
  letter-spacing: 0.04em;
}

.lsp-obj-val {
  font-size: 18px;
  font-weight: 700;
  color: rgba(200, 230, 255, 0.9);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.lsp-obj-val--bomb {
  color: rgba(255, 180, 100, 0.95);
}


/* ── game-hud 아이콘 컬럼 ─────────────────────────────── */
.game-hud__icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ── game-hud view btn ─────────────────────────────────── */
.game-hud__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(180, 200, 255, 0.75);
  cursor: pointer;
  transition: color 0.15s;
}
.game-hud__view-btn:hover {
  color: #fff;
}

/* ── 우측 HUD 프리미엄 왕관 버튼 (미구매자 전용) ─────────────── */
.game-hud__premium-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 200, 50, 0.6);
  cursor: pointer;
  transition: color 0.15s, filter 0.15s;
  margin-top: 4px;
}
.game-hud__premium-btn:hover {
  color: #ffd23f;
  filter: drop-shadow(0 0 6px rgba(255, 200, 50, 0.7));
}

/* ── music panel btn ───────────────────────────────────── */
.music-panel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(180, 200, 255, 0.75);
  cursor: pointer;
  transition: color 0.15s;
}
.music-panel__btn:hover {
  color: #fff;
}

/* ── music popup overlay ──────────────────────────────── */
#music-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 2, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}
#music-popup-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.music-popup {
  width: min(300px, calc(100vw - 32px));
  padding: 22px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(6, 10, 26, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #dce8ff;
  font-size: 13px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255,255,255,0.07);
  animation: music-popup-in 0.22s ease both;
}

@keyframes music-popup-in {
  from { transform: scale(0.93) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.music-popup__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #a8c0f0;
  margin-bottom: 14px;
}
.music-popup__title-icon {
  flex-shrink: 0;
  opacity: 0.8;
}
.music-popup__close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(180, 200, 255, 0.55);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
.music-popup__close-btn:hover {
  color: #fff;
}

.music-popup__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}

.music-popup__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-popup__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.music-popup__label {
  font-size: 13px;
  font-weight: 600;
  color: #c8d8f8;
}

/* ── 토글 스위치 ──────────────────────────────── */
.music-popup__toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}
.music-popup__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.music-popup__toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, border-color 0.2s;
}
.music-popup__toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(180, 200, 255, 0.5);
  transition: transform 0.2s, background 0.2s;
}
.music-popup__toggle input:checked + .music-popup__toggle-track {
  background: rgba(80, 160, 255, 0.35);
  border-color: rgba(80, 160, 255, 0.5);
}
.music-popup__toggle input:checked + .music-popup__toggle-track::after {
  transform: translateX(18px);
  background: #7ab8ff;
}

/* ── 볼륨 슬라이더 행 ─────────────────────────── */
.music-popup__vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.music-popup__vol-row.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.music-popup__vol-icon {
  flex-shrink: 0;
  color: rgba(180, 200, 255, 0.6);
  display: flex;
  align-items: center;
}
.music-popup__slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.music-popup__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7ab8ff;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(100, 180, 255, 0.5);
  transition: background 0.15s, transform 0.15s;
}
.music-popup__slider::-webkit-slider-thumb:hover {
  background: #aad4ff;
  transform: scale(1.2);
}
.music-popup__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #7ab8ff;
  cursor: pointer;
}
.music-popup__vol-val {
  font-size: 11px;
  color: rgba(180, 200, 255, 0.7);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── 천체 감상 모드 오버레이 ────────────────────────────────── */
#celestial-name-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}

#celestial-name-overlay .cno-name {
  font-size: clamp(1.6rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.0);
  text-shadow:
    0 0 30px rgba(160, 210, 255, 0.0),
    0 0 70px rgba(80, 150, 255, 0.0);
  transition: color 1s ease, text-shadow 1s ease;
  user-select: none;
  white-space: nowrap;
  padding: 0 1rem;
  text-align: center;
}

#celestial-name-overlay.visible .cno-name {
  color: rgba(255, 255, 255, 0.92);
  text-shadow:
    0 0 30px rgba(160, 210, 255, 0.75),
    0 0 80px rgba(80, 150, 255, 0.45);
}

#celestial-name-overlay .cno-hint {
  position: fixed;
  bottom: max(56px, env(safe-area-inset-bottom, 0px) + 28px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(0.62rem, 2.2vw, 0.78rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.0);
  transition: color 1.4s ease 1.2s;
  user-select: none;
  white-space: nowrap;
}

#celestial-name-overlay.visible .cno-hint {
  color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 480px) {
  #celestial-name-overlay .cno-name {
    font-size: clamp(1.4rem, 9vw, 2.8rem);
    letter-spacing: 0.06em;
  }
  #celestial-name-overlay .cno-hint {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
}

/* 감상 모드 중 게임 HUD 숨김 */
body.view-mode .game-hud,
body.view-mode #top-hud,
body.view-mode #bottom-hud,
body.view-mode #mobile-hud {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Saved Earth 감상 모드 ───────────────────────────────────── */
body.saved-earth-mode .game-hud,
body.saved-earth-mode #top-hud,
body.saved-earth-mode #bottom-hud,
body.saved-earth-mode #mobile-hud,
body.saved-earth-mode #settings-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#saved-earth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}

#saved-earth-overlay .se-hint {
  margin-bottom: max(60px, env(safe-area-inset-bottom, 0px) + 32px);
  font-size: clamp(0.62rem, 2.2vw, 0.78rem);
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.0);
  transition: color 1.2s ease 0.8s;
  user-select: none;
  white-space: nowrap;
}

#saved-earth-overlay.visible .se-hint {
  color: rgba(255, 255, 255, 0.38);
}

/* ── See Your Earth 버튼 — ALL CLEAR 팝업 전용 ─────────────────── */
@keyframes seEarthPulse {
  0%, 100% {
    box-shadow:
      0 0 18px rgba(0, 180, 240, 0.40),
      0 0 40px rgba(0, 210, 180, 0.20),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  50% {
    box-shadow:
      0 0 30px rgba(0, 200, 255, 0.65),
      0 0 60px rgba(0, 230, 200, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
}
@keyframes seEarthShimmer {
  0%        { left: -80%; }
  40%, 100% { left: 130%; }
}

.rp-btn--saved-earth {
  display: block;
  width: 100%;
  padding: 0.95rem 1.4rem;
  margin-bottom: 0.7rem;
  border: 1px solid rgba(80, 210, 255, 0.30);
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    #07274e 0%,
    #0b4e7a 28%,
    #0a7a70 62%,
    #0b5235 100%
  );
  color: #d6f6ff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-shadow: 0 0 12px rgba(100, 230, 255, 0.70);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.2s;
  animation: seEarthPulse 2.8s ease-in-out infinite;
}

/* 광택 스윕 레이어 */
.rp-btn--saved-earth::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.13) 50%,
    transparent 100%
  );
  animation: seEarthShimmer 3.5s ease-in-out infinite 0.8s;
  pointer-events: none;
}

.rp-btn--saved-earth:hover {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(100, 230, 255, 0.55);
}

.rp-btn--saved-earth:active {
  transform: translateY(0) scale(0.99);
  animation: none;
}

/* ══════════════════════════════════════════════════════════════
   로딩 스크린
══════════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, #0b1730 0%, #020810 55%, #010204 100%);
  opacity: 0;
  transition: opacity 0.6s ease;
  cursor: default;
  user-select: none;
}
#loading-screen.visible { opacity: 1; }
#loading-screen.hiding {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* 별 파티클 */
.ls-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.ls-stars span {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: ls-twinkle ease-in-out infinite;
}
@keyframes ls-twinkle {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50%       { opacity: 0.8;  transform: scale(1.3); }
}

/* 중앙 컨텐츠 */
.ls-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(440px, calc(100vw - 32px));
  text-align: center;
}

/* 궤도 애니메이션 */
.ls-orbit-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  flex-shrink: 0;
}
.ls-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(70, 150, 255, 0.28);
  animation: ls-spin linear infinite;
}
.ls-orbit--outer {
  inset: 0;
  animation-duration: 5s;
}
.ls-orbit--inner {
  inset: 20%;
  animation-duration: 8s;
  animation-direction: reverse;
  border-color: rgba(100, 180, 255, 0.2);
}
.ls-orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5aaeff;
  box-shadow: 0 0 8px #5aaeff, 0 0 16px rgba(90, 174, 255, 0.5);
}
.ls-orbit--inner .ls-orbit-dot {
  width: 5px;
  height: 5px;
  background: #88ccff;
  box-shadow: 0 0 6px #88ccff;
}
.ls-globe-core {
  position: absolute;
  width: 26px;
  height: 26px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 36% 34%, #9dd4ff, #1a5cbf);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(100, 180, 255, 0.65), 0 0 40px rgba(60, 130, 255, 0.3);
  animation: ls-globe-pulse 2.4s ease-in-out infinite;
}
@keyframes ls-spin {
  to { transform: rotate(360deg); }
}
@keyframes ls-globe-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(100, 180, 255, 0.65), 0 0 40px rgba(60, 130, 255, 0.3); }
  50%       { box-shadow: 0 0 28px rgba(100, 180, 255, 0.9),  0 0 60px rgba(60, 130, 255, 0.5); }
}

/* 타이틀 */
.ls-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 5vw, 36px);
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow:
    0 0 24px rgba(100, 180, 255, 0.55),
    0 0 60px rgba(60, 130, 255, 0.25);
  line-height: 1.1;
}
.ls-subtitle {
  margin: 0 0 32px;
  font-size: 11px;
  font-family: var(--font-display);
  color: rgba(140, 170, 220, 0.5);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* 진행률 */
.ls-progress-wrap {
  width: 100%;
  margin-bottom: 8px;
}
.ls-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ls-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2060e0, #5aaeff);
  border-radius: 2px;
  transition: width 0.18s ease;
  box-shadow: 0 0 10px rgba(90, 174, 255, 0.7);
}
.ls-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ls-msg {
  font-size: 11px;
  font-family: var(--font-body);
  color: rgba(140, 180, 255, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
  transition: opacity 0.25s ease;
  font-style: italic;
  letter-spacing: 0.02em;
}
.ls-msg--fade {
  opacity: 0;
}
.ls-pct {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  color: rgba(140, 185, 255, 0.85);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* 클릭 시작 힌트 */
.ls-start-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(160, 205, 255, 0);
  text-transform: uppercase;
  transition: color 0.6s ease;
  pointer-events: none;
}
.ls-start-hint.visible {
  color: rgba(160, 205, 255, 0.75);
  animation: ls-hint-blink 1.6s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
}
.ls-start-hint__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(90, 174, 255, 0.7);
  flex-shrink: 0;
}
@keyframes ls-hint-blink {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

@media (max-width: 480px) {
  .ls-orbit-wrap { width: 72px; height: 72px; margin-bottom: 20px; }
  .ls-globe-core { width: 20px; height: 20px; }
  .ls-subtitle   { margin-bottom: 24px; }
}

/* ── 모바일 전용 좌상단 HUD ──────────────────────────────────────────────── */
#mobile-hud {
  display: none; /* 기본 숨김 — body.is-mobile 에서 활성화 */
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  left: max(12px, env(safe-area-inset-left, 12px));
  z-index: 20;
  min-width: 148px;
  padding: 9px 13px 8px;
  border: none;
  border-radius: 16px;
  background: rgba(6, 10, 24, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: none;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.is-mobile #mobile-hud {
  display: block;
}

/* 모바일에서 기존 top/bottom HUD 숨김 */
body.is-mobile #top-hud,
body.is-mobile #bottom-hud {
  display: none !important;
}

/* 상단 행: 레벨 + 스코어 */
.mhud__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.mhud__level-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mhud__lvdot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.mhud__lvtext {
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: #d0e4ff;
}

/* 스코어 하단 블록 */
.mhud__score-bottom {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* 2번째 행: 하트 */
.mhud__bottom {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 5px;
}

/* 하트 컨테이너 */
.mhud__hearts {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* 하트 (lbar-heart 와 동일한 mask 방식, 16px) */
.mhud__heart {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: opacity 0.3s, filter 0.3s;
}
.mhud__heart::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.593c-5.63-5.539-11-10.297-11-14.402 0-3.791 3.068-5.191 5.281-5.191 1.312 0 4.151.501 5.719 4.457 1.59-3.968 4.464-4.447 5.726-4.447 2.54 0 5.274 1.621 5.274 5.181 0 4.069-5.136 8.625-11 14.402z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.593c-5.63-5.539-11-10.297-11-14.402 0-3.791 3.068-5.191 5.281-5.191 1.312 0 4.151.501 5.719 4.457 1.59-3.968 4.464-4.447 5.726-4.447 2.54 0 5.274 1.621 5.274 5.181 0 4.069-5.136 8.625-11 14.402z'/%3E%3C/svg%3E") no-repeat center / contain;
  background-color: currentColor;
}
.mhud__heart.alive {
  color: #ff3d6e;
  filter: drop-shadow(0 0 4px rgba(255,61,110,0.65));
}
.mhud__heart.dead {
  color: #2a3448;
  opacity: 0.45;
  filter: none;
}
/* ── AD +1 하트 버튼 (Mobile HUD) ──────────────────────────────── */
.mhud__ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-left: 5px;
  padding: 1px 6px;
  border: none;
  border-radius: 6px;
  background: rgba(20, 24, 48, 0.9);
  border: 1px solid rgba(255, 60, 80, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  line-height: 1.2;
  animation: ad-btn-pulse 2.2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(255,60,80,0.3);
  min-height: 20px;
  min-width: 38px;
  pointer-events: auto;
}
.mhud__ad-btn__heart {
  color: #ff3d5e;
  font-size: 12px;
}
.mhud__heart.gained {
  animation: heart-gained 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 하트 수 텍스트 (maxLives > 6) */
.mhud__heart-count {
  font-size: 11px;
  font-weight: 700;
  color: #ff3d6e;
  margin-left: 2px;
}

/* 통계 행: 지뢰 · 깃발 · 타이머 */
.mhud__stats {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 5px;
}

.mhud__sitem {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.mhud__sitem--mines        { color: #ffcc88; }
.mhud__sitem--mines svg    { color: #ffaa55; }
.mhud__sitem--flags        { color: #88eebb; }
.mhud__sitem--flags svg    { color: #55ddaa; }
.mhud__sitem--timer        { color: #b0cfff; }
.mhud__sitem--timer svg    { color: #7ab4ff; }
.mhud__sitem--timer.win    { color: #66ee88; }
.mhud__sitem--timer.lose   { color: #ff6644; }

.mhud__sdot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
  margin: 0 3px;
}

/* 점수 값 (하단 큰 글씨) */
.mhud__score-val {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: #e8f4ff;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(140,200,255,0.35);
}

/* 피격 시 흔들림 */
.mhud--shake {
  animation: mhud-shake 0.45s ease-out;
}

@keyframes mhud-shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-5px); }
  30%  { transform: translateX(5px); }
  45%  { transform: translateX(-3px); }
  60%  { transform: translateX(3px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* ── 모바일 하단 액션 메뉴 ────────────────────────────────────────────────── */

/* 플로팅 컨테이너 — 화면 중앙 하단에 띄움 */
.mcm-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 201;
  transform: translateX(-50%) translateY(calc(100% + 24px));
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              opacity   0.22s ease;
  opacity: 0;
  will-change: transform, opacity;
  /* 콘텐츠 너비에 맞게 자동 조정 */
  width: max-content;
}
.mcm-sheet--in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.mcm-sheet--out {
  transform: translateX(-50%) translateY(calc(100% + 24px));
  opacity: 0;
}

/* 손잡이 숨김 (플로팅이므로 불필요) */
.mcm-handle { display: none; }

/* 버튼 행 — 라운드 pill 컨테이너 */
.mcm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(10, 14, 32, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* 개별 버튼 */
.mcm-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 66px;
  padding: 10px 0 9px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--mcm-color, #94a3b8);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.mcm-btn:active {
  background: color-mix(in srgb, var(--mcm-color, #fff) 14%, rgba(255, 255, 255, 0.04));
}

/* 현재 상태 버튼 강조 */
.mcm-btn--active {
  background: color-mix(in srgb, var(--mcm-color, #fff) 12%, rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mcm-color, #fff) 30%, transparent);
}

/* 버튼 구분선 (취소 버튼 앞) */
.mcm-btn[data-action="cancel"] {
  position: relative;
  margin-left: 2px;
}
.mcm-btn[data-action="cancel"]::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 14%;
  height: 72%;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.mcm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.mcm-icon svg {
  width: 100%;
  height: 100%;
}

.mcm-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: inherit;
  pointer-events: none;
  user-select: none;
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   PREMIUM 기능
   ═══════════════════════════════════════════════════════════ */

/* ── 어드민 패널: 프리미엄 구분선 + 라벨 ─────────────────── */
.panel-section-divider {
  height: 1px;
  background: rgba(255, 200, 50, 0.2);
  margin: 8px 0;
}

.panel-label--premium {
  color: #ffd23f;
  font-weight: 700;
}

/* ── 설정 팝업: PREMIUM 뱃지 ─────────────────────────────── */
.settings-popup__premium-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: -10px auto 14px;
  padding: 3px 14px;
  width: fit-content;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 190, 30, 0.25) 0%, rgba(255, 150, 0, 0.18) 100%);
  border: 1px solid rgba(255, 200, 50, 0.5);
  color: #ffd23f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 180, 0, 0.2);
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.settings-popup__premium-badge:hover {
  background: linear-gradient(135deg, rgba(255, 190, 30, 0.38) 0%, rgba(255, 150, 0, 0.28) 100%);
  box-shadow: 0 0 18px rgba(255, 180, 0, 0.4);
}

.spb-crown {
  font-size: 11px;
}

/* ── 잠금 버튼 공통 스타일 ────────────────────────────────── */

/* 진행도 미해제 레벨 (클리어해서 열리는 레벨) */
.level-selector__btn.progress-locked {
  opacity: 0.2;
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  pointer-events: auto;
}
.level-selector__btn.progress-locked:hover {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}

.level-selector__btn.locked {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

.level-selector__btn.locked::after {
  content: '🔒';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
}

.game-hud__mode-btn.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.mode-lock-icon {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}

.settings-popup__glow-preview.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.glow-lock-icon {
  font-size: 12px;
  margin-left: auto;
  margin-right: 2px;
  flex-shrink: 0;
}

/* ── 프리미엄 구매 유도 모달 ──────────────────────────────── */
#premium-upsell-overlay {
  position: fixed;
  inset: 0;
  z-index: 3600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 1, 8, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  pointer-events: none;
}

#premium-upsell-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@keyframes pum-in {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.premium-upsell-modal {
  position: relative;
  width: min(340px, 100%);
  padding: 32px 24px 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, #0d1020 0%, #080c1c 60%, #0a0d1a 100%);
  border: 1px solid rgba(255, 200, 60, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 24px 64px rgba(0, 0, 0, 0.75),
    0 0 80px rgba(255, 160, 0, 0.06);
  overflow: hidden;
  animation: pum-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 배경 글로우 */
.pum-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 160px;
  background: radial-gradient(ellipse, rgba(255, 180, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* 헤더 */
.pum-header {
  position: relative;
  text-align: center;
  margin-bottom: 20px;
}

.pum-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px rgba(255, 190, 0, 0.5));
}

.pum-title {
  font-size: 22px;
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  color: #ffe066;
  text-shadow:
    0 0 24px rgba(255, 200, 0, 0.45),
    0 1px 0 rgba(0, 0, 0, 0.5);
  margin-bottom: 7px;
  line-height: 1;
}

.pum-tagline {
  font-size: 11.5px;
  font-family: var(--font-display);
  color: rgba(180, 200, 240, 0.55);
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* 구분선 */
.pum-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 60, 0.2) 30%, rgba(255, 200, 60, 0.2) 70%, transparent);
  margin: 0 0 18px;
}

/* 기능 목록 */
.pum-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pum-feature {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pum-feature:last-child {
  border-bottom: none;
}

.pum-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a623, #e8820c);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pum-check::after {
  content: '';
  display: block;
  width: 6px;
  height: 4px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.pum-feature__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pum-feature__title {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  color: #dceaff;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.pum-feature__desc {
  font-size: 10.5px;
  color: rgba(150, 175, 215, 0.6);
  line-height: 1.35;
}
.pum-feature__desc-ko {
  font-size: 10px;
  color: rgba(130, 200, 255, 0.5);
  line-height: 1.35;
  margin-top: 1px;
}

/* CTA 버튼 */
.pum-buy-btn {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 40%, #d97706 100%);
  color: #1a0e00;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow:
    0 4px 24px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.pum-buy-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 55%);
  border-radius: inherit;
  pointer-events: none;
}

.pum-buy-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 6px 28px rgba(245, 158, 11, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.pum-buy-btn:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

/* 복원 버튼 */
.pum-restore-btn {
  display: block;
  width: 100%;
  padding: 9px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(160, 185, 220, 0.4);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s;
}

.pum-restore-btn:hover {
  color: rgba(180, 205, 240, 0.7);
}

.pum-restore-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* 닫기 버튼 */
.pum-close-btn {
  display: block;
  width: 100%;
  padding: 9px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(160, 185, 220, 0.4);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s;
}

.pum-close-btn:hover {
  color: rgba(180, 205, 240, 0.7);
}

/* ── 프리미엄 소유 상태 푸터 ─────────────────────────────────── */
.pum-owned-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 10px;
  color: #ffe26a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pum-owned-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

.pum-owned-close-btn {
  margin-top: 2px;
}

/* ── 가로 모드(landscape): 팝업 스크롤 대응 ─────────────────────
   화면 높이가 낮을 때 팝업 내용이 잘리지 않도록 오버레이를 스크롤 가능하게 설정
   ─────────────────────────────────────────────────────────────── */
@media (orientation: landscape) and (max-height: 480px) {
  #welcome-splash,
  #intro-overlay,
  #settings-popup-overlay,
  #glow-picker-overlay,
  #level-start-overlay,
  #result-overlay,
  #premium-upsell-overlay,
  #music-popup-overlay {
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 16px;
    touch-action: pan-y;
  }

  /* 카드: margin:auto로 공간 있을 때 중앙 정렬, 넘칠 때 스크롤 */
  .ws-card,
  .intro-card,
  .settings-popup,
  .glow-picker-popup,
  .lsp-card,
  .rp-card,
  .premium-upsell-modal,
  .music-popup {
    flex-shrink: 0;
    margin: auto;
  }

  /* 카드 내부 패딩 축소 */
  .ws-card              { padding: 18px 22px 14px; }
  .intro-card           { padding: 20px 28px 16px; }
  .lsp-card             { padding: 18px 20px 14px; gap: 7px; }
  .rp-card              { padding: 20px 26px 16px; }
  .premium-upsell-modal { padding: 18px 18px 14px; }
  .music-popup          { padding: 16px 16px 14px; }

  /* intro 카드 내부 요소 간격 축소 */
  .intro-logo__star     { width: 40px; height: 40px; margin-bottom: 10px; }
  .intro-logo__sub      { margin-bottom: 16px; }
  .intro-card__divider  { margin-bottom: 16px; }

  /* 웰컴 스플래시 타이틀 간격 축소 */
  .ws-title-wrap        { margin-bottom: 12px; gap: 12px; }
  .ws-icon-bomb         { width: 40px; height: 40px; }
  .ws-divider           { margin: 10px 0; }
  .ws-click-hint        { margin-top: 16px; }

  /* 결과 팝업 요소 축소 */
  .rp-icon              { font-size: 32px; margin-bottom: 6px; }
  .rp-title             { font-size: 22px; }
  .rp-score-main        { font-size: 36px; }
  .rp-score-label       { margin-bottom: 10px; }
  .rp-breakdown         { margin-bottom: 14px; padding: 8px 12px; gap: 4px; }

  /* 레벨 시작 팝업 요소 축소 */
  .lsp-level-text       { font-size: 22px; }
  .lsp-objectives       { padding: 8px 10px; gap: 4px; }
}

/* ══════════════════════════════════════════════════════════════
   RATING PANEL
   ══════════════════════════════════════════════════════════════ */
#rating-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3200;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  padding: 16px;
}
#rating-panel-overlay.visible {
  display: flex;
}

.rating-panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  background: rgba(8, 14, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;
}

/* ── 헤더 ── */
.rating-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.rating-panel__header-icon {
  color: #ffd700;
  opacity: 0.9;
  flex-shrink: 0;
}
.rating-panel__title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #e8eeff;
  letter-spacing: 0.04em;
}
.rating-panel__close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.rating-panel__close:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── Scope 버튼 (헤더 내) ── */
.rating-panel__scope-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.rating-panel__scope-btn:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}

/* ── Scope 서브팝업 ── */
#rating-scope-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3300;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  padding: 16px;
}
#rating-scope-overlay.visible {
  display: flex;
}

.scope-popup {
  width: min(360px, calc(100vw - 32px));
  background: rgba(10, 16, 38, 0.97);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  overflow: hidden;
}

.scope-popup__header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
}
.scope-popup__title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #d0deff;
  letter-spacing: 0.05em;
}
.scope-popup__close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
.scope-popup__close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.scope-popup__section {
  padding: 10px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.scope-popup__label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 7px;
}
.scope-popup__row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* 공통 버튼 스타일 */
.scope-popup__mode-btn,
.scope-popup__sort-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.scope-popup__mode-btn:hover,
.scope-popup__sort-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
}
.scope-popup__mode-btn.active {
  background: rgba(100,160,255,0.2);
  border-color: rgba(100,160,255,0.5);
  color: #8abfff;
}
.scope-popup__sort-btn.active {
  background: rgba(80,220,180,0.18);
  border-color: rgba(80,220,180,0.45);
  color: #5cddbb;
}

/* 레벨 버튼 */
.scope-popup__level-row { gap: 4px; }
.scope-popup__level-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px;
  color: rgba(255,255,255,0.45);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.scope-popup__level-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
}
.scope-popup__level-btn.active {
  background: rgba(255,200,50,0.2);
  border-color: rgba(255,200,50,0.5);
  color: #ffd060;
}

/* 연도 셀렉터 */
.scope-popup__year-select {
  padding: 5px 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.scope-popup__year-select option { background: #0d1428; color: #cdd; }

/* Apply 버튼 */
.scope-popup__apply-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px 14px;
  padding: 10px;
  background: rgba(100,160,255,0.18);
  border: 1px solid rgba(100,160,255,0.4);
  border-radius: 10px;
  color: #8abfff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.scope-popup__apply-btn:hover {
  background: rgba(100,160,255,0.28);
  border-color: rgba(100,160,255,0.6);
  color: #c0d8ff;
}

/* ── 리스트 헤더 ── */
.rating-panel__list-header {
  display: grid;
  grid-template-columns: 40px 1fr 64px 74px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.rating-panel__list-header span {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rph__rank  { text-align: left; }
.rph__nick  { text-align: left; padding-left: 2px; }
.rph__time  { text-align: right; }
.rph__score { text-align: right; }

/* ── 리스트 ── */
.rating-panel__list-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
  touch-action: pan-y;
}
.rating-panel__list-wrap::-webkit-scrollbar        { width: 4px; }
.rating-panel__list-wrap::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.14); border-radius: 4px; }
.rating-panel__list-wrap::-webkit-scrollbar-track  { background: transparent; }

.rating-panel__list {
  display: flex;
  flex-direction: column;
}

.rating-row {
  display: grid;
  grid-template-columns: 40px 1fr 64px 74px;
  padding: 7px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
  transition: background 0.1s;
}
.rating-row:hover {
  background: rgba(255,255,255,0.04);
}
.rating-row--me {
  background: rgba(100, 160, 255, 0.1);
  border-left: 2px solid rgba(100, 160, 255, 0.5);
}
.rating-row--me:hover {
  background: rgba(100, 160, 255, 0.15);
}

.rating-row__rank {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-align: left;
}
.rating-row:nth-child(-n+3) .rating-row__rank {
  font-size: 16px;
}
.rating-row__nick {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
}
.rating-row--me .rating-row__nick {
  color: #8abfff;
  font-weight: 700;
}
.rating-row__time {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rating-row__score {
  font-size: 13px;
  font-weight: 700;
  color: #e0eaff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rating-empty {
  padding: 40px 20px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  line-height: 1.6;
}

.rating-pool-info {
  padding: 6px 14px 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  letter-spacing: 0.02em;
}

/* ── 랭킹 버튼 (우측 아이콘 컬럼) ── */
.game-hud__rating-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(180, 200, 255, 0.75);
  cursor: pointer;
  transition: color 0.15s;
}
.game-hud__rating-btn:hover {
  color: #fff;
}

/* ── 모바일 landscape 대응 ── */
@media (orientation: landscape) and (max-height: 480px) {
  #rating-panel-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 8px 12px;
  }
  .rating-panel {
    max-height: none;
  }
}

/* ── Hall of Stars 팝업 ─────────────────────────────────────── */
#hall-of-stars-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
#hall-of-stars-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
#hall-of-stars-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}

.hos-card {
  position: relative;
  width: min(340px, 90vw);
  background: linear-gradient(160deg, #0d1628 0%, #101c35 60%, #0a1020 100%);
  border: 1px solid rgba(120, 180, 255, 0.25);
  border-radius: 20px;
  padding: 36px 28px 28px;
  text-align: center;
  box-shadow: 0 0 60px rgba(80, 140, 255, 0.15), 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}

.hos-stars-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hos-star {
  position: absolute;
  color: rgba(180, 220, 255, 0.35);
  animation: hos-twinkle 2.5s ease-in-out infinite alternate;
}
@keyframes hos-twinkle {
  from { opacity: 0.15; transform: scale(0.8); }
  to   { opacity: 0.7;  transform: scale(1.1); }
}

.hos-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(180, 200, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  transition: color 0.15s;
  z-index: 1;
}
.hos-close:hover { color: #fff; }

.hos-trophy {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px rgba(255, 200, 60, 0.6));
  animation: hos-bounce 1.2s ease-in-out infinite alternate;
}
@keyframes hos-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}

.hos-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #e8f4ff;
  margin: 0 0 4px;
  text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
}

.hos-sub {
  font-size: 12px;
  color: rgba(160, 200, 255, 0.65);
  letter-spacing: 0.08em;
  margin: 0 0 20px;
}

.hos-rank-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  background: rgba(255, 200, 60, 0.1);
  border: 1px solid rgba(255, 200, 60, 0.35);
  border-radius: 12px;
  padding: 8px 22px;
  margin-bottom: 14px;
}
.hos-rank-num {
  font-size: 48px;
  font-weight: 900;
  color: #ffd84d;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 200, 50, 0.5);
}
.hos-rank-suffix {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 200, 80, 0.8);
  align-self: flex-start;
  margin-top: 6px;
}

.hos-congrats {
  font-size: 13px;
  color: rgba(180, 220, 255, 0.8);
  line-height: 1.6;
  margin: 0 0 22px;
}

.hos-btn-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.hos-btn-close,
.hos-btn-ranking {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hos-btn-close {
  background: rgba(60, 120, 220, 0.25);
  border: 1px solid rgba(100, 160, 255, 0.4);
  color: #c8deff;
}
.hos-btn-close:hover {
  background: rgba(60, 120, 220, 0.45);
  border-color: rgba(120, 180, 255, 0.6);
}
.hos-btn-ranking {
  background: rgba(220, 170, 40, 0.25);
  border: 1px solid rgba(255, 210, 80, 0.5);
  color: #ffe580;
}
.hos-btn-ranking:hover {
  background: rgba(220, 170, 40, 0.45);
  border-color: rgba(255, 220, 100, 0.7);
}

/* ── 어드민 비밀번호 인증 모달 ───────────────────────────────── */
#admin-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

#admin-auth-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.admin-auth-popup {
  background: linear-gradient(160deg, rgba(14, 22, 45, 0.98) 0%, rgba(10, 16, 34, 0.98) 100%);
  border: 1px solid rgba(100, 150, 255, 0.25);
  border-radius: 18px;
  padding: 22px 22px 18px;
  width: min(300px, calc(100vw - 40px));
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(10px);
  transition: transform 0.18s;
}

#admin-auth-overlay.visible .admin-auth-popup {
  transform: translateY(0);
}

.admin-auth-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.admin-auth-popup__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #c8deff;
}

.admin-auth-popup__close {
  background: none;
  border: none;
  color: rgba(180, 200, 255, 0.4);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.admin-auth-popup__close:hover {
  color: #c0d8ff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-auth-popup__hint {
  font-size: 11px;
  color: rgba(160, 190, 255, 0.5);
  margin: 0 0 12px;
}

.admin-auth-popup__input-wrap {
  margin-bottom: 6px;
}

.admin-auth-popup__input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(100, 150, 255, 0.25);
  border-radius: 10px;
  color: #d0e4ff;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.admin-auth-popup__input:focus {
  border-color: rgba(100, 160, 255, 0.55);
}

.admin-auth-popup__input.shake {
  animation: input-shake 0.4s ease;
}

.admin-auth-popup__error {
  font-size: 11px;
  color: #ff7070;
  min-height: 16px;
  margin: 0 0 10px;
}

.admin-auth-popup__btns {
  display: flex;
  gap: 8px;
}

.admin-auth-popup__btn-cancel,
.admin-auth-popup__btn-submit {
  flex: 1;
  padding: 9px 0;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.admin-auth-popup__btn-cancel {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(180, 200, 255, 0.7);
}

.admin-auth-popup__btn-cancel:hover {
  background: rgba(255, 255, 255, 0.13);
}

.admin-auth-popup__btn-submit {
  background: rgba(80, 130, 255, 0.3);
  border: 1px solid rgba(100, 160, 255, 0.4);
  color: #a8d0ff;
}

.admin-auth-popup__btn-submit:hover:not(:disabled) {
  background: rgba(80, 130, 255, 0.5);
}

.admin-auth-popup__btn-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ── 앱 업데이트 안내 (네이티브, init 최소 버전 미만) ───────── */
#app-update-overlay {
  position: fixed;
  inset: 0;
  z-index: 3800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 2, 12, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  pointer-events: none;
}

#app-update-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.app-update-modal {
  position: relative;
  width: min(340px, 100%);
  padding: 26px 22px 20px;
  border-radius: 20px;
  background: linear-gradient(165deg, #0c1228 0%, #070a16 100%);
  border: 1px solid rgba(100, 180, 255, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 20px 48px rgba(0, 0, 0, 0.65);
}

.app-update-modal__glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 100px;
  background: radial-gradient(ellipse, rgba(80, 140, 255, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.app-update-modal__title {
  position: relative;
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: #c8dcff;
  text-align: center;
}

.app-update-modal__body {
  position: relative;
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(200, 215, 245, 0.88);
  text-align: center;
}

.app-update-modal__ver {
  position: relative;
  margin: 0 0 18px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: rgba(140, 170, 220, 0.75);
  text-align: center;
}

.app-update-modal__actions {
  position: relative;
  display: flex;
  gap: 10px;
  justify-content: stretch;
}

.app-update-modal__btn {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
}

.app-update-modal__btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(200, 215, 240, 0.85);
}

.app-update-modal__btn--primary {
  background: linear-gradient(180deg, rgba(70, 120, 255, 0.45), rgba(40, 80, 200, 0.5));
  border-color: rgba(120, 170, 255, 0.45);
  color: #e8f0ff;
}
