* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden !important;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
body::-webkit-scrollbar { display: none; }
body {
    font-family: 'Outfit', sans-serif;
    background-color: #1a1a2e;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
canvas {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

/* 우측 상단 스탯: 황금 깃털 · 받은 편지 (상단 랭킹 전광판 아래로) */
#user-stats-container {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 36px);
    right: 12px;
    z-index: 56;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    max-width: min(160px, calc(100vw - 24px));
    pointer-events: none;
}
/* 그리드: 아이콘 열 너비 축소 → 아이콘–숫자 밀착 */
#user-stats-container .stat-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    column-gap: 3px;
    padding: 6px 10px;
    box-sizing: border-box;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: 'Gowun Batang', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 252, 245, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
#user-stats-container .stat-item > img {
    justify-self: center;
    align-self: center;
}
#user-stats-container .stat-feather-icon {
    width: 18px;
    height: auto;
    max-height: 24px;
    display: block;
    object-fit: contain;
    opacity: 0.95;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
/* 받은 편지: 아이콘 열(28px) 안에 맞춤 */
#user-stats-container .stat-bottle-icon {
    width: auto;
    height: 20px;
    max-height: 24px;
    max-width: 28px;
    display: block;
    object-fit: contain;
    object-position: center center;
    opacity: 0.95;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}
#user-stats-container #feather-count,
#user-stats-container #received-letters-count {
    min-width: 2.25em;
    text-align: right;
    justify-self: end;
    font-variant-numeric: tabular-nums;
}
.stat-feather-item {
    pointer-events: auto !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-feather-item:active {
    transform: scale(0.94);
}
@keyframes feather-glow-hint {
    0%, 100% { box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
    50%      { box-shadow: 0 2px 12px rgba(0,0,0,0.15), 0 0 10px rgba(255,215,80,0.5); }
}
.stat-feather-item.has-feathers {
    animation: feather-glow-hint 2.5s ease-in-out infinite;
}

/* 새우깡 봉지 잔량 UI — 기본(상점 옆 콤팩트) / .shrimp-chips-compact */
.shrimp-chips-ui {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    transition: opacity 0.35s ease;
    user-select: none;
    -webkit-user-select: none;
}
.shrimp-chips-ui.shrimp-chips-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.shrimp-bags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    position: relative;
}
.shrimp-inv-slot {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    line-height: 0;
    transition: transform 0.25s ease, opacity 0.35s ease;
    cursor: pointer;
}
.shrimp-inv-slot.shrimp-inv-equipped {
    outline: 2px solid rgba(255, 210, 120, 0.95);
    outline-offset: 3px;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(255, 200, 80, 0.35);
}
.shrimp-inv-slot.shrimp-wpn-jumbo .shrimp-inv-img {
    transform: scale(2);
    transform-origin: center bottom;
}
.shrimp-inv-slot.shrimp-wpn-spicy .shrimp-inv-img {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)) drop-shadow(0 0 6px rgba(255, 90, 30, 0.45));
}
.shrimp-inv-slot.shrimp-wpn-black .shrimp-inv-img {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)) brightness(0.92);
}
.shrimp-inv-slot.shrimp-wpn-rice .shrimp-inv-img {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)) saturate(0.95);
}
.shrimp-inv-slot.shrimp-inv-pop-in {
    animation: shrimpBagPopIn 0.42s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.shrimp-inv-slot.shrimp-inv-depleted {
    filter: grayscale(0.85);
    opacity: 0.35;
    pointer-events: none;
}
.shrimp-inv-slot.shrimp-inv-vanishing {
    pointer-events: none;
    animation: shrimpSlotVanish 0.35s ease-out forwards;
}
@keyframes shrimpSlotVanish {
    to { opacity: 0; transform: scale(0.8); }
}
@keyframes shrimpBagPopIn {
    from { opacity: 0; transform: scale(0.72); }
    to   { opacity: 1; transform: scale(1); }
}
.shrimp-inv-img {
    display: block;
    width: 56px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}
.shrimp-inv-img-large {
    width: 68px;
    max-height: 88px;
}
.shrimp-inv-qty {
    position: absolute;
    right: -4px;
    bottom: -2px;
    min-width: 20px;
    padding: 1px 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
         0  0  4px rgba(0,0,0,0.6);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 6px;
    pointer-events: none;
    z-index: 2;
}
/* 펑 파티클 (JS에서 WAAPI로 이동 거리 지정) */
.shrimp-bag-poof-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    background: radial-gradient(circle at 30% 30%, #fffef5 0%, #ffe082 45%, #ff8f00 75%, transparent 78%);
    box-shadow: 0 0 6px rgba(255, 213, 120, 0.9);
}
.shrimp-current-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.85rem;
    color: rgba(255, 252, 245, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* 새우깡 알맹이 아이콘 (숫자 옆 작은 아이콘) */
.shrimp-chip-icon {
    display: inline-block;
    width: 10px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(135deg, #e8d4a8 0%, #c9a86c 50%, #b8955a 100%);
    box-shadow: inset 0 0 1px rgba(255,255,255,0.4), 0 1px 1px rgba(0,0,0,0.2);
    vertical-align: middle;
    flex-shrink: 0;
}
#shrimp-current-count {
    font-weight: 700;
}

/* 마지막 봉지 알림 토스트 */
.shrimp-last-bag-msg {
    position: fixed;
    left: 50%;
    top: 28%;
    transform: translateX(-50%);
    z-index: 55;
    padding: 12px 24px;
    background: rgba(40, 35, 30, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(220, 180, 120, 0.4);
    border-radius: 12px;
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
    color: #f5e6c8;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    animation: shrimpLastBagIn 0.4s ease-out;
    transition: opacity 0.4s ease;
}
.shrimp-last-bag-msg-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
@keyframes shrimpLastBagIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 새우깡 소진 팝업 */
.shrimp-out-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    padding: 20px;
    transition: opacity 0.3s ease;
}
.shrimp-out-popup-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.shrimp-out-popup-inner {
    max-width: 340px;
    width: 100%;
    padding: 28px 24px;
    background: linear-gradient(180deg, #2a2535 0%, #1e1a28 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
}
.shrimp-out-title {
    font-family: 'Gowun Batang', serif;
    font-size: 1.25rem;
    color: #f5e6c8;
    margin-bottom: 12px;
}
.shrimp-out-desc {
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 252, 245, 0.88);
    margin-bottom: 22px;
}
.shrimp-out-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.shrimp-out-btn {
    padding: 12px 20px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 252, 245, 0.95);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.shrimp-out-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}
.shrimp-out-btn-primary {
    background: linear-gradient(180deg, #c9a227 0%, #a67c00 100%);
    border-color: rgba(255, 220, 120, 0.4);
    color: #1a1a2e;
    font-weight: 700;
}
.shrimp-out-btn-primary:hover {
    background: linear-gradient(180deg, #d4b030 0%, #b38f00 100%);
}
.shrimp-refill-sub {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 2px;
    text-align: center;
}

/* 편의점(CU) 버튼 (퀵충전은 body 고정 #quick-buy-btn) */
.shop-btns-row {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* 퀵 구매 버튼 */
.quick-buy-fab {
    min-width: 48px;
    min-height: 44px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 2px solid rgba(0, 100, 180, 0.45);
    background: linear-gradient(165deg, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%);
    color: #fff;
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    box-shadow:
        0 3px 0 rgba(0, 60, 120, 0.35),
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
    transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1), filter 0.2s ease;
}
.quick-buy-fab:active {
    transform: scale(0.95);
}
.quick-buy-fab.shrimp-shop-open-btn-hidden {
    display: none !important;
}
.quick-buy-fab.quick-buy-pulse {
    animation: quickBuyPulse 1.2s ease-in-out infinite;
    border-color: rgba(255, 80, 60, 0.7);
    background: linear-gradient(165deg, #f97316 0%, #ef4444 45%, #dc2626 100%);
    box-shadow:
        0 3px 0 rgba(120, 20, 10, 0.4),
        0 6px 18px rgba(239, 68, 68, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
}
@keyframes quickBuyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
.quick-buy-inner {
    white-space: nowrap;
}

/* 퀵충전 — 가방 위 고정 (크기·모서리 가방 버튼과 동일 계열) */
.quick-buy-fab.quick-buy-floating {
    position: fixed;
    z-index: 201;
    left: 6px;
    bottom: 242px;
    width: 68px;
    height: 68px;
    min-width: 0;
    min-height: 0;
    padding: 4px 5px;
    border-radius: 16px;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.12;
    font-size: 0.58rem;
    pointer-events: auto;
}
.quick-buy-fab.quick-buy-floating .quick-buy-inner {
    white-space: normal;
    display: block;
}

/* CU 편의점 버튼 */
.cu-store-btn {
    position: relative;
    z-index: 52;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, filter 0.15s ease;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}
.cu-store-btn:hover, .cu-store-btn:focus-visible {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
    outline: none;
}
.cu-store-btn:active {
    transform: scale(0.95);
}
.cu-store-btn.shop-fab-nudge {
    animation: cu-btn-bounce 1s ease-in-out infinite;
}
@keyframes cu-btn-bounce {
    0%, 35%, 62%, 100% { transform: translateY(0); }
    22% { transform: translateY(-6px); }
    48% { transform: translateY(-3px); }
}
.cu-store-btn-img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 12px;
}
.shop-fab-label {
    font-family: 'Gowun Batang', 'Apple SD Gothic Neo', sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 2px 4px rgba(0, 0, 0, 0.45);
    user-select: none;
    -webkit-user-select: none;
}
.shrimp-shop-open-btn-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
/* 상점 FAB + 좌측 가이드(말풍선 → 화살표 → 상점) */
.shop-fab-wrap {
    position: relative;
    align-self: flex-end;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
    pointer-events: none;
}
.shop-fab-wrap .shrimp-shop-open-btn {
    pointer-events: auto;
}
/* 새우깡 0개일 때 상점 왼쪽 안내 */
.shop-hint-arrow {
    width: auto;
    max-width: min(52vw, 200px);
    pointer-events: none;
    margin: 0 2px 0 0;
    opacity: 0;
    flex-shrink: 1;
    min-width: 0;
}
.shop-hint-arrow.shop-hint-arrow-visible {
    display: flex;
    flex-direction: row;
    align-items: center;
    animation: shop-hint-fade-in 0.5s ease-out forwards;
}
.shop-hint-arrow-hidden {
    display: none !important;
    opacity: 0 !important;
    animation: none !important;
}
@keyframes shop-hint-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.shop-hint-arrow-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}
/* 상점 방향으로 까딱 (오른쪽으로 시선 유도) */
.shop-hint-arrow-inner.point-right {
    animation: shop-hint-point-right 0.95s ease-in-out infinite;
}
@keyframes shop-hint-point-right {
    0%,
    100% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(0);
    }
}
.shop-fab-wrap:hover .shop-hint-arrow-inner.point-right {
    animation-play-state: paused;
}
.shop-hint-tooltip {
    position: relative;
    background: linear-gradient(165deg, #ffd700 0%, #ffb020 48%, #ff8c28 100%);
    border: 2px solid rgba(120, 70, 0, 0.55);
    border-radius: 11px;
    padding: 5px 9px 6px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    max-width: 130px;
    filter: drop-shadow(0 0 6px rgba(255, 190, 60, 0.35));
}
/* 꼬리: 오른쪽(상점 쪽)으로 */
.shop-hint-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 8px;
    border-color: transparent transparent transparent rgba(120, 70, 0, 0.65);
    z-index: 0;
}
.shop-hint-tooltip::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 6px;
    border-color: transparent transparent transparent #ffb020;
    z-index: 1;
}
.shop-hint-tooltip-text {
    position: relative;
    z-index: 2;
    font-family: 'Gowun Batang', 'Apple SD Gothic Neo', sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.85),
        0 -1px 0 rgba(0, 0, 0, 0.35),
        1px 1px 2px rgba(0, 0, 0, 0.5);
}
.shop-hint-arrow-gold {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -2px;
}
.shop-hint-arrow-icon {
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
/* 편의점 버튼: 통합 컬럼 안에서 상대 배치 */
.player-growth-panel .shop-shrimp-column .cu-store-btn {
    position: relative;
    flex-shrink: 0;
    z-index: 1;
}
.player-growth-panel .cu-store-btn {
    position: relative;
}

/* 스토어 구매 직후 인벤토리 봉지 반짝임 */
@keyframes shrimpBagSparkle {
    0% {
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)) brightness(1);
        transform: scale(1);
    }
    25% {
        filter: drop-shadow(0 0 10px rgba(255, 230, 150, 0.95)) brightness(1.25);
        transform: scale(1.08);
    }
    50% {
        filter: drop-shadow(0 0 14px rgba(255, 255, 200, 0.9)) brightness(1.15);
        transform: scale(1.04);
    }
    75% {
        filter: drop-shadow(0 0 8px rgba(255, 210, 120, 0.75)) brightness(1.1);
        transform: scale(1.06);
    }
    100% {
        filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)) brightness(1);
        transform: scale(1);
    }
}
.shrimp-bags-row.shrimp-bags-sparkle .shrimp-inv-slot:not(.shrimp-inv-depleted) .shrimp-inv-img {
    animation: shrimpBagSparkle 0.85s ease-in-out;
}

/* 새우깡 스토어 오버레이 — .shop-popup 세련된 글래스 */
.shop-overlay {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.shop-popup .shop-popup-backdrop,
.shop-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 10, 22, 0.48);
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    transition: opacity 0.3s ease, background 0.3s ease;
}
.shop-popup:not(.shop-overlay-hidden):not(.shop-popup-closing) .shop-popup-backdrop {
    animation: shopBackdropIn 0.32s ease-out forwards;
}
@keyframes shopBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.shop-popup.shop-popup-closing .shop-popup-backdrop {
    opacity: 0;
}
.shop-overlay-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.shop-popup-panel,
.shop-overlay-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: min(94vh, 860px);
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: 24px 20px 20px;
    border-radius: 20px;
    background: linear-gradient(155deg, #1a1a2e 0%, #16132a 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform-origin: 50% 40%;
}
.shop-popup-panel::-webkit-scrollbar,
.shop-overlay-panel::-webkit-scrollbar {
    display: none;
}
.shop-popup:not(.shop-overlay-hidden):not(.shop-popup-closing) .shop-popup-panel {
    animation: shopPanelIn 0.36s cubic-bezier(0.34, 1.15, 0.48, 1) forwards;
}
@keyframes shopPanelIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.shop-popup.shop-popup-closing .shop-popup-panel {
    animation: shopPanelOut 0.28s ease-in forwards;
}
@keyframes shopPanelOut {
    to {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
}
.shop-popup.shop-popup-closing {
    pointer-events: none;
}
/* 래퍼: 패널+닫기 버튼을 함께 감싸 위치 기준 */
.shop-panel-outer {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}
/* 플로팅 상점 닫기 버튼 (우상단 고정) */
.shop-floating-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.shop-floating-close-btn:hover {
    background: rgba(255, 60, 60, 0.7);
    border-color: rgba(255, 100, 100, 0.5);
}
.shop-floating-close-btn:active {
    transform: scale(0.88);
}
/* ═══════════════════════════════════════════
   편의점 V2 리뉴얼 레이아웃
   ═══════════════════════════════════════════ */

/* 외부 래퍼: PC에서 넓게 */
.shop-v2 {
    max-width: 92vw !important;
    width: 100%;
}
.shop-v2 .shop-overlay-panel {
    max-width: 100% !important;
    width: 100%;
}

/* V2 헤더 블록 */
.shop-v2-header {
    position: relative;
    margin: -24px -20px 0 -20px;
    width: calc(100% + 40px);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

/* 편의점 지붕 이미지 */
.shop-roof-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, #1a1a2e 0%, #16132a 100%);
    padding: 0;
}
.shop-roof-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
}
.shop-title {
    display: none;
}

/* V2 정보 바: 하트 잔액 + 설명 */
.shop-v2-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.shop-v2-balance {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ff6b6b;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.shop-v2-balance .heart-count-num {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.shop-v2-balance .heart-count-num.scale-up {
    transform: scale(1.35);
}
.shop-v2-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.shop-v2-desc:hover {
    color: rgba(255,255,255,0.7);
}
.shop-v2-desc:active {
    color: #ff6b6b;
}

/* V2 탭: 비활성 (탭 제거됨) */
.shop-v2-tabs {
    display: none !important;
}

/* 섹션 구분선 */
.shop-section-divider {
    grid-column: 1 / -1;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255,255,255,0.8);
    padding: 10px 4px 6px;
    margin-top: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.5px;
}
.shop-v2-tabs .shop-tab {
    flex: 1;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 11px 0;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.4);
    transition: all 0.2s;
    box-shadow: none;
}
.shop-v2-tabs .shop-tab:hover:not(.shop-tab-active) {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
}
.shop-v2-tabs .shop-tab.shop-tab-active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(102,126,234,0.4) !important;
}

/* V2 상품 그리드: auto-fill 반응형 */
.shop-v2 .shop-products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 4px 0;
    width: 100%;
}
.shop-v2 .shop-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px 12px;
    border-radius: 14px;
    background: #1e1b2e;
    border: none;
    transition: transform 0.15s, box-shadow 0.2s;
    position: relative;
    text-align: center;
}
.shop-v2 .shop-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.shop-v2 .shop-product-card:active {
    transform: scale(0.97);
}

/* V2 카드 내부 요소 */
.shop-v2 .shop-product-thumb {
    width: 72px; height: 72px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 0;
    background: none;
    padding: 0;
    display: block;
}
.shop-v2 .shop-product-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin: 4px 0;
    line-height: 1.2;
}
.shop-v2 .shop-product-detail {
    font-size: 0.72rem;
    color: #aaa;
    margin: 2px 0 6px;
    line-height: 1.3;
}
.shop-v2 .shop-product-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ff6b6b;
    margin: 0 0 8px;
}
.shop-v2 .shop-buy-btn {
    width: 100%;
    padding: 7px 0;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    transition: transform 0.12s, opacity 0.2s;
}
.shop-v2 .shop-buy-btn:hover:not(:disabled) { opacity: 0.9; }
.shop-v2 .shop-buy-btn:active:not(:disabled) { transform: scale(0.95); }
.shop-v2 .shop-buy-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* V2 배지들 */
.shop-v2 .shop-buff-badge {
    position: absolute;
    top: 6px; left: 6px;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(102,126,234,0.35);
    color: #c8d6ff;
    font-weight: 700;
    z-index: 2;
}
.shop-v2 .shop-age-badge {
    position: absolute;
    top: 6px; right: 6px;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 6px;
    background: rgba(255,50,50,0.35);
    color: #faa;
    font-weight: 700;
    z-index: 2;
}
.shop-v2 .shop-badge {
    position: absolute;
    top: 6px; right: 6px;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 6px;
}

/* V2 재고 배지 (숨김) */
.shop-v2 .shop-stock-badge { display: none !important; }

/* V2 우산 아이콘 */
.shop-v2 .shop-umbrella-icon {
    font-size: 36px;
    margin-bottom: 4px;
}

/* V2 19세 구분선 */
.shop-v2 .shop-age-divider {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255,100,100,0.7);
    padding: 6px 0;
    border-top: 1px solid rgba(255,100,100,0.15);
    margin-top: 4px;
}

