/* ============================================================================
 * BlockMonsters — 메인 디자인 테마 (홈 화면)
 * 레퍼런스 이미지 기반: 큰 3D 로고 + 그라데이션 카드 + 흰 하단 카드
 * 마크업 변경 없이 CSS 만으로 인라인 스타일을 덮어씀 (!important 필수)
 * ============================================================================ */

/* ============================================================================
 * 몬스터 스프라이트 — 로딩 화면에 워킹 애니메이션
 * 800x540 PNG, 10 columns × 5 rows, 80x108 frame
 * ============================================================================ */
.bm-monster {
    position: absolute;
    width: 80px;
    height: 108px;
    background-image: url('img/monsters_sprite.png');
    background-repeat: no-repeat;
    background-size: 800px 540px;
    image-rendering: -webkit-optimize-contrast;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5));
    animation: bm-walk-cycle 0.6s steps(10) infinite, bm-bounce 0.8s ease-in-out infinite;
}
.bm-monster.row-purple { background-position-y: 0; }
.bm-monster.row-red    { background-position-y: -108px; }
.bm-monster.row-orange { background-position-y: -216px; }
.bm-monster.row-green  { background-position-y: -324px; }
.bm-monster.row-blue   { background-position-y: -432px; }

@keyframes bm-walk-cycle {
    from { background-position-x: 0; }
    to   { background-position-x: -800px; }
}
@keyframes bm-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
/* 좌우 가로 이동 — 각 캐릭터마다 인라인으로 duration / direction 다르게 */
@keyframes bm-stroll {
    0%   { left: var(--from, 10%); }
    50%  { left: var(--to,   75%); }
    100% { left: var(--from, 10%); }
}
.bm-monster.flip {
    transform: scaleX(-1);
}

/* 히어로 모드 — 1마리만, 프로그래스바 위쪽 영역에 배치 */
/* scale() 로 시각 크기만 확대 — 스프라이트 정렬/walk-cycle 은 그대로 사용 */
.bm-monster-hero {
    width: 80px !important;
    height: 108px !important;
    background-size: 800px 540px !important;
    left: 50% !important;
    margin-left: -40px !important;
    bottom: 30% !important;
    z-index: 2 !important;
    transform-origin: 50% 100% !important;
    transform: scale(1.6) !important;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,0.55)) !important;
}
.bm-monster-hero.row-purple { background-position-y: 0 !important; }
.bm-monster-hero.row-red    { background-position-y: -108px !important; }
.bm-monster-hero.row-orange { background-position-y: -216px !important; }
.bm-monster-hero.row-green  { background-position-y: -324px !important; }
.bm-monster-hero.row-blue   { background-position-y: -432px !important; }

/* 좌우 흔들기 + 위아래 바운스 통합 (scale 유지 — bm-bounce 와 충돌 회피) */
@keyframes bm-hero-stroll {
    0%   { transform: scale(1.6) translate(-12px, 0); }
    25%  { transform: scale(1.6) translate(0,    -4px); }
    50%  { transform: scale(1.6) translate(12px,  0); }
    75%  { transform: scale(1.6) translate(0,    -4px); }
    100% { transform: scale(1.6) translate(-12px, 0); }
}

/* 작은 화면 (380px 이하) — scale 축소 */
@media (max-width: 380px) {
    .bm-monster-hero {
        bottom: 32% !important;
        transform: scale(1.35) !important;
    }
    @keyframes bm-hero-stroll {
        0%   { transform: scale(1.35) translate(-10px, 0); }
        25%  { transform: scale(1.35) translate(0,    -4px); }
        50%  { transform: scale(1.35) translate(10px,  0); }
        75%  { transform: scale(1.35) translate(0,    -4px); }
        100% { transform: scale(1.35) translate(-10px, 0); }
    }
}

/* 매우 좁은 화면 (340px 이하) — 더 작게 */
@media (max-width: 340px) {
    .bm-monster-hero {
        bottom: 34% !important;
        transform: scale(1.15) !important;
    }
    @keyframes bm-hero-stroll {
        0%   { transform: scale(1.15) translate(-8px, 0); }
        25%  { transform: scale(1.15) translate(0,   -3px); }
        50%  { transform: scale(1.15) translate(8px,  0); }
        75%  { transform: scale(1.15) translate(0,   -3px); }
        100% { transform: scale(1.15) translate(-8px, 0); }
    }
}

