/* ════════════════════════════════════════════════════════════════════════════
 *  bm-ui2.css — BlockMonster UI v3 "네온 아케이드" 디자인 시스템 (2026-10)
 *  · 마지막에 로드되어 기존 bm-responsive.css / bm-theme.css 위에 최종 적용
 *  · 크기는 clamp()/vw 기반 → 280px 폴드 ~ 태블릿까지 깨지지 않게
 *  · 구성: A 토큰 / B 홈 / C 공통 팝업 / D 전체화면(상점·등급·보상·스테이지 등) / E 사격 크롬
 * ════════════════════════════════════════════════════════════════════════════ */

/* ───────────────────────── A. 디자인 토큰 ───────────────────────── */
:root {
    --u-ink: #0a0720;
    --u-panel-a: #2c1f6e;
    --u-panel-b: #150e3c;
    --u-line: rgba(178, 150, 255, 0.46);
    --u-line-soft: rgba(255, 255, 255, 0.10);
    --u-text: #ffffff;
    --u-sub: #c7c0f2;
    --u-dim: #8f88c4;
    --u-pink: #ff4fa8;
    --u-violet: #8b5cf6;
    --u-cyan: #3fd8ff;
    --u-yellow: #ffd426;
    --u-green: #2fe39a;
    --u-orange: #ff8a2a;
    --u-red: #ff3b5c;
    --u-font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --u-screen-bg:
        radial-gradient(120% 55% at 50% 0%, rgba(110, 60, 230, 0.55) 0%, rgba(110, 60, 230, 0) 62%),
        radial-gradient(80% 40% at 100% 100%, rgba(255, 79, 168, 0.16) 0%, rgba(255, 79, 168, 0) 70%),
        linear-gradient(180deg, #171043 0%, #0b0722 100%);
    --u-card: linear-gradient(180deg, rgba(52, 37, 124, 0.92) 0%, rgba(24, 16, 68, 0.95) 100%);
    --u-3d: 0 4px 0 rgba(6, 4, 22, 0.85), 0 9px 18px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
body { font-family: var(--u-font) !important; background: var(--u-screen-bg) !important; background-color: #0b0722 !important; }
#gameContainer { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1.5px rgba(178, 150, 255, 0.28), 0 0 60px rgba(139, 92, 246, 0.22) !important; }

@keyframes uPop      { from { transform: scale(0.9) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes uFloat    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes uPulse    { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes uShine    { 0% { transform: translateX(-120%) skewX(-18deg); } 60%, 100% { transform: translateX(260%) skewX(-18deg); } }
@keyframes uRise     { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────────────────────── B. 홈 화면 ───────────────────────── */
#homeScreen { font-family: var(--u-font) !important; background: var(--u-ink) !important; overflow: hidden; }
/* 위·아래만 살짝 어둡게 — 가운데 히어로 아트는 그대로 */
#homeScreen .home-overlay {
    background: linear-gradient(180deg,
        rgba(10, 7, 32, 0.62) 0%, rgba(10, 7, 32, 0.12) 15%, rgba(10, 7, 32, 0) 30%,
        rgba(10, 7, 32, 0) 46%, rgba(10, 7, 32, 0.55) 64%, rgba(10, 7, 32, 0.92) 100%) !important;
    pointer-events: none;
}

/* B-1 상단 바 */
#homeScreen .hx-top {
    position: relative; z-index: 5; width: 100%; box-sizing: border-box;
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    padding: max(10px, env(safe-area-inset-top)) clamp(8px, 3vw, 14px) 6px;
    flex-shrink: 0;
}
#homeScreen .hx-top-l, #homeScreen .hx-top-r { display: flex; align-items: center; gap: clamp(4px, 1.6vw, 7px); min-width: 0; }
#homeScreen #homeProfileBtn {
    width: clamp(32px, 10.4vw, 42px) !important; height: clamp(32px, 10.4vw, 42px) !important;
    padding: 0 !important; flex-shrink: 0; cursor: pointer; color: #fff;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px !important;
    background: linear-gradient(160deg, #b79cff 0%, #7c3aed 55%, #5b21b6 100%) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.38) !important;
    box-shadow: 0 3px 0 #371684, 0 7px 14px rgba(109, 40, 217, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}
#homeScreen .hx-chip {
    display: flex; align-items: center; gap: clamp(3px, 1.2vw, 5px); min-width: 0;
    height: clamp(28px, 8.8vw, 36px); padding: 0 clamp(8px, 3vw, 13px) 0 clamp(5px, 2vw, 8px);
    border-radius: 999px; white-space: nowrap;
    background: rgba(12, 8, 38, 0.74); border: 1.5px solid var(--u-line);
    color: #fff; font-size: clamp(11.5px, 3.6vw, 15px); font-weight: 800; letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 3px 10px rgba(0, 0, 0, 0.38);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#homeScreen .hx-rank { padding-left: clamp(7px, 2.6vw, 11px); }
#homeScreen .hx-rank #homeRankName { overflow: hidden; text-overflow: ellipsis; max-width: 26vw; }
#homeScreen .hx-ic { width: clamp(18px, 6vw, 25px); height: clamp(18px, 6vw, 25px); object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
#homeScreen .hx-labels { position: relative; z-index: 1; width: 100%; box-sizing: border-box; display: flex; justify-content: space-between; padding: 0 16px; font-size: 12px; color: #dcc8ff; font-weight: 700; flex-shrink: 0; }

/* B-2 티커 */
#homeScreen #bmTicker {
    position: relative; width: 100%; height: 24px; margin-top: 2px; flex-shrink: 0;
    display: flex; justify-content: center; align-items: center; z-index: 55; pointer-events: none;
}
#homeScreen #bmTickerPill {
    background: rgba(12, 8, 38, 0.68); border: 1px solid var(--u-line); color: #ece8ff;
    font-size: clamp(10.5px, 3vw, 12px); font-weight: 700; padding: 4px 13px; border-radius: 999px;
    white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* B-3 로고 (실패 시 텍스트 타이틀) */
#homeScreen .hx-logo {
    position: relative; z-index: 1; display: block; flex: 0 1 auto; min-height: 0;
    width: min(72vw, 320px); max-height: 22vh; height: auto; object-fit: contain;
    margin: clamp(0px, 0.6vh, 6px) auto 0; pointer-events: none; -webkit-user-drag: none;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
    animation: uRise 0.5s ease-out both, uFloat 5s ease-in-out 0.6s infinite;
}
#homeScreen #homeTitleText.hx-title { display: none !important; }
#homeScreen #homeTitleText.hx-title.hx-show {
    display: block !important; position: relative; z-index: 1;
    font-size: clamp(17px, 5.6vw, 26px) !important; font-weight: 900 !important; padding: 6px 10px !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 79, 168, 0.55) !important;
}
#homeScreen .hx-spacer { flex: 1 1 auto; min-height: 6px; position: relative; z-index: 1; }

/* B-4 메뉴 독 (상점 / 사격 / 등급 / 보상) */
#homeScreen .hx-dock {
    position: relative; z-index: 50; width: 100%; max-width: 460px; box-sizing: border-box; flex-shrink: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 2.4vw, 12px);
    padding: clamp(12px, 4vw, 18px) clamp(12px, 4.4vw, 22px) 0; margin: 0 auto clamp(9px, 2.8vw, 14px);
    animation: uRise 0.45s 0.08s ease-out both;
}
/* (기존 CSS 의 #homeShopBtn 등 !important 규칙을 이기도록 ID 2개 + !important) */
#homeScreen #hxDock .hx-tile {
    position: relative; min-width: 0; min-height: 0 !important; cursor: pointer; overflow: visible;
    display: flex !important; flex-direction: column; align-items: center; justify-content: flex-end;
    padding: clamp(30px, 10.8vw, 50px) 2px clamp(5px, 1.7vw, 8px) !important;
    border-radius: 16px !important; border: 1.5px solid var(--u-line) !important;
    background: var(--u-card) !important;
    color: #fff !important; font-family: inherit; font-size: clamp(11px, 3.3vw, 14.5px) !important; font-weight: 800 !important; letter-spacing: 0 !important; line-height: 1.15 !important;
    box-shadow: var(--u-3d) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65) !important;
    -webkit-tap-highlight-color: transparent; transition: transform 0.08s, box-shadow 0.08s;
    white-space: nowrap;
}
#homeScreen .hx-tile::before {
    content: ''; position: absolute; left: 0; right: 0; margin: 0 auto; top: clamp(-18px, -4.4vw, -10px);
    width: clamp(36px, 12.6vw, 58px); height: clamp(36px, 12.6vw, 58px);
    background: center / contain no-repeat;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); pointer-events: none;
}
#homeScreen .hx-tile.t-shop::before   { background-image: url(img/ui/ic_shop.webp); }
#homeScreen .hx-tile.t-gacha::before  { background-image: url(img/ui/ic_gacha.webp); }
#homeScreen .hx-tile.t-grade::before  { background-image: url(img/ui/ic_grade.webp); }
#homeScreen .hx-tile.t-reward::before { background-image: url(img/ui/ic_reward.webp); }
#homeScreen #hxDock .hx-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(6, 4, 22, 0.85), 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important; }
#homeScreen #hxDock #homeGachaText { display: block; font-size: inherit !important; line-height: inherit; }
#homeScreen #homeShopBtn, #homeScreen #homeGradeBtn, #homeScreen #homeRewardsBtn, #homeScreen #homeGachaText { color: #fff !important; }