/* V2 오리지널 새우깡 수량 조절 */
.shop-v2 .shop-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}
.shop-v2 .shop-qty-btn {
    width: 26px; height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.shop-v2 .shop-product-total-line {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin: 2px 0 4px;
}
.shop-v2 .shop-product-unit-price {
    font-size: 0.7rem;
}
.shop-v2 .shop-lock-hint {
    font-size: 0.65rem;
    color: rgba(255,180,80,0.8);
    margin-top: 4px;
}
.shop-v2 .shop-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.shop-v2 .shop-product-card:not(.shop-product-locked) .shop-lock-overlay { display: none; }

/* V2 장바구니 바: 하단 고정 */
.shop-v2 .cart-bar {
    border-radius: 0 0 20px 20px;
    margin: 0 -20px -20px -20px;
    padding: 10px 18px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* V2 피드백 */
.shop-v2 .shop-feedback {
    font-size: 0.78rem;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 6px 0;
}

/* V2 오늘의 행사 배너 */
.shop-v2 .daily-deal-banner {
    grid-column: 1 / -1;
}

/* V2 복권 카드 */
.shop-v2 .shop-lottery-thumb {
    font-size: 40px;
    padding: 4px 0;
}

/* ── PC 와이드 스크린 (768px+) ── */
@media (min-width: 768px) {
    .shop-v2 {
        max-width: 90vw !important;
        width: 90vw;
    }
    .shop-v2 .shop-overlay-panel {
        max-height: 85vh;
        max-width: 100%;
    }
    .shop-v2 .shop-products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .shop-v2 .shop-product-thumb {
        width: 84px; height: 84px;
    }
    .shop-v2 .shop-product-name {
        font-size: 0.88rem;
    }
    .shop-v2 .shop-product-detail {
        font-size: 0.72rem;
    }
    .shop-roof-img {
        width: 100%;
    }
    .shop-v2-header {
        margin: -24px -20px 0 -20px;
        width: calc(100% + 40px);
    }
}

/* ── 큰 PC (1024px+) ── */
@media (min-width: 1024px) {
    .shop-v2 {
        max-width: 1100px !important;
        width: 85vw;
    }
    .shop-v2 .shop-overlay-panel {
        max-height: 82vh;
        padding: 24px 28px 20px;
    }
    .shop-v2 .shop-products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .shop-roof-img {
        width: 100%;
    }
    .shop-v2-info-bar {
        padding: 10px 28px;
    }
}

/* ── 와이드 PC (1200px+) ── */
@media (min-width: 1200px) {
    .shop-v2 {
        max-width: 1200px !important;
        width: 88vw;
    }
    .shop-v2 .shop-products {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 14px;
    }
}

/* ── 초대형 PC (1400px+) ── */
@media (min-width: 1400px) {
    .shop-v2 {
        max-width: 1300px !important;
    }
    .shop-v2 .shop-products {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
}

.shop-desc {
    display: none;
}
.shop-balance {
    display: none;
}
/* 상점 탭 */
.shop-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.shop-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.shop-tab-active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    box-shadow: inset 0 -2px 0 #f5c542;
}
.shop-tab:not(.shop-tab-active):active {
    background: rgba(255,255,255,0.08);
}
.shop-tab-panel-hidden { display: none !important; }
.shop-title-logo {
    width: 28px; height: 28px;
    object-fit: contain;
    border-radius: 4px;
}
/* 인기상품 카드 - 강제 가시성 */
#shrimp-shop-overlay .shop-product-card[data-popular-item] {
    background: #1e1b2e !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}
#shrimp-shop-overlay .shop-product-card[data-popular-item] .shop-product-thumb {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 72px !important;
    height: 72px !important;
    object-fit: contain !important;
    margin-bottom: 8px !important;
    background: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
#shrimp-shop-overlay .shop-product-card[data-popular-item] .shop-product-name {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    margin: 4px 0 !important;
}
#shrimp-shop-overlay .shop-product-card[data-popular-item] .shop-product-detail {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #cccccc !important;
    font-size: 0.72rem !important;
    margin: 2px 0 6px !important;
    line-height: 1.3 !important;
}
#shrimp-shop-overlay .shop-product-card[data-popular-item] .shop-product-price {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ff6b6b !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
}
/* 버프 아이템 강조 */
.shop-buff-item {
    border-color: #2a2740;
    background: #1e1b2e;
}
.shop-buff-badge {
    position: absolute;
    top: 6px; right: 6px;
    background: linear-gradient(135deg, #0088ff, #00c8ff);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    z-index: 3;
    line-height: 1.3;
}
/* 편의점 전광판 (뉴스 티커) */
.store-ticker {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 28px;
    background: linear-gradient(90deg, rgba(10,10,30,0.92), rgba(20,20,50,0.92));
    border-bottom: 1px solid rgba(255,80,80,0.3);
    z-index: 310;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.store-ticker-icon {
    flex-shrink: 0;
    padding: 0 8px;
    font-size: 13px;
    background: rgba(255,50,50,0.25);
    height: 100%;
    display: flex;
    align-items: center;
}
.store-ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}
.store-ticker-text {
    display: inline-block;
    white-space: nowrap;
    color: #ffdd44;
    font-size: 11px;
    font-weight: 700;
    line-height: 28px;
    padding-left: 100%;
    animation: ticker-scroll 18s linear infinite;
}
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
/* 날씨 HUD */
.weather-hud {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 44px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 305;
    background: rgba(10,20,40,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}
.weather-hud span:first-child { font-size: 16px; }
.weather-hud span:last-child { font-size: 10px; color: rgba(255,255,255,0.7); font-weight: 600; }
/* 비 오버레이 */
/* ── 소나기 Canvas 오버레이 (JS에서 동적 생성, CSS에서 추가 스타일 없음) ── */

/* 기상청 소나기 예보 트리거 팝업 강화 */
.trigger-popup.rain-alert {
    background: linear-gradient(135deg, #1a3a6b 0%, #0d2247 100%);
    border: 2px solid #4a9eff;
    color: #e8f4ff;
    box-shadow: 0 6px 32px rgba(30,100,255,0.35), 0 0 0 4px rgba(74,158,255,0.15);
    animation: rainAlertPopIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}
.trigger-popup.rain-alert::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(100,170,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
@keyframes rainAlertPopIn {
    0%  { transform: translateX(-50%) scale(0.7) translateY(-10px); opacity: 0; }
    70% { transform: translateX(-50%) scale(1.04) translateY(0); opacity: 1; }
    100%{ transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}
/* 상점 재고 배지 */
.shop-stock-badge,
.shop-stock-ok,
.shop-stock-low,
.shop-stock-out { display: none !important; }
@keyframes stock-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.shop-product-card.shop-sold-out { opacity: 1; pointer-events: auto; }
.flash-sale-badge {
    position: absolute;
    bottom: 6px; right: 6px;
    background: linear-gradient(135deg, #ff3050, #ff8800);
    color: #fff;
    font-size: 9px; font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 3;
    animation: stock-pulse 1s ease-in-out infinite;
}
.shop-restock-eta {
    font-size: 8px;
    color: rgba(255,255,255,0.4);
    text-align: center;
    margin-top: 2px;
}
/* 구매 제한 표시 (숨김) */
.shop-limit-badge { display: none !important; }
/* 버프 HUD */
.buff-hud {
    position: fixed;
    top: 48px; left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    gap: 6px;
    pointer-events: none;
}
.buff-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: buff-tag-pulse 1.5s ease-in-out infinite;
}
.buff-bacchus { background: rgba(255, 160, 0, 0.7); }
.buff-coffee { background: rgba(120, 70, 20, 0.75); }
.buff-water { background: rgba(0, 120, 220, 0.7); }
.buff-cider { background: rgba(0, 180, 80, 0.7); }
.buff-rice { background: rgba(200, 160, 40, 0.75); }
.buff-ramen { background: rgba(220, 50, 30, 0.7); }
.buff-bread { background: rgba(220, 170, 100, 0.7); }
.buff-gimbab { background: rgba(180, 100, 40, 0.75); }
.buff-cupramen { background: rgba(220, 120, 20, 0.75); }
.buff-soju { background: rgba(60, 180, 120, 0.7); }
.buff-beer { background: rgba(200, 150, 20, 0.7); }
.buff-cig { background: rgba(120, 120, 120, 0.7); }
@keyframes buff-tag-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
/* 오늘의 행사 배너 */
.daily-deal-banner {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(255, 50, 80, 0.15), rgba(255, 160, 0, 0.12));
    border: 1.5px solid rgba(255, 80, 80, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}
.daily-deal-banner::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255,255,255,0.04) 25%, transparent 50%);
    animation: deal-shine 4s linear infinite;
}
@keyframes deal-shine {
    to { transform: rotate(360deg); }
}
.daily-deal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}
.daily-deal-tag {
    background: linear-gradient(135deg, #ff3050, #ff6030);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
    animation: deal-tag-bounce 2s ease-in-out infinite;
}
@keyframes deal-tag-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
.daily-deal-timer {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    font-weight: 600;
}
.daily-deal-body {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}
.daily-deal-card {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 8px 10px;
}
.daily-deal-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.daily-deal-info {
    flex: 1;
    min-width: 0;
}
.daily-deal-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
}
.daily-deal-promo {
    font-size: 11px;
    font-weight: 800;
    color: #ffcc00;
    margin: 0 0 2px;
}
.daily-deal-desc {
    font-size: 9px;
    color: rgba(255,255,255,0.5);
    margin: 0;
}
.daily-deal-buy-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, #ff3050, #ff6030);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
}
.daily-deal-buy-btn:active { transform: scale(0.95); }
.daily-deal-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.daily-deal-promo-badge {
    display: inline-block;
    background: #ff3050;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
    animation: deal-tag-bounce 2s ease-in-out infinite;
}
/* 행사 적용 상품 카드 하이라이트 */
.shop-product-card.daily-deal-active {
    border-color: rgba(255, 80, 80, 0.4) !important;
    box-shadow: 0 0 12px rgba(255, 50, 80, 0.2);
}

/* 19세 구분선 */
.shop-age-divider {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #ff6b6b;
    padding: 8px 0 4px;
    border-top: 1px dashed rgba(255,100,100,0.3);
    margin-top: 4px;
}
.shop-age-restricted {
    border-color: #2a2740;
    background: #1e1b2e;
}
.shop-age-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: #e03030;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    z-index: 3;
    line-height: 1.3;
}
.shop-products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    justify-content: center;
}
.shop-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border-radius: 14px;
    background: #1e1b2e;
    border: none;
}
.shop-product-card-umbrella {
    border-color: #2a2740;
    background: #1e1b2e;
}
.shop-umbrella-icon {
    display: block;
    text-align: center;
    font-size: 40px;
    margin: 4px 0 6px;
    line-height: 1.1;
}
.shop-umbrella-icon-bundle {
    font-size: 28px;
    letter-spacing: -2px;
}
.shop-umbrella-stock {
    font-size: 11px;
    color: rgba(160, 200, 255, 0.7);
    text-align: center;
    margin-top: 6px;
}
.shop-buy-umbrella-btn {
    background: linear-gradient(135deg, #1a6dd4, #3b8ef0) !important;
}
.shop-buy-umbrella-btn:active {
    background: linear-gradient(135deg, #155cb8, #2d7ae0) !important;
}
.shop-lock-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 4;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.58);
    pointer-events: none;
}
.shop-product-locked .shop-lock-overlay {
    display: flex;
}
.shop-lock-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.shop-lock-hint {
    margin: 6px 0 0;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: transparent;
    min-height: 0;
}
.shop-lock-hint.shop-lock-hint-visible {
    color: #e53935;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.shop-product-sale {
    border-color: rgba(200, 170, 90, 0.35);
}
.shop-product-featured {
    border-color: rgba(255, 140, 90, 0.45);
    background: linear-gradient(135deg, rgba(90, 50, 40, 0.35) 0%, rgba(40, 35, 55, 0.5) 100%);
}
.shop-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(200, 170, 90, 0.35);
    color: #fff5d6;
}
.shop-badge-hot {
    background: rgba(220, 100, 70, 0.45);
    color: #ffe8e0;
}
.shop-product-thumb {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}
.shop-product-thumb-large {
    width: 72px;
    height: 100px;
}
.shop-product-name {
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
    color: #f0e4d4;
    margin: 0 0 4px;
    text-align: center;
}
.shop-product-detail {
    font-family: 'Gowun Batang', serif;
    font-size: 0.82rem;
    color: #bbb;
    margin: 0 0 4px;
    text-align: center;
}
.shop-product-price {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffd27a;
    margin: 0 0 10px;
    text-align: center;
}
.shop-product-unit-price {
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: rgba(255, 210, 150, 0.95);
}
/* 오리지널: 수량 조절 (최대 3봉지) */
.shop-qty-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 8px;
}
.shop-qty-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.18) 0%, rgba(80, 90, 120, 0.45) 100%);
    color: #fff8ef;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.12s ease,
        box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.shop-qty-btn:hover:not(:disabled):not(.shop-qty-btn-disabled) {
    background: linear-gradient(160deg, rgba(255, 220, 160, 0.35) 0%, rgba(120, 100, 160, 0.55) 100%);
    border-color: rgba(255, 210, 120, 0.75);
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 3px 12px rgba(255, 200, 100, 0.25);
}
.shop-qty-btn:active:not(:disabled):not(.shop-qty-btn-disabled) {
    transform: scale(0.96);
}
.shop-qty-btn:disabled,
.shop-qty-btn.shop-qty-btn-disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.45);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(40, 45, 60, 0.55);
    color: rgba(200, 200, 210, 0.55);
    box-shadow: none;
}
.shop-qty-value {
    min-width: 28px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.shop-product-total-line {
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffe0a8;
    text-align: center;
    margin: 0 0 8px;
}
.shop-product-total-line strong {
    font-weight: 800;
    color: #ffd27a;
}
.shop-buy-btn-original {
    font-size: 0.82rem;
    line-height: 1.35;
    padding: 10px 10px;
}
.shop-buy-btn {
    width: 100%;
    margin-top: auto;
    padding: 11px 16px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff8ef;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.shop-buy-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}
.shop-buy-btn-primary {
    border-color: rgba(200, 170, 90, 0.5);
    background: linear-gradient(180deg, rgba(200, 170, 90, 0.35) 0%, rgba(140, 110, 50, 0.4) 100%);
}
.shop-buy-btn-bulk {
    border-color: rgba(255, 130, 90, 0.55);
    background: linear-gradient(180deg, rgba(200, 90, 70, 0.45) 0%, rgba(120, 50, 60, 0.5) 100%);
}
.shop-buy-btn:disabled,
.shop-buy-btn.shop-buy-btn-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.25);
}
.shop-buy-btn:disabled:hover,
.shop-buy-btn.shop-buy-btn-disabled:hover {
    background: rgba(255, 255, 255, 0.1);
}
.shop-buy-btn-primary:disabled,
.shop-buy-btn-primary.shop-buy-btn-disabled:hover {
    background: linear-gradient(180deg, rgba(200, 170, 90, 0.22) 0%, rgba(140, 110, 50, 0.25) 100%);
}
.shop-buy-btn-bulk:disabled,
.shop-buy-btn-bulk.shop-buy-btn-disabled:hover {
    background: linear-gradient(180deg, rgba(200, 90, 70, 0.25) 0%, rgba(120, 50, 60, 0.28) 100%);
}
.shop-feedback {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: center;
    transition: opacity 0.25s ease;
}
.shop-feedback-hidden {
    display: none;
}
.shop-feedback-error {
    background: rgba(120, 40, 50, 0.45);
    border: 1px solid rgba(255, 150, 150, 0.35);
    color: #ffd4d4;
}
.shop-feedback-success {
    background: rgba(50, 100, 70, 0.45);
    border: 1px solid rgba(150, 220, 170, 0.35);
    color: #d8ffe8;
}

/* ── 장바구니 바 ── */
.cart-bar {
    position: sticky;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(180deg, rgba(10,20,50,0.95), rgba(5,10,30,0.98));
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.cart-bar-hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }
.cart-bar-left { display: flex; align-items: center; gap: 8px; }
.cart-bar-icon { font-size: 20px; transition: transform 0.3s; }
.cart-bar-icon.cart-bounce { animation: cart-icon-bounce 0.4s ease; }
@keyframes cart-icon-bounce {
    0% { transform: scale(1) translateY(0); }
    40% { transform: scale(1.3) translateY(-8px); }
    70% { transform: scale(0.95) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
}
.cart-bar-count {
    background: #ff3050;
    color: #fff;
    font-size: 11px; font-weight: 800;
    min-width: 20px; height: 20px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
}
.cart-bar-total { color: #ffdd44; font-size: 13px; font-weight: 700; }
.cart-bar-checkout-btn {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #fff; border: none; border-radius: 10px;
    padding: 8px 18px; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: transform 0.15s;
}
.cart-bar-checkout-btn:active { transform: scale(0.95); }

/* ── 장바구니 상세 오버레이 ── */
.cart-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2100;
    display: flex; align-items: flex-end; justify-content: center;
    transition: opacity 0.3s;
}
.cart-overlay-hidden { opacity: 0; pointer-events: none; }
.cart-panel {
    background: linear-gradient(180deg, #1a2040, #0d1225);
    border-radius: 20px 20px 0 0;
    width: 100%; max-width: 420px;
    max-height: 80vh; overflow-y: auto;
    padding: 20px 16px 24px;
    position: relative;
}
.cart-close-btn {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; color: rgba(255,255,255,0.5);
    font-size: 20px; cursor: pointer;
}
.cart-title { text-align: center; color: #fff; font-size: 16px; margin: 0 0 12px; }
.cart-alert {
    background: rgba(255,80,80,0.15);
    border: 1px solid rgba(255,80,80,0.3);
    border-radius: 8px; padding: 8px 10px;
    color: #faa; font-size: 11px; font-weight: 600;
    margin-bottom: 10px;
}
.cart-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cart-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px; padding: 8px 10px;
}
.cart-item-thumb { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.cart-item-icon { font-size: 28px; flex-shrink: 0; width: 36px; text-align: center; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 12px; font-weight: 700; color: #fff; margin: 0 0 2px; }
.cart-item-price { font-size: 10px; color: rgba(255,255,255,0.5); margin: 0; }
.cart-item-qty {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.cart-item-qty button {
    width: 24px; height: 24px; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff; font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cart-item-qty span { font-size: 13px; color: #fff; font-weight: 700; min-width: 16px; text-align: center; }
.cart-item-remove {
    background: none; border: none; color: rgba(255,100,100,0.6);
    font-size: 16px; cursor: pointer; flex-shrink: 0; padding: 2px;
}
.cart-summary { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; margin-bottom: 12px; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.cart-summary-total { font-size: 14px; font-weight: 800; color: #ffdd44; }
.cart-summary-balance { color: rgba(255,255,255,0.4); font-size: 11px; }
.cart-discount-row span:last-child { color: #4f4; }
.cart-pay-btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #fff; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 800;
    cursor: pointer; transition: transform 0.15s;
}
.cart-pay-btn:active { transform: scale(0.97); }
.cart-pay-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 성인 인증 퀴즈 ── */
.age-quiz-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2150;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.3s;
}
.age-quiz-hidden { opacity: 0; pointer-events: none; }
.age-quiz-panel {
    background: linear-gradient(180deg, #1e2850, #121830);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    width: 92%; max-width: 360px;
    padding: 20px 16px 24px;
    animation: receipt-slide-up 0.35s ease;
}
.age-quiz-clerk {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 16px;
}
.age-quiz-clerk-avatar {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #2a3a6a, #3a4a8a);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
}
.age-quiz-clerk-bubble {
    background: rgba(255,255,255,0.08);
    border-radius: 12px 12px 12px 2px;
    padding: 10px 14px;
    font-size: 13px; font-weight: 600;
    color: #fff;
    line-height: 1.5;
    flex: 1;
}
.age-quiz-question {
    font-size: 13px; font-weight: 700;
    color: #ffdd44;
    margin-bottom: 12px;
    line-height: 1.5;
}
.age-quiz-options { display: flex; flex-direction: column; gap: 8px; }
.age-quiz-option-btn {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: left;
    color: #ddd; font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.age-quiz-option-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.age-quiz-option-btn.quiz-correct {
    background: rgba(0,200,80,0.2) !important;
    border-color: rgba(0,220,80,0.5) !important;
    color: #8f8 !important;
}
.age-quiz-option-btn.quiz-wrong {
    background: rgba(255,50,50,0.2) !important;
    border-color: rgba(255,50,50,0.4) !important;
    color: #faa !important;
}
.age-quiz-option-btn:disabled { cursor: default; opacity: 0.7; }
.quiz-opt-hint { display: block; font-size: 0.82em; color: rgba(255,255,200,0.8); margin-top: 3px; transition: all 0.3s; }
.quiz-opt-hint-hidden { display: none; }
.age-quiz-result {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    font-size: 12px; font-weight: 700;
    text-align: center;
    line-height: 1.6;
    animation: receipt-slide-up 0.3s ease;
}
.age-quiz-result.quiz-pass {
    background: rgba(0,200,80,0.12);
    border: 1px solid rgba(0,200,80,0.3);
    color: #8f8;
}
.age-quiz-result.quiz-fail {
    background: rgba(255,160,0,0.12);
    border: 1px solid rgba(255,160,0,0.3);
    color: #fda;
}

/* ── 영수증 팝업 ── */
.receipt-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2200;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.3s;
}
.receipt-overlay-hidden { opacity: 0; pointer-events: none; }
.receipt-paper {
    background: #faf8f0;
    color: #222;
    width: 280px; max-height: 85vh; overflow-y: auto;
    padding: 20px 16px;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    font-family: 'Courier New', monospace;
    animation: receipt-slide-up 0.4s ease;
}
@keyframes receipt-slide-up {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.receipt-header { text-align: center; margin-bottom: 8px; }
.receipt-store-name { font-size: 16px; font-weight: 800; margin: 0 0 2px; }
.receipt-store-sub { font-size: 10px; color: #888; margin: 0 0 4px; }
.receipt-datetime { font-size: 9px; color: #999; margin: 0; }
.receipt-divider { text-align: center; color: #ccc; font-size: 10px; margin: 6px 0; letter-spacing: -1px; }
.receipt-items { font-size: 11px; }
.receipt-item-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.receipt-item-name { flex: 1; }
.receipt-item-price { text-align: right; font-weight: 700; }
.receipt-totals { font-size: 12px; }
.receipt-total-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.receipt-total-row.receipt-grand-total { font-size: 14px; font-weight: 800; border-top: 1px dashed #bbb; padding-top: 4px; }
.receipt-total-row.receipt-balance { color: #888; font-size: 11px; }
.receipt-footer-msg { text-align: center; font-size: 10px; color: #666; font-style: italic; margin: 8px 0; }
.receipt-barcode-img { display: block; margin: 8px auto 4px; width: 80%; max-width: 200px; height: auto; }
.receipt-thankyou { text-align: center; font-size: 10px; color: #999; margin: 0 0 10px; }
.receipt-actions { display: flex; gap: 8px; }
.receipt-save-btn, .receipt-close-btn {
    flex: 1; padding: 8px;
    border-radius: 8px; border: none;
    font-size: 12px; font-weight: 700;
    cursor: pointer; transition: transform 0.15s;
}
.receipt-save-btn { background: #4488ff; color: #fff; }
.receipt-close-btn { background: #e0e0e0; color: #333; }
.receipt-save-btn:active, .receipt-close-btn:active { transform: scale(0.95); }

@media (min-width: 480px) {
    .shop-products {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        max-width: 520px;
        margin: 0 auto;
    }
}

/* 모바일: 하단 인디케이터·좌우 HUD (중앙 여백) */
@media (max-width: 768px) {
    .player-growth-panel {
        width: auto;
        max-width: none;
    }
    .player-info-strip {
        max-width: min(50vw, 200px);
        padding: 5px 7px 6px;
        gap: 4px;
    }
    .strip-nick {
        font-size: 0.62rem;
    }
    .strip-rank,
    .strip-score-wrap {
        font-size: 0.7rem;
    }
    .hud-happiness-mini {
        top: calc(env(safe-area-inset-top, 0px) + 52px);
    }
    .hud-stat-grid .score-num { font-size: 0.95rem; }
    .hud-stat-grid .hud-feather-num { font-size: 0.95rem; }
}

#game-container {
    position: relative;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    pointer-events: auto;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    padding: 0;
}

/* 좌상단: 행복지수 미니멀 — 전광판(z-index 55) 아래에 두어 가리지 않음 */
#score-board.hud-happiness-mini {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    left: max(10px, env(safe-area-inset-left, 0px));
    z-index: 56;
    display: inline-flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
    margin: 0;
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    min-width: 0;
    width: auto;
}

/* 2x2 그리드: 아이콘 | 숫자, 위아래 정렬 */
.hud-stat-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 2px;
    column-gap: 5px;
    align-items: baseline;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.hud-stat-grid .hud-stat-icon {
    justify-self: center;
    align-self: center;
}
.hud-stat-grid .hud-stat-value {
    text-align: left;
    font-variant-numeric: tabular-nums;
    min-width: 0;
}
/* 1행: 하트 + 행복지수 */
.hud-stat-grid .score-heart {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 6px rgba(255, 100, 120, 0.55));
}
.hud-stat-grid .score-num {
    font-size: 1.12rem;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 255, 255, 0.35);
}
/* 2행: 깃털 + 개수 */
.hud-stat-grid .hud-feather-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid rgba(255, 210, 80, 0.55);
    border-radius: 50%;
    background: rgba(10, 14, 30, 0.5);
    animation: golden-feather-aura 2.5s ease-in-out infinite;
}
.hud-stat-grid .hud-feather-icon {
    width: 14px;
    height: auto;
    max-height: 16px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255, 210, 80, 0.5)) drop-shadow(0 0 10px rgba(255, 190, 50, 0.25));
}
.hud-feather-lock-icon {
    font-size: 13px;
    line-height: 1;
    filter: drop-shadow(0 0 3px rgba(255, 210, 80, 0.4));
}
.hud-stat-grid .hud-feather-num {
    font-size: 1.12rem;
    font-weight: 800;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 255, 255, 0.35);
}
.umbrella-hud {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding: 3px 8px 3px 4px;
    background: rgba(100, 180, 255, 0.25);
    border: 1.5px solid rgba(100, 180, 255, 0.45);
    border-radius: 12px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.2s ease, transform 0.15s ease;
    pointer-events: auto;
}
.umbrella-hud:active {
    background: rgba(100, 180, 255, 0.5);
    transform: scale(0.92);
}
.umbrella-hud-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.umbrella-hud-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    min-width: 12px;
    text-align: center;
}

/* 편지 게이지 (그리드 옆) */
.hud-happiness-mini .hud-happiness-extra.letter-gauge {
    width: 22px;
    height: 22px;
    margin-left: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    align-self: center;
}
.hud-happiness-mini .hud-happiness-extra.letter-gauge .letter-gauge-icon {
    font-size: 0.72rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.75));
}

/* 좌하단 플로팅: 병 힌트 · 일괄 팔기 (반투명 큰 박스 제거) */
.hud-bottle-hint-floating.bottle-found-hint {
    position: fixed;
    left: max(10px, env(safe-area-inset-left, 0px));
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    z-index: 44;
    max-width: min(70vw, 240px);
    pointer-events: none;
    padding: 0;
}
/* 우산 쓰기 버튼 */
.hud-umbrella-use-floating.umbrella-use-btn {
    position: fixed;
    left: max(6px, env(safe-area-inset-left, 0px));
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 76px);
    z-index: 45;
    width: 68px;
    height: 68px;
    min-height: 0;
    padding: 5px 4px;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: center;
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(60, 130, 200, 0.88), rgba(30, 80, 160, 0.92));
    border: 2px solid rgba(160, 210, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(100, 180, 255, 0.25) inset;
    backdrop-filter: blur(6px);
    color: #fff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.hud-umbrella-use-floating.umbrella-use-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(70, 150, 220, 0.94), rgba(40, 100, 180, 0.96));
    transform: scale(1.05);
}
.hud-umbrella-use-floating.umbrella-use-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.umbrella-use-count {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(220, 240, 255, 0.9);
    margin-left: 2px;
}
.umbrella-spacebar-hint {
    display: none;
    font-size: 8px;
    opacity: 0.7;
    letter-spacing: 0.5px;
    margin-top: 1px;
    color: #cde;
}
@media (hover: hover) and (pointer: fine) {
    .umbrella-spacebar-hint {
        display: inline-block;
    }
}
.umbrella-use-btn-hidden {
    display: none !important;
    pointer-events: none;
}

.hud-mass-sell-floating.bottle-mass-sell-btn {
    position: fixed;
    left: max(6px, env(safe-area-inset-left, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    z-index: 45;
    width: 68px;
    height: 68px;
    min-height: 0;
    padding: 6px 4px;
    font-size: 0.72rem;
    line-height: 1.3;
    text-align: center;
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(40, 180, 120, 0.85), rgba(20, 120, 80, 0.9));
    border: 2px solid rgba(180, 255, 200, 0.6);
    border-radius: 16px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(80, 220, 150, 0.25) inset;
    backdrop-filter: blur(6px);
    color: #fff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.hud-mass-sell-floating.bottle-mass-sell-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(50, 200, 140, 0.92), rgba(28, 140, 90, 0.95));
    transform: scale(1.05);
}

/* 우하단: 상점 FAB 래퍼만 (순위·XP는 상단 player-info-strip) */
.player-growth-panel {
    position: fixed;
    right: max(6px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    z-index: 52;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    width: auto;
    min-width: 0;
    max-width: none;
    pointer-events: none;
}
.player-growth-panel .shop-fab-wrap {
    align-self: flex-end;
}
/* 새우깡 봉지 + 개수 + 상점 — 우하단 한 덩어리 */
.shop-fab-wrap.shop-shrimp-integrated {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
    pointer-events: none;
}
.shop-shrimp-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 7px;
    pointer-events: none;
}
.shop-shrimp-column > * {
    pointer-events: auto;
}
/* 콤팩트 새우깡: 배경 박스 제거, 상점과 시각적 세트 */
.shrimp-chips-ui.shrimp-chips-compact {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    max-width: min(52vw, 200px);
    margin: 0;
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.shrimp-chips-compact .shrimp-bags-row {
    gap: 5px;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 100%;
}
.shrimp-chips-compact .shrimp-inv-img {
    width: 36px;
    max-height: 42px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.25));
}
.shrimp-chips-compact .shrimp-inv-img-large {
    width: 42px;
    max-height: 48px;
}
.shrimp-chips-compact .shrimp-inv-slot.shrimp-wpn-jumbo .shrimp-inv-img {
    transform: scale(1.25);
    transform-origin: center bottom;
}
.shrimp-chips-compact .shrimp-inv-qty {
    font-size: 0.58rem;
    min-width: 16px;
    padding: 0 3px;
    right: -3px;
    bottom: -3px;
}
.shrimp-chips-compact .shrimp-inv-slot.shrimp-inv-equipped {
    outline-width: 1.5px;
    outline-offset: 2px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(255, 200, 80, 0.35);
}
.shrimp-chips-compact .shrimp-current-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Outfit', 'Gowun Batang', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: rgba(255, 252, 245, 0.98);
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.55),
        0 1px 3px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}
.shrimp-chips-compact .shrimp-count-unit {
    font-weight: 700;
    font-size: 0.68em;
    opacity: 0.92;
}
.shrimp-chips-compact .shrimp-chip-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    opacity: 0.95;
}
/* (레거시) 구 growth-panel-me → 2단 통합형에서는 미사용 */
.player-info-strip .growth-panel-me {
    display: none;
}
.growth-panel-me {
    font-size: 0.62rem !important;
    padding: 2px 4px 3px !important;
    border-bottom: none !important;
    text-align: right !important;
    opacity: 0.92;
    width: 100%;
    box-sizing: border-box;
}
/* (2단 통합형) mini-rank-me는 .strip-rank로 사용 — growth-panel-me 쉘은 숨김 */
.player-info-strip .mini-rank-me.growth-panel-me {
    display: none;
}

.nickname-display {
    font-family: 'Gowun Batang', serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 248, 230, 0.9);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5), 0 0 6px rgba(255,200,80,0.2);
    text-align: center;
    padding: 2px 8px 3px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 2px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
/* (2단 통합형) nickname-display → .strip-nick으로 대체 */
.player-info-strip .nickname-display {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
/* (2단 복층형) xp-duplex로 대체 */
.bottle-found-hint {
    font-family: 'Outfit', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(200, 238, 255, 0.98);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
    padding: 2px 0 0 2px;
    line-height: 1.2;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}
.bottle-found-hint:not(.bottle-found-hint-hidden) {
    animation: bottleFoundHintPop 0.4s cubic-bezier(0.34, 1.2, 0.48, 1) both;
}
@keyframes bottleFoundHintPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.bottle-found-hint-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    pointer-events: none;
}

/* 행복지수 박스: 레거시(박스형) — 게임 HUD 미니멀은 .hud-happiness-mini */
#score-board.happiness-container:not(.hud-happiness-mini),
#score-board:not(.hud-happiness-mini) {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 11px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    width: auto;
    min-width: 7.5rem;
    max-width: min(98vw, 30rem);
    flex-wrap: nowrap;
    white-space: nowrap;
    box-sizing: border-box;
}

#score-board:not(.hud-happiness-mini) .score-heart { font-size: 1.05em; flex-shrink: 0; }
#score-board:not(.hud-happiness-mini) .score-heart.gold { filter: drop-shadow(0 0 4px rgba(255, 200, 50, 0.8)); }

.letter-gauge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.25);
}
.letter-gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(0deg, rgba(255,180,80,0.55) 0%, rgba(255,220,130,0.45) 100%);
    transition: height 0.6s ease-out;
    border-radius: 0 0 50% 50%;
}
.letter-gauge-icon {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    line-height: 1;
}
.letter-gauge.gauge-full {
    animation: gauge-glow 1.5s ease-in-out infinite;
    border-color: rgba(255, 200, 80, 0.7);
}
@keyframes gauge-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(255,200,80,0.3); }
    50%      { box-shadow: 0 0 12px rgba(255,200,80,0.6); }
}