/* 살짝 더 화려한 등장 효과 */
.bm-monster.bm-spawn {
    animation:
        bm-walk-cycle 0.6s steps(10) infinite,
        bm-bounce 0.8s ease-in-out infinite,
        bm-fade-in 0.5s ease-out;
}
@keyframes bm-fade-in {
    from { opacity: 0; transform: translateY(20px) scale(0.6); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 로딩 화면 내에서만 적용 */
#loadingScreen .bm-monster {
    bottom: 14%;
}

/* 작은 화면 — 캐릭터 축소 */
@media (max-width: 380px) {
    .bm-monster { width: 64px; height: 86px; background-size: 640px 432px; }
    .bm-monster.row-red    { background-position-y: -86px; }
    .bm-monster.row-orange { background-position-y: -172px; }
    .bm-monster.row-green  { background-position-y: -259px; }
    .bm-monster.row-blue   { background-position-y: -345px; }
    @keyframes bm-walk-cycle {
        from { background-position-x: 0; }
        to   { background-position-x: -640px; }
    }
}

/* ── 1) 배경 — 원본 home.jpg 그대로 (어둡게 처리 X) ──────────────────────── */
#homeScreen {
    background: #0f0c29 !important; /* 이미지 로드 전 폴백 */
}
#homeScreen .home-bg {
    opacity: 1 !important;
    filter: none !important;
}
#homeScreen .home-overlay {
    background: transparent !important;
}

/* ── 2) 상단 헤더 (아바타 / 등급 / 열쇠 / 수정) ───────────────────────────── */
#homeScreen .home-top {
    padding: 14px 18px !important;
    z-index: 5 !important;
}
#homeProfileBtn {
    width: 42px !important;
    height: 42px !important;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    border: 2px solid rgba(255,255,255,0.25) !important;
    box-shadow: 0 4px 12px rgba(139,92,246,0.5) !important;
}
#homeScreen .home-stat {
    background: rgba(0,0,0,0.55) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 7px 12px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

/* ── 3) 홈 화면 타이틀 — 한 줄, 작게, 상단 ─────────────────────────────────── */
#homeTitleText,
#homeScreen .home-title {
    display: block !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    padding: 4px 10px 2px !important;
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    color: #ffffff !important;
    letter-spacing: 0.2px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    text-shadow:
        0 2px 6px rgba(0,0,0,0.7),
        0 0 18px rgba(139,92,246,0.45) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important;
}
#homeTitleText .bm-title-yellow,
#homeScreen .home-title .bm-title-yellow {
    color: #FFD60A !important;
    text-shadow:
        0 2px 6px rgba(0,0,0,0.6),
        0 0 12px rgba(255,214,10,0.55) !important;
}
@media (max-width: 380px) {
    #homeTitleText, #homeScreen .home-title { font-size: 16px !important; padding: 4px 6px 2px !important; }
}
@media (max-width: 340px) {
    #homeTitleText, #homeScreen .home-title { font-size: 14px !important; letter-spacing: 0 !important; }
}

/* 로딩 화면 타이틀 — 두 줄(BLOCK / MONSTERS) 가운데 컴팩트 */
#loadingTitle.loading-title {
    font-size: 44px !important;
    font-weight: 900 !important;
    letter-spacing: -1px !important;
    line-height: 0.95 !important;
    padding: 6px 14px !important;
    text-align: center !important;
    white-space: normal !important;       /* 두 줄 표시 — <br> 사용 */
    max-width: 92vw !important;
    box-sizing: border-box !important;
    color: #ffffff !important;
    text-shadow:
        0 3px 0 rgba(0,0,0,0.4),
        0 5px 0 rgba(0,0,0,0.3),
        0 8px 18px rgba(255,214,10,0.3),
        0 0 28px rgba(139,92,246,0.5) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif !important;
}
#loadingTitle.loading-title .bm-title-yellow {
    display: inline-block;
}
@media (max-width: 380px) {
    #loadingTitle.loading-title { font-size: 38px !important; }
}
@media (max-width: 340px) {
    #loadingTitle.loading-title { font-size: 32px !important; }
}
#loadingTitle .bm-title-yellow {
    color: #FFD60A !important;
    text-shadow:
        0 2px 0 #b8800a,
        0 4px 0 #8a5e07,
        0 6px 0 #5d3f05,
        0 8px 16px rgba(0,0,0,0.4),
        0 0 30px rgba(255,214,10,0.5) !important;
}