/* 사격 알림 뱃지 + 말풍선 (독 위 빈 공간으로) */
#homeScreen #gachaLowBadge {
    position: absolute; top: -7px; right: -5px; z-index: 3;
    width: 19px !important; height: 19px !important; line-height: 19px !important; border-radius: 50%;
    background: var(--u-red); color: #fff; font-size: 12px !important; font-weight: 900; text-align: center;
    box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, 0.5) !important;
    animation: uPulse 1.1s ease-in-out infinite;
}
#homeScreen #gachaLowBubble {
    position: absolute; left: 50%; bottom: calc(100% + clamp(16px, 4.6vw, 22px)); top: auto; transform: translateX(-50%);
    z-index: 10; white-space: nowrap; max-width: 92vw;
    padding: 6px 28px 6px 11px !important; border-radius: 10px !important;
    background: #fff; color: #2a1d55; font-size: clamp(10.5px, 3vw, 12px) !important; font-weight: 800 !important; line-height: 1.25 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important; text-shadow: none; letter-spacing: -0.2px;
}
#homeScreen #gachaLowBubble::after {
    content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
    border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 7px solid #fff;
}
#homeScreen .hx-bubble-x {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%;
    color: #8a82b8; font-size: 13px; font-weight: 900; cursor: pointer; user-select: none;
}

