/* ==========================================================================
   STEMOS LXP - 3D WORLD GLOBE & GAMIFIED LEARNING PATH (MARIO / DUOLINGO)
   High-performance, lightweight, hardware-accelerated interactive experience
   WHITE TECH MODE WITH DYNAMIC COLORFUL AURORAS & SEQUENTIAL EXPEDITION
   ========================================================================== */

:root {
    --wm-bg: #f8fafc;
    --wm-surface: rgba(255, 255, 255, 0.90);
    --wm-surface-card: rgba(255, 255, 255, 0.96);
    --wm-border: rgba(203, 213, 225, 0.85);
    --wm-border-glow: rgba(14, 165, 233, 0.45);
    --wm-text-primary: #0f172a;
    --wm-text-secondary: #475569;
    --wm-text-muted: #94a3b8;

    /* Realm Palette (Vibrant Tech Contrast for White Mode) */
    --wm-cat-tech: #0284c7;
    --wm-cat-tech-glow: rgba(2, 132, 199, 0.25);
    --wm-cat-eng: #ea580c;
    --wm-cat-eng-glow: rgba(234, 88, 12, 0.25);
    --wm-cat-sci: #9333ea;
    --wm-cat-sci-glow: rgba(147, 51, 234, 0.25);
    --wm-cat-career: #16a34a;
    --wm-cat-career-glow: rgba(22, 163, 74, 0.25);

    --wm-gold: #d97706;
    --wm-gold-glow: rgba(217, 119, 6, 0.30);
}

/* ─── MAIN WORLD VIEW CONTAINER ─────────────────────────────────── */
.world-experience-wrap {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 120px);
    background: radial-gradient(circle at 50% 15%, #ffffff 0%, #f8fafc 45%, #f1f5f9 100%);
    border-radius: 24px;
    border: 1px solid var(--wm-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: var(--wm-text-primary);
}

/* ─── COLORFUL TECH AURORAS BACKGROUND ──────────────────────────── */
.world-aurora-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.world-aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(85px);
    opacity: 0.60;
    pointer-events: none;
    will-change: transform;
}

.aurora-blob-1 {
    width: 520px;
    height: 520px;
    top: -120px;
    left: 8%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.50) 0%, rgba(56, 189, 248, 0) 70%);
    animation: wmAuroraFloat1 20s ease-in-out infinite alternate;
}

.aurora-blob-2 {
    width: 580px;
    height: 580px;
    top: 15%;
    right: 4%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.40) 0%, rgba(168, 85, 247, 0) 70%);
    animation: wmAuroraFloat2 24s ease-in-out infinite alternate;
}

.aurora-blob-3 {
    width: 480px;
    height: 480px;
    bottom: -100px;
    left: 22%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.38) 0%, rgba(52, 211, 153, 0) 70%);
    animation: wmAuroraFloat3 22s ease-in-out infinite alternate;
}

.aurora-blob-4 {
    width: 460px;
    height: 460px;
    bottom: 8%;
    right: 22%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.32) 0%, rgba(251, 191, 36, 0) 70%);
    animation: wmAuroraFloat4 26s ease-in-out infinite alternate;
}

@keyframes wmAuroraFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.12); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

@keyframes wmAuroraFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-70px, 50px) scale(1.15); }
    100% { transform: translate(30px, -60px) scale(0.92); }
}

@keyframes wmAuroraFloat3 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -60px) scale(1.08); }
    100% { transform: translate(-50px, 30px) scale(0.96); }
}

@keyframes wmAuroraFloat4 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -50px) scale(1.14); }
    100% { transform: translate(40px, 50px) scale(0.94); }
}

/* ─── TOP WORLD HUD / NAVIGATION BAR ───────────────────────────── */
.world-hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    flex-wrap: wrap;
}

.world-hud-top > * {
    pointer-events: auto;
}

.world-title-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wm-border);
    border-radius: 40px;
    padding: 8px 18px 8px 12px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.world-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    animation: wmPulseGlow 3s infinite alternate;
}

@keyframes wmPulseGlow {
    0% { box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }
    100% { box-shadow: 0 0 22px rgba(56, 189, 248, 0.75); }
}

.world-title-text {
    display: flex;
    flex-direction: column;
}

