/* --- CORE VARIABLES --- */
:root {
    --bg-light: #F4F6F9;
    --bg-dark: #121212;
    --primary-black: #1a1a1a;
    --primary-blue: #3B82F6;
    --accent-green: #22C55E;
    --accent-orange: #F59E0B;
    --accent-purple: #8B5CF6;
    --lock-grey: #94A3B8;
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    --glow-green: rgba(34, 197, 94, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #1e1e1e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}
body, button, input, textarea {
    font-family: 'Poppins', sans-serif !important;
}

/* --- PHONE FRAME --- */
.phone-frame {
    width: clamp(320px, 90vw, 420px);
    height: clamp(600px, 90vh, 900px);
    transition: 0.3s ease;
    background: var(--bg-light);
    border-radius: 45px;
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.5);
    border: 12px solid #000;
    position: relative;
    overflow: hidden;
    margin: auto;
}

.notch {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 35px;
    background: #000;
    border-radius: 20px;
    z-index: 999;
}

/* --- SCREEN CONTAINER --- */
#app-screen {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    overflow-y: auto;
    scrollbar-width: none;
}

#app-screen::-webkit-scrollbar {
    display: none;
}

/* --- SCREEN TRANSITIONS --- */
.screen {
    display: none;
    padding: 24px;
    padding-top: 70px;
    padding-bottom: 120px;
    
    min-height: 100%;
    flex-direction: column;
    animation: screenFade 0.45s ease;
}

@keyframes screenFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    display: flex;
}

.screen.dark-mode {
    background-color: var(--bg-dark);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        margin-top: 20px;
    }

    to {
        opacity: 1;
        margin-top: 0;
    }
}

/* --- UI COMPONENTS --- */
h1,
h2 {
    color: var(--primary-black);
    letter-spacing: -0.5px;
}

h3 {
    color: var(--primary-black);
}

.dark-mode h2,
.dark-mode p,
.dark-mode h3 {
    color: white;
}

.btn {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.96);
}

.btn-black {
    background: var(--primary-black);
    color: white;
}

.btn-blue {
    background: linear-gradient(135deg,#3b82f6,#2563eb);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.btn-green {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.4);
}

.back-btn {
    font-size: 22px;
    margin-bottom: 20px;
    cursor: pointer;
    color: #64748B;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-mode .back-btn {
    color: white;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 24px;
    margin-bottom: 15px;
    box-shadow: var(--card-shadow);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
}

.card.selected {
    border-color: var(--primary-black);
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.sticky-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 24px 30px;
    background: linear-gradient(to top, var(--bg-light) 85%, transparent);
    z-index: 100;
    pointer-events: none;
}

.sticky-footer>* {
    pointer-events: auto;
}

.dark-mode .sticky-footer {
    background: linear-gradient(to top, var(--bg-dark) 85%, transparent);
}

/* --- ROADMAP STYLES --- */
.roadmap-area {
    position: relative;
    width: 100%;
    height: 1100px;
    margin-top: 50px;
    z-index: 1;
}

.roadmap-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: visible;
    pointer-events: none;
}

.map-node {
    position: absolute;
    z-index: 10;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.node-current {
    width: 80px;
    height: 80px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 30px var(--glow-green);
    border: 4px solid white;
    animation: pulse 2s infinite;
    font-size: 14px;
    font-weight: 800;
}

.node-done {
    width: 50px;
    height: 50px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4);
    border: 4px solid white;
    font-size: 20px;
}

.node-locked {
    filter: grayscale(100%);
    opacity: 0.7;
    pointer-events: none;
}

.node-locked .node-circle {
    background: #E2E8F0;
    color: #94A3B8;
    border-color: white;
    box-shadow: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    font-size: 18px;
}

.node-label {
    position: absolute;
    background: white;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    top: 55px;
}

.mod-header {
    position: absolute;
    left: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 1px;
    z-index: 2;
}