/* B-5 게임 모드 카드 (홈의 주역) */
#homeScreen .hx-modes {
    position: relative; z-index: 2; width: 100%; max-width: 460px; box-sizing: border-box; flex-shrink: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(7px, 2.4vw, 12px);
    padding: clamp(20px, 7.4vw, 36px) clamp(12px, 4.4vw, 22px) 0; margin: 0 auto;
    animation: uRise 0.45s 0.16s ease-out both;
}
#homeScreen #hxModes .hx-mode {
    position: relative; min-width: 0; min-height: 0 !important; cursor: pointer; overflow: visible;
    display: flex !important; flex-direction: column; align-items: center; justify-content: flex-end; gap: clamp(3px, 1vw, 5px);
    padding: clamp(36px, 13vw, 62px) 4px clamp(8px, 2.8vw, 13px) !important;
    border-radius: 20px !important; border: 2px solid rgba(255, 255, 255, 0.55) !important;
    color: #fff !important; font-family: inherit; letter-spacing: 0 !important;
    -webkit-tap-highlight-color: transparent; transition: transform 0.08s, box-shadow 0.08s;
}
#homeScreen .hx-mode.m-monster { background: linear-gradient(180deg, #b392ff 0%, #7c3aed 52%, #4c1d95 100%); box-shadow: 0 6px 0 #2e1065, 0 14px 26px rgba(124, 58, 237, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -10px 18px rgba(46, 16, 101, 0.45); }
#homeScreen .hx-mode.m-endless { background: linear-gradient(180deg, #5ff0b6 0%, #10b981 52%, #047857 100%); box-shadow: 0 6px 0 #064e3b, 0 14px 26px rgba(16, 185, 129, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -10px 18px rgba(4, 78, 59, 0.45); }
#homeScreen .hx-mode.m-stage   { background: linear-gradient(180deg, #ffc46b 0%, #f97316 52%, #c2410c 100%); box-shadow: 0 6px 0 #7c2d12, 0 14px 26px rgba(249, 115, 22, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -10px 18px rgba(124, 45, 18, 0.45); }
/* 카드 위로 튀어나오는 3D 아이콘 */
#homeScreen .hx-mode::before {
    content: ''; position: absolute; left: 0; right: 0; margin: 0 auto; top: clamp(-30px, -8.6vw, -18px);
    width: clamp(58px, 21vw, 98px); height: clamp(58px, 21vw, 98px);
    background: center / contain no-repeat;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); pointer-events: none;
    animation: uFloat 3.6s ease-in-out infinite;
}
#homeScreen .hx-mode.m-monster::before { background-image: url(img/ui/mode_monster.webp); }
#homeScreen .hx-mode.m-endless::before { background-image: url(img/ui/mode_endless.webp); animation-delay: 0.5s; }
#homeScreen .hx-mode.m-stage::before   { background-image: url(img/ui/mode_stage.webp); animation-delay: 1s; }
/* 광택 스윕 */
#homeScreen .hx-mode::after {
    content: ''; position: absolute; inset: 0; border-radius: 18px; overflow: hidden; pointer-events: none;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0) 70%);
    background-size: 250% 100%; background-position: 130% 0; animation: uSweep 4.5s ease-in-out infinite;
}
@keyframes uSweep { 0%, 55% { background-position: 130% 0; } 100% { background-position: -130% 0; } }
#homeScreen .hx-mode:active { transform: translateY(4px); }
#homeScreen .hx-mode .hx-mode-t,
#homeScreen #homeSurvivalLabel, #homeScreen #homeEndlessLabel, #homeScreen #homeStageLabel {
    position: relative; z-index: 1; display: block; white-space: nowrap;
    font-size: clamp(13px, 4.3vw, 20px) !important; font-weight: 900 !important; line-height: 1.1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28), 0 1px 4px rgba(0, 0, 0, 0.4);
}
#homeScreen #monsterDailyLabel, #homeScreen #endlessDailyLabel, #homeScreen #stageModeLabel {
    position: relative; z-index: 1; display: block !important; white-space: nowrap; max-width: 100%;
    margin: 0 !important; padding: clamp(2px, 0.8vw, 4px) clamp(6px, 2.2vw, 10px); border-radius: 999px;
    background: rgba(10, 6, 30, 0.38); border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: clamp(9.5px, 2.9vw, 13px) !important; font-weight: 800 !important; opacity: 1 !important; letter-spacing: -0.2px !important;
    overflow: hidden; text-overflow: ellipsis; box-sizing: border-box;
}

