/* =========================================================
   GAME MAP MINIMALIST (CLEAN, SHARP & HIGH CONTRAST)
   Rõ nét, tương phản cao, tối giản thanh lịch
========================================================= */

#game-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 24px 16px 120px;
    position: relative;
    min-height: 100vh;
    box-sizing: border-box;
}

#skill-tree-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    z-index: 2;
}

#tree-svg-layer {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

/* Dây nối TĨNH mảnh mai, không có nét đứt chạy chạy rối mắt */
.tree-path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.14);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.tree-path.unlocked {
    stroke: rgba(162, 155, 254, 0.45);
}
.tree-path.glow-purple {
    stroke: #b388ff;
    filter: drop-shadow(0 0 6px rgba(179, 136, 255, 0.8));
}


/* =========================================================
   PHÂN TÁCH TRẠM TINH TẾ (RÕ NÉT)
   ========================================================= */
.station-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 340px;
    margin: 36px 0 24px;
    z-index: 3;
    user-select: none;
}

.station-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.station-divider-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #a29bfe;
}

.station-divider.station-boss .station-divider-title {
    color: #ff6b6b;
}
.station-divider.station-boss .station-divider-line {
    background: rgba(255, 107, 107, 0.3);
}

/* =========================================================
   HÀNG CHẶNG VÀ NODE S-CURVE (RÕ NÉT, NỔI KHỐI)
   ========================================================= */
.tree-step-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 3;
    margin-bottom: 95px; /* Giãn cách đủ rộng để chứa Text và Ngôi sao */
    transition: transform 0.2s ease;
}

/* Uốn lượn S-Curve mạnh hơn, rộng ra 2 bên */
.tree-step-row.shift-center { transform: translateX(0); }
.tree-step-row.shift-right  { transform: translateX(calc(min(24vw, 100px))); }
.tree-step-row.shift-left   { transform: translateX(calc(max(-24vw, -100px))); }

/* Vòng tròn Node: Sang trọng, Kính mờ (Glassmorphism), Clean & Clear */
.skill-node-clean {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    background: rgba(30, 30, 45, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.05);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.skill-node-clean:active {
    transform: scale(0.9);
}

/* Icon bự, lấp đầy hình tròn, xịn xò */
.clean-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clean-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    stroke-width: 1.5px;
}

/* Nhãn tên rõ ràng, đậm nét, dễ đọc */
.clean-node-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    max-width: 150px;
    line-height: 1.35;
    margin-top: 12px;
    pointer-events: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.2px;
}

/* --- TRẠNG THÁI RÕ RÀNG --- */

/* 1. Đang mở / Đang cày (Current) */
.skill-node-clean.current {
    background: rgba(162, 155, 254, 0.15);
    border-color: rgba(162, 155, 254, 0.6);
    box-shadow: 0 0 24px rgba(162, 155, 254, 0.25), inset 0 0 12px rgba(162, 155, 254, 0.15);
}
.skill-node-clean.current .clean-icon {
    color: #ffffff;
}
.skill-node-clean.current + .clean-node-label {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(162, 155, 254, 0.6);
}

/* 2. Đã hoàn thành Xuất Sắc (Mastered 3 Sao) */
.skill-node-clean.mastered {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.15);
}
.skill-node-clean.mastered .clean-icon {
    color: #ffc107;
}

/* 2.5 Đã hoàn thành nhưng chưa max (1-2 Sao) */
.skill-node-clean.mastered-partial {
    background: rgba(0, 206, 201, 0.08);
    border-color: rgba(0, 206, 201, 0.4);
    box-shadow: 0 4px 16px rgba(0, 206, 201, 0.15);
}
.skill-node-clean.mastered-partial .clean-icon {
    color: #00cec9;
}

/* 3. Khóa (Locked) */
.skill-node-clean.locked {
    background: rgba(15, 15, 25, 0.4);
    border-color: rgba(162, 155, 254, 0.25); /* Viền tím nhạt theo yêu cầu */
    cursor: not-allowed;
    box-shadow: none;
}
.skill-node-clean.locked .clean-icon {
    color: rgba(255, 255, 255, 0.3);
}
.skill-node-clean.locked + .clean-node-label {
    color: rgba(255, 255, 255, 0.4);
}

/* 4. Node Boss Cuối */
.skill-node-clean.boss-node {
    width: 72px;
    height: 72px;
    border-color: rgba(255, 107, 107, 0.5);
    background: rgba(255, 107, 107, 0.08);
}
.skill-node-clean.boss-node .clean-icon {
    width: 44px;
    height: 44px;
    color: #ff6b6b;
}
.skill-node-clean.boss-node.current {
    box-shadow: 0 0 24px rgba(255, 107, 107, 0.3), inset 0 0 12px rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.8);
}

/* =========================================================
   3 NGÔI SAO BO CONG BÁM VIỀN TRÊN
   ========================================================= */
.clean-stars-arc {
    position: absolute;
    top: -30px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 68px;
    height: 26px;
    pointer-events: none;
    z-index: 4;
}

.clean-stars-arc .star-item {
    display: block;
    transform-origin: center center;
    transition: all 0.2s ease;
}

.clean-stars-arc .star-left {
    transform: translateY(7px) rotate(-26deg);
    margin-inline-end: -2px;
}
.clean-stars-arc .star-mid {
    transform: translateY(0);
    z-index: 2;
}
.clean-stars-arc .star-right {
    transform: translateY(7px) rotate(26deg);
    margin-inline-start: -2px;
}

.clean-stars-arc .star-item.lit {
    filter: drop-shadow(0 0 6px rgba(255, 204, 0, 0.9));
}
.clean-stars-arc .star-item.unlit {
    opacity: 1;
}

/* MACRO-ECONOMY: Map Soft-Lock Glow Effect */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(140, 133, 230, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(140, 133, 230, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(140, 133, 230, 0);
    }
}

.node-pulse-glow {
    animation: pulse-glow 2s infinite cubic-bezier(0.66, 0, 0, 1) !important;
    border-color: #8c85e6 !important;
    z-index: 10;
}
.node-pulse-glow .clean-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}