.world-title-main {
    font-size: 1rem;
    font-weight: 800;
    color: var(--wm-text-primary);
    letter-spacing: -0.01em;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-title-sub {
    font-size: 0.72rem;
    color: var(--wm-text-secondary);
    font-weight: 500;
}

/* ─── REALM FILTERS BAR ────────────────────────────────────────── */
.world-realm-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 6px;
    border-radius: 30px;
    border: 1px solid var(--wm-border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    overflow-x: auto;
    max-width: 100%;
}

.realm-filter-btn {
    border: none;
    background: transparent;
    color: var(--wm-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.realm-filter-btn:hover {
    color: var(--wm-text-primary);
    background: rgba(15, 23, 42, 0.04);
}

.realm-filter-btn.active {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.realm-filter-btn[data-cat="technology"].active {
    background: var(--wm-cat-tech);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--wm-cat-tech-glow);
}

.realm-filter-btn[data-cat="engineering"].active {
    background: var(--wm-cat-eng);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--wm-cat-eng-glow);
}

.realm-filter-btn[data-cat="science"].active {
    background: var(--wm-cat-sci);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--wm-cat-sci-glow);
}

.realm-filter-btn[data-cat="career"].active {
    background: var(--wm-cat-career);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--wm-cat-career-glow);
}

/* ─── HUD TOP RIGHT TOOLS ──────────────────────────────────────── */
.world-hud-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.world-tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--wm-border);
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--wm-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.world-tool-btn:hover {
    color: #0284c7;
    background: #ffffff;
    border-color: var(--wm-border-glow);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.world-tool-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 0 14px rgba(2, 132, 199, 0.4);
}

/* ─── GLOBE CANVAS CONTAINER ───────────────────────────────────── */
.world-globe-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    touch-action: none; /* enable custom gesture handling */
    z-index: 10;
}

.world-globe-viewport.dragging {
    cursor: grabbing;
}

#world-globe-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ─── FLOATING ZOOM & CAMERA CONTROLS ──────────────────────────── */
.world-floating-controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--wm-border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.world-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(203, 213, 225, 0.7);
    background: rgba(248, 250, 252, 0.9);
    color: var(--wm-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.18s ease;
}

.world-ctrl-btn:hover {
    color: #0284c7;
    background: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.2);
}

.world-ctrl-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

/* ─── GESTURE / INSTRUCTION HINT PILL ───────────────────────────── */
.world-gesture-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--wm-border);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    pointer-events: none;
    animation: wmFadeHint 8s forwards;
}

.world-gesture-hint i {
    color: #0284c7;
}

@keyframes wmFadeHint {
    0%, 80% { opacity: 0.95; }
    100% { opacity: 0.55; }
}

/* ─── HOLOGRAPHIC 3D NODE TOOLTIP ──────────────────────────────── */
.world-hover-tooltip {
    position: absolute;
    z-index: 40;
    pointer-events: none;
    transform: translate(-50%, -120%);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wm-border-glow);
    border-radius: 16px;
    padding: 14px 18px;
    min-width: 220px;
    max-width: 280px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10), 0 0 20px rgba(56, 189, 248, 0.15);
    transition: opacity 0.15s ease, transform 0.15s ease;
    opacity: 0;
    display: none;
}

.world-hover-tooltip.visible {
    opacity: 1;
    display: block;
}

.wtt-cat-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 6px;
}

.wtt-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.wtt-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.74rem;
    color: var(--wm-text-secondary);
    margin-bottom: 8px;
}

.wtt-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 0.7rem;
    font-weight: 700;
    color: #0284c7;
}

/* ==========================================================================
   LEVEL PATH VIEW (SUPER MARIO BROS & DUOLINGO WINDING TRAIL)
   ========================================================================== */
.world-level-path-view {
    position: absolute;
    inset: 0;
    z-index: 35;
    background: radial-gradient(circle at 50% 15%, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 100px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.world-level-path-view.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* ─── LEVEL PATH TOP HEADER ────────────────────────────────────── */
.path-header-card {
    width: 100%;
    max-width: 820px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wm-border);
    border-radius: 20px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.path-back-btn {
    border: none;
    background: #ffffff;
    border: 1px solid var(--wm-border);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.path-back-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateX(-3px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.path-track-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 220px;
}

.path-track-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.path-cat-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
}

.path-standard-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--wm-text-secondary);
    background: rgba(15, 23, 42, 0.05);
    padding: 2px 8px;
    border-radius: 6px;
}