/* ── 4) 상단 유틸 4개 카드 (상점 / 사격 / 등급 / 보상) ─────────────────────── */
#homeShopBtn.btn-shop,
#homeScreen .btn-gacha,
#homeGradeBtn.btn-rank,
#homeRewardsBtn.btn-badge {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    padding: 9px 4px !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 12px !important;
    box-shadow:
        0 3px 10px rgba(0,0,0,0.32),
        inset 0 -2px 0 rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.18) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    position: relative;
    overflow: visible;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 42px !important;
}
#homeShopBtn.btn-shop {
    background: linear-gradient(160deg, #fcd34d 0%, #f59e0b 60%, #d97706 100%) !important;
}
#homeScreen .btn-gacha {
    background: linear-gradient(160deg, #f472b6 0%, #db2777 60%, #be185d 100%) !important;
}
#homeGradeBtn.btn-rank {
    background: linear-gradient(160deg, #60a5fa 0%, #2563eb 60%, #1e40af 100%) !important;
}
#homeRewardsBtn.btn-badge {
    background: linear-gradient(160deg, #f9a8d4 0%, #ec4899 60%, #be185d 100%) !important;
    color: #fff !important;
}

/* 상단 4개 카드 — 아이콘 제거 (사용자 요청) */
#homeShopBtn.btn-shop::before,
#homeScreen .btn-gacha::before,
#homeGradeBtn.btn-rank::before,
#homeRewardsBtn.btn-badge::before {
    content: none !important;
    display: none !important;
}

/* 상단 4개 글자 — 강제 흰색 (specificity ID×2 로 원본 #homeScreen .btn-shop 의 #000 덮어쓰기) */
#homeScreen #homeShopBtn,
#homeScreen #homeShopBtn.btn-shop,
#homeScreen #homeRewardsBtn,
#homeScreen #homeRewardsBtn.btn-badge,
#homeScreen #homeGradeBtn,
#homeScreen #homeGradeBtn.btn-rank,
#homeScreen .btn-gacha,
#homeScreen #homeGachaText {
    color: #ffffff !important;
}

/* 가챠(사격) 빨간 알림 점 — 더 또렷하게 */
#gachaLowBadge {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 2px 4px rgba(0,0,0,0.4) !important;
    width: 14px !important;
    height: 14px !important;
    line-height: 14px !important;
    font-size: 9px !important;
}

/* 가챠 말풍선 — 얇게 (두께 줄임) */
#gachaLowBubble {
    padding: 3px 22px 3px 8px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25) !important;
    line-height: 1.2 !important;
}

/* ── 5) 모드 버튼 3개 (몬스터 / 무한 / STAGE) ───────────────────────────── */
#homeScreen .btn-survival,
#homeScreen .btn-endless,
#homeScreen button.home-btn:not(.btn-shop):not(.btn-gacha):not(.btn-rank):not(.btn-badge):not(.btn-survival):not(.btn-endless) {
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    padding: 10px 6px !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 14px !important;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.35),
        inset 0 -2px 0 rgba(0,0,0,0.22),
        inset 0 1px 0 rgba(255,255,255,0.22) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 56px !important;
    position: relative;
}
#homeScreen .btn-survival {
    background: linear-gradient(160deg, #a78bfa 0%, #7c3aed 60%, #5b21b6 100%) !important;
}
#homeScreen .btn-endless {
    background: linear-gradient(160deg, #34d399 0%, #059669 60%, #047857 100%) !important;
}
#homeScreen button.home-btn:not(.btn-shop):not(.btn-gacha):not(.btn-rank):not(.btn-badge):not(.btn-survival):not(.btn-endless) {
    background: linear-gradient(160deg, #fb923c 0%, #ea580c 60%, #c2410c 100%) !important;
}