.hud-feather-display {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    padding-left: 8px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    font-size: 0.92em;
}
.hud-feather-icon {
    width: 16px;
    height: auto;
    max-height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
#hud-feather-count {
    font-variant-numeric: tabular-nums;
    min-width: 1.2em;
    text-align: right;
}

#score-board:not(.hud-happiness-mini) .score-num {
    min-width: 0;
    text-align: right;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.hud-happiness-mini .score-num {
    min-width: 0;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
/* 깃털 펜 버튼: 완전 숨김 (HTML에서 제거됨, CSS 안전장치) */
.write-letter-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}
/* 낮 (06~18시): 딥 네이비, 얇은 화이트 테두리 */
body[data-theme="day"] .write-letter-btn {
    color: #1a2332;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
/* 밤 (18~06시): 은은한 화이트, 실버 테두리 */
body[data-theme="night"] .write-letter-btn {
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(200, 220, 255, 0.35);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.write-letter-btn:hover {
    transform: scale(1.06);
}
body[data-theme="day"] .write-letter-btn:hover {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1);
}
body[data-theme="night"] .write-letter-btn:hover {
    box-shadow: 0 3px 18px rgba(120, 160, 255, 0.12);
}
.write-letter-btn:active {
    transform: scale(0.96);
}
.write-letter-btn.write-letter-btn-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
/* 신비로운 득템: 은은한 금빛 광채 (낮/밤 공통) */
.write-letter-btn.write-letter-btn-glow {
    animation: write-letter-glow-gold 2.2s ease-in-out infinite;
}
@keyframes write-letter-glow-gold {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 218, 120, 0.4)) drop-shadow(0 0 8px rgba(255, 200, 80, 0.2)); }
    50%      { filter: drop-shadow(0 0 8px rgba(255, 218, 120, 0.6)) drop-shadow(0 0 14px rgba(255, 200, 80, 0.35)); }
}
body[data-theme="day"] .write-letter-btn.write-letter-btn-glow {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06), 0 0 12px rgba(255, 210, 100, 0.2);
}
body[data-theme="night"] .write-letter-btn.write-letter-btn-glow {
    animation: write-letter-glow-gold-night 2.2s ease-in-out infinite;
}
@keyframes write-letter-glow-gold-night {
    0%, 100% { box-shadow: 0 2px 12px rgba(0,0,0,0.18), 0 0 10px rgba(255, 218, 140, 0.25); }
    50%      { box-shadow: 0 2px 14px rgba(0,0,0,0.22), 0 0 18px rgba(255, 218, 140, 0.4); }
}
.write-letter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}
.write-letter-icon svg {
    width: 100%;
    height: 100%;
}

/* 모바일: 우하단 깃털 펜 버튼 제거(남는 아이콘·오동작 방지). 편지는 황금 보상/랜딩 플로우에서만 열림 */
@media (max-width: 768px) {
    .write-letter-btn {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: fixed !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        opacity: 0 !important;
    }
}

/* ──── 이어하기(Resume) 모달 ──── */
.resume-modal {
    position: fixed;
    inset: 0;
    z-index: 410;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 30, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 16px;
    box-sizing: border-box;
}
.resume-modal-hidden { display: none !important; }
.resume-modal-card {
    width: 92%;
    max-width: 370px;
    background: linear-gradient(180deg, #1a2744 0%, #0f172a 100%);
    border-radius: 22px;
    border: 1.5px solid rgba(120, 180, 255, 0.25);
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    animation: resumeAppear 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes resumeAppear {
    0% { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.resume-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.resume-modal-title {
    margin: 0 0 10px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.resume-modal-info {
    margin: 0 0 22px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.82rem;
    color: rgba(200, 220, 255, 0.7);
    line-height: 1.55;
}
.resume-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.resume-modal-btn {
    display: block;
    width: 100%;
    padding: 14px 0;
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.resume-modal-btn:active { transform: scale(0.96); }
.resume-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.resume-btn-secondary {
    color: rgba(200, 220, 255, 0.85);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(120, 180, 255, 0.2);
}
.resume-btn-secondary:active { background: rgba(255,255,255,0.12); }

/* ──── 닉네임 입력 모달 ──── */
.nickname-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    box-sizing: border-box;
}
.nickname-modal-hidden {
    display: none !important;
}
.nickname-modal-card {
    width: 92%;
    max-width: 360px;
    background: linear-gradient(180deg, #1a2744 0%, #0f172a 100%);
    border-radius: 22px;
    border: 1.5px solid rgba(120, 180, 255, 0.25);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 40px rgba(80, 150, 255, 0.08) inset;
    padding: 36px 28px 32px;
    text-align: center;
    animation: nicknameAppear 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
@keyframes nicknameAppear {
    0% { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.nickname-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.nickname-modal-title {
    margin: 0 0 6px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.nickname-modal-hint {
    margin: 0 0 18px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.8rem;
    color: rgba(200, 220, 255, 0.7);
}
.nickname-modal-input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    margin: 0 0 8px;
    box-sizing: border-box;
    font-family: 'Gowun Batang', serif;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(120, 180, 255, 0.35);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.nickname-modal-input:focus {
    border-color: rgba(120, 180, 255, 0.7);
    box-shadow: 0 0 12px rgba(80, 150, 255, 0.2);
}
.nickname-modal-input::placeholder {
    color: rgba(200, 220, 255, 0.35);
}
.nickname-modal-error {
    margin: 0 0 12px;
    font-size: 0.78rem;
    color: #ff6b6b;
    min-height: 1.2em;
}
.nickname-modal-btn {
    display: inline-block;
    padding: 14px 36px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.nickname-modal-btn:active {
    transform: scale(0.96);
}

/* 편지 쓰기 모달 */
.write-letter-overlay-hidden {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
}
#write-letter-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 45, 70, 0.65);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    overflow: hidden;
    padding: 16px;
    box-sizing: border-box;
}
#write-letter-overlay.write-letter-overlay-hidden {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
}
.write-letter-modal {
    width: 90%;
    max-width: 440px;
    min-height: 450px;
    max-height: 85vh;
    padding: 26px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(180deg, #faf8f2 0%, #f5f0e6 100%);
    border-radius: 16px;
    border: 1px solid rgba(200, 180, 140, 0.5);
    box-shadow: 0 12px 40px rgba(40, 35, 25, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    font-family: 'Gowun Batang', serif;
    box-sizing: border-box;
}
.write-letter-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #4a4035;
    text-align: center;
}
.write-letter-hint {
    margin: 0;
    font-size: 0.9rem;
    color: #6b5d50;
    line-height: 1.8;
    text-align: center;
    word-break: keep-all;
}
.write-letter-text {
    width: 100%;
    height: 250px;
    min-height: 250px;
    padding: 20px 15px;
    margin: 0;
    border: 1px solid rgba(180, 160, 120, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    font-family: 'Gowun Batang', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #3a352d;
    text-align: left;
    vertical-align: top;
    resize: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.write-letter-text::placeholder {
    color: #9a8f80;
}
.write-letter-count {
    margin: 0 0 20px 0;
    font-size: 0.75rem;
    color: rgba(100, 90, 75, 0.4);
    text-align: right;
    transition: color 0.3s ease;
}
.write-letter-count.char-warn {
    color: rgba(200, 60, 60, 0.7);
}
.write-letter-warning {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    color: #c44;
    text-align: center;
}
.write-letter-warning-hidden {
    display: none;
}
.write-letter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 4px;
}
.write-letter-cancel,
.write-letter-send {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.write-letter-cancel {
    background: rgba(120, 110, 95, 0.2);
    border: 1px solid rgba(100, 90, 75, 0.4);
    color: #5a5248;
}
.write-letter-send {
    background: linear-gradient(135deg, #7eb8da, #5a9fc9);
    border: 1px solid rgba(80, 130, 160, 0.5);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(90, 159, 201, 0.4);
}
.write-letter-send:hover {
    box-shadow: 0 4px 12px rgba(90, 159, 201, 0.5);
}
.write-letter-send:active {
    transform: scale(0.98);
}
.write-letter-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 감성 토스트 (편지 전송 후 등) */
.toast-msg {
    position: fixed;
    left: 50%;
    top: 35%;
    bottom: auto;
    transform: translateX(-50%);
    max-width: 88%;
    padding: 14px 20px;
    background: rgba(40, 50, 70, 0.92);
    color: #f5f0e8;
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
    white-space: pre-line;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    z-index: 120;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast-msg.toast-msg-visible {
    opacity: 1;
}
.toast-msg.toast-msg-hidden {
    opacity: 0;
    visibility: hidden;
}

/* 영수증 확인 시: 영수증 용지 바로 위에 표시 (일반 토스트보다 위 레이어) */
.toast-msg.toast-msg-over-receipt {
    z-index: 2500;
    max-width: min(92vw, 320px);
}

/* 랜덤 팁 툴팁: 화면 중앙 */
.random-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 85%;
    padding: 16px 24px;
    background: rgba(15, 20, 40, 0.88);
    color: #fff;
    font-family: 'Gowun Batang', serif;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.55;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    pointer-events: none;
    z-index: 60;
    transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.random-tip.random-tip-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.random-tip.random-tip-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.92);
}

/* 편지 받았을 때 안내 문구 */
.letter-arrival-msg {
    margin: 0 0 6px;
    padding: 6px 20px;
    color: #fff;
    font-family: 'Gowun Batang', serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.7;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    flex-shrink: 0;
}
.letter-arrival-sub {
    display: block;
    margin-top: 6px;
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1.6;
    text-align: center;
}
@media (max-width: 480px) {
    .letter-arrival-msg { font-size: 1.1rem; max-width: 92%; }
    .letter-arrival-sub { font-size: 0.88rem; }
}

#score-board .score-num.bump {
    animation: score-bump 0.35s ease-out;
}
@keyframes score-bump {
    0% { transform: scale(1); }
    45% { transform: scale(1.22); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* 카운트업 시 짧은 롤(슬롯 느낌) */
#score-board .score-num.score-roll {
    animation: score-roll 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes score-roll {
    0% {
        transform: translateY(0.35em);
        opacity: 0.55;
        filter: blur(0.5px);
    }
    55% {
        transform: translateY(-0.06em);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

/* 화면 가운데 뮤직 플레이어 패널 — 곡 바뀔 때만 표시 후 천천히 사라짐 */
#music-player-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 220px;
    max-width: 280px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s ease;
    z-index: 30;
}
#music-player-panel.credit-visible {
    opacity: 1;
}

.music-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.music-title {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.7);
}

/* 작은 음폭 웨이브 애니메이션 */
.music-wave {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 12px;
}

.music-wave .wave-bar {
    width: 3px;
    height: 4px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    animation: wave-bounce 0.8s ease-in-out infinite;
}

.music-wave .wave-bar:nth-child(1) { animation-delay: 0s; }
.music-wave .wave-bar:nth-child(2) { animation-delay: 0.15s; }
.music-wave .wave-bar:nth-child(3) { animation-delay: 0.3s; }
.music-wave .wave-bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes wave-bounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

.music-now-playing {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.7);
}

#music-track-title {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.7);
}

.music-credit {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 0, 0, 0.6);
}

/* 황금 갈매기 먹튀 순간: 화면 전체 금빛 플래시 (0.5초) */
#gold-flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(255, 215, 80, 0.85) 0%, rgba(255, 180, 50, 0.5) 50%, transparent 70%);
    opacity: 0;
}
#gold-flash-overlay.gold-flash-on {
    animation: goldFlash 0.5s ease-out forwards;
}
@keyframes goldFlash {
    0%   { opacity: 0; }
    20%  { opacity: 0.95; }
    50%  { opacity: 0.9; }
    100% { opacity: 0; }
}

/* 황금 갈매기 성공 시 화면 중앙 안내 문구 (3초) */
.golden-blessing-msg {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    margin: 0;
    padding: 16px 24px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #4a4035;
    text-align: center;
    background: rgba(255, 252, 245, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(40, 35, 25, 0.25);
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.golden-blessing-msg-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* 편지 모달: 깊은 밤바다 위 젖은 양피지 (긴 본문은 양피지 영역 내 스크롤) */
#letter-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
    background: rgba(10, 15, 35, 0.82);
    backdrop-filter: blur(12px);
    cursor: pointer;
    pointer-events: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
#letter-overlay.letter-hidden {
    display: none;
    pointer-events: none;
}

/* 양피지 본체: old_letter_paper.png 배경 */
.parchment {
    position: relative;
    width: 88%;
    max-width: 420px;
    max-height: 60vh;
    padding: 40px 36px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    cursor: default;
    pointer-events: auto;

    background-image: url('assets/old_letter_paper.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;

    animation: parchmentReveal 0.7s ease-out both;
}

@keyframes parchmentReveal {
    0%   { opacity: 0; transform: scale(0.88) rotate(-1.5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* 양피지 위 텍스트 */
.parchment-text {
    margin: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.9;
    color: #2C1A0E;
    text-align: center;
    word-break: keep-all;
    overflow: visible;
    white-space: pre-line;
    opacity: 0;
    text-shadow: 0 1px 2px rgba(62, 39, 35, 0.15);
}

/* 편지 닫기 버튼 */
.letter-close-btn {
    display: block;
    position: sticky;
    bottom: 0;
    margin: 10px auto 0;
    padding: 8px 32px;
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: rgba(93, 64, 55, 0.88);
    border: 1.5px solid rgba(141, 110, 70, 0.6);
    border-radius: 12px;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    transition: background 0.2s ease;
    z-index: 2;
    box-shadow: 0 -8px 16px rgba(255, 248, 230, 0.9), 0 2px 8px rgba(0,0,0,0.2);
}
.letter-close-btn:active {
    background: rgba(93, 64, 55, 0.95);
}

/* 편지 이전/다음 네비게이션 */
.letter-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 12px;
    padding: 8px 0 4px;
}
.letter-nav-hidden { display: none !important; }
.letter-nav-btn {
    padding: 7px 16px;
    border: 1px solid rgba(141, 110, 70, 0.4);
    border-radius: 8px;
    background: rgba(93, 64, 55, 0.7);
    color: #fff;
    font-family: 'Gowun Batang', serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.letter-nav-btn:hover:not(:disabled) {
    background: rgba(93, 64, 55, 0.9);
    transform: scale(1.03);
}
.letter-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.letter-nav-counter {
    font-family: 'Gowun Batang', serif;
    font-size: 0.78rem;
    color: #5D4037;
    min-width: 50px;
    text-align: center;
}

/* 안개 걷히듯 떠오르는 페이드인 */
.parchment-text.parchment-text-visible {
    animation: gentleFadeIn 2.8s ease-out forwards;
}
@keyframes gentleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .parchment {
        width: 90%;
        max-height: 55vh;
        padding: 28px 24px;
    }
    .parchment-text {
        font-size: 0.92rem;
        font-weight: 600;
        line-height: 1.75;
    }
    .letter-close-btn {
        margin: 6px auto 0;
        padding: 6px 24px;
        font-size: 0.88rem;
    }
    .letter-nav {
        margin-top: 6px;
        gap: 10px;
    }
    .letter-nav-btn {
        padding: 5px 12px;
        font-size: 0.76rem;
    }
}

/* 황금 깃털 보상 오버레이 (수채화풍) */
.golden-feather-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 48, 0.25);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.golden-feather-overlay.golden-feather-overlay-visible {
    opacity: 1;
}
.golden-feather-overlay.feather-overlay-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.feather-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    animation: float 2.8s ease-in-out infinite, featherAppear 0.8s ease-out both;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.feather-item:hover {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.75));
    transform: scale(1.06);
}
.feather-item:active {
    transform: scale(0.96);
}
@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-12px) scale(1); }
}
@keyframes featherAppear {
    0%   { opacity: 0; transform: translateY(30px) scale(0.7); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.feather-image {
    width: 140px;
    height: auto;
    display: block;
    pointer-events: none;
}
.feather-hint {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 248, 230, 0.95);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    animation: featherHintPulse 2s ease-in-out infinite;
}
@keyframes featherHintPulse {
    0%, 100% { opacity: 0.8; }
    50%      { opacity: 1; }
}

/* 디버그 로그 패널 (모바일에서 클릭/터치 확인용) */
/* ---------- 랜딩 시퀀스: 깃털 → 엽서 → 게임 시작 ---------- */
body.landing-active {
    overflow: hidden;
}
.landing-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: #0f0f23;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 160, 220, 0.45) rgba(0, 0, 0, 0.2);
}
.landing-overlay::-webkit-scrollbar {
    width: 8px;
}
.landing-overlay::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}
.landing-overlay::-webkit-scrollbar-thumb {
    background: rgba(120, 160, 220, 0.4);
    border-radius: 4px;
}
/* 랜딩 본문 래퍼: 세로 스크롤 시 중앙 정렬된 콘텐츠 */
.landing-inner {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 16px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}
.landing-overlay.landing-overlay-hidden {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.landing-overlay.landing-overlay-behind {
    z-index: 0;
    pointer-events: none;
}
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: landing-fadein 1s ease-out;
}
@keyframes landing-fadein {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.landing-title {
    margin: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: #f0f4ff;
    text-shadow: 0 2px 16px rgba(100, 160, 255, 0.35), 0 1px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.08em;
    word-spacing: 0.06em;
}
.landing-subtitle {
    margin: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}
.landing-guide {
    margin: 6px 24px 0;
    font-family: 'Gowun Batang', serif;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #dce8f5;
    text-align: center;
    text-shadow: 0 1px 8px rgba(100, 160, 255, 0.3);
    animation: guide-float 4s ease-in-out infinite;
    position: relative;
}
@keyframes guide-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
.guide-sparkle {
    display: inline-block;
    font-size: 0.7rem;
    color: rgba(255, 225, 130, 0.85);
    vertical-align: middle;
    animation: sparkle-twinkle 2s ease-in-out infinite;
    margin: 0 4px;
}
.guide-sparkle:last-child { animation-delay: 1s; }
@keyframes sparkle-twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50%      { opacity: 1; transform: scale(1.3); }
}
.game-start-btn {
    margin-top: 16px;
    padding: 16px 48px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ffa751 0%, #ffe259 100%);
    border: none;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 167, 81, 0.45), 0 0 0 0 rgba(255, 226, 89, 0);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    animation: btn-pulse 2.5s ease-in-out infinite;
}
.game-start-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 28px rgba(255, 167, 81, 0.6);
}
.game-start-btn:active {
    transform: scale(0.96);
}
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255,167,81,0.45), 0 0 0 0 rgba(255,226,89,0.3); }
    50%      { box-shadow: 0 4px 20px rgba(255,167,81,0.45), 0 0 0 12px rgba(255,226,89,0); }
}