.path-track-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.path-track-stats-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.path-stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--wm-gold);
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.25);
    padding: 6px 12px;
    border-radius: 12px;
}

.path-track-select {
    background: #ffffff;
    border: 1px solid var(--wm-border);
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

/* ─── WINDING TRAIL ROAD CONTAINER ─────────────────────────────── */
.path-winding-trail-wrap {
    position: relative;
    width: 100%;
    max-width: 680px;
    min-height: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

/* SVG Background Winding Trail */
.path-svg-trail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.path-svg-line-bg {
    fill: none;
    stroke: rgba(203, 213, 225, 0.7);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.path-svg-line-glow {
    fill: none;
    stroke: #0284c7;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
    stroke-dasharray: 12 8;
    animation: wmDashFlow 30s linear infinite;
}

@keyframes wmDashFlow {
    to { stroke-dashoffset: -1000; }
}

/* ─── STEPPING STONE LEVEL NODES ───────────────────────────────── */
.path-nodes-layer {
    position: relative;
    z-index: 5;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.path-level-step {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    transition: transform 0.2s ease;
}

.path-level-step.align-left {
    justify-content: flex-start;
    padding-left: 10%;
}

.path-level-step.align-center {
    justify-content: center;
}

.path-level-step.align-right {
    justify-content: flex-end;
    padding-right: 10%;
}

/* Stepping Stone Disc */
.path-node-disc {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 4px solid var(--wm-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08), inset 0 2px 4px rgba(255, 255, 255, 0.9);
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

.path-node-disc:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12), 0 0 20px rgba(56, 189, 248, 0.35);
}

.path-node-disc:active {
    transform: scale(0.96);
}

.path-node-disc .node-m-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--wm-text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.path-node-disc .node-m-icon {
    font-size: 1.25rem;
    color: #0f172a;
    margin-top: 1px;
}

/* Node States: Completed */
.path-level-step.completed .path-node-disc {
    background: linear-gradient(145deg, #059669, #047857);
    border-color: #34d399;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35), 0 0 16px rgba(52, 211, 153, 0.45);
}

.path-level-step.completed .path-node-disc .node-m-num {
    color: #d1fae5;
}

.path-level-step.completed .path-node-disc .node-m-icon {
    color: #ffffff;
}

.path-star-crown {
    position: absolute;
    top: -12px;
    display: flex;
    gap: 2px;
    font-size: 0.68rem;
    color: #fbbf24;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.8));
}

/* Node States: Active (Current Target) */
.path-level-step.active-node .path-node-disc {
    background: linear-gradient(145deg, #0284c7, #0369a1);
    border-color: #38bdf8;
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.25), 0 10px 24px rgba(2, 132, 199, 0.4);
    animation: wmActivePulse 2s infinite ease-in-out;
}

.path-level-step.active-node .path-node-disc .node-m-num {
    color: #e0f2fe;
}

.path-level-step.active-node .path-node-disc .node-m-icon {
    color: #ffffff;
}

@keyframes wmActivePulse {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.25), 0 10px 24px rgba(2, 132, 199, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(56, 189, 248, 0.4), 0 12px 30px rgba(56, 189, 248, 0.6);
    }
}

/* Node States: Locked */
.path-level-step.locked .path-node-disc {
    background: rgba(241, 245, 249, 0.85);
    border-color: rgba(203, 213, 225, 0.6);
    opacity: 0.7;
    cursor: not-allowed;
}

.path-level-step.locked .path-node-disc:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.path-level-step.locked .path-node-disc .node-m-icon {
    color: #94a3b8;
}

/* ─── LEVEL INFO FLOATING CARD ─────────────────────────────────── */
.path-level-card {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--wm-border);
    border-radius: 14px;
    padding: 10px 14px;
    width: 220px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    pointer-events: none;
    transition: all 0.2s ease;
}

.path-level-step.align-left .path-level-card {
    left: 88px;
}

.path-level-step.align-center .path-level-card {
    left: 88px;
}

.path-level-step.align-right .path-level-card {
    right: 88px;
    text-align: right;
}

.plc-status-pill {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.plc-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.plc-meta {
    font-size: 0.7rem;
    color: var(--wm-text-secondary);
}

/* ─── stemBOT ROBOTIC MASCOT (MARIO OVERWORLD COMPANION) ───────── */
.path-player-mascot {
    position: absolute;
    top: -66px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.path-player-mascot:hover .stembot-body {
    transform: scale(1.08);
}

/* Hovering / Floating Animation */
.stembot-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: stemBotHover 2.2s ease-in-out infinite alternate;
    transition: transform 0.25s ease;
}

@keyframes stemBotHover {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Character SVG Vector */
.stembot-svg {
    filter: drop-shadow(0 8px 16px rgba(2, 132, 199, 0.35));
    transition: all 0.25s ease;
    overflow: visible;
}

/* Blinking Eyes */
.stembot-eye {
    transform-origin: center;
    animation: stemBotBlink 3.8s infinite ease-in-out;
}

@keyframes stemBotBlink {
    0%, 94%, 100% { transform: scaleY(1); }
    96%, 98% { transform: scaleY(0.12); }
}

/* Pulsing Antenna Beacon */
.stembot-beacon {
    transform-origin: 32px 5px;
    animation: stemBotBeaconPulse 1.4s ease-in-out infinite alternate;
}

@keyframes stemBotBeaconPulse {
    0% { filter: drop-shadow(0 0 2px #00f5d4); opacity: 0.85; }
    100% { filter: drop-shadow(0 0 10px #00f5d4); opacity: 1; transform: scale(1.2); }
}

/* Articulated Waving Arm */
.stembot-arm-right {
    transform-origin: 50px 30px;
    transition: transform 0.3s ease;
}

.path-player-mascot:hover .stembot-arm-right,
.stembot-waving .stembot-arm-right {
    animation: stemBotWaveHand 0.65s ease-in-out infinite alternate;
}

@keyframes stemBotWaveHand {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-38deg) translateY(-2px); }
}

/* Anti-Gravity Jet Flame */
.stembot-flame {
    transform-origin: 32px 51px;
    animation: stemBotFlameFlicker 0.4s ease-in-out infinite alternate;
}

@keyframes stemBotFlameFlicker {
    0% { transform: scaleY(0.85) scaleX(0.95); opacity: 0.8; }
    100% { transform: scaleY(1.2) scaleX(1.08); opacity: 1; filter: drop-shadow(0 4px 8px #00f5d4); }
}

/* Dynamic Ground Drop Shadow */
.stembot-shadow {
    width: 28px;
    height: 7px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.28) 0%, rgba(15, 23, 42, 0) 72%);
    border-radius: 50%;
    margin-top: -2px;
    animation: stemBotShadowPulse 2.2s ease-in-out infinite alternate;
}

@keyframes stemBotShadowPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(0.65); opacity: 0.35; }
}

/* ─── STEMBOT SPEECH BUBBLE ─────────────────────────────────────── */
.stembot-speech-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.92);
    background: #ffffff;
    color: #0f172a;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.35;
    padding: 6px 12px;
    border-radius: 14px;
    white-space: nowrap;
    max-width: 230px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(2, 132, 199, 0.25);
    border: 1.5px solid #e0f2fe;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stembot-speech-bubble.visible {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.stembot-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #ffffff transparent;
}

.stembot-bubble-bot-tag {
    background: linear-gradient(135deg, #0284c7, #00f5d4);
    color: #ffffff;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

/* ─── STEMBOT HOP & ADVANCE ANIMATION ──────────────────────────── */
.stembot-hopping {
    animation: stemBotHopMove 0.85s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

@keyframes stemBotHopMove {
    0% { transform: translateX(-50%) translateY(0) scale(1); }
    20% { transform: translateX(-50%) translateY(6px) scale(1.15, 0.85); }
    50% { transform: translateX(-50%) translateY(-38px) scale(0.9, 1.15); }
    75% { transform: translateX(-50%) translateY(-14px) scale(1.05, 0.95); }
    88% { transform: translateX(-50%) translateY(3px) scale(1.1, 0.9); }
    100% { transform: translateX(-50%) translateY(0) scale(1); }
}

/* Victory Celebration Spin */
.stembot-celebrating .stembot-svg {
    animation: stemBotSpinCelebrate 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stemBotSpinCelebrate {
    0% { transform: rotate(0deg) scale(1); }
    40% { transform: rotate(-15deg) translateY(-25px) scale(1.25); }
    70% { transform: rotate(375deg) translateY(-15px) scale(1.15); }
    100% { transform: rotate(360deg) translateY(0) scale(1); }
}

/* Celebratory Sparkle Particles */
.stembot-sparkles-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 12;
}

.stembot-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #00f5d4;
    border-radius: 50%;
    box-shadow: 0 0 10px #00f5d4, 0 0 20px #0284c7;
    animation: stemBotSparkleFly 0.8s ease-out forwards;
}

@keyframes stemBotSparkleFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--sparkle-dx, 20px), var(--sparkle-dy, -25px)) scale(0); opacity: 0; }
}

