@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Quicksand:wght@500;700;800&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #0f172a; /* Deep space blue */
    color: #ffffff;
    font-family: 'Quicksand', sans-serif;
    overflow: hidden; /* Prevent body scroll, map handles scrolling */
    width: 100vw;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Background Stars/Nebula effect */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(46, 204, 113, 0.1), transparent 25%);
    z-index: -1;
}

/* Header Glassmorphism */
.journey-header {
    height: 70px;
    padding: env(safe-area-inset-top, 10px) 15px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.btn-back:active { transform: scale(0.9); }
.btn-back img { width: 24px; }

.header-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(241, 196, 15, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    color: #f1c40f;
    min-width: 80px;
    justify-content: center;
}
.coin-display img { width: 20px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

/* Map Container */
.journey-map-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    /* Hide scrollbar */
    scrollbar-width: none; 
}
.journey-map-container::-webkit-scrollbar { display: none; }

/* SVG Path */
.journey-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.journey-path path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 20 15;
}

.journey-nodes {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 50px 0 150px; /* Padding for scrolling */
    display: flex;
    flex-direction: column-reverse; /* Bottom to top */
    align-items: center;
    gap: 80px;
    z-index: 10;
}

/* Individual Node */
.node-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    /* Zigzag pattern is handled via nth-child margins in JS */
}

.node-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.3);
}

.node-btn img {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
    z-index: 2;
}

.node-title {
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(0,0,0,0.6);
    padding: 4px 12px;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Node States */
.node-container.locked .node-btn {
    background: linear-gradient(135deg, #475569, #1e293b);
    border: 3px solid #64748b;
    opacity: 0.7;
}
.node-container.locked .node-btn img {
    filter: grayscale(100%) opacity(0.6);
}

.node-container.current .node-btn {
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    border: 4px solid #c7d2fe;
    animation: pulseGlow 2s infinite;
}

.node-container.completed .node-btn {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    border: 4px solid #bbf7d0;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7), 0 10px 20px rgba(0,0,0,0.5); }
    70% { box-shadow: 0 0 0 20px rgba(99, 102, 241, 0), 0 10px 20px rgba(0,0,0,0.5); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0), 0 10px 20px rgba(0,0,0,0.5); }
}

/* Modals */
.glass-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.glass-modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border-radius: 24px;
    width: 90%;
    max-width: 360px;
    padding: 24px;
    transform: translateY(50px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}
.modal-header img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}
.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #c7d2fe;
}

.modal-body {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
}

.desc-text {
    font-size: 0.95rem;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.5;
}

.reward-box, .fee-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.fee-box { border-bottom: none; }

.reward-label, .fee-label {
    font-weight: 700;
    font-size: 0.9rem;
}
.reward-label { color: #4ade80; }
.fee-label { color: #f43f5e; }

.reward-amount, .fee-amount {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
}
.reward-amount { color: #f1c40f; }
.fee-amount { color: #f43f5e; }

.reward-amount img, .fee-amount img {
    width: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel, .btn-play {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.btn-cancel {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.btn-cancel:active { transform: scale(0.95); }

.btn-play {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.4);
}
.btn-play:active { transform: scale(0.95); }
.btn-play:disabled {
    background: #475569;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* Toast */
.toast-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 10000;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    white-space: nowrap;
}
.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