/* ──── TOP10 전광판 마퀴 (인트로) ──── */
.landing-marquee {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 310;
    height: 38px;
    min-height: 38px;
    flex-shrink: 0;
    background: rgba(10, 25, 48, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.55);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.35),
        inset 0 -1px 0 rgba(255, 220, 100, 0.12);
    overflow: hidden;
    display: flex;
    align-items: center;
}
.marquee-text {
    display: inline-block;
    white-space: nowrap;
    font-family: 'Gowun Batang', serif;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(230, 242, 255, 0.98);
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.85),
        0 -1px 0 rgba(0, 0, 0, 0.5),
        1px 1px 2px rgba(0, 0, 0, 0.9),
        0 0 12px rgba(0, 20, 40, 0.5);
    animation: marquee-scroll 120s linear infinite;
    padding-left: 100%;
}
@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ──── 로드맵 버튼 ──── */
.roadmap-open-btn {
    display: block;
    margin: 16px auto 0;
    padding: 8px 20px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.roadmap-open-btn:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* ──── 랜딩 랭킹 박스 (명예의 전당 · 실시간 순위) ──── */
.landing-rank-box {
    width: 100%;
    margin-top: 20px;
    padding: 16px 14px 12px;
    background: linear-gradient(135deg, rgba(15, 25, 60, 0.88) 0%, rgba(10, 15, 40, 0.92) 100%);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 215, 0, 0.1);
    animation: landingFadeIn 0.8s ease both;
    animation-delay: 0.3s;
}
.landing-rank-header { display: none; }
.landing-rank-list {
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.landing-rank-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    padding: 12px 0;
}
.landing-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.2s;
}
.landing-rank-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.04);
}
.landing-rank-row.is-me {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.landing-rank-pos {
    min-width: 28px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}
.landing-rank-pos.rank-gold { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.4); }
.landing-rank-pos.rank-silver { color: #c0c0c0; text-shadow: 0 0 6px rgba(192,192,192,0.3); }
.landing-rank-pos.rank-bronze { color: #cd7f32; text-shadow: 0 0 6px rgba(205,127,50,0.3); }
.landing-rank-pos.rank-normal { color: rgba(255,255,255,0.55); }
.landing-rank-info {
    flex: 1;
    min-width: 0;
}
.landing-rank-name {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.landing-rank-row.is-me .landing-rank-name {
    color: #ffd700;
}
.landing-rank-score {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
}
.landing-rank-crown {
    font-size: 0.8rem;
    flex-shrink: 0;
}
.landing-rank-my {
    text-align: center;
    padding: 8px 0 4px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 215, 0, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 6px;
}
.landing-rank-my:empty { display: none; }
.landing-rank-more-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 9px 0;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    color: rgba(255, 215, 0, 0.8);
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.landing-rank-more-btn:active {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

/* 탭 */
.landing-rank-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.landing-rank-tab {
    flex: 1;
    padding: 9px 0;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.landing-rank-tab-active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}
.landing-rank-panel-hidden { display: none; }

/* 명예의 전당 행 */
.landing-legend-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    margin-bottom: 5px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.12);
}
.landing-legend-crown {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.landing-legend-info { flex: 1; min-width: 0; }
.landing-legend-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-family: 'Black Han Sans', sans-serif;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    padding: 1px 8px;
    border-radius: 8px;
    margin-bottom: 3px;
}
.landing-legend-name {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.88rem;
    color: #fff;
}
.landing-legend-quote {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.landing-legend-meta {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 3px;
}

/* ──── 시작 화면: Lv.41+ 성장 보상 요약 ──── */
.landing-reward-tiers {
    width: 100%;
    margin-top: 20px;
    padding: 18px 16px 20px;
    box-sizing: border-box;
    background: rgba(12, 22, 48, 0.72);
    border: 1px solid rgba(120, 160, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    scroll-margin-top: 44px;
}
.landing-reward-tiers-title {
    margin: 0 0 8px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #eef3ff;
    text-align: center;
    letter-spacing: 0.04em;
}
.landing-reward-tiers-lead {
    margin: 0 0 14px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(220, 232, 245, 0.82);
    text-align: center;
}
.landing-reward-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.landing-reward-item {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    padding: 10px 10px;
    margin-bottom: 5px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.88rem;
    line-height: 1.3;
    color: #e8eef8;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.landing-reward-item:last-of-type { margin-bottom: 0; }
.landing-reward-item-highlight {
    border-color: rgba(255, 100, 150, 0.35);
    background: rgba(60, 15, 30, 0.4);
}
.landing-reward-item-final {
    border-color: rgba(255, 215, 120, 0.25);
    background: rgba(40, 28, 8, 0.35);
}
.landing-reward-lv {
    flex: 0 0 auto;
    font-weight: 700;
    color: rgba(180, 210, 255, 0.95);
    font-size: 0.85rem;
    min-width: 0;
}
.landing-reward-icon {
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
}
.landing-reward-name {
    flex: 0 0 auto;
    font-weight: 600;
    color: #fff;
}
.landing-reward-sep {
    color: rgba(255, 255, 255, 0.25);
    font-weight: 400;
    font-size: 0.75rem;
}
.landing-reward-perk {
    flex: 1 1 auto;
    margin-left: 0;
    padding-left: 0;
    font-size: 0.82rem;
    color: rgba(200, 220, 255, 0.88);
    text-align: right;
}

.guide-crown-hint {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: rgba(255, 215, 100, 0.85);
}

/* ──── 로드맵 모달 ──── */
.roadmap-modal {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    transition: opacity 0.25s ease;
}
.roadmap-modal-hidden { opacity: 0; pointer-events: none; }
.roadmap-modal-inner {
    width: 90%;
    max-width: 360px;
    max-height: 75vh;
    background: linear-gradient(180deg, #1a1a3e 0%, #0f0f2a 100%);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.roadmap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.roadmap-title {
    margin: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}
.roadmap-close-btn {
    background: none; border: none; color: rgba(255,255,255,0.6);
    font-size: 1.5rem; cursor: pointer; padding: 0 4px; line-height: 1;
}
.roadmap-close-btn:hover { color: #fff; }

.roadmap-progress {
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.roadmap-progress-label {
    font-family: 'Gowun Batang', serif;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 6px;
}
.roadmap-bar {
    height: 10px;
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    position: relative;
}
.roadmap-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #ffa751, #ffe259);
    transition: width 0.5s ease;
}
.roadmap-bar-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
    text-align: right;
}

.roadmap-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 12px;
    -webkit-overflow-scrolling: touch;
}
.roadmap-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    border-radius: 8px;
    margin-bottom: 3px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
}
.roadmap-row.reached {
    color: rgba(255,255,255,0.95);
    background: rgba(255,200,80,0.1);
}
.roadmap-row.current {
    background: rgba(255,200,80,0.2);
    border: 1px solid rgba(255,200,80,0.3);
    color: #fff;
    animation: roadmap-glow 2s ease-in-out infinite;
}
@keyframes roadmap-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,200,80,0); }
    50%      { box-shadow: 0 0 12px 2px rgba(255,200,80,0.2); }
}
.roadmap-row.locked {
    color: rgba(255,255,255,0.35);
    cursor: pointer;
}
.roadmap-crown { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.roadmap-crown-achieved {
    filter: drop-shadow(0 0 6px rgba(255,200,80,0.7));
    animation: roadmap-shine 2.5s ease-in-out infinite;
}
@keyframes roadmap-shine {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255,200,80,0.5)); }
    50%      { filter: drop-shadow(0 0 10px rgba(255,230,120,0.9)); }
}
.roadmap-crown-locked { filter: grayscale(1) opacity(0.45); }
.roadmap-info { flex: 1; }
.roadmap-lv { font-weight: 700; }
.roadmap-check { font-size: 0.72rem; margin-left: 4px; }
.roadmap-lv-locked { color: rgba(255,255,255,0.35); }
.roadmap-lv-mystery {
    color: rgba(255,200,120,0.6);
    font-style: italic;
    text-shadow: 0 0 8px rgba(255,200,80,0.3);
}
.roadmap-lock-tag {
    display: inline-block;
    font-size: 0.58rem;
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
    margin-left: 4px;
    vertical-align: middle;
}
.roadmap-perk { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 1px; }
.roadmap-perk-locked { color: rgba(255,255,255,0.2); font-style: italic; }
.roadmap-perk-mystery {
    color: rgba(255,200,120,0.4);
    font-style: italic;
    letter-spacing: 1px;
}

/* ──── 2단 복층 XP 게이지 바 ──── */
.xp-duplex {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 3px 0 2px;
    box-sizing: border-box;
    z-index: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.xp-bar-hidden { opacity: 0; }

/* ── 상단: 티어 진행 바 (골드) ── */
.xp-tier-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.xp-tier-track {
    flex: 1;
    height: 7px;
    border-radius: 3px;
    background: rgba(15, 25, 50, 0.6);
    overflow: hidden;
}
.xp-tier-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #b8860b, #d4af37, #f5d76e);
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
    width: 0%;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}
.xp-tier-fill.xp-tier-bump {
    transition: width 0.35s cubic-bezier(.2,.8,.3,1.3);
    box-shadow: 0 0 10px rgba(245, 215, 110, 0.8);
}
.xp-tier-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: #d4af37;
    white-space: nowrap;
    text-align: right;
    text-shadow: 0 0 5px rgba(212,175,55,0.6);
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

/* ── 하단: 레벨 진행 바 (오렌지) ── */
.xp-lv-row {
    display: flex;
    align-items: center;
    gap: 3px;
}
.xp-lv-anchor {
    font-family: 'Outfit', sans-serif;
    font-size: 0.60rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    min-width: 16px;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.xp-lv-nxt {
    color: rgba(255, 200, 100, 0.85);
}
.xp-lv-track {
    flex: 1;
    height: 7px;
    border-radius: 3px;
    background: rgba(15, 25, 50, 0.6);
    overflow: hidden;
    position: relative;
}
.xp-lv-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #ff8c00, #ff6a00, #ffb347);
    transition: width 0.45s ease-out;
    width: 0%;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
    position: relative;
}
.xp-lv-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 10px;
    height: 100%;
    border-radius: 0 3px 3px 0;
    background: radial-gradient(ellipse at right center, rgba(255,255,255,0.6) 0%, transparent 70%);
    pointer-events: none;
}
/* 레벨업 플래시 */
@keyframes xp-lv-flash {
    0%   { box-shadow: 0 0 8px rgba(255,140,0,0.5); }
    50%  { box-shadow: 0 0 20px rgba(255,200,60,0.9), 0 0 40px rgba(255,140,0,0.4); }
    100% { box-shadow: 0 0 8px rgba(255,140,0,0.5); }
}
.xp-lv-fill.xp-lv-levelup {
    animation: xp-lv-flash 0.5s ease-out;
}

/* ──── 실시간 랭킹 전광판 (상단 바 · 프리미엄) ──── */
.mini-rank-widget.mini-rank-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 55;
    height: auto;
    min-height: 38px;
    background: rgba(10, 25, 48, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0;
    border: none;
    border-bottom: 2px solid #d4af37;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    pointer-events: auto;
}
.mini-rank-widget.mini-rank-top-bar:hover {
    background: rgba(12, 30, 58, 0.92);
    border-bottom-color: #ffe066;
}

/* 첫 표시: 위에서 아래로 슬라이드 */
.mini-rank-widget.mini-rank-top-bar.mini-rank-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-110%);
}
.mini-rank-widget.mini-rank-top-bar:not(.mini-rank-hidden) {
    animation: mini-rank-bar-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes mini-rank-bar-enter {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mini-rank-bar-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 36px;
}
/* LIVE 배지 (좌측) */
.mini-rank-live-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    border-right: 1px solid rgba(212, 175, 55, 0.35);
    font-family: 'Gowun Batang', system-ui, sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #fff;
    text-shadow:
        0 1px 0 #000,
        0 -1px 0 #000,
        1px 0 0 #000,
        -1px 0 0 #000,
        0 2px 8px rgba(0, 0, 0, 0.6);
}
.mini-rank-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff2d2d;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.35),
        0 0 10px rgba(255, 40, 40, 0.95),
        0 0 18px rgba(255, 60, 60, 0.65);
    animation: mini-rank-live-pulse 1.15s ease-in-out infinite;
}
@keyframes mini-rank-live-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1.1);
    }
    45% {
        opacity: 0.45;
        transform: scale(0.88);
        filter: brightness(0.85);
    }
    70% {
        opacity: 1;
        transform: scale(1.05);
    }
}
.mini-rank-live-text {
    font-weight: 800;
}

/* ──── 전광판 아래 우측: 깃털 + 내 순위·닉·XP ──── */
.hud-top-right-cluster {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    right: max(6px, env(safe-area-inset-right, 0px));
    z-index: 56;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
    gap: max(6px, min(2vw, 12px));
    max-width: min(calc(100vw - 8px), 440px);
    pointer-events: none;
}
.hud-top-right-cluster > * {
    pointer-events: auto;
}

/* ──── 2단 통합형 스마트 전광판 (우측 상단 클러스터) ──── */
.player-info-strip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    min-width: 0;
    max-width: min(52vw, 220px);
    padding: 6px 8px 7px;
    box-sizing: border-box;
    background: rgba(15, 20, 35, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 3px 10px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-bottom: 1.5px solid #d4af37;
    box-shadow:
        0 0 0 0.5px rgba(255, 220, 120, 0.2),
        0 0 14px rgba(255, 200, 90, 0.22),
        0 3px 16px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 줄 공통 */
.strip-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 0;
    line-height: 1.2;
    padding: 0;
}

/* 1줄: [Lv.N] + 닉네임 */
.strip-row-nick {
    gap: 4px;
    min-width: 0;
}
.strip-lv-badge {
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(255, 220, 120, 0.95);
    background: rgba(212, 175, 55, 0.18);
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(255, 200, 80, 0.35);
}
.strip-nick {
    flex: 1;
    min-width: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 248, 230, 0.92);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}
.nickname-title {
    font-weight: 400;
}
.nickname-tag {
    font-weight: 400;
    font-size: 0.85em;
    color: rgba(200, 210, 230, 0.55);
    margin-left: 1px;
}