/* ─── 3D WORLD GLOBE HUD COMPANION (stemBOT WIDGET) ─────────────── */
.stembot-hud-widget {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--wm-border-glow);
    padding: 8px 14px 8px 10px;
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 0 20px rgba(2, 132, 199, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.stembot-hud-widget:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18), 0 0 24px rgba(2, 132, 199, 0.25);
    border-color: #0284c7;
}

.stembot-hud-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #00f5d4 100%);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.stembot-hud-avatar svg {
    width: 32px;
    height: 36px;
}

.stembot-hud-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stembot-hud-title {
    font-size: 0.76rem;
    font-weight: 900;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stembot-hud-subtitle {
    font-size: 0.68rem;
    color: var(--wm-text-secondary);
    font-weight: 600;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .stembot-hud-widget {
        bottom: 16px;
        right: 14px;
        padding: 6px 10px 6px 8px;
    }
    .stembot-hud-subtitle {
        max-width: 120px;
    }
}

/* ─── MODULE INSPECTION DRAWER / MODAL ─────────────────────────── */
.world-module-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--wm-border-glow);
    border-radius: 28px 28px 0 0;
    padding: 28px 32px 36px;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.12);
    max-width: 780px;
    margin: 0 auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.world-module-drawer.open {
    transform: translateY(0);
}

