/* ==========================================================================
   DUOLINGO WINDING LEVEL PATH ENGINE (DuoMapEngine)
   Bilişim Oyunları - Eğitsel Oyun Seviye Haritası Motoru
   ========================================================================== */

:root {
    --duo-green: #58cc02;
    --duo-green-dark: #46a302;
    --duo-green-shadow: #3b8701;

    --duo-blue: #1cb0f6;
    --duo-blue-dark: #1899d6;
    --duo-blue-shadow: #1480b3;

    --duo-purple: #8544ff;
    --duo-purple-dark: #6e30eb;
    --duo-purple-shadow: #5b22cd;

    --duo-orange: #ff9600;
    --duo-orange-dark: #e07b00;
    --duo-orange-shadow: #b86500;

    --duo-pink: #ff4b8b;
    --duo-pink-dark: #e63977;
    --duo-pink-shadow: #bf255e;

    --duo-teal: #00cd9c;
    --duo-teal-dark: #00b085;
    --duo-teal-shadow: #008f6c;

    --duo-gold: #ffc800;
    --duo-gold-dark: #e5a800;
    --duo-gold-shadow: #bf8c00;

    --duo-gray: #e5e5e5;
    --duo-gray-dark: #afafaf;
    --duo-gray-shadow: #888888;
}

/* ==========================================================================
   STANDARDIZED DUO MAP SCREEN & HEADER (Tüm Oyunlar İçin Birebir Standart)
   ========================================================================== */
.duo-map-screen-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 10px 15px 40px 15px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.duo-map-screen-container {
    width: 100% !important;
    max-width: 760px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.duo-map-header {
    width: 100% !important;
    border-bottom: 3px dashed #e2e8f0 !important;
    padding-bottom: 18px !important;
    margin-bottom: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
}

.duo-map-title-box {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}

.duo-map-emoji {
    font-size: 2.4rem !important;
    line-height: 1 !important;
    display: inline-block !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08)) !important;
}

.duo-map-title {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 2.1rem !important;
    font-weight: 900 !important;
    color: #1e293b !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.5px !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: initial !important;
}

/* Duolingo Tarzı 3D Beyaz "Oyunlar" Butonu */
.duo-map-games-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #475569 !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-bottom: 5px solid #cbd5e1 !important;
    border-radius: 16px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

.duo-map-games-btn i {
    font-size: 1rem !important;
    color: #64748b !important;
    transition: transform 0.15s ease !important;
}

.duo-map-games-btn:hover {
    background: #f8fafc !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    border-bottom-color: #94a3b8 !important;
    transform: translateY(-2px) !important;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
}

.duo-map-games-btn:hover i {
    color: #3b82f6 !important;
    transform: scale(1.1) !important;
}

.duo-map-games-btn:active {
    transform: translateY(2px) !important;
    border-bottom-width: 2px !important;
    box-shadow: none !important;
}

/* Winding Path Harita Kapsayıcısı */
.duo-map-render-container {
    width: 100% !important;
    max-width: 720px !important;
    margin: 0 auto !important;
    padding-top: 10px !important;
    box-sizing: border-box !important;
}

/* Harita Kapsayıcısı */
.duo-path-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 10px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

/* Arka Plan Akıcı Yol Çizgisi */
.duo-path-svg-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   ÜNİTE BAŞLIK ŞERİDİ (UNIT HEADER BANNER)
   ========================================================================== */
.duo-unit-banner {
    position: sticky;
    top: 90px;
    z-index: 50;
    width: 100%;
    margin-bottom: 45px;
    border-radius: 22px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.duo-unit-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.duo-unit-info {
    flex: 1;
    color: #ffffff;
}

.duo-unit-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.duo-unit-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.duo-unit-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-bottom: 4px solid rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 10px 18px;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    backdrop-filter: blur(8px);
}

.duo-unit-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px);
    border-bottom-width: 5px;
}

.duo-unit-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

/* ==========================================================================
   BASAMAK TAŞLARI (STEPPING STONE NODES) & ZİKZAK YOL
   ========================================================================== */
.duo-nodes-track {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 10;
}

