/* css/screens.css - Multi-Screen Transitions, Mobile Layout, and Views */

/* Screen Visibility Controller */
.app-screen {
    display: none !important;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
}

.app-screen.screen-active {
    display: flex !important;
}

/* ==================== 1. ANIMATED SPLASH SCREEN ==================== */
#screenSplash {
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 30%, #1e5a36 0%, #0c2b18 55%, #05140b 100%);
    overflow: hidden;
}

/* Animated Floating Leaves & Particles in Background */
.splash-bg-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.floating-leaf {
    position: absolute;
    font-size: 28px;
    opacity: 0.25;
    animation: leafFall 10s linear infinite;
}

.floating-leaf.l1 { left: 10%; top: -10%; animation-duration: 9s; animation-delay: 0s; font-size: 32px; }
.floating-leaf.l2 { left: 80%; top: -10%; animation-duration: 12s; animation-delay: 2s; font-size: 24px; }
.floating-leaf.l3 { left: 45%; top: -10%; animation-duration: 8s; animation-delay: 4s; font-size: 36px; }
.floating-leaf.l4 { left: 25%; top: -10%; animation-duration: 11s; animation-delay: 6s; font-size: 26px; }
.floating-leaf.l5 { left: 70%; top: -10%; animation-duration: 10s; animation-delay: 3s; font-size: 30px; }

@keyframes leafFall {
    0% {
        transform: translateY(-10vh) rotate(0deg) translateX(0);
        opacity: 0;
    }
    15% {
        opacity: 0.35;
    }
    85% {
        opacity: 0.35;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) translateX(40px);
        opacity: 0;
    }
}

.splash-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 420px;
    width: 100%;
}

.splash-logo-wrap {
    position: relative;
    margin-bottom: 20px;
    animation: splashFloat 3s ease-in-out infinite;
}

.splash-logo-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 20px rgba(255, 209, 102, 0.4));
}

@keyframes splashFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.03); }
}