/* 2줄: 순위 + ❤️점수 */
.strip-row-rank-score {
    justify-content: center;
    gap: 6px;
    padding-top: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.strip-rank {
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffe566;
    text-shadow:
        0 0 8px rgba(255, 240, 80, 0.8),
        0 0 16px rgba(255, 200, 40, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.strip-rank:hover {
    color: #fff78a;
    text-shadow:
        0 0 12px rgba(255, 255, 140, 0.95),
        0 0 24px rgba(255, 220, 60, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.5);
}
.strip-rank:active {
    color: #ffd700;
}
.strip-score-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}
.strip-score-heart {
    font-size: 0.72em;
    filter: drop-shadow(0 0 5px rgba(255, 60, 80, 0.7)) drop-shadow(0 0 12px rgba(255, 30, 50, 0.4));
}
.strip-score-num {
    color: #ffe0e6;
    text-shadow:
        0 0 6px rgba(255, 60, 80, 0.55),
        0 0 14px rgba(255, 30, 50, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
    font-variant-numeric: tabular-nums;
}

/* 3줄: 2단 복층 XP 바 — strip 오버라이드 */
.strip-xp.xp-duplex {
    padding: 3px 0 2px;
    gap: 3px;
    min-height: auto;
    background: none;
    border: none;
    box-shadow: none;
}

/* 전투 스탯 게이지 (공격·방어·행복 + 레벨 진행) */
.combat-stats-hud {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}
.combat-stats-hud-hidden {
    display: none !important;
}
.combat-stats-hud-warrior .csh-bar-fill-atk,
.combat-stats-hud-warrior .csh-bar-fill-def,
.combat-stats-hud-warrior .csh-bar-fill-hap {
    background: linear-gradient(90deg, #7c3aed, #a855f7, #e879f9);
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.45);
}
.combat-stats-hud-warrior .csh-val {
    color: rgba(230, 190, 255, 0.95);
}
.csh-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.5rem;
}
.csh-row-lv {
    padding-bottom: 2px;
    margin-bottom: 1px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.csh-icon {
    flex-shrink: 0;
    width: 14px;
    text-align: center;
    font-size: 0.55rem;
    line-height: 1;
}
.csh-name {
    flex-shrink: 0;
    width: 26px;
    color: rgba(200, 215, 240, 0.75);
    font-weight: 600;
}
.csh-bar-track {
    flex: 1;
    min-width: 0;
    height: 6px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.csh-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.35s ease;
}
.csh-bar-fill-lv {
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fcd34d);
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.45);
}
.csh-bar-fill-atk {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    box-shadow: 0 0 5px rgba(56, 189, 248, 0.4);
}
.csh-bar-fill-def {
    background: linear-gradient(90deg, #64748b, #94a3b8);
    box-shadow: 0 0 4px rgba(148, 163, 184, 0.35);
}
.csh-bar-fill-hap {
    background: linear-gradient(90deg, #eab308, #fde047);
    box-shadow: 0 0 5px rgba(234, 179, 8, 0.35);
}
.csh-val {
    flex-shrink: 0;
    width: 22px;
    text-align: right;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: rgba(180, 210, 255, 0.92);
    letter-spacing: -0.3px;
}

/* ──── 황금 깃털 버튼 (상단 중앙 → 숨김, 날씨 HUD로 대체) ──── */
.golden-feather-btn.golden-feather-center {
    display: none;
}
.golden-feather-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid rgba(255, 210, 80, 0.55);
    border-radius: 50%;
    background: rgba(10, 14, 30, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.25s ease, box-shadow 0.35s ease, opacity 0.35s ease, border-color 0.35s ease;
    animation: golden-feather-aura 2.5s ease-in-out infinite;
}
.golden-feather-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}
.golden-feather-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 3px rgba(255, 210, 80, 0.5));
}
.golden-feather-lock {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* 황금 아우라 네온 (항상 적용) */
@keyframes golden-feather-aura {
    0%, 100% {
        box-shadow:
            0 0 8px rgba(255, 210, 80, 0.4),
            0 0 20px rgba(255, 190, 50, 0.25),
            0 0 40px rgba(255, 170, 30, 0.12),
            inset 0 0 8px rgba(255, 220, 100, 0.08);
        border-color: rgba(255, 210, 80, 0.55);
    }
    50% {
        box-shadow:
            0 0 14px rgba(255, 220, 100, 0.6),
            0 0 30px rgba(255, 200, 60, 0.4),
            0 0 60px rgba(255, 180, 40, 0.2),
            inset 0 0 12px rgba(255, 230, 120, 0.12);
        border-color: rgba(255, 230, 120, 0.75);
    }
}
.golden-feather-img {
    filter: drop-shadow(0 0 6px rgba(255, 210, 80, 0.5)) drop-shadow(0 0 14px rgba(255, 190, 50, 0.25));
}

/* 잠금 상태: Lv.51 미만 — 아우라 유지, 이미지만 흑백 + 자물쇠 */
.golden-feather-btn.golden-feather-locked {
    cursor: not-allowed;
    pointer-events: auto;
}
.golden-feather-btn.golden-feather-locked .golden-feather-img {
    filter: grayscale(0.7) brightness(0.7) drop-shadow(0 0 4px rgba(255, 210, 80, 0.3));
}
.golden-feather-btn.golden-feather-locked .golden-feather-lock {
    opacity: 1;
}

/* 해금 상태: Lv.51+ */
.golden-feather-btn:not(.golden-feather-locked) .golden-feather-lock {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* 호버: 살짝 기울기 + 확대 (translateX 유지) */
.golden-feather-btn:not(.golden-feather-locked):hover {
    transform: translateX(-50%) scale(1.08) rotate(-6deg);
    border-color: rgba(255, 220, 100, 0.7);
}
.golden-feather-btn:not(.golden-feather-locked):hover .golden-feather-icon {
    transform: translateY(-2px) rotate(8deg);
}
.golden-feather-btn:not(.golden-feather-locked):active {
    transform: translateX(-50%) scale(0.95);
}

/* 날아가는 애니메이션 (클릭 시 JS가 추가) */
@keyframes golden-feather-fly {
    0%   { transform: scale(1) rotate(0deg) translateY(0); opacity: 1; }
    30%  { transform: scale(1.3) rotate(-15deg) translateY(-12px); opacity: 1; }
    70%  { transform: scale(0.7) rotate(25deg) translateX(40px) translateY(-50px); opacity: 0.5; }
    100% { transform: scale(0.3) rotate(45deg) translateX(80px) translateY(-90px); opacity: 0; }
}
.golden-feather-btn.golden-feather-flying .golden-feather-icon {
    animation: golden-feather-fly 0.7s ease-out forwards;
}

/* 깃털 없을 때 숨김 */
.golden-feather-btn.golden-feather-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(-10px);
}

/* 모바일 최적화 — 클러스터 위치만 조정 (깃털은 클러스터 안에서 상대 배치) */
@media (max-width: 480px) {
    .hud-top-right-cluster {
        top: calc(env(safe-area-inset-top, 0px) + 50px);
        gap: 5px;
        right: max(4px, env(safe-area-inset-right, 0px));
    }
    .player-info-strip {
        max-width: min(46vw, 178px);
        padding: 4px 5px 4px;
    }
    .golden-feather-btn {
        width: 42px;
        height: 42px;
    }
    .golden-feather-icon { width: 24px; height: 24px; }
    .golden-feather-lock { font-size: 12px; }
}

/* 세로 폭이 좁은 환경(인앱 브라우저 등): 상·하단 HUD 간격 확보 */
@media (max-height: 640px) {
    .hud-top-right-cluster {
        top: calc(env(safe-area-inset-top, 0px) + 46px);
        gap: 4px;
    }
    .player-info-strip {
        max-width: min(46vw, 172px);
        padding: 3px 5px 3px;
        gap: 1px;
    }
    .player-info-strip .xp-duplex {
        min-height: auto;
        padding: 1px 0;
    }
    .hud-umbrella-use-floating.umbrella-use-btn {
        bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 66px);
        width: 60px;
        height: 60px;
        font-size: 0.63rem;
    }
    .hud-mass-sell-floating.bottle-mass-sell-btn {
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
        width: 60px;
        height: 60px;
        font-size: 0.65rem;
    }
    .bag-open-btn {
        bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 66px + 60px + 8px);
        width: 60px;
        height: 60px;
        font-size: 0.63rem;
    }
    .quick-buy-fab.quick-buy-floating {
        width: 60px;
        height: 60px;
        font-size: 0.54rem;
        padding: 3px 4px;
    }
    .hud-bottle-hint-floating.bottle-found-hint {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }
    .player-growth-panel {
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }
    .write-letter-btn {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }
}
@media (max-height: 520px) {
    .hud-top-right-cluster {
        top: calc(env(safe-area-inset-top, 0px) + 44px);
    }
    .player-info-strip {
        max-width: min(52vw, 158px);
        padding: 3px 5px 4px;
        gap: 2px;
    }
    .strip-nick { font-size: 0.54rem; }
    .strip-rank, .strip-score-wrap { font-size: 0.54rem; }
    .strip-xp .xp-tier-track { height: 4px; }
    .strip-xp .xp-lv-track { height: 4px; }
    .strip-xp .xp-tier-label { font-size: 0.50rem; }
    .strip-xp .xp-lv-anchor { font-size: 0.46rem; }
}

/* 내 순위 줄 */
.mini-rank-me {
    padding: 5px 9px 4px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.78rem;
    color: rgba(255,200,80,0.8);
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-shadow: 0 0 6px rgba(255,200,80,0.3);
}

/* 전광판 마퀴 */
.mini-rank-marquee {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    height: 36px;
    display: flex;
    align-items: center;
}
.mini-rank-top-bar .mini-rank-marquee {
    padding: 0 12px 0 8px;
}
.mini-rank-track {
    display: inline-block;
    white-space: nowrap;
    font-family: 'Gowun Batang', serif;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(230, 242, 255, 0.98);
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.85),
        0 -1px 0 rgba(0, 0, 0, 0.5),
        1px 1px 2px rgba(0, 0, 0, 0.9),
        0 0 12px rgba(0, 20, 40, 0.5);
    padding-left: 100%;
    animation: mini-marquee-scroll 28s linear infinite;
}
.mini-rank-track .mini-rank-mq-item {
    font-weight: 700;
}
/* 순위: 형광 느낌 */
.mini-rank-mq-rank {
    font-weight: 800;
    margin-right: 2px;
}
.mini-rank-mq-rank--1 {
    color: #fff566;
    text-shadow:
        0 0 10px rgba(255, 240, 80, 0.95),
        0 0 18px rgba(255, 200, 40, 0.55),
        0 1px 0 #000,
        1px 1px 0 #000;
}
.mini-rank-mq-rank--2 {
    color: #7dff9a;
    text-shadow:
        0 0 10px rgba(120, 255, 160, 0.75),
        0 1px 0 #000,
        1px 1px 0 #000;
}
.mini-rank-mq-rank--3 {
    color: #6ee7ff;
    text-shadow:
        0 0 10px rgba(100, 220, 255, 0.75),
        0 1px 0 #000,
        1px 1px 0 #000;
}
.mini-rank-mq-meta,
.mini-rank-mq-nick {
    font-weight: 700;
    text-shadow:
        0 1px 0 #000,
        1px 1px 2px rgba(0, 0, 0, 0.85);
}
.mini-rank-mq-heart-wrap {
    display: inline;
    margin-left: 2px;
    white-space: nowrap;
}
.mini-rank-mq-heart {
    display: inline;
    filter: drop-shadow(0 0 6px rgba(255, 45, 60, 0.95)) drop-shadow(0 0 14px rgba(255, 30, 50, 0.75));
    margin-right: 1px;
    vertical-align: middle;
}
.mini-rank-mq-score {
    font-weight: 800;
    color: #ffe8ec;
    text-shadow:
        0 0 8px rgba(255, 60, 80, 0.55),
        0 1px 0 #000;
}
/* Lv.100 전설: 전광판 무지개 그라데이션 */
.mini-rank-mq-item--legend .mini-rank-mq-rank--1,
.mini-rank-mq-item--legend .mini-rank-mq-rank--2,
.mini-rank-mq-item--legend .mini-rank-mq-rank--3,
.mini-rank-mq-item--legend .mini-rank-mq-meta,
.mini-rank-mq-item--legend .mini-rank-mq-nick,
.mini-rank-mq-item--legend .mini-rank-mq-score {
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(90deg, #ff3366, #ffcc00, #33ff99, #33ccff, #aa66ff, #ff3366);
    background-size: 280% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none !important;
    animation: mq-rainbow-slide 5s linear infinite;
}
@keyframes mq-rainbow-slide {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.mini-rank-mq-sep {
    display: inline-block;
    padding: 0 1.1em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    text-shadow: 0 1px 2px #000;
}
.mini-rank-mq-loop-gap {
    display: inline-block;
    width: 3.5em;
}
.mini-rank-mq-empty {
    font-weight: 700;
    color: rgba(200, 230, 255, 0.95);
    text-shadow: 0 1px 2px #000;
}
.mini-rank-widget:hover .mini-rank-track,
.mini-rank-widget:active .mini-rank-track {
    animation-play-state: paused;
}
@keyframes mini-marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ──── 가이드 팁 시스템 ──── */
.mini-rank-marquee-switcher {
    position: relative;
}
.mini-rank-tip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Gowun Batang', serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffe680;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 8px rgba(255,220,80,0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 12px;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(0);
}
.mini-rank-tip-hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}
.mini-rank-tip-show {
    opacity: 1;
    transform: translateY(0);
}
.mini-rank-track-fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.mini-rank-hint {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Gowun Batang', serif;
    font-size: 0.58rem;
    color: rgba(200, 220, 255, 0.5);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.mini-rank-widget:hover .mini-rank-hint,
.mini-rank-widget:focus .mini-rank-hint {
    opacity: 1;
}

/* 순위 변동 알림 */
@keyframes mini-rank-flash {
    0%   { box-shadow: 0 0 0 0 rgba(100,180,255,0.5); }
    50%  { box-shadow: 0 0 14px 3px rgba(100,180,255,0.3); }
    100% { box-shadow: 0 0 0 0 rgba(100,180,255,0); }
}
.mini-rank-flash { animation: mini-rank-flash 0.6s ease-out; }

@media (max-width: 400px) {
    .mini-rank-top-bar .mini-rank-track { font-size: 0.74rem; }
}

/* ──── 새우깡 소진 팝업 다음 보상 힌트 ──── */
.next-reward-hint {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255,200,80,0.1);
    border: 1px solid rgba(255,200,80,0.2);
    text-align: center;
    font-family: 'Gowun Batang', serif;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
}
.next-reward-hint strong { color: #ffe259; }

/* ──── 랭킹 행 진행률 미니바 ──── */
.ranking-progress-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
.ranking-mini-track {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    max-width: 80px;
}
.ranking-mini-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #ffa751, #ffe259);
}
.ranking-mini-pct {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
}

#debug-log {
    position: fixed;
    bottom: 80px;
    left: 8px;
    right: 8px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 11px;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.75);
    color: #0f0;
    padding: 6px 8px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 9999;
    line-height: 1.4;
}
#debug-log.debug-log-hidden {
    display: none;
}
#debug-log .debug-line {
    word-break: break-all;
}

/* 모바일: 새우깡 UI — 콤팩트(상점 옆) 제외 시 소형화 */
@media (max-width: 768px) {
    .shrimp-chips-ui:not(.shrimp-chips-compact) {
        padding: 6px 8px;
        gap: 3px;
        box-sizing: border-box;
    }

    .shrimp-chips-ui:not(.shrimp-chips-compact) .shrimp-bags-row {
        gap: 6px;
    }

    .shrimp-chips-ui:not(.shrimp-chips-compact) .shrimp-inv-img {
        width: 30px !important;
        max-height: 38px !important;
    }
    .shrimp-chips-ui:not(.shrimp-chips-compact) .shrimp-inv-img-large {
        width: 38px !important;
        max-height: 48px !important;
    }
    .shrimp-chips-ui:not(.shrimp-chips-compact) .shrimp-inv-qty {
        font-size: 0.65rem;
        min-width: 16px;
        padding: 0 3px;
    }

    .shrimp-chips-ui:not(.shrimp-chips-compact) .shrimp-current-label {
        font-size: 12px;
        gap: 3px;
    }

    .shrimp-chips-ui:not(.shrimp-chips-compact) .shrimp-chip-icon {
        width: 8px;
        height: 4px;
    }
}

/* 유리병 읽기/팔기 말풍선 (캔버스 클릭 위치 근처) */
.bottle-action-menu {
    position: fixed;
    z-index: 175;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    min-width: 168px;
    background: rgba(28, 32, 48, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}
.bottle-action-menu-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.bottle-action-btn {
    font-family: 'Outfit', 'Malgun Gothic', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 252, 248, 0.96);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, transform 0.1s ease;
}
.bottle-action-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}
.bottle-action-btn:active {
    transform: scale(0.98);
}

/* 전체 빈병 팔기: 좌하단 HUD 스택 맨 아래 (터치 영역 확보) */
.bottle-mass-sell-btn {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 45;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 8px;
    font-family: 'Outfit', 'Malgun Gothic', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    border-radius: 11px;
    border: 1px solid rgba(120, 200, 160, 0.45);
    background: rgba(24, 42, 38, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(220, 255, 235, 0.95);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease, background 0.2s ease;
    white-space: normal;
    text-align: center;
}
.bottle-mass-sell-btn:hover:not(:disabled) {
    background: rgba(32, 58, 50, 0.95);
    transform: scale(1.02);
}
.bottle-mass-sell-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.bottle-mass-sell-btn-hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 일괄 매각 축하 오버레이 */
.mass-sell-happy-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(255, 240, 200, 0.12) 0%, transparent 55%);
}
.mass-sell-happy-hidden {
    opacity: 0;
    visibility: hidden;
}
.mass-sell-happy-text {
    font-family: 'Arial Black', 'Malgun Gothic', sans-serif;
    font-size: clamp(1.6rem, 6vw, 2.75rem);
    font-weight: 900;
    color: rgba(255, 230, 120, 0.98);
    text-shadow: 0 0 22px rgba(255, 200, 60, 0.65), 0 4px 0 rgba(120, 60, 20, 0.35);
    letter-spacing: 0.04em;
    animation: massSellHappyPop 0.45s cubic-bezier(0.34, 1.4, 0.48, 1) both;
}
@keyframes massSellHappyPop {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================================
 *  랜딩 푸터: 깃털 화면에서 제대로 보이는 풀사이즈 푸터
 * ============================================================ */
.landing-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px 20px;
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
    font-family: 'Outfit', sans-serif;
    line-height: 1.65;
}
/* 스크롤 가능한 랜딩 레이아웃: 푸터는 흐름에 포함 */
.landing-inner .landing-footer {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    margin-top: 20px;
    padding: 16px 8px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
}
.landing-footer-love {
    margin: 0 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 225, 180, 0.9);
    letter-spacing: 0.02em;
}
.landing-footer-copy {
    margin: 0 0 3px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}
.landing-footer-contact {
    margin: 0;
    font-size: 0.72rem;
}
.landing-footer-email {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.25s ease;
}
.landing-footer-email:hover,
.landing-footer-email:focus {
    color: gold;
    text-decoration: underline;
}
@media (max-width: 480px) {
    .landing-footer { padding: 12px 14px 16px; }
    .landing-footer-love { font-size: 0.78rem; }
    .landing-footer-copy,
    .landing-footer-contact { font-size: 0.65rem; }
}

/* ──── 편지 읽기 버튼 (랜딩 화면) ──── */
.landing-share-row {
    display: flex;
    justify-content: center;
    margin: 18px 0 6px;
}
.landing-letter-reader-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #fff;
    font-family: 'Gowun Batang', serif;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}
.landing-letter-reader-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
}
.landing-letter-reader-btn:active {
    transform: scale(0.97);
}