/* B-6 BGM (한 줄) */
#homeScreen .hx-bgm {
    position: relative; z-index: 2; width: 100%; max-width: 460px; box-sizing: border-box; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 10px);
    padding: 0 clamp(12px, 4.4vw, 22px); margin: clamp(10px, 3vw, 16px) auto 0;
}
#homeScreen .hx-bgm-mid {
    flex: 1 1 auto; min-width: 0; height: clamp(32px, 9.6vw, 40px); box-sizing: border-box;
    display: flex; align-items: center; gap: 8px; padding: 0 clamp(8px, 2.8vw, 12px);
    border-radius: 999px; background: rgba(12, 8, 38, 0.7); border: 1.5px solid var(--u-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 10px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#homeScreen #homeBgmBtn {
    flex: 0 0 auto; min-width: 0 !important; width: auto; padding: 0 !important; margin: 0;
    background: none !important; border: none !important; box-shadow: none !important; border-radius: 0 !important;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    color: #fff; font-family: inherit; font-size: clamp(11.5px, 3.4vw, 14px) !important; font-weight: 800; white-space: nowrap; cursor: pointer;
}
#homeScreen #homeBgmTitle {
    flex: 1 1 auto; min-width: 0; margin: 0 !important; text-align: right;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--u-sub) !important; font-size: clamp(10.5px, 3vw, 12.5px) !important; font-weight: 700 !important; text-shadow: none !important; letter-spacing: 0 !important;
}
#homeScreen #homeBgmPrev, #homeScreen #homeBgmNext {
    flex: 0 0 auto; width: clamp(32px, 9.6vw, 40px) !important; height: clamp(32px, 9.6vw, 40px) !important; padding: 0 !important;
    border-radius: 50% !important; cursor: pointer; color: #fff; font-size: clamp(11px, 3.2vw, 14px) !important; font-weight: 900;
    background: rgba(12, 8, 38, 0.7) !important; border: 1.5px solid var(--u-line) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 3px 10px rgba(0, 0, 0, 0.35) !important;
}

/* B-7 하단 링크 */
#homeScreen .hx-foot {
    position: relative; z-index: 2; width: 100%; max-width: 460px; box-sizing: border-box; flex-shrink: 0;
    display: flex; gap: clamp(3px, 1.2vw, 6px);
    padding: clamp(7px, 2.2vw, 10px) clamp(12px, 4.4vw, 22px) max(clamp(10px, 3.4vw, 18px), env(safe-area-inset-bottom)); margin: 0 auto;
}
#homeScreen .hx-link {
    flex: 1 1 0; min-width: 0; padding: clamp(5px, 1.8vw, 8px) 2px; border-radius: 10px; cursor: pointer;
    background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--u-sub); font-family: inherit; font-size: clamp(9px, 2.9vw, 12px); font-weight: 700; letter-spacing: -0.3px;
    white-space: nowrap; overflow: hidden; text-overflow: clip; text-align: center;
}
#homeScreen .hx-link:active { background: rgba(255, 255, 255, 0.16); }