.wmd-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.wmd-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.wmd-handle {
    width: 40px;
    height: 4px;
    background: rgba(203, 213, 225, 0.9);
    border-radius: 2px;
    margin: -14px auto 18px;
}

.wmd-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.wmd-title-box {
    display: flex;
    flex-direction: column;
}

.wmd-tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.wmd-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.wmd-subtitle {
    font-size: 0.85rem;
    color: var(--wm-text-secondary);
    margin-top: 2px;
}

.wmd-close-btn {
    border: none;
    background: rgba(15, 23, 42, 0.05);
    color: var(--wm-text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.wmd-close-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.wmd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.wmd-stat-box {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.wmd-stat-lbl {
    font-size: 0.68rem;
    color: var(--wm-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.wmd-stat-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2px;
}

.wmd-readings-list {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.wmd-reading-item {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wmd-r-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
}

.wmd-r-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--wm-text-muted);
    white-space: nowrap;
}

.wmd-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wmd-btn-primary {
    flex: 1;
    min-width: 200px;
    border: none;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 800;
    padding: 14px 24px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.35);
    transition: all 0.2s ease;
}

.wmd-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
}

.wmd-btn-secondary {
    border: 1px solid var(--wm-border);
    background: #ffffff;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 14px 18px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.wmd-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ─── SOUND FX POPUP NOTIFICATION (TOAST) ───────────────────────── */
.world-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #0284c7;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 0 20px rgba(56, 189, 248, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.world-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── RESPONSIVE BREAKPOINTS ────────────────────────────────────── */
@media (max-width: 768px) {
    .world-experience-wrap {
        border-radius: 0;
        min-height: calc(100vh - 80px);
    }

    .world-hud-top {
        padding: 12px;
    }

    .world-title-badge {
        padding: 6px 12px;
    }

    .world-title-sub {
        display: none;
    }

    .path-level-step.align-left {
        padding-left: 4%;
    }

    .path-level-step.align-right {
        padding-right: 4%;
    }

    .path-level-card {
        width: 170px;
        padding: 8px 10px;
    }

    .path-level-step.align-left .path-level-card,
    .path-level-step.align-center .path-level-card {
        left: 78px;
    }

    .path-level-step.align-right .path-level-card {
        right: 78px;
    }

    .world-module-drawer {
        padding: 20px 20px 28px;
    }
}