/* 모드 버튼 아이콘 */
/* 모드 3개 카드 — 아이콘 제거 (사용자 요청) */
#homeScreen .btn-survival::before,
#homeScreen .btn-endless::before,
#homeScreen button.home-btn:not(.btn-shop):not(.btn-gacha):not(.btn-rank):not(.btn-badge):not(.btn-survival):not(.btn-endless)::before {
    content: none !important;
    display: none !important;
}

/* sub 라벨 (오늘 0/5, Best 0w, 진행 01) — 더 작고 흐리게 */
#monsterDailyLabel,
#endlessDailyLabel,
#stageModeLabel {
    font-size: 11px !important;
    font-weight: 600 !important;
    opacity: 0.85 !important;
    margin-top: 4px !important;
    letter-spacing: -0.2px !important;
}

/* ── 6) BGM 컨트롤 — 하단 메뉴와 붙게 (spacer 가 모든 잔여공간 흡수) ─── */
#homeScreen .home-spacer { flex: 1 1 auto !important; min-height: 0 !important; }
#homeScreen .home-title-area {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 2px !important;
    padding-top: 0 !important;
}
#homeBgmBtn {
    background: rgba(0,0,0,0.5) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1) !important;
    border-radius: 16px !important;
    font-size: 14px !important;
    padding: 10px 22px !important;
    min-width: 170px !important;
}
#homeBgmPrev, #homeBgmNext {
    background: rgba(0,0,0,0.5) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    border-radius: 14px !important;
    width: 42px;
    height: 42px;
    padding: 0 !important;
}
#homeBgmTitle {
    color: rgba(255,255,255,0.95) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    text-shadow: 0 2px 8px rgba(139,92,246,0.5) !important;
}

/* ── 6-B) 도움말 모달 — 헤더 + 4탭 컴팩트화 ────────────────────────────────
 *  4개 탭(전체/몬스터/무한/스테이지)이 작은 폰에서 밀리지 않게 강력한 축소
 * ────────────────────────────────────────────────────────────────────────── */
#helpModal .modal-content {
    padding: 14px 12px 12px !important;
    width: min(94vw, 440px) !important;
    max-width: min(94vw, 440px) !important;
}
#helpModal #helpModalTitle,
#helpModal h2 {
    font-size: 17px !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    text-align: center !important;
}
#helpTabs {
    margin-bottom: 8px !important;
    flex-shrink: 0 !important;
}
#helpTabs > div {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr 1fr !important;   /* 4 등분 — 강제 */
    gap: 3px !important;
    width: 100% !important;
}
#helpTabs button {
    padding: 6px 0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    border-radius: 7px !important;
    letter-spacing: -0.6px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex: 1 1 0 !important;
    text-align: center !important;
}

/* 380px 이하 — 더 작게 */
@media (max-width: 380px) {
    #helpTabs button {
        font-size: 10px !important;
        padding: 5px 0 !important;
        letter-spacing: -0.8px !important;
    }
    #helpTabs > div { gap: 2px !important; }
}

/* 340px 이하 — 극소형 폰 (iPhone 5/SE 1세대) */
@media (max-width: 340px) {
    #helpTabs button {
        font-size: 9px !important;
        padding: 4px 0 !important;
        letter-spacing: -1px !important;
    }
}

#helpModal #helpMsg {
    font-size: 13px !important;
    line-height: 1.55 !important;
}
#helpModal #helpTutorialBtn,
#helpModal #helpCloseBtn {
    padding: 9px 0 !important;
    font-size: 13px !important;
    border-radius: 10px !important;
}

/* ── 7) 하단 5개 카드 (RANK / HELP / MADE BY / TERMS / EN) ─────────────────
 *  레퍼런스 이미지 기준: 다크 보라 그라데이션 카드 + 컬러 SVG 아이콘 + 흰 라벨
 *  마크업의 이모지는 index.html 에서 제거됨. CSS ::before(아이콘) + ::after(라벨) 으로만 렌더링
 * ───────────────────────────────────────────────────────────────────────── */