/* 태블릿 — 조작부 폭과 아이콘을 키움 */
@media (min-width: 600px) and (min-height: 800px) {
    #homeScreen .hx-dock, #homeScreen .hx-modes, #homeScreen .hx-bgm, #homeScreen .hx-foot { max-width: 620px; }
    #homeScreen .hx-logo { width: min(56vw, 460px); max-height: 26vh; }
    #homeScreen #hxDock .hx-tile { padding-top: 66px !important; font-size: 17px !important; }
    #homeScreen .hx-tile::before { width: 76px; height: 76px; top: -22px; }
    #homeScreen .hx-modes { padding-top: 50px; }
    #homeScreen #hxModes .hx-mode { padding-top: 86px !important; padding-bottom: 16px !important; border-radius: 24px !important; }
    #homeScreen .hx-mode::before { width: 132px; height: 132px; top: -44px; }
    #homeScreen .hx-mode .hx-mode-t,
    #homeScreen #homeSurvivalLabel, #homeScreen #homeEndlessLabel, #homeScreen #homeStageLabel { font-size: 25px !important; }
    #homeScreen #monsterDailyLabel, #homeScreen #endlessDailyLabel, #homeScreen #stageModeLabel { font-size: 15px !important; }
    #homeScreen .hx-link { font-size: 14px; padding: 10px 2px; }
}
/* 세로가 짧은 폰 — 로고·카드 높이만 줄여 한 화면에 수납 */
@media (max-height: 620px) {
    #homeScreen .hx-logo { max-height: 15vh; }
    #homeScreen #hxDock .hx-tile { padding-top: clamp(24px, 8.4vw, 32px) !important; padding-bottom: 4px !important; }
    #homeScreen .hx-tile::before { width: clamp(32px, 10.4vw, 40px); height: clamp(32px, 10.4vw, 40px); top: -10px; }
    #homeScreen .hx-modes { padding-top: clamp(16px, 5.6vw, 22px); }
    #homeScreen #hxModes .hx-mode { padding-top: clamp(30px, 10.4vw, 40px) !important; padding-bottom: 7px !important; }
    #homeScreen .hx-mode::before { width: clamp(48px, 16.5vw, 62px); height: clamp(48px, 16.5vw, 62px); top: -18px; }
    #homeScreen .hx-bgm { margin-top: 8px; }
    #homeScreen .hx-foot { padding-top: 6px; padding-bottom: 8px; }
}
@media (max-height: 500px) {
    #homeScreen .hx-logo { display: none; }
}