.splash-title {
    font-family: var(--font-heading);
    font-size: 36px;
    background: linear-gradient(180deg, #fff275 0%, #ffd166 50%, #f77f00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.splash-subtitle {
    color: #a3e6be;
    font-size: 16px;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.splash-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 280px;
}

.splash-play-btn {
    padding: 16px 24px !important;
    font-size: 20px !important;
    border-radius: 18px !important;
    animation: buttonPulse 2s infinite alternate;
}

.splash-auth-status {
    background: rgba(10, 30, 18, 0.88);
    border: 2px solid #ffd166;
    border-radius: 16px;
    padding: 10px 16px;
    color: #ffd166;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

.splash-loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(10, 30, 18, 0.94);
    border: 2px solid #ffd166;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 209, 102, 0.3);
    animation: fadeIn 0.35s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.jungle-spinner {
    width: 44px;
    height: 44px;
    border: 4.5px solid rgba(116, 198, 157, 0.25);
    border-top: 4.5px solid #ffd166;
    border-right: 4.5px solid #52b788;
    border-radius: 50%;
    animation: jungleSpin 0.9s cubic-bezier(0.6, 0.2, 0.4, 0.9) infinite;
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.4);
}

@keyframes jungleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.splash-loading-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.splash-loading-greeting {
    font-family: var(--font-heading);
    font-size: 15px;
    color: #ffd166;
    letter-spacing: 0.5px;
}

.splash-loading-sub {
    font-size: 13px;
    color: #a3e6be;
    opacity: 0.9;
}

@keyframes buttonPulse {
    0% { box-shadow: 0 4px 15px rgba(255, 209, 102, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
    100% { box-shadow: 0 8px 25px rgba(255, 209, 102, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
}

/* ==================== 2. AUTH SCREEN ==================== */
#screenAuth {
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: radial-gradient(circle at 50% 20%, #174227 0%, #0a2113 65%, #040e08 100%);
}

.auth-screen-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: rgba(18, 48, 30, 0.95);
    border: 3px solid #52b788;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.auth-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ==================== 3. HOME SCREEN (LEVEL MAP AS MAIN) ==================== */
#screenHome {
    background: radial-gradient(ellipse at 50% 20%, #205033 0%, #0d2818 60%, #05140b 100%);
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Home Floating HUD Overlay (Top-Left Profile & Stats, Top-Right Actions) */
.home-hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    box-sizing: border-box;
}

/* Top-Left Stack */
.home-hud-left {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

/* Clickable Profile Pill */
.clickable-profile-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(20, 55, 35, 0.94) 0%, rgba(10, 30, 20, 0.96) 100%);
    border: 2.5px solid #ffd166;
    border-radius: 36px;
    padding: 5px 20px 5px 5px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-align: left;
    color: inherit;
}

.clickable-profile-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(255, 209, 102, 0.5);
}

.clickable-profile-pill:active {
    transform: scale(0.97);
}

.home-avatar-thumb {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 2.5px solid #ffd166;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-avatar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 19px;
    color: #ffd166;
    line-height: 1.15;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.profile-hint-tap {
    font-size: 11px;
    font-weight: 700;
    color: #a3e6be;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stat Badges (Gold & Stars) */
.home-hud-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 28, 18, 0.92);
    border: 2px solid #ffd166;
    padding: 7px 18px;
    border-radius: 20px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
    font-family: var(--font-heading);
    font-size: 17px;
    color: #ffd166;
    backdrop-filter: blur(8px);
}

.home-hud-badge img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Top-Right Action Stack (Icons Only) */
.home-hud-right {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.home-hud-action-btn {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    padding: 0 !important;
    border-radius: 18px !important;
    border: 2.5px solid #ffd166 !important;
    background: linear-gradient(180deg, #78421a 0%, #4a2810 55%, #2c1608 100%) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55), inset 0 2px 1px rgba(255, 255, 255, 0.35), inset 0 -2px 1px rgba(0, 0, 0, 0.4) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.home-hud-action-btn:hover {
    transform: translateY(-3px) scale(1.08) !important;
    box-shadow: 0 8px 24px rgba(255, 209, 102, 0.6), inset 0 2px 1px rgba(255, 255, 255, 0.45) !important;
}

.home-hud-action-btn:active {
    transform: translateY(1px) scale(0.96) !important;
}

.home-hud-action-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
    pointer-events: none;
}

/* Home Level Map Viewport */
.home-map-viewport {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 185px;
    padding-bottom: 36px;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Floating Jump to Current Stage Button (Anchored within #screenHome) */
.btn-jump-current-floating {
    position: absolute;
    bottom: 26px;
    right: 22px;
    z-index: 95;
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    padding: 13px 22px !important;
    font-size: 16px !important;
    font-family: var(--font-heading) !important;
    letter-spacing: 0.5px;
    border-radius: 24px !important;
    border: 3px solid #ffe699 !important;
    background: linear-gradient(180deg, #ffd166 0%, #f77f00 55%, #c85a00 100%) !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
    animation: jumpBtnPulse 2.5s infinite alternate;
    cursor: pointer;
}

.btn-jump-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@keyframes jumpBtnPulse {
    0% { transform: scale(1); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
    100% { transform: scale(1.06); box-shadow: 0 10px 28px rgba(255, 209, 102, 0.7), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
}

/* ==================== DEDICATED SUB-SCREENS (LEADERBOARDS & SHOP) ==================== */
#screenLeaderboard, #screenShop {
    background: radial-gradient(ellipse at 50% 20%, #1e4d35 0%, #0d2818 65%, #05140b 100%);
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sub-screen-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(13, 40, 24, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(116, 198, 157, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-screen-back {
    padding: 8px 16px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
}

.sub-screen-title {
    font-family: var(--font-heading);
    font-size: 20px;
    color: #ffd166;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.screen-title-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.settings-row-icon-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.rules-booster-inline-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    object-fit: contain;
    margin-right: 4px;
}

.node-star-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    margin: 0 1px;
}

.node-star-img.star-dim {
    opacity: 0.35;
    filter: grayscale(1);
}

.milestone-badge-icon {
    width: 13px;
    height: 13px;
    vertical-align: middle;
    object-fit: contain;
    margin-right: 3px;
}

.star-icon-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

.sub-screen-spacer {
    width: 76px; /* Matches back button for center alignment */
}

.shop-gold-chip {
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid #ffd166;
    padding: 5px 12px;
    border-radius: 14px;
    font-family: var(--font-heading);
    color: #ffd166;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-screen-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    box-sizing: border-box;
}

/* ==================== PROFILE MODAL ==================== */
.profile-modal-card {
    max-width: 440px !important;
}

.profile-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.profile-avatar-large {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #fff;
    border: 3.5px solid #ffd166;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    padding: 4px;
    margin-bottom: 8px;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-display-name {
    font-family: var(--font-heading);
    font-size: 22px;
    color: #ffd166;
    margin: 0 0 2px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.profile-display-email {
    font-size: 12px;
    color: #a3e6be;
    margin: 0;
}

.profile-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-profile-logout-danger {
    border-color: #ff6b6b !important;
    color: #ffc9c9 !important;
}

/* ==================== SETTINGS MODAL ==================== */
.settings-modal-card {
    max-width: 440px !important;
}

.settings-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-row-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid rgba(116, 198, 157, 0.28);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.settings-row-card-column {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px;
}

.settings-row-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.settings-row-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.settings-row-title {
    font-family: var(--font-heading);
    font-size: 15px;
    color: #ffd166;
    margin-bottom: 2px;
}

.settings-row-desc {
    font-size: 11px;
    color: #a3e6be;
    line-height: 1.3;
}

.btn-setting-toggle {
    padding: 8px 14px !important;
    font-size: 12px !important;
    white-space: nowrap;
    min-width: 135px;
    text-align: center;
}

/* New Explorer Fullscreen Tip Banner */
.settings-fs-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.2) 0%, rgba(45, 106, 79, 0.45) 100%);
    border: 2px solid #ffd166;
    border-radius: 18px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 209, 102, 0.25);
    animation: bannerPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bannerPop {
    0% { opacity: 0; transform: translateY(-8px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.fs-banner-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid #ffd166;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fs-banner-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fs-banner-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.fs-banner-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: #ffd166;
    letter-spacing: 0.5px;
}

.fs-banner-desc {
    font-size: 12px;
    color: #d8f3dc;
    line-height: 1.35;
    font-weight: 600;
}

.settings-row-card.fs-highlight {
    border-color: #ffd166 !important;
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.55), inset 0 0 10px rgba(255, 209, 102, 0.25) !important;
    animation: fsRowGlow 1.4s ease-in-out infinite alternate !important;
}

@keyframes fsRowGlow {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 209, 102, 0.3); }
    100% { transform: scale(1.02); box-shadow: 0 0 22px rgba(255, 209, 102, 0.7); }
}

/* About the Developer Card in Settings */
.settings-dev-card {
    background: linear-gradient(135deg, rgba(13, 40, 24, 0.85) 0%, rgba(20, 60, 36, 0.9) 100%) !important;
    border: 2px solid rgba(116, 198, 157, 0.4) !important;
    padding: 14px 16px !important;
}

.dev-profile-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.38);
    border: 1.5px solid rgba(255, 209, 102, 0.25);
    border-radius: 16px;
    padding: 12px 14px;
    width: 100%;
    box-sizing: border-box;
}

.dev-avatar-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle, #2d6a4f 0%, #0d2818 100%);
    border: 2px solid #ffd166;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 209, 102, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dev-avatar-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.dev-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    flex: 1;
}

.dev-name {
    font-family: var(--font-heading);
    font-size: 15px;
    color: #ffd166;
    margin: 0;
    letter-spacing: 0.5px;
}

.dev-role {
    font-size: 12px;
    color: #a3e6be;
    margin: 0 0 6px 0;
    font-weight: 600;
}

.dev-portfolio-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px !important;
    font-size: 11px !important;
    text-decoration: none !important;
    color: #1a4329 !important;
    border-radius: 10px !important;
    font-weight: 800 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dev-portfolio-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 209, 102, 0.5);
}

/* ==================== 4. LEVEL MAP VIEW (SAGA ADVENTURE PATH) ==================== */
.map-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 14px;
    background: rgba(13, 40, 24, 0.75);
    border: 1.5px solid rgba(116, 198, 157, 0.25);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.map-view-titles {
    display: flex;
    flex-direction: column;
}

.btn-jump-current {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Winding Map Canvas */
.adventure-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 90px;
    background: 
        radial-gradient(circle at 50% 15%, rgba(45, 106, 79, 0.3) 0%, transparent 65%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 C15 15 10 30 20 40 C30 50 45 45 50 30 C55 15 45 5 30 5 Z' fill='%2352b788' fill-opacity='0.03'/%3E%3C/svg%3E");
    border-radius: 20px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.map-path-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* SVG Trail Styles */
.map-trail-bg {
    fill: none;
    stroke: rgba(22, 13, 5, 0.8);
    stroke-width: 16;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-trail-progress {
    fill: none;
    stroke: #ffd166;
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.8));
}

.map-trail-dashed {
    fill: none;
    stroke: rgba(116, 198, 157, 0.45);
    stroke-width: 4;
    stroke-dasharray: 8 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Map Nodes Container */
.map-nodes-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Base Node Medallion */
.map-node {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s ease;
    z-index: 5;
}

.map-node:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 20;
}

.node-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}

/* Completed Node */
.map-node.node-completed .node-disc {
    background: radial-gradient(circle at 35% 30%, #52b788 0%, #2d6a4f 65%, #1b4332 100%);
    border: 3.5px solid #ffd166;
    box-shadow: 
        0 6px 14px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -3px 6px rgba(0, 0, 0, 0.4);
}

.map-node.node-completed .node-num {
    font-family: var(--font-heading);
    font-size: 19px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.map-node.node-completed .node-check {
    font-size: 9px;
    font-weight: 800;
    color: #ffd166;
    margin-top: 1px;
}

/* Current Active Stage Node */
.map-node.node-current {
    z-index: 15;
}

.map-node.node-current .node-disc {
    background: radial-gradient(circle at 35% 30%, #fff275 0%, #f77f00 70%, #d62828 100%);
    border: 4px solid #ffffff;
    box-shadow: 
        0 0 24px rgba(255, 209, 102, 0.95),
        0 8px 18px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.7);
    animation: nodeCurrentPulse 1.8s infinite ease-in-out alternate;
}

@keyframes nodeCurrentPulse {
    0% { transform: scale(1); box-shadow: 0 0 16px rgba(255, 209, 102, 0.8), 0 6px 14px rgba(0,0,0,0.5); }
    100% { transform: scale(1.08); box-shadow: 0 0 28px rgba(255, 209, 102, 1), 0 10px 22px rgba(0,0,0,0.65); }
}

.map-node.node-current .node-num.current {
    font-family: var(--font-heading);
    font-size: 20px;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.map-node.node-current .node-play-label {
    font-family: var(--font-heading);
    font-size: 9px;
    color: #fff9db;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Player Avatar Pin Standing on Current Stage */
.player-map-pawn {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 25;
    animation: pawnBounce 1.8s infinite ease-in-out;
}

@keyframes pawnBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

.pawn-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #ffd166;
    padding: 2px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 209, 102, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pawn-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pawn-tag {
    background: linear-gradient(135deg, #e63946, #d62828);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
    border: 1.5px solid #ffffff;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Locked Node */
.map-node.node-locked {
    cursor: not-allowed;
    opacity: 0.75;
}

.map-node.node-locked .node-disc {
    background: radial-gradient(circle at 35% 30%, #294233 0%, #15271d 100%);
    border: 2.5px solid #3c654b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.node-lock-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.node-num-locked {
    font-size: 10px;
    font-weight: 700;
    color: #74c69d;
    opacity: 0.6;
    margin-top: 1px;
}

/* Milestone / Boss Node */
.map-node.node-milestone {
    width: 68px;
    height: 68px;
}

.milestone-badge {
    position: absolute;
    top: -10px;
    background: linear-gradient(135deg, #e09f12, #a46d04);
    border: 1px solid #ffd166;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 8px;
    padding: 1px 6px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 6;
}

/* Stars Badge below node */
.node-stars {
    position: absolute;
    bottom: -15px;
    font-size: 9px;
    background: rgba(10, 30, 18, 0.85);
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 209, 102, 0.4);
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    z-index: 4;
}

/* Hover Tooltip showing stage name */
.node-tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 30, 18, 0.95);
    border: 1.5px solid #ffd166;
    border-radius: 10px;
    padding: 4px 10px;
    color: #ffffff;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
    z-index: 30;
    pointer-events: none;
}

.map-node:hover .node-tooltip {
    display: block;
}

/* Infinite Load More Footer */
.map-load-more-wrap {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
    max-width: 320px;
    text-align: center;
}

.map-load-more-wrap button {
    width: 100%;
    padding: 10px 16px !important;
    font-size: 13px !important;
}

/* Locked Node Shake animation */
.map-node.shake {
    animation: nodeShake 0.4s ease;
}

@keyframes nodeShake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    20% { transform: translate(-55%, -50%) rotate(-6deg); }
    40% { transform: translate(-45%, -50%) rotate(6deg); }
    60% { transform: translate(-53%, -50%) rotate(-4deg); }
    80% { transform: translate(-47%, -50%) rotate(4deg); }
}

/* ==================== 5. SHOP VIEW ==================== */
.shop-coins-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid #ffd166;
    border-radius: 16px;
    padding: 12px 18px;
    margin-bottom: 16px;
}

.shop-coins-header .lbl {
    font-size: 14px;
    font-weight: 700;
    color: #ffd166;
}

.shop-tabs {
    margin-bottom: 16px;
}

.shop-content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 24px;
}

.shop-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    border-bottom: 1.5px solid rgba(116, 198, 157, 0.25);
    padding-bottom: 8px;
}

.shop-section-title {
    font-family: var(--font-heading);
    font-size: 17px;
    color: #ffd166;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.shop-section-icon {
    font-size: 20px;
}

.shop-section-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(116, 198, 157, 0.15);
    border: 1px solid rgba(116, 198, 157, 0.4);
    color: #a3e6be;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.shop-booster-subgroup {
    background: rgba(0, 0, 0, 0.22);
    border: 1.5px solid rgba(116, 198, 157, 0.2);
    border-radius: 16px;
    padding: 12px;
    margin-top: 6px;
}

.shop-subgroup-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: #e2fbdc;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-items-grid,
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.shop-item-card {
    position: relative;
    background: rgba(18, 48, 30, 0.85);
    border: 2px solid rgba(116, 198, 157, 0.3);
    border-radius: 18px;
    padding: 14px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.shop-item-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 209, 102, 0.6);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.shop-item-card.card-mystery {
    border-color: #ffd166;
    background: linear-gradient(180deg, rgba(35, 75, 45, 0.9) 0%, rgba(18, 48, 30, 0.95) 100%);
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.25);
}

.shop-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    background: #f77f00;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
}

.shop-badge.badge-daily {
    background: #2a9d8f;
}

.shop-badge.badge-hourly {
    background: #e76f51;
}

.shop-badge.badge-deal {
    background: #e63946;
}

.shop-item-icon {
    font-size: 36px;
    margin-bottom: 6px;
}

.shop-item-title {
    font-family: var(--font-heading);
    font-size: 15px;
    color: #ffffff;
    margin-bottom: 4px;
}

.shop-item-desc {
    font-size: 11px;
    color: #a3e6be;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 32px;
}

.btn-buy-item {
    width: 100%;
    padding: 8px !important;
    font-size: 13px !important;
}

.btn-daily-cooldown {
    background: linear-gradient(180deg, rgba(40, 30, 20, 0.9) 0%, rgba(25, 18, 10, 0.95) 100%) !important;
    border: 1.5px solid rgba(255, 209, 102, 0.4) !important;
    color: #e0d0b0 !important;
    cursor: not-allowed !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    opacity: 0.95;
}

.btn-daily-cooldown:hover {
    transform: none !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

.daily-cd-timer {
    font-family: var(--font-heading);
    color: #ffd166;
    letter-spacing: 0.5px;
    font-size: 13px;
    font-weight: 800;
}

/* ==================== 6. PROFILE VIEW ==================== */
.profile-card-header {
    background: rgba(18, 48, 30, 0.85);
    border: 2px solid rgba(116, 198, 157, 0.3);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin-bottom: 18px;
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
    margin: 0 auto 10px auto;
    border: 3px solid #ffd166;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-screen-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.profile-stat-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(116, 198, 157, 0.25);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
}

.profile-stat-box .val {
    display: block;
    font-family: var(--font-heading);
    font-size: 20px;
    color: #ffd166;
}

.profile-stat-box .lbl {
    font-size: 11px;
    color: #74c69d;
    text-transform: uppercase;
    font-weight: 700;
}

/* ==================== BOTTOM NAVIGATION BAR ==================== */
.home-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(10, 30, 18, 0.95);
    backdrop-filter: blur(12px);
    border-top: 2px solid rgba(116, 198, 157, 0.3);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: #88bfa0;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    transition: color 0.15s ease, transform 0.12s ease;
}

.bottom-nav-item .icon {
    font-size: 20px;
}

.bottom-nav-item .nav-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    transition: transform 0.15s ease, filter 0.15s ease;
}

.bottom-nav-item.nav-active .nav-icon-img {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.8));
}