.duo-node-row {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.duo-node-row.has-active-popover {
    z-index: 2000 !important;
}

/* Kıvrım Ofsetleri (Sine-Wave Zigzag) */
.duo-offset-0 {
    transform: translateX(0px);
}

.duo-offset-r1 {
    transform: translateX(45px);
}

.duo-offset-r2 {
    transform: translateX(85px);
}

.duo-offset-r3 {
    transform: translateX(45px);
}

.duo-offset-l1 {
    transform: translateX(-45px);
}

.duo-offset-l2 {
    transform: translateX(-85px);
}

.duo-offset-l3 {
    transform: translateX(-45px);
}

/* Dairesel 3D Basamak Taşı */
.duo-stone-btn {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    outline: none !important;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, filter 0.2s ease;
    box-shadow: 0 6px 0 var(--node-shadow, #888888), 0 10px 20px rgba(0, 0, 0, 0.12);
    background: var(--node-bg, #e5e5e5);
}

/* Parlaklık (Gloss) Katmanı Kaldırıldı - Mat ve Saf Duolingo 3D Tasarım */
.duo-stone-btn::before {
    display: none !important;
}

.duo-stone-btn:hover:not(:disabled) {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 9px 0 var(--node-shadow, #888888), 0 14px 25px rgba(0, 0, 0, 0.16);
}

.duo-stone-btn:active:not(:disabled) {
    transform: scale(0.96) translateY(4px);
    box-shadow: 0 2px 0 var(--node-shadow, #888888), 0 4px 10px rgba(0, 0, 0, 0.1);
}

.duo-stone-icon {
    font-size: 1.85rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Seviye Numarası */
.duo-stone-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    line-height: 1;
}

/* ==========================================================================
   DÜĞME DURUMLARI (STATES: COMPLETED, ACTIVE/CURRENT, LOCKED, CHEST)
   ========================================================================== */

/* 1. Tamamlanmış Seviye (Completed) */
.duo-stone-btn.completed {
    background: var(--node-bg, var(--duo-theme-color, #58cc02));
    box-shadow: 0 7px 0 var(--node-shadow, var(--duo-theme-shadow, #3b8701)), 0 10px 20px rgba(0, 0, 0, 0.12);
}

.duo-stone-stars {
    position: absolute;
    bottom: -10px;
    display: flex;
    gap: 2px;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.duo-stone-star {
    font-size: 0.75rem;
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.5));
}

.duo-stone-star.empty {
    color: #cbd5e1;
    filter: none;
}

/* 2. Aktif / Sıradaki Seviye (Current - Mat, Net ve Odaklı) */
.duo-stone-btn.current {
    background: var(--node-bg, var(--duo-theme-color, #0ea5e9));
    box-shadow: 0 8px 0 var(--node-shadow, var(--duo-theme-shadow, #0369a1)), 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Aktif Seviye Üstündeki "BAŞLA" Zıplayan Baloncuğu */
.duo-start-bubble {
    position: absolute;
    top: -42px;
    background: #ffffff;
    color: var(--node-bg, var(--duo-theme-color, #0ea5e9));
    border: 2.5px solid var(--node-bg, var(--duo-theme-color, #0ea5e9));
    border-bottom: 4px solid var(--node-shadow, var(--duo-theme-shadow, #0369a1));
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 14px;
    border-radius: 14px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    animation: duoFloatingBounce 1.8s infinite ease-in-out;
    pointer-events: none;
    z-index: 20;
}

.duo-start-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px 6px 0 6px;
    border-style: solid;
    border-color: var(--node-bg, var(--duo-theme-color, #0ea5e9)) transparent transparent transparent;
}

@keyframes duoFloatingBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* 3. Kilitli Seviye (Locked) */
.duo-stone-btn.locked {
    background: #e2e8f0;
    box-shadow: 0 6px 0 #cbd5e1;
    cursor: not-allowed;
    opacity: 0.85;
}

.duo-stone-btn.locked .duo-stone-icon,
.duo-stone-btn.locked .duo-stone-num {
    color: #94a3b8;
    text-shadow: none;
}

.duo-stone-btn.locked::before {
    display: none;
}

/* 4. Özel Sandık / Hazine Basamağı (Treasure Chest Milestone) */
.duo-stone-btn.chest-node {
    width: 82px;
    height: 76px;
    border-radius: 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 8px 0 #d97706, 0 12px 24px rgba(245, 158, 11, 0.25);
}

.duo-stone-btn.chest-node .chest-emoji {
    font-size: 2.3rem;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
}

.duo-stone-btn.chest-node.locked {
    background: #e2e8f0;
    box-shadow: 0 6px 0 #cbd5e1;
}

.duo-stone-btn.chest-node.locked .chest-emoji {
    filter: grayscale(100%) opacity(0.5);
}

/* ==========================================================================
   YOL KENARI MASKOTLARI & YAN İLLÜSTRASYONLAR
   ========================================================================== */
.duo-side-mascot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 5;
    animation: mascotIdle 3s infinite ease-in-out;
}

.duo-side-mascot.left {
    left: -130px;
}

.duo-side-mascot.right {
    right: -130px;
}

.duo-mascot-visual {
    font-size: 4.5rem;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15));
    line-height: 1;
}

.duo-mascot-pedestal {
    width: 80px;
    height: 14px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    margin-top: -6px;
}

@keyframes mascotIdle {

    0%,
    100% {
        transform: translateY(-50%) rotate(0deg);
    }

    50% {
        transform: translateY(-56%) rotate(2deg);
    }
}

@media (max-width: 767px) {
    .duo-side-mascot.left {
        left: -75px;
    }

    .duo-side-mascot.right {
        right: -75px;
    }

    .duo-mascot-visual {
        font-size: 3.2rem;
    }

    .duo-mascot-pedestal {
        width: 55px;
        height: 10px;
    }
}

/* ==========================================================================
   DUOLINGO SEVİYE BİLGİ POPUP MODALI (SPEECH BUBBLE DIALOG)
   ========================================================================== */
.duo-level-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: duoModalFadeIn 0.2s ease forwards;
}

.duo-level-modal-overlay.active {
    display: flex;
}

/* ==========================================================================
   DUOLINGO SEVİYE BAŞLATMA BALONCUĞU (POPOVER CARD)
   ========================================================================== */

/* Duolingo Tarzı Popover Kartı */
.duo-popover-card {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: 295px;
    max-width: calc(100vw - 32px);
    background: var(--duo-popover-bg, #22c55e);
    border-radius: 20px;
    padding: 16px 18px 18px 18px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24), 0 4px 10px rgba(0, 0, 0, 0.12);
    z-index: 9999 !important;
    display: none;
    text-align: left;
    box-sizing: border-box;
    pointer-events: auto !important;
}

.duo-popover-card.active {
    display: block;
    animation: duoPopoverBounceIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Düğmeye bakan üçgen ok ucu (Speech Bubble Caret) */
.duo-popover-caret {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 15px;
    height: 15px;
    background: inherit;
    border-top-left-radius: 3px;
    z-index: 1;
}

/* Başlık ve Alt Başlık */
.duo-popover-header {
    margin-bottom: 12px;
}

.duo-popover-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.12rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 3px 0;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    word-break: break-word;
}

.duo-popover-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.35;
    margin: 0;
}

/* Beyaz 3D Başlatma Butonu */
.duo-popover-btn {
    width: 100%;
    background: #ffffff;
    color: var(--duo-popover-color, #22c55e);
    border: none;
    border-bottom: 4px solid #d1d5db;
    border-radius: 15px;
    padding: 12px 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.1s ease, border-bottom-width 0.1s ease, box-shadow 0.1s ease;
    box-sizing: border-box;
}

.duo-popover-btn:hover {
    transform: translateY(-2px);
    border-bottom-width: 5px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.duo-popover-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Tatlı ve Canlı Zıplama Animasyonu */
@keyframes duoPopoverBounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px) scale(0.75);
    }

    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(3px) scale(1.04);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ==========================================================================
   REHBER / KILAVUZ MODALI (GUIDE MODAL)
   ========================================================================== */
.duo-guide-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: duoModalFadeIn 0.2s ease forwards;
}

.duo-guide-modal-overlay.active {
    display: flex;
}

.duo-guide-modal-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 28px;
    border: 3px solid #e2e8f0;
    border-bottom: 8px solid #cbd5e1;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: duoModalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.duo-guide-header {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    padding: 22px 24px;
    color: #ffffff;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.duo-guide-header-icon {
    font-size: 2rem;
    line-height: 1;
}

.duo-guide-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    margin: 0;
    color: #ffffff;
}

.duo-guide-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.18);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.duo-guide-close:hover {
    background: rgba(0, 0, 0, 0.35);
}

.duo-guide-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.duo-guide-content {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #334155;
    line-height: 1.7;
    white-space: pre-line;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 20px;
}

.duo-guide-ok-btn {
    width: 100%;
    background: #0ea5e9;
    border: none;
    border-bottom: 5px solid #0284c7;
    border-radius: 18px;
    padding: 14px;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.duo-guide-ok-btn:hover {
    transform: translateY(-2px);
    border-bottom-width: 6px;
}

.duo-guide-ok-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}