/* ──── 편지 읽기 모달 ──── */
.letter-reader-overlay {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 8, 30, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
}
.letter-reader-hidden {
    display: none !important;
}
.letter-reader-card {
    position: relative;
    width: min(92vw, 420px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, #1a1a3e 0%, #0e0e2a 100%);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 20px;
    padding: 28px 24px 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.letter-reader-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
}
.letter-reader-close:hover { color: #fff; }
.letter-reader-title {
    text-align: center;
    font-family: 'Gowun Batang', serif;
    font-size: 1.15rem;
    color: #e0d4f5;
    margin: 0 0 16px;
}
.letter-reader-body {
    flex: 1;
    overflow-y: auto;
    min-height: 140px;
    max-height: 50vh;
    padding: 20px;
    background: rgba(255, 255, 240, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.letter-reader-text {
    font-family: 'Gowun Batang', serif;
    font-size: 0.92rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.88);
    white-space: pre-wrap;
    word-break: keep-all;
    margin: 0;
    transition: opacity 0.15s ease;
}
.letter-reader-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}
.letter-reader-nav-btn {
    padding: 8px 18px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 10px;
    background: rgba(167, 139, 250, 0.12);
    color: #d4c4f5;
    font-family: 'Gowun Batang', serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.letter-reader-nav-btn:hover:not(:disabled) {
    background: rgba(167, 139, 250, 0.25);
    transform: scale(1.03);
}
.letter-reader-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.letter-reader-counter {
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 60px;
    text-align: center;
}

/* ──── 업데이트 환영 팝업 ──── */
.update-announce-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 8, 24, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
    box-sizing: border-box;
    animation: announce-fade-in 0.4s ease;
}
@keyframes announce-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.update-announce-hidden {
    display: none !important;
}
.update-announce-card {
    width: 90%;
    max-width: 380px;
    padding: 28px 24px 24px;
    background: linear-gradient(165deg, #1a2544 0%, #0d1528 50%, #162040 100%);
    border-radius: 20px;
    border: 1.5px solid rgba(255, 210, 80, 0.3);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 200, 60, 0.08) inset;
    text-align: center;
    font-family: 'Gowun Batang', serif;
    animation: announce-card-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes announce-card-pop {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.update-announce-badge {
    font-size: 2.6rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 8px rgba(255, 200, 60, 0.4));
}
.update-announce-title {
    margin: 0 0 12px;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd966, #ffb347, #ffd966);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.update-announce-body {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.75;
    color: rgba(220, 230, 255, 0.88);
    word-break: keep-all;
}
.update-announce-body strong {
    color: #ffd966;
    -webkit-text-fill-color: #ffd966;
}
.update-announce-close {
    display: inline-block;
    padding: 11px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffd966, #f0b830);
    color: #2a1a00;
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 14px rgba(255, 200, 60, 0.3);
}
.update-announce-close:hover {
    transform: scale(1.04);
    box-shadow: 0 5px 20px rgba(255, 200, 60, 0.4);
}
.update-announce-close:active {
    transform: scale(0.97);
}

/* ============================================================
 *  게임 중 슬림 푸터: 클릭 관통, 최소 존재감
 * ============================================================ */
.slim-footer {
    position: fixed;
    bottom: 4px;
    left: 0;
    right: 0;
    z-index: 800;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.48rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    user-select: none;
}
/* 랜딩 중에는 슬림 푸터 숨김 (랜딩 안에 풀사이즈 푸터가 있으므로) */
body.landing-active .slim-footer {
    opacity: 0;
}
.slim-footer-text {
    pointer-events: none;
}
.slim-footer-sep {
    margin: 0 4px;
    opacity: 0.4;
}
.slim-footer-email {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    pointer-events: auto;
    transition: color 0.2s ease;
}
.slim-footer-email:hover,
.slim-footer-email:focus {
    color: gold;
    text-decoration: underline;
}
@media (max-width: 480px) {
    .slim-footer {
        font-size: 0.42rem;
        bottom: 3px;
    }
}

/* ──── 여전사 장비 획득 팝업 ──── */
.warrior-item-overlay {
    position: fixed; inset: 0; z-index: 7500;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0);
    pointer-events: all;
    transition: background 0.4s ease;
}
.warrior-item-overlay.warrior-item-show { background: rgba(0, 0, 0, 0.78); }
.warrior-item-overlay.warrior-item-hide { background: rgba(0, 0, 0, 0); }
.warrior-item-card {
    text-align: center;
    background: linear-gradient(135deg, #1a1028 0%, #2a1040 50%, #1a1028 100%);
    border: 2px solid rgba(200, 140, 255, 0.35);
    border-radius: 18px;
    padding: 28px 24px 22px;
    max-width: 320px; width: 85vw;
    box-shadow: 0 0 40px rgba(160, 100, 255, 0.25), inset 0 0 30px rgba(120, 60, 200, 0.08);
    transform: scale(0.7) translateY(30px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}
.warrior-item-show .warrior-item-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.warrior-item-hide .warrior-item-card {
    transform: scale(0.85) translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.warrior-item-icon {
    font-size: 56px;
    margin-bottom: 8px;
    animation: warrior-icon-float 2s ease-in-out infinite;
}
@keyframes warrior-icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.warrior-item-name {
    font-size: 20px;
    font-weight: 700;
    color: #e0c0ff;
    margin-bottom: 12px;
    text-shadow: 0 0 12px rgba(180, 120, 255, 0.5);
}
.warrior-item-msg {
    font-size: 14px;
    line-height: 1.65;
    color: #c8b8e0;
    margin-bottom: 16px;
    font-style: italic;
}
.warrior-item-progress {
    font-size: 12px;
    color: #9080b0;
    margin-bottom: 6px;
}
.warrior-item-complete {
    font-size: 13px;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}
.warrior-item-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 32px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.warrior-item-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ──── 레벨업 축하 팝업 ──── */
.lu-popup-overlay {
    position: fixed; inset: 0; z-index: 7000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0);
    pointer-events: all;
    transition: background 0.4s ease;
}
.lu-popup-overlay.lu-popup-show { background: rgba(0, 0, 0, 0.72); }
.lu-popup-overlay.lu-popup-hide { background: rgba(0, 0, 0, 0); transition: background 0.4s ease; }

.lu-popup-card {
    position: relative;
    width: min(88vw, 360px);
    padding: 32px 24px 26px;
    border-radius: 20px;
    background: linear-gradient(165deg, rgba(20, 10, 50, 0.95), rgba(10, 25, 60, 0.97));
    border: 1.5px solid rgba(255, 200, 80, 0.35);
    box-shadow:
        0 0 40px rgba(255, 200, 80, 0.18),
        0 8px 32px rgba(0, 0, 0, 0.6);
    text-align: center;
    overflow: hidden;
    transform: scale(0.5) translateY(40px); opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.lu-popup-show .lu-popup-card { transform: scale(1) translateY(0); opacity: 1; }
.lu-popup-hide .lu-popup-card { transform: scale(0.85) translateY(30px); opacity: 0; transition: all 0.35s ease; }

.lu-popup-confetti {
    position: absolute; inset: 0;
    pointer-events: none; overflow: hidden;
}
.lu-confetti-piece {
    position: absolute; top: -20px;
    animation: lu-confetti-fall linear forwards;
    opacity: 0.9;
}
@keyframes lu-confetti-fall {
    0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    80%  { opacity: 0.8; }
    100% { transform: translateY(calc(100vh)) rotate(720deg) scale(0.5); opacity: 0; }
}

.lu-popup-badge {
    font-size: 3rem; margin-bottom: 4px;
    animation: lu-badge-bounce 0.7s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes lu-badge-bounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.lu-popup-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.4rem; font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ffaa00, #ffe066);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.08em;
    text-shadow: none;
    filter: drop-shadow(0 2px 6px rgba(255, 180, 0, 0.45));
    animation: lu-title-pop 0.6s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes lu-title-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.lu-popup-level {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 200, 80, 0.6);
    margin-top: 2px;
    animation: lu-slide-up 0.4s 0.3s ease-out both;
}
.lu-popup-rank {
    font-family: 'Gowun Batang', serif;
    font-size: 1.15rem;
    color: rgba(255, 230, 160, 0.95);
    margin-top: 4px;
    animation: lu-slide-up 0.4s 0.4s ease-out both;
}
.lu-popup-nick {
    font-size: 0.95rem;
    color: rgba(200, 220, 255, 0.85);
    margin-top: 2px;
    animation: lu-slide-up 0.4s 0.48s ease-out both;
}
.lu-popup-perk {
    margin-top: 14px; padding: 8px 14px;
    border-radius: 10px;
    background: rgba(60, 255, 140, 0.1);
    border: 1px solid rgba(60, 255, 140, 0.25);
    font-size: 0.92rem;
    color: rgba(140, 255, 180, 0.95);
    animation: lu-slide-up 0.4s 0.55s ease-out both;
}
.lu-popup-mission {
    margin-top: 12px;
    display: flex; flex-direction: column; gap: 2px;
    animation: lu-slide-up 0.4s 0.62s ease-out both;
}
.lu-popup-mission-label {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: rgba(255, 200, 80, 0.7);
}
.lu-popup-mission-detail {
    font-size: 0.9rem;
    color: rgba(255, 240, 210, 0.9);
}
.lu-popup-mission-detail b { color: #ffd700; }

@keyframes lu-slide-up {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.lu-popup-btn {
    margin-top: 20px;
    padding: 12px 28px;
    border: none; border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem; font-weight: 700;
    color: #1a0a00;
    background: linear-gradient(135deg, #ffd700, #ffb300, #ffe066);
    box-shadow:
        0 0 18px rgba(255, 200, 0, 0.4),
        0 4px 14px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    animation: lu-btn-glow 1.8s ease-in-out infinite alternate, lu-slide-up 0.5s 0.75s ease-out both;
}
.lu-popup-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 28px rgba(255, 200, 0, 0.6), 0 4px 18px rgba(0, 0, 0, 0.4);
}
.lu-popup-btn:active { transform: scale(0.97); }
@keyframes lu-btn-glow {
    0%   { box-shadow: 0 0 14px rgba(255, 200, 0, 0.3), 0 4px 14px rgba(0,0,0,0.35); }
    100% { box-shadow: 0 0 26px rgba(255, 200, 0, 0.55), 0 4px 18px rgba(0,0,0,0.4); }
}

/* ──── 랭킹 FAB 버튼 ──── */
.ranking-fab {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.15);
    transition: transform 0.15s ease, opacity 0.3s ease;
}
.ranking-fab:active { transform: translateX(-50%) scale(0.92); }
.ranking-fab-hidden { opacity: 0; pointer-events: none; display: none; }

/* ──── 랭킹 모달 ──── */
.ranking-modal {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.3s ease;
}
.ranking-modal-hidden { opacity: 0; pointer-events: none; }
.ranking-modal-inner {
    width: 92%;
    max-width: 380px;
    max-height: 80vh;
    background: linear-gradient(180deg, #1a1a3e 0%, #0f0f2a 100%);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ranking-title {
    margin: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 1.28rem;
    font-weight: 700;
    color: #fff;
}
.ranking-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.ranking-close-btn:hover { color: #fff; }

.ranking-tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ranking-tab {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.ranking-tab-active {
    color: #ffe566;
    border-color: rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.12);
    box-shadow: 0 0 12px rgba(255, 200, 80, 0.15);
}
.ranking-panel-hidden {
    display: none !important;
}
.ranking-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.ranking-legend-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 8px;
    -webkit-overflow-scrolling: touch;
}

.ranking-row-legend {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    padding: 14px 12px;
    margin-bottom: 12px;
    border-radius: 16px;
    position: relative;
    min-height: 88px;
    box-sizing: border-box;
    background: linear-gradient(145deg, rgba(30, 22, 8, 0.95) 0%, rgba(18, 14, 28, 0.98) 100%);
    border: 2px solid rgba(255, 200, 80, 0.45);
    box-shadow:
        0 0 0 1px rgba(255, 220, 120, 0.15),
        0 0 28px rgba(255, 180, 40, 0.35);
    animation: legend-card-glow 3.5s ease-in-out infinite;
}
@keyframes legend-card-glow {
    0%, 100% {
        border-color: rgba(255, 200, 80, 0.45);
        box-shadow: 0 0 0 1px rgba(255, 220, 120, 0.15), 0 0 28px rgba(255, 180, 40, 0.35);
    }
    50% {
        border-color: rgba(255, 230, 140, 0.85);
        box-shadow: 0 0 0 2px rgba(255, 200, 80, 0.35), 0 0 48px rgba(255, 200, 80, 0.45);
    }
}
.ranking-row-legend.is-me {
    box-shadow: 0 0 24px rgba(255, 200, 80, 0.25);
}
.ranking-legend-crown {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    align-self: flex-start;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}
.ranking-legend-inner {
    flex: 1;
    min-width: 0;
}
.ranking-legend-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 200, 80, 0.5);
    margin-bottom: 4px;
}
.ranking-legend-name {
    font-family: 'Gowun Batang', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    word-break: break-word;
}
.ranking-legend-quote {
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    color: rgba(255, 240, 220, 0.9);
    margin-top: 6px;
    line-height: 1.35;
    word-break: break-word;
}
.ranking-legend-meta {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 8px;
}

/* ──── 고백 연출 오버레이 ──── */
.confession-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 2s ease;
}
.confession-overlay.confession-show {
    background: rgba(0, 0, 0, 0.85);
}
.confession-overlay.confession-fadeout {
    background: rgba(0, 0, 0, 0);
    transition: background 0.8s ease;
}
.confession-overlay.confession-hidden {
    display: none !important;
}
.confession-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.confession-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px;
    text-align: center;
}
.confession-figure {
    width: 140px;
    height: auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 0 60px rgba(255, 215, 0, 0.15);
    animation: confessionFigureAppear 1.2s ease-out both, confessionFigureGlow 3s ease-in-out infinite 1.2s;
    object-fit: cover;
}
@keyframes confessionFigureAppear {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes confessionFigureGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 0 60px rgba(255, 215, 0, 0.15); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), 0 0 80px rgba(255, 215, 0, 0.25); }
}
@media (max-width: 420px) {
    .confession-figure { width: 110px; }
}
.confession-typing {
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 1.6rem;
    color: #fff;
    min-height: 2em;
    line-height: 1.5;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.3);
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.confession-typing::after {
    content: '|';
    animation: confession-blink 0.7s step-end infinite;
    color: rgba(255, 215, 0, 0.8);
    margin-left: 2px;
}
@keyframes confession-blink {
    50% { opacity: 0; }
}
.confession-name-reveal {
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 2rem;
    background: linear-gradient(135deg, #ffd700, #fff7ae, #ffd700, #ffe066);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: confession-name-glow 3s ease infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
    transform: scale(0);
    transition: transform 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.confession-name-reveal.confession-name-show {
    transform: scale(1);
}
@keyframes confession-name-glow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.confession-name-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}
.confession-wave {
    font-size: 3rem;
    transform-origin: 70% 70%;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.confession-wave.confession-wave-anim {
    opacity: 1;
    animation: confession-wave-hand 1.5s ease-in-out infinite;
}
@keyframes confession-wave-hand {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-8deg); }
    45% { transform: rotate(14deg); }
    60% { transform: rotate(-4deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}
.confession-continue-btn {
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 1rem;
    color: #1a1a2e;
    background: linear-gradient(135deg, #ffd700, #ffec80);
    border: none;
    border-radius: 30px;
    padding: 12px 36px;
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    transform: scale(0) !important;
}
.confession-continue-btn.confession-name-show {
    opacity: 1;
    transform: scale(1) !important;
    pointer-events: auto;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.confession-continue-btn:active {
    transform: scale(0.95) !important;
    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.3);
}
.confession-guardian-line {
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.92);
    text-shadow:
        0 0 12px rgba(180, 220, 255, 0.6),
        0 0 30px rgba(120, 180, 255, 0.3);
    line-height: 1.7;
    white-space: pre-line;
    min-height: 2.5em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.confession-guardian-line.confession-name-show {
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 420px) {
    .confession-typing { font-size: 1.2rem; }
    .confession-name-reveal { font-size: 1.5rem; }
    .confession-wave { font-size: 2.4rem; }
    .confession-guardian-line { font-size: 0.95rem; }
}

.mini-rank-mq-guard-text {
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Lv.100 전설 등록 모달 */
.legend-hall-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.legend-hall-modal-show {
    pointer-events: auto;
    opacity: 1;
}
.legend-hall-modal-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
.legend-hall-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 20, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.legend-hall-modal-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 28px 22px 24px;
    border-radius: 20px;
    background: linear-gradient(165deg, #1a1530 0%, #0d0a18 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
    box-shadow:
        0 0 0 1px rgba(255, 220, 120, 0.2),
        0 0 40px rgba(255, 180, 40, 0.2),
        0 16px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
.legend-hall-aura {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 50% 0%, rgba(255, 200, 80, 0.35) 0%, transparent 55%);
    pointer-events: none;
    animation: legend-hall-pulse 3s ease-in-out infinite;
}
@keyframes legend-hall-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}
.legend-hall-title {
    position: relative;
    margin: 0 0 6px;
    font-family: 'Gowun Batang', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 200, 100, 0.4);
}
.legend-hall-sub {
    position: relative;
    margin: 0 0 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 220, 160, 0.85);
    text-align: center;
}
.legend-hall-label {
    position: relative;
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 6px;
}
.legend-hall-hint {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
}
.legend-hall-input,
.legend-hall-textarea {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
}
.legend-hall-textarea {
    resize: vertical;
    min-height: 52px;
}
.legend-hall-error {
    position: relative;
    min-height: 1.2em;
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: #ff8a8a;
    text-align: center;
}
.legend-hall-actions {
    position: relative;
    margin-top: 8px;
    text-align: center;
}
.legend-hall-submit {
    padding: 12px 28px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1a1205;
    background: linear-gradient(90deg, #ffd700, #ffec8b, #ffd700);
    background-size: 200% auto;
    box-shadow: 0 4px 24px rgba(255, 200, 60, 0.45);
    animation: legend-hall-pulse 3s ease-in-out infinite;
}
.legend-hall-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ranking-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px 4px;
    -webkit-overflow-scrolling: touch;
}
.ranking-loading {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    padding: 24px 0;
}
.ranking-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.2s ease;
}
.ranking-row.is-me { background: rgba(255,200,80,0.12); }
.ranking-row:nth-child(1) { background: rgba(255,215,0,0.15); }
.ranking-row:nth-child(2) { background: rgba(192,192,192,0.1); }
.ranking-row:nth-child(3) { background: rgba(205,127,50,0.1); }
.ranking-rank {
    width: 32px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.08rem;
    flex-shrink: 0;
}
.rank-gold { color: #FFD700; }
.rank-silver { color: #C0C0C0; }
.rank-bronze { color: #CD7F32; }
.rank-normal { color: rgba(255,255,255,0.6); }
.ranking-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.ranking-name {
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ranking-score {
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
}
.ranking-crown {
    font-size: 1.12rem;
    flex-shrink: 0;
}
.ranking-my {
    padding: 10px 18px 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    color: rgba(255,220,160,0.9);
    text-align: center;
}

/* ═══════════════════════════════════════════
   이벤트 배너
   ═══════════════════════════════════════════ */
.event-banner {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 46px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 54;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 92%;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(168,85,247,0.92), rgba(99,102,241,0.92));
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 6px 24px rgba(99,102,241,0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    animation: eventBannerSlide 0.5s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes eventBannerSlide {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.event-banner-hidden {
    display: none !important;
}
.event-banner-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.event-banner-title {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.88rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-banner-desc {
    font-family: 'Gowun Batang', serif;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-banner-close {
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.event-banner-close:hover {
    background: rgba(255,255,255,0.25);
}

/* ═══════════════════════════════════════════
   편지 시스템 고도화 UI
   ═══════════════════════════════════════════ */

/* 편지 쓰기: 행복지수 별점 */
.write-letter-happiness-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0 4px;
}
.write-letter-happiness-label {
    font-size: 0.85rem;
    color: #6b5d50;
    font-weight: 600;
}
.write-letter-stars {
    display: flex;
    gap: 4px;
}
.write-letter-star {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #c8b897;
    cursor: pointer;
    padding: 2px;
    transition: color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}
.write-letter-star:hover {
    transform: scale(1.2);
}
.write-letter-star.star-filled {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* 편지 읽기: 행복지수 표시 */
.letter-happiness-display {
    text-align: center;
    padding: 6px 0 10px;
    font-family: 'Gowun Batang', serif;
}
.letter-happiness-hidden {
    display: none;
}
.letter-happiness-label {
    font-size: 0.78rem;
    color: #8d6e46;
    margin-right: 6px;
}
.letter-star {
    font-size: 1.1rem;
    color: #c8b897;
}
.letter-star-filled {
    color: #f59e0b;
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

/* 잭팟 배너 */
.letter-jackpot-banner {
    text-align: center;
    padding: 12px 8px;
    margin-top: 12px;
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: #d97706;
    background: linear-gradient(135deg, rgba(255,237,180,0.6), rgba(255,220,120,0.4));
    border-radius: 10px;
    border: 1px solid rgba(217,119,6,0.3);
    animation: jackpotPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.letter-jackpot-hidden {
    display: none;
}
@keyframes jackpotPop {
    0% { opacity: 0; transform: scale(0.6); }
    100% { opacity: 1; transform: scale(1); }
}

/* ── 유리병 선택 모달 ── */
.bottle-choice-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 12, 30, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 16px;
    box-sizing: border-box;
}
.bottle-choice-hidden {
    display: none !important;
    pointer-events: none;
}
.bottle-choice-card {
    width: 92%;
    max-width: 380px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
    padding: 28px 22px 24px;
    text-align: center;
    animation: bottleChoiceAppear 0.35s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes bottleChoiceAppear {
    0% { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.bottle-choice-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
    animation: bottleFloat 2s ease-in-out infinite;
}
@keyframes bottleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.bottle-choice-title {
    margin: 0 0 6px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.25rem;
    color: rgba(255, 252, 240, 0.95);
}
.bottle-choice-desc {
    margin: 0 0 20px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.88rem;
    color: rgba(200, 210, 230, 0.75);
    line-height: 1.6;
}
.bottle-choice-event-badge {
    margin: -6px 0 10px;
    padding: 5px 12px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.78rem;
    color: #fef3c7;
    background: linear-gradient(135deg, rgba(245,158,11,0.85), rgba(239,68,68,0.85));
    border-radius: 8px;
    text-align: center;
    animation: eventBadgePulse 1.5s ease-in-out infinite;
}
.bottle-choice-event-hidden {
    display: none;
}
@keyframes eventBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
.bottle-choice-jackpot-info {
    margin: 10px 0 0;
    padding: 8px 12px;
    font-size: 0.72rem;
    color: #e2e8f0;
    background: rgba(30,41,59,0.65);
    border-radius: 8px;
    border: 1px solid rgba(251,191,36,0.3);
    text-align: center;
    line-height: 1.6;
}
.jackpot-tier {
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}
.jackpot-tier.tier-legend {
    color: #fbbf24;
    background: rgba(251,191,36,0.15);
}
.jackpot-tier.tier-rare {
    color: #a78bfa;
    background: rgba(167,139,250,0.15);
}
.jackpot-tier.tier-common {
    color: #34d399;
    background: rgba(52,211,153,0.15);
}
.bottle-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bottle-choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}
.bottle-choice-btn:active {
    transform: scale(0.97);
}
.bottle-choice-btn-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.bottle-choice-btn-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255,252,245,0.95);
}
.bottle-choice-btn-sub {
    display: block;
    font-family: 'Gowun Batang', serif;
    font-size: 0.72rem;
    color: rgba(200,210,230,0.6);
    margin-top: 2px;
}
.bottle-choice-sell {
    background: rgba(255,255,255,0.06);
}
.bottle-choice-sell:hover {
    background: rgba(255,255,255,0.12);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.bottle-choice-read {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.2));
    border-color: rgba(168,85,247,0.3);
}
.bottle-choice-read:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(168,85,247,0.3));
    box-shadow: 0 4px 20px rgba(168,85,247,0.25);
}

/* ── New Challenger 경고 오버레이 ── */
.new-challenger-overlay {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: newChallengerFlash 0.3s ease-in-out 3;
}
.new-challenger-hidden {
    display: none !important;
}
.new-challenger-card {
    text-align: center;
    padding: 28px 40px;
    background: radial-gradient(ellipse at center, rgba(40,0,0,0.92) 0%, rgba(20,0,0,0.85) 100%);
    border: 3px solid rgba(255,60,40,0.8);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(255,40,20,0.5), inset 0 0 20px rgba(255,60,40,0.2);
    animation: newChallengerPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.new-challenger-warning {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.1rem;
    color: #ff4444;
    letter-spacing: 6px;
    margin-bottom: 8px;
    animation: newChallengerBlink 0.5s ease-in-out infinite alternate;
}
.new-challenger-icon {
    font-size: 3rem;
    margin: 8px 0;
}
.new-challenger-title {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.3rem;
    color: #fbbf24;
    margin-bottom: 4px;
}
.new-challenger-name {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.6rem;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255,60,40,0.8);
}
@keyframes newChallengerFlash {
    0%, 100% { background: transparent; }
    50% { background: rgba(255,20,0,0.12); }
}
@keyframes newChallengerPop {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes newChallengerBlink {
    0% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* ── Confetti 캔버스 ── */
.confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 300;
    pointer-events: none;
    width: 100%;
    height: 100%;
}
.confetti-hidden {
    display: none;
}

/* ═══════════════════════════════════════════
   인트로 스토리 모달
   ═══════════════════════════════════════════ */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    box-sizing: border-box;
}
.intro-hidden {
    display: none !important;
    pointer-events: none;
}
.intro-card {
    position: relative;
    width: 92%;
    max-width: 400px;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    border-radius: 24px;
    border: 1px solid rgba(99,102,241,0.25);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(99,102,241,0.1) inset;
    padding: 36px 24px 28px;
    overflow: hidden;
    animation: introCardAppear 0.6s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes introCardAppear {
    0% { opacity: 0; transform: scale(0.85) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.intro-skip-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.15s ease;
    z-index: 2;
}
.intro-skip-btn:hover {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}

/* 페이지 슬라이드 */
.intro-page {
    display: none;
    text-align: center;
    animation: introPageFade 0.4s ease-out both;
}
.intro-page-active {
    display: block;
}
@keyframes introPageFade {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}
.intro-emoji {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: introEmojiFloat 2.5s ease-in-out infinite;
}
@keyframes introEmojiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.intro-heading {
    margin: 0 0 12px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.2rem;
    color: rgba(255,240,220,0.95);
    letter-spacing: 0.03em;
}
.intro-text {
    margin: 0;
    font-family: 'Gowun Batang', serif;
    font-size: 0.88rem;
    color: rgba(200,210,230,0.82);
    line-height: 1.75;
}
.intro-text strong {
    color: rgba(255,220,140,0.95);
}

/* 페이지 인디케이터 */
.intro-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 18px;
}
.intro-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s ease, transform 0.3s ease;
}
.intro-dot-active {
    background: rgba(99,102,241,0.9);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

/* 버튼 */
.intro-next-btn,
.intro-start-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    border: none;
}
.intro-next-btn {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.12);
}
.intro-next-btn:hover {
    background: rgba(255,255,255,0.14);
}
.intro-start-btn {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    box-shadow: 0 6px 24px rgba(99,102,241,0.4);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    font-size: 1.05rem;
}
.intro-start-btn:hover {
    box-shadow: 0 8px 32px rgba(99,102,241,0.55);
}
.intro-next-btn:active,
.intro-start-btn:active {
    transform: scale(0.97);
}
.intro-start-hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════
   기부 & 환생 시스템
   ═══════════════════════════════════════════ */

/* 기부 뱃지 (HUD 레벨 옆) */
.donation-badge-icon {
    font-size: 0.9rem;
    margin: 0 2px;
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.5));
    animation: badgeShine 3s ease-in-out infinite;
}
.donation-badge-hidden {
    display: none !important;
}
@keyframes badgeShine {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255,215,0,0.4)); }
    50% { filter: drop-shadow(0 0 8px rgba(255,215,0,0.7)); }
}

/* 기부 FAB 버튼 (Lv.100 이상 상시 표시) */
.donate-fab-btn {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: calc(52px + env(safe-area-inset-top, 0px));
    z-index: 58;
    padding: 6px 14px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 0.75rem;
    color: #fff;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    border: 1px solid rgba(236,72,153,0.4);
    border-radius: 20px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(168,85,247,0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    animation: donateFabPulse 2.5s ease-in-out infinite;
}
.donate-fab-btn:active {
    transform: translateX(-50%) scale(0.95);
}
.donate-fab-hidden {
    display: none !important;
}
@keyframes donateFabPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(168,85,247,0.35); }
    50% { box-shadow: 0 4px 24px rgba(168,85,247,0.55); }
}