#homeScreen .home-bottom {
    padding: 8px 16px 14px !important;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 14px)) !important;
}
#homeScreen .home-bottom > div {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}
#homeScreen .home-bottom-btn {
    background: rgba(42, 31, 94, 0.45) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow:
        0 2px 6px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.08) !important;
    padding: 4px 4px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
    min-height: 28px !important;
    height: 28px !important;
    text-align: center;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
}
/* 하단 카드 아이콘 — 제거 (사용자 요청, 글자만 표시) */
#homeRankingBtn::before,
#homeHelpBtn::before,
#homeCreditsBtn::before,
#homeTermsBtn::before,
#homeLangBtn::before {
    content: none !important;
    display: none !important;
}
/* ::after 라벨 제거 — JS 가 button 텍스트 자체를 언어에 맞게 채움 */

/* RANK — 트로피 노랑 */
#homeRankingBtn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fbbf24'><path d='M7 4v2h-3v3c0 2.21 1.79 4 4 4h.42c.36 1.4 1.46 2.5 2.84 2.91v2.09h-3v2h8v-2h-3v-2.09c1.38-.41 2.48-1.51 2.84-2.91h.42c2.21 0 4-1.79 4-4v-3h-3v-2h-10zm-1 4h2v2c0 .55-.45 1-1 1s-1-.45-1-1v-2zm14 0v2c0 .55-.45 1-1 1s-1-.45-1-1v-2h2z'/></svg>");
}
/* RANK 라벨 — JS 가 textContent 로 채움 */

/* HELP — 물음표 파란 */
#homeHelpBtn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2360a5fa'><path d='M12 2c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92c-.5.51-.87.93-1.07 1.61-.09.31-.15.66-.15 1.22h-2v-.5c0-.56.09-1.07.27-1.5.21-.5.55-.94.96-1.34l1.24-1.26c.4-.39.6-.95.49-1.55-.11-.61-.58-1.13-1.18-1.29-.96-.26-1.83.27-2.13 1.04-.11.3-.38.55-.74.55h-.3c-.49 0-.85-.49-.71-.96.27-.93.99-1.7 1.92-2.03 1.26-.46 2.64-.05 3.41 1.04.86 1.18.62 2.71-.55 3.66z'/></svg>");
}
/* HELP 라벨 — JS */

/* MADE BY — 사람 오렌지 */
#homeCreditsBtn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fb923c'><path d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>");
}
/* MADE BY 라벨 — JS */

/* TERMS — 문서 파란 */
#homeTermsBtn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2360a5fa'><path d='M14 2h-8c-1.1 0-1.99.9-1.99 2l-.01 16c0 1.1.89 2 1.99 2h12c1.1 0 2-.9 2-2v-12l-6-6zm2 16h-8v-2h8v2zm0-4h-8v-2h8v2zm-3-5v-5.5l5.5 5.5h-5.5z'/></svg>");
}
/* TERMS 라벨 — JS */

/* KR → EN / EN → KR 토글 — 화살표 포함, 짤리지 않게 nowrap */
#homeLangBtn {
    border-radius: 999px !important;
    background: linear-gradient(160deg, #2a1f5e 0%, #1f1647 100%) !important;
    flex-direction: row !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    letter-spacing: 0.2px !important;
}
#homeLangBtn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2360a5fa'><path d='M11.99 2c-5.52 0-9.99 4.48-9.99 10s4.47 10 9.99 10c5.53 0 10.01-4.48 10.01-10s-4.48-10-10.01-10zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zm-6.92-3.96c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zm-9.86 9.96c-.11-.64-.14-1.32-.14-2s.03-1.36.14-2h3.38c-.07.66-.12 1.32-.12 2 0 .68.05 1.34.12 2h-3.38zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8h-2.95c.96-1.66 2.49-2.93 4.33-3.56-.6 1.11-1.06 2.31-1.38 3.56zm5.09 11.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zm2.34-5.96h-4.68c-.08-.66-.14-1.32-.14-2 0-.68.06-1.35.14-2h4.68c.08.65.14 1.32.14 2 0 .68-.06 1.34-.14 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zm1.77-5.56c.07-.66.12-1.32.12-2 0-.68-.05-1.34-.12-2h3.38c.11.64.14 1.32.14 2s-.03 1.36-.14 2h-3.38z'/></svg>");
    width: 18px;
    height: 18px;
}
/* 언어 토글 버튼 글자 — JS 가 'KR → EN' / 'EN → KR' 채움 */
#homeLangBtn {
    font-size: 10.5px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* ── 8) 광고패스/관리자 라벨이 표시될 때도 자연스럽게 ─────────────────────── */