.bottom-nav-item .lbl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}


.bottom-nav-item.nav-active {
    color: #ffd166;
    transform: translateY(-2px);
}

/* ==================== 7. GAME SCREEN MOBILE FIT ==================== */
#screenGame {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px;
    box-sizing: border-box;
    max-width: 540px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.board-inner-scaler {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* Blocked tile visual shade overlay */
.tile-shade-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 15, 0.52);
    border-radius: 8px;
    pointer-events: none;
}

.jungle-tile.is-blocked .tile-shade-overlay {
    display: block;
}

/* Mobile Responsiveness for all screens */
@media (max-width: 480px) {
    .home-hud-overlay {
        padding: 10px 12px;
    }
    .clickable-profile-pill {
        padding: 4px 14px 4px 4px;
        gap: 8px;
    }
    .home-avatar-thumb {
        width: 44px;
        height: 44px;
    }
    .profile-name {
        font-size: 16px;
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .profile-hint-tap {
        font-size: 10px;
    }
    .home-hud-badge {
        padding: 5px 12px;
        font-size: 14px;
        gap: 6px;
    }
    .home-hud-badge img {
        width: 20px;
        height: 20px;
    }
    .home-hud-action-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        border-radius: 15px !important;
    }
    .home-hud-action-img {
        width: 30px;
        height: 30px;
    }
    .btn-jump-current-floating {
        padding: 10px 16px !important;
        font-size: 14px !important;
        bottom: 20px;
        right: 16px;
    }
    .home-map-viewport {
        padding-top: 165px;
    }
    .hero-stage-title {
        font-size: 22px;
    }
    .hero-play-btn {
        padding: 12px 24px !important;
        font-size: 18px !important;
    }
}

@media (max-width: 420px) {
    .home-top-bar {
        padding: 8px 10px;
        gap: 6px;
    }
    .home-stats-chips {
        gap: 4px;
    }
    .stat-chip {
        padding: 3px 6px;
        font-size: 11px;
    }
    .home-user-pill {
        gap: 6px;
    }
    .profile-name {
        font-size: 12px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .booster-btn {
        padding: 5px 2px;
        gap: 2px;
    }
    .booster-name {
        font-size: 11px;
    }
    .game-icon-booster {
        width: 20px;
        height: 20px;
    }
    .lb-podium {
        gap: 4px;
    }
    .podium-col {
        max-width: 95px;
    }
    .podium-top-badge {
        width: 38px;
        height: 38px;
    }
    .podium-col.rank-1 .podium-top-badge {
        width: 46px;
        height: 46px;
    }
    .podium-avatar {
        width: 36px;
        height: 36px;
    }
    .podium-avatar.crown-glow {
        width: 44px;
        height: 44px;
    }
    .podium-name {
        font-size: 10px;
        max-width: 75px;
    }
    .podium-score {
        font-size: 10px;
    }
    .pedestal-1 { height: 52px; }
    .pedestal-2 { height: 38px; }
    .pedestal-3 { height: 28px; }
}