/* 기부 제안 팝업 */
.donation-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 22, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px;
    box-sizing: border-box;
}
.donation-hidden {
    display: none !important;
    pointer-events: none;
}
.donation-card {
    width: 92%;
    max-width: 400px;
    background: linear-gradient(180deg, #1a1035 0%, #0d0a1f 100%);
    border-radius: 22px;
    border: 1px solid rgba(168,85,247,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(168,85,247,0.15) inset;
    padding: 32px 24px 28px;
    text-align: center;
    animation: donationAppear 0.5s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes donationAppear {
    0% { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.donation-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    animation: donationHeartbeat 1.5s ease-in-out infinite;
}
@keyframes donationHeartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
.donation-title {
    margin: 0 0 14px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.3rem;
    color: rgba(255,240,220,0.95);
    letter-spacing: 0.02em;
}
.donation-desc {
    margin: 0 0 22px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.88rem;
    color: rgba(200,210,230,0.85);
    line-height: 1.7;
}
.donation-sub {
    font-size: 0.78rem;
    color: rgba(180,190,210,0.65);
}
.donation-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.donation-btn {
    padding: 14px 16px;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}
.donation-btn:active {
    transform: scale(0.97);
}
.donation-btn-donate {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #fff;
    border-color: rgba(236,72,153,0.4);
    box-shadow: 0 6px 24px rgba(168,85,247,0.35);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.donation-btn-donate:hover {
    box-shadow: 0 8px 30px rgba(168,85,247,0.5);
}
.donation-btn-stay {
    background: rgba(255,255,255,0.06);
    color: rgba(200,210,230,0.7);
    border-color: rgba(255,255,255,0.1);
}
.donation-btn-stay:hover {
    background: rgba(255,255,255,0.12);
}

/* 명예 기부 증서 */
.certificate-overlay {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    box-sizing: border-box;
}
.certificate-hidden {
    display: none !important;
    pointer-events: none;
}
.certificate-card {
    width: 92%;
    max-width: 380px;
    animation: certAppear 0.7s cubic-bezier(0.34,1.2,0.64,1) both;
}
@keyframes certAppear {
    0% { opacity: 0; transform: scale(0.8) rotate(-2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.certificate-border {
    background: linear-gradient(180deg, #fdf8ef 0%, #f5eed8 100%);
    border-radius: 16px;
    border: 3px solid #c9a96e;
    box-shadow: 0 12px 40px rgba(40,30,10,0.4), inset 0 0 30px rgba(201,169,110,0.15);
    padding: 32px 24px 28px;
    text-align: center;
    position: relative;
}
.certificate-header {
    font-family: 'Black Han Sans', serif;
    font-size: 1.3rem;
    color: #5a4020;
    margin-bottom: 18px;
    letter-spacing: 0.08em;
}
.certificate-body {
    margin-bottom: 16px;
}
.certificate-line {
    font-family: 'Gowun Batang', serif;
    font-size: 0.88rem;
    color: #6b5d50;
    line-height: 1.8;
    margin: 0 0 18px;
}
.certificate-info {
    padding: 14px;
    background: rgba(201,169,110,0.1);
    border-radius: 10px;
    border: 1px solid rgba(201,169,110,0.25);
}
.certificate-donor,
.certificate-amount,
.certificate-rebirth {
    margin: 6px 0;
    font-family: 'Gowun Batang', serif;
    font-size: 0.9rem;
    color: #5a4020;
}
.certificate-donor strong,
.certificate-amount strong,
.certificate-rebirth strong {
    color: #8b5e2a;
}
.certificate-stamp {
    font-size: 2.5rem;
    margin: 14px 0 8px;
    opacity: 0.7;
}
.certificate-confirm-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 28px;
    font-family: 'Gowun Batang', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7eb8da, #5a9fc9);
    border: 1px solid rgba(80,130,160,0.5);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(90,159,201,0.4);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.certificate-confirm-btn:hover {
    box-shadow: 0 6px 20px rgba(90,159,201,0.55);
}
.certificate-confirm-btn:active {
    transform: scale(0.97);
}

/* ── 적 도망 페널티: 하트 깜빡임 ── */
@keyframes penaltyHeartBlink {
    0%   { color: #ff2233; text-shadow: 0 0 12px rgba(255,34,51,0.9); transform: scale(1.3); }
    20%  { color: inherit; text-shadow: none; transform: scale(1); }
    40%  { color: #ff2233; text-shadow: 0 0 10px rgba(255,34,51,0.7); transform: scale(1.2); }
    60%  { color: inherit; text-shadow: none; transform: scale(1); }
    80%  { color: #ff2233; text-shadow: 0 0 8px rgba(255,34,51,0.5); transform: scale(1.1); }
    100% { color: inherit; text-shadow: none; transform: scale(1); }
}

.score-heart.penalty-blink {
    animation: penaltyHeartBlink 1.2s ease-out;
}

@keyframes penaltyBoardFlash {
    0%   { box-shadow: 0 0 20px 6px rgba(255,34,51,0.6); }
    25%  { box-shadow: none; }
    50%  { box-shadow: 0 0 16px 4px rgba(255,34,51,0.4); }
    75%  { box-shadow: none; }
    100% { box-shadow: none; }
}

.penalty-blink-board {
    animation: penaltyBoardFlash 1.2s ease-out;
}

/* ══════════════════════════════════════════
   PC 브라우저 반응형 UI 보정 (768px+)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {

    /* 1. 좌상단 HUD: 배경 반투명 박스 + 스케일업 */
    #score-board.hud-happiness-mini {
        left: max(5vw, 32px);
        top: calc(env(safe-area-inset-top, 0px) + 48px);
        transform: scale(1.35);
        transform-origin: top left;
        background: rgba(0, 0, 0, 0.35);
        border-radius: 14px;
        padding: 8px 12px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    }

    /* 텍스트 그림자 강화 */
    .hud-stat-grid .score-num,
    .hud-stat-grid .hud-feather-num {
        text-shadow:
            0 0 14px rgba(255, 255, 255, 0.9),
            0 2px 4px rgba(0, 0, 0, 0.6),
            0 0 24px rgba(255, 255, 255, 0.4);
    }
    .hud-stat-grid .score-heart {
        filter: drop-shadow(0 0 10px rgba(255, 100, 120, 0.7));
    }

    /* 편지 게이지 */
    .hud-happiness-mini .hud-happiness-extra.letter-gauge {
        width: 26px;
        height: 26px;
    }

    /* 2. 우상단 전광판 클러스터 */
    .hud-top-right-cluster {
        right: max(5vw, 32px);
        top: calc(env(safe-area-inset-top, 0px) + 48px);
        transform: scale(1.35);
        transform-origin: top right;
    }

    /* 랭킹 FAB */
    .ranking-fab {
        transform: translateX(-50%) scale(1.3);
    }

    /* 3. 우하단 상점 패널 */
    .player-growth-panel {
        right: max(5vw, 32px);
        bottom: max(3vh, 20px);
        transform: scale(1.25);
        transform-origin: bottom right;
    }

    /* 4. 좌하단 병 힌트 + 일괄 팔기 */
    .hud-bottle-hint-floating.bottle-found-hint {
        left: max(5vw, 32px);
        font-size: 1rem;
    }
    .hud-umbrella-use-floating.umbrella-use-btn {
        left: max(5vw, 32px);
        bottom: calc(max(3vh, 20px) + 90px);
        transform: scale(1.25);
        transform-origin: bottom left;
    }
    .hud-mass-sell-floating.bottle-mass-sell-btn {
        left: max(5vw, 32px);
        bottom: max(3vh, 20px);
        transform: scale(1.25);
        transform-origin: bottom left;
    }
    .bag-open-btn {
        left: max(5vw, 32px);
        bottom: calc(max(3vh, 20px) + 90px + 90px);
        transform: scale(1.25);
        transform-origin: bottom left;
    }
    .quick-buy-fab.quick-buy-floating {
        transform: scale(1.25);
        transform-origin: bottom left;
    }

    /* 5. 토스트 메시지 */
    .toast-msg {
        font-size: 1.15rem;
        padding: 18px 28px;
        max-width: 560px;
        border-radius: 16px;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }

    /* 6. 랜덤 팁 */
    .random-tip {
        font-size: 0.95rem;
        padding: 10px 22px;
        max-width: 520px;
    }

    /* 7. 새우깡 소진 팝업 */
    .shrimp-out-popup {
        transform: scale(1.2);
    }

    /* 8. 유리병 선택 모달 */
    .bottle-choice-overlay .bottle-choice-card {
        transform: scale(1.15);
    }

    /* 9. 이벤트 배너 (편지 시스템 오픈 등) */
    .event-banner {
        transform: translateX(-50%) scale(1.35);
        transform-origin: top center;
        max-width: 560px;
    }
    .event-banner-title {
        font-size: 1.1rem;
    }
    .event-banner-desc {
        font-size: 0.88rem;
    }
    .event-banner-close {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* 더 넓은 PC (1200px+) */
@media (min-width: 1200px) {

    #score-board.hud-happiness-mini {
        left: max(6vw, 48px);
        transform: scale(1.5);
        padding: 10px 14px;
    }

    .hud-top-right-cluster {
        right: max(6vw, 48px);
        transform: scale(1.5);
    }

    .player-growth-panel {
        right: max(6vw, 48px);
        transform: scale(1.4);
    }

    .toast-msg {
        font-size: 1.25rem;
        padding: 20px 32px;
        max-width: 640px;
    }

    .random-tip {
        font-size: 1.05rem;
        max-width: 600px;
    }

    .hud-bottle-hint-floating.bottle-found-hint {
        left: max(6vw, 48px);
        font-size: 1.1rem;
    }

    .hud-umbrella-use-floating.umbrella-use-btn {
        left: max(6vw, 48px);
        bottom: calc(max(3vh, 20px) + 100px);
        transform: scale(1.4);
        transform-origin: bottom left;
    }
    .hud-mass-sell-floating.bottle-mass-sell-btn {
        left: max(6vw, 48px);
        bottom: max(3vh, 20px);
        transform: scale(1.4);
        transform-origin: bottom left;
    }
    .bag-open-btn {
        left: max(6vw, 48px);
        bottom: calc(max(3vh, 20px) + 100px + 100px);
        transform: scale(1.4);
        transform-origin: bottom left;
    }
    .quick-buy-fab.quick-buy-floating {
        transform: scale(1.4);
        transform-origin: bottom left;
    }

    .ranking-fab {
        transform: translateX(-50%) scale(1.45);
    }

    .event-banner {
        transform: translateX(-50%) scale(1.5);
        max-width: 640px;
    }
    .event-banner-title {
        font-size: 1.2rem;
    }
    .event-banner-desc {
        font-size: 0.95rem;
    }
}

/* ── 인트로 영상 오버레이 ── */
.intro-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}
.intro-video-overlay.intro-video-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}
.intro-video-overlay.intro-video-fadeout {
    opacity: 0;
    pointer-events: none;
}
.intro-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.intro-video.intro-video-visible {
    opacity: 1;
}

.intro-cinema-title {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    opacity: 0;
    transition: opacity 1.8s ease;
    pointer-events: none;
}
.intro-cinema-title.intro-cinema-show {
    opacity: 1;
}
.intro-cinema-hidden {
    opacity: 0;
}
.intro-cinema-line1 {
    font-family: 'Gowun Batang', serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.5em;
    margin-bottom: 18px;
    opacity: 0;
    transition: opacity 1.6s 0.2s ease;
}
.intro-cinema-title.intro-cinema-show .intro-cinema-line1 {
    opacity: 1;
}
.intro-cinema-line2 {
    font-family: 'Gowun Batang', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.18em;
    text-shadow: 0 0 60px rgba(100,180,255,0.35), 0 0 20px rgba(100,180,255,0.15), 0 2px 8px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 1.6s 0.8s ease;
}
.intro-cinema-title.intro-cinema-show .intro-cinema-line2 {
    opacity: 1;
}
.intro-cinema-line3 {
    font-family: 'Gowun Batang', serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.35em;
    margin-top: 22px;
    opacity: 0;
    transition: opacity 1.6s 1.6s ease;
}
.intro-cinema-title.intro-cinema-show .intro-cinema-line3 {
    opacity: 1;
}

.intro-cinema-letterbox {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    background: #000;
    z-index: 5;
    transition: height 1s ease;
}
.intro-cinema-letterbox-top { top: 0; }
.intro-cinema-letterbox-bottom { bottom: 0; }
.intro-cinema-letterbox.intro-letterbox-show {
    height: 8vh;
}

.intro-cinema-skip {
    position: absolute;
    bottom: max(10vh, 60px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    font-family: 'Gowun Batang', serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.1em;
    padding: 8px 24px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.5s ease, color 0.3s;
    pointer-events: auto;
}
.intro-cinema-skip.intro-cinema-show {
    opacity: 1;
}
.intro-cinema-skip:active {
    color: rgba(255,255,255,0.7);
}
@media (max-width: 480px) {
    .intro-cinema-line1 { font-size: 0.8rem; letter-spacing: 0.3em; }
    .intro-cinema-line2 { font-size: 1.6rem; }
    .intro-cinema-line3 { font-size: 0.72rem; }
    .intro-cinema-skip { bottom: max(12vh, 50px); font-size: 0.72rem; }
}

/* ══════════════════════════════════════
   Interactive Tutorial Overlay
   ══════════════════════════════════════ */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: auto;
    transition: opacity 0.35s ease;
}
.tutorial-overlay-hidden {
    opacity: 0;
    pointer-events: none !important;
}

.tutorial-dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.tutorial-spotlight {
    display: none;
}

.tutorial-clone-btn {
    border: 3px solid rgba(255, 220, 100, 0.9) !important;
    box-shadow: 0 0 24px 8px rgba(255, 220, 100, 0.45),
                0 0 60px 15px rgba(255, 200, 50, 0.2) !important;
    animation: tut-clone-glow 1.2s ease-in-out infinite alternate !important;
    border-radius: 14px !important;
    overflow: hidden;
}
@keyframes tut-clone-glow {
    0% { box-shadow: 0 0 24px 8px rgba(255,220,100,0.45), 0 0 60px 15px rgba(255,200,50,0.2); }
    100% { box-shadow: 0 0 32px 14px rgba(255,220,100,0.65), 0 0 80px 25px rgba(255,200,50,0.35); }
}

.tutorial-pulse-after {
    animation: tut-real-pulse 0.6s ease-in-out 5 !important;
}
@keyframes tut-real-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,160,0,0); }
    50% { box-shadow: 0 0 20px 8px rgba(255,160,0,0.6); }
}

.tutorial-hand {
    position: absolute;
    font-size: 48px;
    z-index: 2;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
    animation: tut-hand-bounce 1s ease-in-out infinite;
    pointer-events: none;
    transition: top 0.4s ease, left 0.4s ease;
}

@keyframes tut-hand-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.tutorial-msgbox {
    position: absolute;
    z-index: 3;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border: 2px solid #f0c040;
    border-radius: 18px;
    padding: 22px 26px 18px;
    max-width: 340px;
    min-width: 240px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 3px rgba(240,192,64,0.2);
    text-align: center;
    animation: tut-msgbox-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tut-msgbox-pop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.tutorial-msg-text {
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #2c2c2c;
    white-space: pre-line;
    margin-bottom: 16px;
}

.tutorial-ok-btn {
    display: inline-block;
    font-family: 'Black Han Sans', 'Arial Black', sans-serif;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    border: none;
    border-radius: 30px;
    padding: 10px 32px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255,107,0,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tutorial-ok-btn:active {
    transform: scale(0.94);
    box-shadow: 0 2px 8px rgba(255,107,0,0.25);
}

.tutorial-tap-hint {
    margin-top: 10px;
    font-size: 0.72rem;
    color: #999;
    font-family: sans-serif;
}

@media (max-width: 480px) {
    .tutorial-msgbox {
        max-width: 85vw;
        min-width: 200px;
        padding: 18px 18px 14px;
    }
    .tutorial-msg-text { font-size: 0.92rem; }
    .tutorial-hand { font-size: 38px; }
}

/* ──── 여전사 인벤토리 오버레이 ──── */
.inv-overlay {
    position: fixed; inset: 0; z-index: 580;
    display: flex; align-items: center; justify-content: center;
    pointer-events: all;
    transition: opacity 0.35s ease;
    opacity: 1;
}
.inv-overlay-hidden { opacity: 0; pointer-events: none; }
.inv-backdrop {
    position: absolute; inset: 0;
    background: rgba(5, 8, 22, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.inv-panel {
    position: relative; z-index: 1;
    width: 88vw; max-width: 380px;
    background: linear-gradient(160deg, #0d1233 0%, #141840 40%, #1a1050 100%);
    border: 1.5px solid rgba(120, 140, 255, 0.2);
    border-radius: 20px;
    padding: 24px 20px 20px;
    box-shadow: 0 8px 60px rgba(60, 40, 160, 0.3), inset 0 0 40px rgba(80, 60, 180, 0.06);
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.inv-overlay:not(.inv-overlay-hidden) .inv-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.inv-close-btn {
    position: absolute; top: 10px; right: 14px;
    background: none; border: none;
    font-size: 28px; color: rgba(180, 190, 255, 0.6);
    cursor: pointer; line-height: 1;
    transition: color 0.15s;
}
.inv-close-btn:hover, .inv-close-btn:active { color: #fff; }
.inv-title {
    text-align: center;
    font-size: 18px; font-weight: 800;
    color: #d0c0ff;
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-shadow: 0 0 16px rgba(160, 120, 255, 0.4);
}

/* 실루엣 영역 */
.inv-silhouette-wrap {
    display: flex; justify-content: center;
    margin-bottom: 18px;
}
.inv-silhouette {
    position: relative;
    width: 120px; height: 180px;
}
.inv-sil-part {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    text-align: center;
    transition: opacity 0.6s ease, filter 0.6s ease;
}
.inv-sil-part.inv-sil-locked {
    opacity: 0.12;
    filter: grayscale(1) brightness(0.4);
}
.inv-sil-part.inv-sil-unlocked {
    opacity: 1;
    filter: none;
    animation: inv-sil-glow 2.5s ease-in-out infinite;
}
@keyframes inv-sil-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(180, 140, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 12px rgba(180, 140, 255, 0.6)); }
}
.inv-sil-boots   { bottom: 0; font-size: 28px; }
.inv-sil-shield  { bottom: 55px; left: 20%; transform: none; font-size: 26px; }
.inv-sil-cloak   { top: 30px; font-size: 32px; }
.inv-sil-armor   { top: 45px; font-size: 30px; }
.inv-sil-weapon  { top: 10px; left: 72%; transform: none; font-size: 30px; }
.inv-sil-body    {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 64px;
    opacity: 0.06;
    filter: grayscale(1);
    transition: opacity 0.8s ease, filter 0.8s ease;
    pointer-events: none;
}
.inv-sil-body.inv-sil-body-progress-1 { opacity: 0.12; }
.inv-sil-body.inv-sil-body-progress-2 { opacity: 0.22; }
.inv-sil-body.inv-sil-body-progress-3 { opacity: 0.38; }
.inv-sil-body.inv-sil-body-progress-4 { opacity: 0.6; filter: grayscale(0.4); }
.inv-sil-body.inv-sil-body-complete {
    opacity: 1;
    filter: none;
    animation: inv-sil-body-shine 3s ease-in-out infinite;
}
@keyframes inv-sil-body-shine {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(200, 160, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(200, 160, 255, 0.7)) brightness(1.1); }
}

/* 아이템 슬롯 그리드 */
.inv-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}
.inv-slot {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.inv-slot-locked {
    background: rgba(40, 40, 80, 0.5);
    border: 1.5px dashed rgba(100, 100, 160, 0.3);
    color: rgba(120, 120, 180, 0.4);
}
.inv-slot-unlocked {
    background: rgba(60, 40, 120, 0.4);
    border: 1.5px solid rgba(160, 120, 255, 0.35);
    box-shadow: 0 0 12px rgba(140, 100, 240, 0.2);
    animation: inv-slot-pulse 2s ease-in-out infinite;
}
@keyframes inv-slot-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(140, 100, 240, 0.15); }
    50% { box-shadow: 0 0 18px rgba(140, 100, 240, 0.35); }
}
.inv-slot-label {
    position: absolute; bottom: -16px; left: 50%;
    transform: translateX(-50%);
    font-size: 9px; white-space: nowrap;
    color: rgba(180, 170, 220, 0.7);
}
.inv-status-msg {
    text-align: center;
    font-size: 12px;
    color: #9888c0;
    line-height: 1.5;
    min-height: 18px;
}
.inv-status-msg-complete {
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* 인벤토리 열기 버튼 */
.inventory-open-btn {
    position: fixed;
    left: 12px; bottom: 140px;
    z-index: 200;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(160, 120, 255, 0.3);
    background: rgba(20, 15, 50, 0.7);
    color: #d0c0ff;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(100, 60, 200, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: transform 0.15s, box-shadow 0.15s;
}
.inventory-open-btn:active {
    transform: scale(0.92);
}
.inventory-open-btn-hidden { display: none; }
.inventory-open-btn-has-new {
    animation: inv-btn-notify 1.5s ease-in-out infinite;
}
@keyframes inv-btn-notify {
    0%, 100% { box-shadow: 0 2px 12px rgba(100, 60, 200, 0.3); }
    50% { box-shadow: 0 2px 20px rgba(160, 100, 255, 0.6), 0 0 8px rgba(200, 160, 255, 0.4); }
}

/* ── 여전사 변신 시네마틱 영상 ── */
.warrior-cinema-overlay {
    position: fixed; inset: 0;
    z-index: 20000;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.warrior-cinema-overlay.warrior-cinema-show { opacity: 1; }
.warrior-cinema-overlay.warrior-cinema-hide { opacity: 0; pointer-events: none; }
.warrior-cinema-video {
    max-width: 100%; max-height: 100%;
    width: auto; height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 0 80px rgba(255, 190, 60, 0.25);
}
.warrior-cinema-skip {
    position: fixed;
    bottom: 36px; right: 32px;
    z-index: 20001;
    padding: 10px 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.3s, transform 0.15s;
    letter-spacing: 0.5px;
}
.warrior-cinema-skip:hover { opacity: 1; color: #fff; transform: scale(1.05); }

/* ── 인벤토리 내 여전사 변신 섹션 ── */
.inv-transform-section {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(60, 30, 8, 0.6) 0%, rgba(90, 45, 12, 0.5) 100%);
    border: 1px solid rgba(255, 190, 60, 0.3);
    text-align: center;
}
.inv-transform-hidden { display: none; }
.inv-tf-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffe8a0;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}
.inv-tf-desc {
    font-size: 0.78rem;
    color: rgba(255, 230, 180, 0.75);
    line-height: 1.45;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
}
.inv-tf-desc strong { color: #ffd060; }
.inv-tf-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffc040;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 6px rgba(255, 170, 40, 0.35);
}
.inv-tf-paypal-wrap {
    min-height: 48px;
    margin-bottom: 2px;
}
.inv-tf-complete-msg {
    font-size: 0.82rem;
    font-weight: 600;
    color: #a8ff90;
    padding: 6px 0;
    font-family: 'Outfit', sans-serif;
}

/* ═══════════════════════════════════════════
   🎒 소비 아이템 가방 시스템
   ═══════════════════════════════════════════ */

/* 가방 열기 버튼 - 우측 중단 */
.bag-open-btn {
    position: fixed;
    left: 6px;
    bottom: 166px;
    z-index: 200;
    width: 68px;
    height: 68px;
    min-height: 0;
    padding: 5px 4px;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: center;
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(160, 100, 30, 0.88), rgba(100, 55, 10, 0.92));
    border: 2px solid rgba(255, 200, 120, 0.6);
    border-radius: 16px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(220, 150, 60, 0.25) inset;
    backdrop-filter: blur(6px);
    color: #fff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.bag-open-btn:active { transform: scale(0.9); }
.bag-btn-game-hidden { display: none !important; }
.bag-open-btn:hover:not(:active) {
    background: linear-gradient(135deg, rgba(190, 125, 45, 0.94), rgba(130, 75, 20, 0.96));
    transform: scale(1.05);
}
.bag-btn-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 230, 180, 0.9);
    margin-top: 1px;
    display: block;
}
@keyframes bagBtnPulse {
    0%, 100% { box-shadow: 0 3px 14px rgba(0,0,0,0.35); }
    50% { box-shadow: 0 3px 18px rgba(220,150,60,0.55), 0 0 10px rgba(220,150,60,0.25) inset; }
}
.bag-btn-new-glow {
    animation: bagBtnNewGlow 1.5s ease-in-out infinite !important;
    border-color: rgba(200, 160, 255, 0.9) !important;
}
@keyframes bagBtnNewGlow {
    0%, 100% { box-shadow: 0 3px 14px rgba(0,0,0,0.35); }
    50% { box-shadow: 0 0 20px rgba(200, 120, 255, 0.7), 0 0 10px rgba(200, 120, 255, 0.4) inset; }
}

.bag-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.bag-badge-hidden { display: none; }

/* 가방 오버레이 - 풀스크린 탭아웃 레이어 */
.bag-overlay {
    position: fixed;
    inset: 0;
    z-index: 6500;
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 76px + 76px + 68px + 8px + 68px + 6px);
    backdrop-filter: blur(2px);
    animation: bagFadeIn 0.18s ease;
}
.bag-overlay-hidden { display: none !important; }
@keyframes bagFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 가방 패널 - 버튼 위에서 위로 쫘악 펼쳐짐 */
.bag-panel {
    width: 270px;
    max-height: calc(100svh - max(14px, env(safe-area-inset-bottom, 0px)) - 76px - 76px - 68px - 8px - 68px - 6px - 20px);
    background: linear-gradient(160deg, rgba(30, 22, 14, 0.97), rgba(18, 12, 6, 0.99));
    border-radius: 18px;
    box-shadow: 0 -6px 30px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.4);
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: bagSlideUp 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    border: 1.5px solid rgba(166, 124, 82, 0.55);
}
@keyframes bagSlideUp {
    from { transform: translateY(40px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0)     scale(1);    opacity: 1; }
}

.bag-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(107, 79, 43, 0.95), rgba(166, 124, 82, 0.9));
    color: #fff;
    border-bottom: 1px solid rgba(255, 200, 120, 0.2);
}
.bag-title { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; }
.bag-close-btn {
    background: rgba(255,255,255,0.18);
    border: none; border-radius: 50%;
    width: 26px; height: 26px;
    color: #fff; font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.bag-close-btn:active { background: rgba(255,255,255,0.4); }

.bag-items {
    padding: 8px 10px;
    overflow-y: auto;
    flex: 1;
}
.bag-empty-msg {
    text-align: center;
    color: rgba(255,255,255,0.4);
    padding: 24px 10px;
    font-size: 13px;
}

.bag-item-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 6px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 200, 120, 0.12);
    margin-bottom: 6px;
    transition: background 0.12s;
}
.bag-item-row:active { background: rgba(255, 200, 120, 0.15); }

.bag-item-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}
.bag-item-icon img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.bag-item-info {
    flex: 1;
    min-width: 0;
}
.bag-item-name {
    font-weight: 700;
    font-size: 12px;
    color: rgba(255, 235, 200, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bag-item-qty {
    font-size: 11px;
    color: rgba(255, 200, 100, 0.7);
    font-weight: 600;
}

.bag-item-use-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #ff6b35, #ffa040);
    color: #fff;
    font-size: 12px; font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: 0 2px 8px rgba(255, 100, 40, 0.4);
    letter-spacing: 0.3px;
}
.bag-item-use-btn:active {
    transform: scale(0.9);
    box-shadow: 0 1px 4px rgba(255, 100, 40, 0.3);
}

.bag-section-divider {
    font-size: 10px;
    font-weight: 800;
    color: rgba(200, 160, 255, 0.7);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 4px 4px;
    border-top: 1px solid rgba(200, 160, 255, 0.15);
    margin-top: 4px;
}

.bag-warrior-row {
    border-color: rgba(200, 160, 255, 0.2);
    background: rgba(160, 100, 255, 0.08);
}
.bag-warrior-row:active { background: rgba(160, 100, 255, 0.18); }

.bag-warrior-btn {
    background: linear-gradient(135deg, #9b59b6, #6c3483) !important;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.5) !important;
}
.bag-warrior-btn:active { transform: scale(0.9); }

.bag-warrior-new .bag-warrior-btn {
    animation: warriorBtnPulse 1.5s ease-in-out infinite;
}
@keyframes warriorBtnPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(155, 89, 182, 0.5); }
    50% { box-shadow: 0 2px 16px rgba(200, 120, 255, 0.8), 0 0 8px rgba(200, 120, 255, 0.4); }
}

/* 퀵 슬롯 */
.quick-slots {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 500;
    display: flex; gap: 8px;
    pointer-events: auto;
}

.quick-slot-btn {
    position: relative;
    width: 48px; height: 48px;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.6);
    background: linear-gradient(135deg, rgba(50,50,50,0.85), rgba(30,30,30,0.9));
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
    transition: transform 0.12s, border-color 0.2s;
    overflow: hidden;
}
.quick-slot-btn:active { transform: scale(0.88); }
.quick-slot-btn img {
    width: 32px; height: 32px;
    object-fit: contain;
}