#homeAdPassLabel,
#homeAdminLabel {
    background: rgba(139,92,246,0.2) !important;
    border: 1px solid rgba(216,180,254,0.4) !important;
    border-radius: 999px !important;
    padding: 4px 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #e9d5ff !important;
}

/* ── 9) 안드로이드 가로 정렬 보정: 모드 버튼 카드 sub 라벨이 너무 빠지지 않게 ── */
#homeSurvivalLabel,
#homeEndlessLabel,
#homeStageLabel {
    line-height: 1.1 !important;
    font-size: 14px !important;
}
#homeSurvivalLabel > span,
#homeEndlessLabel > span,
#homeStageLabel > span {
    display: block;
    font-size: 10px !important;
    opacity: 0.85 !important;
    font-weight: 700 !important;
    margin-top: 1px;
}
#monsterDailyLabel,
#endlessDailyLabel,
#stageModeLabel {
    font-size: 10px !important;
    margin-top: 2px !important;
}

/* ── 10) 작은 화면 (380px 이하) — 디자인 비율 유지 ───────────────────────── */
@media (max-width: 380px) {
    #homeShopBtn.btn-shop,
    #homeScreen .btn-gacha,
    #homeGradeBtn.btn-rank,
    #homeRewardsBtn.btn-badge { min-height: 42px; padding: 9px 4px !important; font-size: 11px !important; }
    #homeScreen .btn-survival,
    #homeScreen .btn-endless,
    #homeScreen button.home-btn:not(.btn-shop):not(.btn-gacha):not(.btn-rank):not(.btn-badge):not(.btn-survival):not(.btn-endless) {
        min-height: 54px;
        padding: 10px 4px !important;
    }
    #homeSurvivalLabel,
    #homeEndlessLabel,
    #homeStageLabel { font-size: 12px !important; }
    #homeScreen .home-bottom-btn { font-size: 9.5px !important; min-height: 26px !important; height: 26px !important; padding: 3px 2px !important; letter-spacing: -0.4px !important; }
}
@media (max-width: 340px) {
    #homeScreen .home-bottom-btn { font-size: 9px !important; letter-spacing: -0.6px !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  홈 위계 v2 (2026-10) — 게임 모드 3개를 주역으로, 유틸/BGM 은 보조로
 *  · 이 파일이 마지막에 로드되므로 여기 값이 모든 폭에서 최종 적용됨
 *  · px 고정 대신 clamp(최소, vw, 최대) → 280px 폴드 ~ 태블릿까지 깨지지 않음
 * ════════════════════════════════════════════════════════════════════════════ */
/* 모드 3개 (몬스터 / 무한 / STAGE) — 크고 또렷하게
 * (선택자 특이도를 높여, bm-responsive 의 세로 900px+ 규칙 `#homeScreen button.home-btn` 21px 도 이김) */
#homeScreen button.home-btn.btn-survival,
#homeScreen button.home-btn.btn-endless,
#homeScreen button.home-btn:not(.btn-shop):not(.btn-gacha):not(.btn-rank):not(.btn-badge):not(.btn-survival):not(.btn-endless) {
    min-height: clamp(58px, 17.5vw, 104px) !important;
    padding: clamp(9px, 2.8vw, 18px) 4px !important;
    font-size: clamp(14px, 4.3vw, 24px) !important;
    letter-spacing: 0 !important;
    border-radius: 16px !important;
    border: 1.5px solid rgba(255,255,255,0.34) !important;
    box-shadow:
        0 6px 18px rgba(0,0,0,0.45),
        0 0 0 3px rgba(255,255,255,0.07),
        inset 0 -3px 0 rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.32) !important;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}