.path-glow {
    filter: drop-shadow(0px 0px 8px var(--glow-green));
    transition: stroke-dashoffset 1s ease;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* --- EDITOR & QUIZ --- */
.code-editor {
    background: #1F2937;
    border-radius: 16px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    color: #e5e5e5;
    margin: 20px 0;
    border: 1px solid #374151;
    font-size: 13px;
    line-height: 1.6;
}

.quiz-option {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    color: white;
    font-size: 14px;
}

.quiz-option:hover {
    border-color: #555;
}

.quiz-option.correct {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}

.quiz-option.wrong {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 14px;
    border: 1px solid #E5E7EB;
    font-family: Poppins;
}

/* --- SNAKE GAME STYLES --- */
.btn-game-opt {
    flex: 1;
    padding: 20px 10px;
    border-radius: 15px;
    font-size: 24px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    color: black;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.btn-game-opt:active {
    transform: scale(0.9);
}

.btn-snake {
    background-color: #76ff03;
}

.btn-water {
    background-color: #00e5ff;
}

.btn-gun {
    background-color: #f44336;
    color: white;
}

.score-box {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
    width: 100%;
}

.ai-hint-btn {
    position: sticky;
    top: 18px;
    margin-left: auto;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    padding: 8px 18px;
    border-radius: 22px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.5);
    z-index: 200;
}


@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: white;
    padding: 24px;
    border-radius: 22px;
    width: 85%;
    max-width: 320px;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

#coming-soon-modal.show .modal-overlay {
    opacity: 1;
}

#coming-soon-modal.show .modal-box {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}


.modal-box h3 {
    margin-bottom: 12px;
}

.modal-box p {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 20px;
}

.lang-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 26px;
    position: relative;
    overflow: hidden;
}

.lang-icon {
    font-size: 38px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.java .lang-icon {
    background: linear-gradient(135deg, #f97316, #facc15);
}

.cpp .lang-icon {
    background: linear-gradient(135deg, #6366f1, #a855f7);
}

.lang-info h3 {
    margin: 0;
    font-size: 17px;
}

.lang-info small {
    color: #64748B;
    font-size: 12px;
}

.lang-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
}

.lang-tag.active {
    background: #22C55E;
    color: white;
}

.lang-tag.coming {
    background: #E5E7EB;
    color: #64748B;
}

.lang-card:hover {
    transform: translateY(-4px) scale(1.02);
    transition: 0.25s ease;
}

.math-task {
    background: white;
    padding: 14px;
    border-radius: 14px;
    margin-top: 10px;
    text-align: center;
}

.math-code {
    font-family: 'Courier New';
    background: #F3F4F6;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.math-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 700;
}

#math-feedback {
    margin-top: 10px;
    font-weight: 700;
}

.node-done {
    animation: unlockGlow 1s ease;
}

@keyframes unlockGlow {
    0% {
        box-shadow: 0 0 0 rgba(34, 197, 94, 0);
    }

    50% {
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.9);
    }

    100% {
        box-shadow: 0 0 0 rgba(34, 197, 94, 0);
    }
}

.battle-header {
    position: sticky;
    top: 20px;
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(to bottom, rgba(18, 18, 18, 0.95) 85%, transparent);
    backdrop-filter: blur(10px);
    text-align: center;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-header small {
    color: #8B5CF6;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 10px;
}

.battle-header h2 {
    color: white;
    margin: 4px 0 0;
}

.card {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    transition: 0.25s ease;
}

.card:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}
.btn-black,
.btn-blue {
    color: white !important;
}
.auth-card{
    margin-top: 40px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
}

.auth-card h2{
    font-weight:700;
    letter-spacing:-0.5px;
}

.auth-card p{
    color:#64748B;
    font-size:13px;
}

.auth-input{
    background:#F1F5F9;
    border:1px solid #E2E8F0;
    border-radius:14px;
    padding:14px;
}

.auth-btn{
    margin-top:14px;
    border-radius:18px;
    font-weight:700;
    letter-spacing:0.4px;
}

.reset-gear {
    font-size: 50px;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
}

.reset-gear:hover {
    animation: spinGear 0.8s linear infinite;
    color: #3B82F6;
}

@keyframes spinGear {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


.reset-gear:active {
    transform: scale(0.9) rotate(-30deg);
}
/* Force paint on heavy battle screens */
#scrn-mod1-game,
#scrn-mod3-game {
    transform: translateZ(0);
    will-change: transform;
}