.quick-slot-qty {
    position: absolute;
    bottom: -2px; right: -2px;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* 트리거 메시지 팝업 */
.trigger-popup {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7000;
    background: linear-gradient(135deg, #fff3cd, #fff);
    border: 2px solid #ffc107;
    border-radius: 14px;
    padding: 14px 22px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    max-width: 320px;
    animation: triggerPopIn 0.3s ease;
    cursor: pointer;
}
.trigger-popup-danger {
    background: linear-gradient(135deg, #ffe0e0, #fff);
    border-color: #e74c3c;
}
@keyframes triggerPopIn { from { transform: translateX(-50%) scale(0.8); opacity:0; } to { transform: translateX(-50%) scale(1); opacity:1; } }

/* ═══════════════════════════════════════════
   🎰 즉석복권 미니게임
   ═══════════════════════════════════════════ */
.lottery-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    animation: lotteryFadeIn 0.25s ease;
}
.lottery-overlay-closing { animation: lotteryFadeOut 0.3s ease forwards; }
@keyframes lotteryFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes lotteryFadeOut { from { opacity:1; } to { opacity:0; } }

.lottery-card {
    width: 330px;
    background: linear-gradient(145deg, #fdf6e3, #fff8dc);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.6);
    text-align: center;
    animation: lotteryCardIn 0.3s ease;
}
@keyframes lotteryCardIn { from { transform: scale(0.85) translateY(20px); opacity:0; } to { transform: scale(1) translateY(0); opacity:1; } }

.lottery-header {
    font-size: 28px;
    font-weight: 800;
    color: #c0392b;
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}
.lottery-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.lottery-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.lottery-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.03);
    transition: all 0.4s;
}
.lottery-row-win {
    background: linear-gradient(90deg, rgba(255,215,0,0.25), rgba(255,165,0,0.2));
    box-shadow: 0 0 12px rgba(255,215,0,0.4);
    animation: lotteryRowGlow 0.8s ease infinite alternate;
}
@keyframes lotteryRowGlow {
    from { box-shadow: 0 0 8px rgba(255,215,0,0.3); }
    to { box-shadow: 0 0 20px rgba(255,215,0,0.6); }
}

.lottery-prize-label {
    font-size: 11px;
    font-weight: 700;
    color: #c0392b;
    min-width: 55px;
    text-align: right;
}

.lottery-cell {
    width: 60px; height: 60px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
    border: 2px solid rgba(0,0,0,0.08);
}
.lottery-cell:active { transform: scale(0.9); }

.lottery-cell-hidden {
    background: linear-gradient(135deg, #bdc3c7, #95a5a6);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}
.lottery-cell-hidden .lottery-animal { display: none; }
.lottery-cell-hidden .lottery-cover {
    font-size: 28px;
    animation: lotteryCoverShake 2s ease-in-out infinite;
}
@keyframes lotteryCoverShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

.lottery-cell-revealed {
    background: linear-gradient(135deg, #fff, #ffeaa7);
    animation: lotteryCellReveal 0.35s ease;
}
.lottery-cell-revealed .lottery-cover { display: none; }
.lottery-cell-revealed .lottery-animal { display: block; }
@keyframes lotteryCellReveal {
    0% { transform: scale(1.3) rotateY(90deg); }
    50% { transform: scale(1.1) rotateY(0deg); }
    100% { transform: scale(1); }
}

.lottery-instruction {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}

.lottery-result {
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    animation: lotteryResultIn 0.4s ease;
}
.lottery-result-hidden { display: none; }
.lottery-result-win {
    background: linear-gradient(135deg, #fff9c4, #ffe082);
    color: #e65100;
    border: 2px solid #ffa000;
}
.lottery-result-lose {
    background: rgba(0,0,0,0.05);
    color: #999;
}
@keyframes lotteryResultIn { from { transform: scale(0.8); opacity:0; } to { transform: scale(1); opacity:1; } }

.lottery-reward-amount {
    display: block;
    font-size: 22px;
    color: #d32f2f;
    margin-top: 4px;
}

.lottery-close-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}
.lottery-close-btn:active { transform: scale(0.96); }
.lottery-close-btn-hidden { display: none; }

/* 상점 복권 썸네일 */
.shop-lottery-thumb {
    font-size: 48px;
    text-align: center;
    padding: 8px 0;
}
.shop-lottery-card {
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,165,0,0.05)) !important;
}

/* ──── 캐릭터 선택 모달 ──── */
.char-select-modal {
    position: fixed;
    inset: 0;
    z-index: 8500;
    background: rgba(5, 8, 22, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px 12px;
    transition: opacity 0.4s ease;
}
.char-select-hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}
.char-select-modal:not(.char-select-hidden) {
    opacity: 1;
    pointer-events: auto;
}
.char-select-inner {
    width: 100%;
    max-width: 780px;
    margin: auto;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}
.char-select-header {
    text-align: center;
    margin-bottom: 24px;
}
.char-select-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
    margin-bottom: 6px;
}
.char-select-subtitle {
    font-size: 0.9rem;
    color: rgba(180, 210, 255, 0.7);
    font-family: 'Outfit', sans-serif;
}
.char-select-cards {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.char-card {
    position: relative;
    background: rgba(10,20,50,0.55);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 22px;
    padding: 20px 16px 16px;
    width: min(340px, calc(50vw - 24px));
    min-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.char-card:hover,
.char-card.char-card-hover {
    transform: translateY(-4px);
}
/* 호버·클릭 시 캐릭터 1회전 + 황금 아우라 */
.char-img-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8%;
    width: 175%;
    height: 78%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse 72% 100% at 50% 100%,
        rgba(255, 235, 160, 0.72) 0%,
        rgba(255, 200, 90, 0.35) 38%,
        rgba(255, 180, 60, 0.12) 55%,
        transparent 72%);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.char-card:hover .char-img-wrap::before,
.char-card.char-card-hover .char-img-wrap::before,
.char-card.char-card-showcase .char-img-wrap::before {
    opacity: 1;
    animation: charSelectGoldAura 1.05s ease-in-out forwards;
}
.char-img-wrap .char-img {
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    backface-visibility: visible;
}
/* .char-img-warrior 의 무한 glow 가 나중에 선언되어 호버를 덮어쓰므로 동일·더 높은 특이도로 지정 */
.char-card:hover .char-img-wrap .char-img.char-img-girl,
.char-card:hover .char-img-wrap .char-img.char-img-warrior,
.char-card.char-card-hover .char-img-wrap .char-img.char-img-girl,
.char-card.char-card-hover .char-img-wrap .char-img.char-img-warrior,
.char-card.char-card-showcase .char-img-wrap .char-img.char-img-girl,
.char-card.char-card-showcase .char-img-wrap .char-img.char-img-warrior {
    animation: charSelectSpinGold 1.05s cubic-bezier(0.38, 0.12, 0.22, 1) forwards;
}
@keyframes charSelectSpinGold {
    0% {
        transform: perspective(600px) rotateY(0deg);
        filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
    }
    20% {
        filter:
            drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35))
            drop-shadow(0 0 22px rgba(255, 215, 100, 0.85))
            drop-shadow(0 0 38px rgba(255, 190, 50, 0.55));
    }
    50% {
        transform: perspective(600px) rotateY(180deg);
        filter:
            drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3))
            drop-shadow(0 0 32px rgba(255, 235, 140, 0.95))
            drop-shadow(0 0 52px rgba(255, 200, 70, 0.65));
    }
    80% {
        filter:
            drop-shadow(0 6px 14px rgba(0, 0, 0, 0.38))
            drop-shadow(0 0 18px rgba(255, 210, 100, 0.65));
    }
    100% {
        transform: perspective(600px) rotateY(360deg);
        filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
    }
}
@keyframes charSelectGoldAura {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.88;
    }
    50% {
        transform: translateX(-50%) scale(1.06);
        opacity: 1;
    }
}
/* 움직임 줄이기 설정이 있어도 캐릭터 쇼케이스는 짧게 재생 (완전 비활성화 시 “안 됨”으로 느껴짐) */
@media (prefers-reduced-motion: reduce) {
    .char-card:hover .char-img-wrap::before,
    .char-card.char-card-hover .char-img-wrap::before,
    .char-card.char-card-showcase .char-img-wrap::before {
        animation-duration: 0.55s;
    }
    .char-card:hover .char-img-wrap .char-img.char-img-girl,
    .char-card:hover .char-img-wrap .char-img.char-img-warrior,
    .char-card.char-card-hover .char-img-wrap .char-img.char-img-girl,
    .char-card.char-card-hover .char-img-wrap .char-img.char-img-warrior,
    .char-card.char-card-showcase .char-img-wrap .char-img.char-img-girl,
    .char-card.char-card-showcase .char-img-wrap .char-img.char-img-warrior {
        animation-duration: 0.55s;
    }
}
.char-card-free {
    border-color: rgba(100, 200, 255, 0.3);
    box-shadow: 0 4px 30px rgba(100, 200, 255, 0.08);
}
.char-card-warrior {
    border-color: rgba(200, 120, 255, 0.5);
    box-shadow: 0 4px 40px rgba(180, 80, 255, 0.2);
    background: linear-gradient(160deg, rgba(60,20,80,0.5) 0%, rgba(30,10,60,0.6) 100%);
}
.char-card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    font-family: 'Outfit', sans-serif;
}
.char-badge-free {
    background: rgba(100,200,255,0.2);
    color: #7dd3fc;
    border: 1px solid rgba(100,200,255,0.4);
}
.char-badge-premium {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 2px 12px rgba(168,85,247,0.5);
}
.char-card-hot {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251,191,36,0.15);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 8px;
    padding: 2px 8px;
}
.char-img-wrap {
    position: relative;
    overflow: visible;
    width: 140px;
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
    perspective: 800px;
}
/* 여전사: 같은 카드 안에서 소녀보다 약 22% 큰 프레임 */
.char-card-warrior .char-img-wrap {
    width: 172px;
    height: 220px;
}
.char-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.char-img-warrior {
    filter: drop-shadow(0 0 18px rgba(180,80,255,0.6));
    animation: char-warrior-glow 2.5s ease-in-out infinite alternate;
}
@keyframes char-warrior-glow {
    from { filter: drop-shadow(0 0 12px rgba(180,80,255,0.4)); }
    to   { filter: drop-shadow(0 0 28px rgba(180,80,255,0.8)); }
}
.char-info {
    width: 100%;
    text-align: center;
}
.char-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.char-desc {
    font-size: 12px;
    color: rgba(200,220,255,0.75);
    line-height: 1.6;
    margin-bottom: 10px;
}
.char-stats {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.char-stats li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.char-stat-label {
    font-size: 11px;
    color: rgba(200,220,255,0.7);
    width: 60px;
    text-align: left;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}
.char-stat-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.char-stat-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8, #7dd3fc);
    border-radius: 4px;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 6px rgba(56,189,248,0.5);
}
.char-stat-fill-warrior {
    background: linear-gradient(90deg, #7c3aed, #a855f7, #e879f9);
    box-shadow: 0 0 8px rgba(168,85,247,0.7);
}
.char-stat-num {
    font-size: 10px;
    font-weight: 700;
    color: rgba(150,210,255,0.9);
    width: 22px;
    text-align: right;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.3px;
}
.char-stat-num-warrior {
    color: rgba(220,150,255,0.95);
}
.char-perks {
    list-style: none;
    padding: 8px;
    margin: 0;
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}
.char-perks li {
    font-size: 11px;
    color: rgba(220,180,255,0.9);
    font-family: 'Outfit', sans-serif;
}
.char-select-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 4px;
}
.char-select-btn:active { transform: scale(0.97); }
.char-btn-free {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(14,165,233,0.4);
}
.char-btn-free:hover { box-shadow: 0 6px 24px rgba(14,165,233,0.6); transform: translateY(-1px); }
.char-btn-warrior {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    box-shadow: 0 4px 20px rgba(124,58,237,0.5);
}
.char-btn-warrior:hover { box-shadow: 0 6px 28px rgba(124,58,237,0.7); transform: translateY(-1px); }
.char-btn-price {
    font-size: 1.2rem;
    font-weight: 800;
}
.char-btn-sub {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
}
#char-paypal-container {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 540px) {
    .char-select-cards { flex-direction: column; align-items: center; }
    .char-card { width: min(340px, 90vw); }
    .char-img-wrap { width: 110px; height: 140px; }
    .char-card-warrior .char-img-wrap { width: 134px; height: 170px; }
    .char-select-title { font-size: 1.3rem; }
}

/* ──── PayPal 후원 버튼 ──── */
.paypal-donate-wrap {
    margin-top: 18px;
    padding: 14px 16px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    text-align: center;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}
.paypal-donate-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 10px 0;
    font-family: 'Outfit', sans-serif;
}
.paypal-result-msg {
    margin-top: 10px;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    min-height: 18px;
    color: rgba(255, 255, 255, 0.7);
}
.paypal-result-success {
    color: #4ade80;
    font-weight: 600;
}
.paypal-result-error {
    color: #f87171;
}

/* ──── 게임 중 대기실 이탈 버튼 ──── */
.game-exit-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 6200;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    pointer-events: auto;
}
.game-exit-btn:hover {
    background: rgba(220, 50, 50, 0.7);
    border-color: rgba(255, 100, 100, 0.5);
    color: #fff;
    transform: scale(1.1);
}
.game-exit-btn-hidden {
    display: none !important;
}

/* ──── 대기실 이탈 확인 팝업 ──── */
.exit-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9200;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: exitOverlayFadeIn 0.2s ease;
}
@keyframes exitOverlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.exit-confirm-box {
    background: linear-gradient(160deg, rgba(10,20,50,0.97) 0%, rgba(5,15,40,0.97) 100%);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 28px 28px 22px;
    width: min(320px, 88vw);
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.exit-confirm-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}
.exit-confirm-desc {
    font-size: 0.85rem;
    color: rgba(180,210,255,0.75);
    margin-bottom: 22px;
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
}
.exit-confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.exit-confirm-btn-cancel {
    flex: 1;
    padding: 11px 0;
    border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: background 0.2s ease;
}
.exit-confirm-btn-cancel:hover { background: rgba(255,255,255,0.15); }
.exit-confirm-btn-ok {
    flex: 1;
    padding: 11px 0;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #e05252 0%, #b02020 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: opacity 0.2s ease, transform 0.15s ease;
}
.exit-confirm-btn-ok:hover { opacity: 0.88; transform: scale(1.03); }