#homeScreen #homeSurvivalLabel,
#homeScreen #homeEndlessLabel,
#homeScreen #homeStageLabel {
    font-size: inherit !important;
}
#homeScreen #monsterDailyLabel,
#homeScreen #endlessDailyLabel,
#homeScreen #stageModeLabel {
    font-size: clamp(10px, 3vw, 15px) !important;
    opacity: 0.92 !important;
    margin-top: clamp(2px, 1vw, 6px) !important;
    white-space: nowrap;
}
/* 유틸 4개 (상점 / 사격 / 등급 / 보상) — 한 단계 작게 (보조) */
#homeScreen button#homeShopBtn.home-btn,
#homeScreen button.home-btn.btn-gacha,
#homeScreen button#homeGradeBtn.home-btn,
#homeScreen button#homeRewardsBtn.home-btn {
    min-height: clamp(36px, 10.2vw, 52px) !important;
    padding: clamp(5px, 1.6vw, 10px) 3px !important;
    font-size: clamp(11px, 3.1vw, 16px) !important;
    letter-spacing: 0 !important;
    border-radius: 11px !important;
    min-width: 0;
}
/* BGM 컨트롤 — 컴팩트 */
#homeBgmBtn {
    min-width: clamp(118px, 36vw, 200px) !important;
    padding: clamp(6px, 2vw, 11px) clamp(10px, 3.6vw, 22px) !important;
    font-size: clamp(12px, 3.3vw, 16px) !important;
    border-radius: 14px !important;
}
#homeBgmPrev, #homeBgmNext {
    width: clamp(34px, 9.6vw, 46px) !important;
    height: clamp(34px, 9.6vw, 46px) !important;
}
#homeBgmTitle {
    font-size: clamp(11.5px, 3.2vw, 16px) !important;
    margin-bottom: 2px !important;
}
/* 사격 말풍선 — 화면 밖으로 나가지 않게 */
#gachaLowBubble { max-width: 88vw; }
/* 세로가 짧은 폰 (≤600px) — 버튼 높이만 살짝 줄여 한 화면에 수납 */
@media (max-height: 600px) {
    #homeScreen button.home-btn.btn-survival,
    #homeScreen button.home-btn.btn-endless,
    #homeScreen button.home-btn:not(.btn-shop):not(.btn-gacha):not(.btn-rank):not(.btn-badge):not(.btn-survival):not(.btn-endless) {
        min-height: 50px !important;
        padding: 6px 4px !important;
    }
    #homeScreen button#homeShopBtn.home-btn,
    #homeScreen button.home-btn.btn-gacha,
    #homeScreen button#homeGradeBtn.home-btn,
    #homeScreen button#homeRewardsBtn.home-btn { min-height: 32px !important; padding: 4px 3px !important; }
    #homeBgmPrev, #homeBgmNext { width: 32px !important; height: 32px !important; }
    #homeBgmBtn { padding: 5px 10px !important; }
}

/* ── 결과 팝업 마스코트 (AI 생성 일러스트: 출석/클리어/게임오버) ─────────────── */
.bm-mascot {
    display: block;
    width: clamp(64px, 26vw, 120px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto 6px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45));
    animation: bmMascotBob 2.4s ease-in-out infinite;
    pointer-events: none;
    -webkit-user-drag: none;
}
#attendanceModal .att-icon { margin-bottom: 4px !important; line-height: 1; }
@keyframes bmMascotBob {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50%      { transform: translateY(-6px) rotate(1.5deg); }
}
/* 세로가 짧은 폰 — 팝업이 화면을 넘지 않도록 축소 / 선택적 마스코트는 숨김 */
@media (max-height: 680px) { .bm-mascot { width: clamp(52px, 18vw, 76px); margin-bottom: 2px; } }
@media (max-height: 600px) { .bm-mascot.bm-mascot-opt { display: none; } }
@media (prefers-reduced-motion: reduce) { .bm-mascot { animation: none; } }