/* ───────────────────────── C. 공통 팝업 (.modal) ───────────────────────── */
.modal {
    background: radial-gradient(120% 80% at 50% 18%, rgba(70, 36, 160, 0.5) 0%, rgba(6, 4, 20, 0.9) 70%) !important;
    -webkit-backdrop-filter: blur(6px) !important; backdrop-filter: blur(6px) !important;
    font-family: var(--u-font);
}
.modal .modal-content,
#langPromptOverlay > div, #consentPromptOverlay > div, #gachaPromptOverlay > div,
#nicknamePromptOverlay > div, #bmAuthOverlay > div, #bmNickSetup > div,
#bmExitConfirm > div, #bmInGameQuit > div, #gachaTipPopup > div {
    background: linear-gradient(180deg, #2e2072 0%, #1c124c 44%, #120b34 100%) !important;
    border: 1.5px solid rgba(190, 165, 255, 0.55) !important;
    border-radius: 24px !important;
    box-shadow:
        0 0 0 4px rgba(18, 11, 52, 0.92),
        0 0 0 5.5px rgba(255, 79, 168, 0.38),
        0 24px 60px rgba(0, 0, 0, 0.65),
        0 0 60px rgba(139, 92, 246, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    color: #fff; font-family: var(--u-font);
}
.modal.show .modal-content { animation: uPop 0.22s cubic-bezier(0.2, 1.3, 0.4, 1); }
.modal h2 { font-weight: 900 !important; letter-spacing: -0.2px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 0 18px rgba(255, 79, 168, 0.3); }
.modal p { color: var(--u-sub); }

/* 버튼 — 3D 아케이드 키 */
.modal button,
#langPromptOverlay button, #consentPromptOverlay button, #gachaPromptOverlay button,
#nicknamePromptOverlay button, #bmAuthOverlay button, #bmNickSetup button,
#bmExitConfirm button, #bmInGameQuit button, #gachaTipPopup button {
    font-family: var(--u-font); font-weight: 800 !important; letter-spacing: 0;
    border-radius: 14px !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
    transition: transform 0.08s, filter 0.15s, box-shadow 0.08s !important;
    -webkit-tap-highlight-color: transparent;
}
.modal button { background: linear-gradient(180deg, #ff74bd 0%, #e8389a 55%, #c21f7c 100%); }
.modal button:hover { transform: none; filter: brightness(1.06); }
.modal button:active,
#langPromptOverlay button:active, #consentPromptOverlay button:active, #gachaPromptOverlay button:active,
#nicknamePromptOverlay button:active, #bmAuthOverlay button:active, #bmExitConfirm button:active, #bmInGameQuit button:active {
    transform: translateY(3px) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}
/* 인라인으로 지정된 색을 새 팔레트로 통일 (보조 / 재화 / 시작 / 광고) */
button[style*="#374151"], button[style*="#444466"], button[style*="#4b5563"] {
    background: linear-gradient(180deg, #5b52a0 0%, #3b3378 55%, #2a245c 100%) !important; color: #fff !important;
}
button[style*="rgba(255,255,255,0.1)"]:not(.hx-link):not([disabled]),
button[style*="rgba(255,255,255,0.15)"]:not(.hx-link):not([disabled]) {
    background: rgba(255, 255, 255, 0.09) !important; border: 1.5px solid rgba(255, 255, 255, 0.22) !important; color: #e6e1ff !important;
}
button[style*="#1e5082"]:not([disabled]) { background: linear-gradient(180deg, #5cc8ff 0%, #1d8fe0 55%, #0f66b3 100%) !important; }
button[style*="#d97706,#f59e0b"] { background: linear-gradient(180deg, #ffc857 0%, #ff9320 55%, #e06a08 100%) !important; }
button[style*="#10b981,#059669"] { background: linear-gradient(180deg, #5ff0b6 0%, #12b981 55%, #07835c 100%) !important; }
button[style*="#7c3aed,#a855f7"] { background: linear-gradient(180deg, #b392ff 0%, #8145f0 55%, #5b21b6 100%) !important; }

/* 팝업별 다듬기 */
#startModal #startRotateInfo { background: rgba(12, 8, 38, 0.55) !important; border: 1px solid var(--u-line) !important; border-radius: 14px !important; }
#startModalClose { width: 30px; height: 30px; line-height: 30px !important; text-align: center; top: 10px !important; right: 10px !important; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #fff !important; font-size: 15px !important; }
#monsterClearModal .modal-content > div[style*="flex-direction:column"]:not(#clearButtons),
#gameOverModal #gameOverMsg {
    background: rgba(12, 8, 38, 0.5) !important; border: 1px solid var(--u-line) !important; border-radius: 14px !important;
}
#gameOverModal #gameOverMsg { padding: 12px 14px !important; margin: 10px 0 !important; color: #e9e5ff !important; }
#gameOverModal #gameOverTitle { color: #ff6b8e; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 59, 92, 0.5); letter-spacing: 1px; }
#monsterDiffModal #monsterDiffList > div { border-radius: 14px !important; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
#monsterDiffModal #monsterDiffList button { margin: 0 !important; }
#attendanceModal .att-keys { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 16px rgba(255, 212, 38, 0.45); }
#tutorialModal #tutorialIllust { background: rgba(8, 5, 26, 0.75) !important; border: 1px solid var(--u-line); border-radius: 16px !important; }
#helpModal #helpMsg, #infoModal .modal-content > div { scrollbar-width: thin; scrollbar-color: rgba(178, 150, 255, 0.5) transparent; }
#helpTabs button { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important; }

/* ───────────────────────── D. 전체화면 (상점 / 등급 / 보상 / 도감 / 제작 / 스테이지) ───────────────────────── */
#shopScreen, #rankScreen, #dexScreen, #collectionScreen, #creatorScreen, #stageSelectModal {
    background: var(--u-screen-bg) !important; background-color: #0b0722 !important;
    font-family: var(--u-font) !important;
}
#shopScreen > div, #rankScreen > div, #dexScreen > div { padding-top: max(18px, env(safe-area-inset-top)) !important; }
#shopScreen h1, #rankScreen h1, #dexScreen h1, #collectionScreen h1, #stageSelectModal h2, #creatorScreen h2 {
    font-family: var(--u-font); font-weight: 900 !important; letter-spacing: -0.3px;
    font-size: clamp(20px, 6.2vw, 28px) !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 79, 168, 0.4);
}
/* 홈 이동 / 닫기 버튼 */
#shopHomeBtn, #rankHomeBtn, #dexHomeBtn, #stageSelectCloseBtn {
    background: linear-gradient(180deg, #5b52a0, #2f2866) !important; border: 1.5px solid rgba(190, 165, 255, 0.5) !important;
    border-radius: 999px !important; padding: 8px 16px !important; color: #fff !important; font-weight: 800 !important; font-family: var(--u-font);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important; white-space: nowrap; flex-shrink: 0;
}
#shopHomeBtn:active, #rankHomeBtn:active, #dexHomeBtn:active, #stageSelectCloseBtn:active { transform: translateY(2px); }

/* D-1 상점 */
#shopScreen #shopKeys, #shopScreen #shopGems { color: var(--u-yellow); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
#shopScreen > div > div[style*="justify-content:center"]:nth-of-type(2) {
    background: rgba(12, 8, 38, 0.6); border: 1.5px solid var(--u-line); border-radius: 999px;
    padding: 8px 18px; width: fit-content; margin-left: auto !important; margin-right: auto !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
#shopScreen > div > button {
    border-radius: 18px !important; border: 1.5px solid rgba(255, 255, 255, 0.42) !important; font-family: var(--u-font);
    box-shadow: 0 5px 0 rgba(6, 4, 22, 0.75), 0 10px 20px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
    transition: transform 0.08s; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
#shopScreen > div > button:active { transform: translateY(4px); }
#shopScreen > div > button[onclick*="shopExchangeKeys"] { background: linear-gradient(180deg, #a98bff 0%, #7440e8 55%, #4c1d95 100%) !important; }
#shopScreen #shopAdKeyWatchBtn { background: linear-gradient(180deg, #62ccff 0%, #1f8fe6 55%, #1259a8 100%) !important; }
#shopScreen #shopAdWatchBtn    { background: linear-gradient(180deg, #5ff0b6 0%, #12b981 55%, #07835c 100%) !important; }
#shopScreen > div > button > div:nth-child(2) { color: rgba(255, 255, 255, 0.85) !important; font-weight: 600; }
#shopScreen button[disabled] {
    background: var(--u-card) !important; border: 1.5px dashed rgba(178, 150, 255, 0.4) !important; border-radius: 16px !important;
    opacity: 0.62 !important; box-shadow: none !important;
}
#shopScreen #iapDividerText { color: var(--u-sub) !important; font-weight: 800 !important; }
#shopScreen #shopAdPassStatus { background: rgba(139, 92, 246, 0.2) !important; border: 1.5px solid var(--u-line) !important; border-radius: 14px !important; }

/* D-2 등급표 / 보상 / 도감 — JS 가 만드는 행(카드)들 공통 */
#rankContent > div, #dexGrid > div, #colContentMonster > div, #colContentEndless > div { font-family: var(--u-font); }
#rankContent div[style*="border-radius"], #dexGrid div[style*="border-radius"] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
#dexScreen #dexBadgeTotal { background: rgba(12, 8, 38, 0.55); border: 1.5px solid var(--u-line); border-radius: 14px; padding: 10px 12px; }
#dexScreen button:not(#dexHomeBtn), #rankScreen #rankContent button, #collectionScreen button {
    font-family: var(--u-font); font-weight: 800 !important; border-radius: 12px !important;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
#stageSelectModal #stageSelectList > * { border-radius: 14px !important; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.16); font-family: var(--u-font); font-weight: 800; }

/* ───────────────────────── E. 사격(가챠) 화면 크롬 ───────────────────────── */
#gachaScreen { font-family: var(--u-font); }
#gachaUI > div[style*="rgba(60,35,10"] {
    background: linear-gradient(180deg, rgba(34, 22, 92, 0.96), rgba(18, 11, 52, 0.94)) !important;
    border-bottom: 1.5px solid var(--u-line); padding-top: max(8px, env(safe-area-inset-top)) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
#gachaBottomBar {
    background: linear-gradient(180deg, rgba(34, 22, 92, 0.96), rgba(12, 8, 38, 0.98)) !important;
    border-top: 1.5px solid var(--u-line) !important; bottom: 0 !important;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
}
#gachaBottomBar button {
    font-family: var(--u-font); font-weight: 800 !important; border-radius: 14px !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
}
#gachaBottomBar button:active { transform: translateY(3px); }
#gachaBottomBar #gachaExchangeBtn { background: linear-gradient(180deg, #ff74bd 0%, #e8389a 55%, #c21f7c 100%) !important; }

@media (prefers-reduced-motion: reduce) {
    #homeScreen .hx-logo, #homeScreen .hx-mode::before, #homeScreen .hx-mode::after, #homeScreen #gachaLowBadge { animation: none !important; }
}

/* ═══ F. 조작 튜토리얼 오버레이 (game-core _ctrlTutRender) ═══ */
#bmCtrlTut { position: fixed; inset: 0; z-index: 9000; pointer-events: none; font-family: inherit; }
#bmCtrlTut .bm-ctut-dim { position: fixed; background: rgba(4, 6, 20, .72); pointer-events: none; }
#bmCtrlTut .bm-ctut-spot { position: fixed; border: 3px solid #FFE34D; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,79,168,.6), 0 0 22px rgba(255,227,77,.75), inset 0 0 18px rgba(255,227,77,.25); animation: bmCtutPulse 1.1s ease-in-out infinite; pointer-events: none; }
#bmCtrlTut .bm-ctut-hand { position: fixed; font-size: 46px; line-height: 1; transform: translate(-30%, -10%); filter: drop-shadow(0 3px 6px rgba(0,0,0,.7)); pointer-events: none; }
#bmCtrlTut .bm-ctut-tap { animation: bmCtutTap 1s ease-in-out infinite; }
#bmCtrlTut .bm-ctut-sweep { animation: bmCtutSweep 2.2s ease-in-out infinite; }
#bmCtrlTut .bm-ctut-card { position: fixed; left: 50%; transform: translateX(-50%); width: min(92vw, 360px); box-sizing: border-box; padding: 12px 14px 12px; border-radius: 16px; background: linear-gradient(180deg, #2A1D5C, #17123A); border: 2px solid #FF4FA8; box-shadow: 0 6px 22px rgba(0,0,0,.6), 0 0 16px rgba(255,79,168,.45); color: #fff; text-align: center; pointer-events: none; }
#bmCtrlTut .bm-ctut-step { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; color: #FFE34D; letter-spacing: .3px; margin-bottom: 6px; }
#bmCtrlTut .bm-ctut-step span { font-size: 11px; font-weight: 800; color: #fff; background: #FF4FA8; border-radius: 99px; padding: 2px 8px; }
#bmCtrlTut .bm-ctut-body { font-size: 14px; line-height: 1.45; word-break: keep-all; }
#bmCtrlTut .bm-ctut-body b { color: #7CF7FF; }
#bmCtrlTut .bm-ctut-sub { margin-top: 5px; font-size: 11.5px; color: #B9B4E6; }
#bmCtrlTut .bm-ctut-skip { margin-top: 8px; font-size: 12px; color: #C9C4F0; text-decoration: underline; padding: 4px 10px; pointer-events: auto; cursor: pointer; }
#bmCtrlTut .bm-ctut-shake { animation: bmCtutShake .45s ease; }
#bmCtrlTut .bm-ctut-done { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(88vw, 340px); box-sizing: border-box; padding: 16px 14px; border-radius: 18px; text-align: center; font-size: 17px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #FF4FA8, #B8237A); border: 2px solid #FFE34D; box-shadow: 0 0 24px rgba(255,79,168,.7); animation: bmCtutPop .35s ease-out; word-break: keep-all; }
@keyframes bmCtutPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes bmCtutTap { 0%,100% { transform: translate(-30%, -10%) scale(1); } 50% { transform: translate(-30%, 4%) scale(.86); } }
@keyframes bmCtutSweep { 0% { transform: translate(-30%, -10%) translateX(0); } 25% { transform: translate(-30%, -10%) translateX(calc(var(--sw) * -1)); } 75% { transform: translate(-30%, -10%) translateX(var(--sw)); } 100% { transform: translate(-30%, -10%) translateX(0); } }
@keyframes bmCtutShake { 0%,100% { transform: translateX(-50%); } 20% { transform: translateX(calc(-50% - 8px)); } 40% { transform: translateX(calc(-50% + 8px)); } 60% { transform: translateX(calc(-50% - 5px)); } 80% { transform: translateX(calc(-50% + 5px)); } }
@keyframes bmCtutPop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@media (max-height: 600px) { #bmCtrlTut .bm-ctut-body { font-size: 12.5px; } #bmCtrlTut .bm-ctut-card { padding: 9px 11px; } #bmCtrlTut .bm-ctut-hand { font-size: 38px; } }
