/* --- GLOBAL STYLES --- */
body {
    margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif;
    background: url('https://www.transparenttextures.com/patterns/cubes.png'), linear-gradient(-45deg, #0f172a, #1e293b, #0f3460, #000000);
    background-size: auto, 400% 400%;
    /* NEW: Uses combined animation for both cubes and gradient */
    animation: combinedBG 20s linear infinite;
    color: white; display: flex; flex-direction: column; align-items: center; min-height: 100vh; overflow-x: hidden;
}

/* NEW: Combined Keyframes to slide cubes diagonally AND pulse the gradient */
@keyframes combinedBG {
    0% { background-position: 0px 0px, 0% 50%; }
    50% { background-position: 200px 200px, 100% 50%; }
    100% { background-position: 400px 400px, 0% 50%; }
}

::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: #0f172a; } ::-webkit-scrollbar-thumb { background: #4ecca3; border-radius: 10px; }

/* SCREENS */
#intro-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle at center, #1a1a2e 0%, #050b14 100%); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.8s ease-out; text-align: center; overflow: hidden; cursor: pointer; }
.intro-logo { font-size: 80px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 10px; text-shadow: 0 0 20px #4ecca3, 0 0 40px #4ecca3; transform: scale(0.1); opacity: 0; animation: logoSmash 0.8s forwards; z-index: 10; }
.intro-subtitle { margin-top: 10px; font-size: 24px; color: #f6d365; font-weight: bold; letter-spacing: 5px; opacity: 0; animation: fadeIn 1s 0.8s forwards; z-index: 10; }
.intro-mascot { position: absolute; width: 150px; height: 150px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 10px 30px rgba(0,0,0,0.8); border: 4px solid #f6d365; opacity: 0; transform: scale(0); }
#mascot-1 { background-image: url('https://robohash.org/oyen?set=set4'); background-color: #f6ad55; top: 15%; left: 20%; animation: popIn 0.6s 0.4s forwards, floatUpDown 3s 1s ease-in-out infinite alternate; }
#mascot-2 { background-image: url('https://api.dicebear.com/7.x/bottts/svg?seed=Kapten&backgroundColor=e94560'); bottom: 15%; right: 20%; animation: popIn 0.6s 0.6s forwards, floatUpDown 4s 1.2s ease-in-out infinite alternate; }
.intro-coin { position: absolute; width: 60px; height: 60px; background: #f6d365; border-radius: 50%; border: 5px solid #d4a017; color: #997300; font-size: 30px; font-weight: bold; display: flex; justify-content: center; align-items: center; opacity: 0; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
#coin-1 { top: 60%; left: 25%; animation: popIn 0.5s 0.5s forwards, spinCoin 2s 1s linear infinite; } #coin-2 { top: 30%; right: 15%; animation: popIn 0.5s 0.7s forwards, spinCoin 2.5s 1.2s linear infinite; }
.skip-hint { position: absolute; bottom: 30px; font-size: 18px; color: rgba(255,255,255,0.7); letter-spacing: 2px; animation: blink 1.5s infinite; z-index: 10; }
@keyframes logoSmash { 100% { transform: scale(1); opacity: 1; } } @keyframes popIn { 100% { transform: scale(1); opacity: 1; } } @keyframes fadeIn { 100% { opacity: 1; } } @keyframes floatUpDown { 100% { transform: translateY(-20px); } } @keyframes spinCoin { 100% { transform: rotateY(360deg); } } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }


/* AUTH SCREEN */
#auth-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: none; justify-content: center; align-items: center; z-index: 5000; opacity: 0; transition: opacity 0.5s ease; }
.auth-container { background: #1e293b; width: 480px; border-radius: 20px; padding: 40px; border: 2px solid #4ecca3; text-align: center; }
.auth-decoration { position: absolute; width: 100px; height: 100px; border-radius: 50%; border: 3px solid #f6d365; background-size: cover; box-shadow: 0 10px 20px rgba(0,0,0,0.5); z-index: -1; animation: floatUpDown 4s ease-in-out infinite alternate; }
#auth-mascot-oyen { background-image: url('https://robohash.org/oyen?set=set4'); background-color: #f6ad55; top: -40px; left: -40px; } #auth-mascot-kapten { background-image: url('https://api.dicebear.com/7.x/bottts/svg?seed=Kapten&backgroundColor=e94560'); bottom: -30px; right: -40px; animation-delay: 1s;}
.auth-logo { font-size: 32px; font-weight: 900; color: #f6d365; letter-spacing: 3px; margin-bottom: 25px; }
.tab-group { display: flex; gap: 10px; margin-bottom: 25px; } .tab-btn { flex: 1; padding: 12px; background: transparent; border: 2px solid #334155; color: #94a3b8; font-weight: bold; border-radius: 8px; cursor: pointer; transition: 0.3s; } .tab-btn.active { background: #4ecca3; border-color: #4ecca3; color: #0f172a; box-shadow: 0 0 15px rgba(78, 204, 163, 0.4); }
.form-group { margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px; }
input { padding: 12px; border-radius: 8px; border: 2px solid #334155; background: #0f172a; color: #fff; font-size: 16px; outline: none; width: 100%; box-sizing: border-box;} input:focus { border-color: #4ecca3; }
#register-form { display: none; }

/* HUD */
#global-hud { width: 100%; background: rgba(15, 23, 42, 0.95); padding: 15px 40px; display: none; justify-content: space-between; align-items: center; box-sizing: border-box; border-bottom: 2px solid #f6d365; z-index: 1000; position: sticky; top: 0; }
.hud-logo { margin: 0; color: #f6d365; font-size: 24px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase;}
.stats { display: flex; align-items: center; gap: 15px; font-weight: bold; font-size: 16px;}
.xp-text { color: #4ecca3; text-shadow: 0 0 5px #4ecca3; }
.btn-nav { padding: 8px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 14px;}
.btn-profil { background: transparent; color: #f6d365; border: 2px solid #f6d365; transition: 0.2s;} .btn-profil:hover { background: #f6d365; color: #0f172a; }
.btn-logout { background: #e94560; color: white; border: 2px solid #e94560; transition: 0.2s;} .btn-logout:hover { background: #c81e3b; border-color: #c81e3b;}

/* DASHBOARD */
#dashboard-screen { width: 100%; max-width: 1000px; padding: 50px 20px; display: none; flex-direction: column; align-items: center; opacity: 0; transition: 0.5s; box-sizing: border-box; }
.dash-header { font-size: 32px; color: #fff; font-weight: 900; margin-bottom: 5px; }
.dash-subtitle { color: #4ecca3; font-size: 16px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 50px; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; }
.module-card { background: #1e293b; border: 2px solid #334155; border-radius: 12px; padding: 40px 20px; cursor: pointer; transition: 0.3s; position: relative; text-align: center; min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.module-card:hover { border-color: #4ecca3; transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.mod-num { font-size: 40px; font-weight: 900; color: rgba(255,255,255,0.05); position: absolute; top: 10px; right: 20px; }
.mod-title { font-size: 16px; font-weight: bold; color: #e2e8f0; z-index: 2; }
.ujian-card { border-color: #e94560; box-shadow: 0 0 15px rgba(233,69,96,0.2); }
.ujian-card .mod-badge { position: absolute; top: 15px; left: 15px; background: #e94560; padding: 4px 10px; border-radius: 5px; font-size: 10px; font-weight: bold; }
.ujian-card .mod-num { color: rgba(255,255,255,0.05); }

/* NEW HISTORY CARD ON DASHBOARD */
.history-card { border-color: #f6d365; }
.history-card:hover { border-color: #f6d365; box-shadow: 0 10px 25px rgba(246,211,101,0.2); }
.history-card .mod-badge { position: absolute; top: 15px; left: 15px; background: #f6d365; color: black; padding: 4px 10px; border-radius: 5px; font-size: 10px; font-weight: bold; }

/* GAME LEVELS LOGIC */
.level-card { border-color: #4ecca3; }
.level-card.locked { opacity: 0.5; pointer-events: none; filter: grayscale(1); border-color: #334155;}
.level-card.completed { border-color: #4ecca3; background: #0f172a; }
.level-card.completed::after { content: '✔ SELESAI'; position: absolute; bottom: 10px; left: 15px; color: #4ecca3; font-weight: bold; font-size: 12px; }

.back-btn-sub { margin-bottom: 25px; background: transparent; color: #f6d365; border: 2px solid #f6d365; padding: 10px 20px; border-radius: 10px; font-weight: bold; cursor: pointer; text-transform: uppercase; letter-spacing: 2px; transition: 0.3s; } .back-btn-sub:hover { background: #f6d365; color: #0f172a; transform: translateY(-3px); }
.btn-revision { background: #e94560; border: none; color: white; font-weight: bold; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; text-transform: uppercase; transition: 0.2s;} .btn-revision:hover { background: #c81e3b; }

/* GAME UI */
#game-ui { width: 100%; display: none; flex-direction: column; align-items: center; opacity: 0; transition: all 0.5s ease-out; padding-bottom: 50px; }
.scene-container { display: flex; flex-direction: column; align-items: center; width: 700px; margin-top: 30px; }
.characters-stage { display: flex; justify-content: space-between; width: 100%; padding: 0 20px; margin-bottom: -20px; z-index: 2; }
.character { width: 130px; height: 130px; border-radius: 50%; border: 4px solid #334155; background-color: #1e293b; background-size: cover; background-position: center; box-shadow: 0 10px 25px rgba(0,0,0,0.8); transition: all 0.3s ease; filter: brightness(0.5); }
.character.active { border-color: #f6d365; filter: brightness(1); transform: scale(1.1) translateY(-10px); box-shadow: 0 0 30px rgba(246, 211, 101, 0.6); }
#char-kapten { background-image: url('https://api.dicebear.com/7.x/bottts/svg?seed=Kapten&backgroundColor=e94560'); }
#char-eko { background-image: url('https://robohash.org/oyen?set=set4'); background-color: #f6ad55; }
.dialogue-box { background: rgba(15, 23, 42, 0.95); border: 3px solid #f6d365; border-radius: 15px; width: 100%; padding: 25px; box-shadow: 0 15px 30px rgba(0,0,0,0.8); position: relative; z-index: 3; min-height: 120px; display: flex; flex-direction: column; }
.dialogue-name { position: absolute; top: -20px; left: 30px; background: #f6d365; color: #0f172a; padding: 5px 20px; border-radius: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.dialogue-text { font-size: 18px; line-height: 1.6; font-family: monospace; font-weight: bold; color: #e2e8f0;}

.quest-card { background: #1e293b; width: 700px; padding: 30px; border-radius: 20px; border: 2px solid #334155; margin-top: 20px; position: relative;}
.answer-area { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px;}
.btn-mcq { background: #0f172a; border: 2px solid #334155; color: white; padding: 15px; border-radius: 8px; cursor: pointer; text-align: left; font-weight: bold; margin-bottom: 10px; width: 100%; font-size: 16px; transition: 0.2s;}
.btn-mcq:hover { border-color: #4ecca3; }
.btn-mcq.selected { background: #4ecca3; border-color: #4ecca3; color: #0f172a; }
.btn-mcq:disabled { cursor: not-allowed; opacity: 0.5; }
.answer-input { text-align: center; font-size: 18px; font-weight: bold; letter-spacing: 1px; width: 100%; padding: 15px; border-radius: 10px; border: 2px solid #334155; background: #0f172a; color: #4ecca3;}
.answer-input:disabled { background: #1e293b; color: #94a3b8; }
.type-badge { background: #e94560; color: white; padding: 5px 15px; border-radius: 20px; font-size: 12px; display: inline-block; margin-bottom: 15px; font-weight: bold;}
.btn-submit { width: 100%; padding: 18px; font-size: 18px; font-weight: 900; color: #0f172a; background: #f6d365; border: none; border-radius: 12px; cursor: pointer; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px; }
.btn-submit:disabled { background: #334155; color: #94a3b8; cursor: not-allowed; }

#notification { position: fixed; top: 100px; left: 50%; transform: translateX(-50%) scale(0.5); opacity: 0; color: white; padding: 15px 30px; border-radius: 30px; font-weight: bold; font-size: 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); transition: 0.4s; pointer-events: none; z-index: 2000; text-align: center; border: 2px solid rgba(255,255,255,0.5); } #notification.show { opacity: 1; transform: translateX(-50%) scale(1); }
.shake { animation: shakeError 0.4s; } @keyframes shakeError { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-15px); } 75% { transform: translateX(15px); } }
.particle { position: absolute; width: 12px; height: 12px; background: #4ecca3; border-radius: 50%; pointer-events: none; z-index: 2000; }

/* =========================================
   PROFILE MODAL PREMIUM (GAMER CARD STYLE)
   ========================================= */
#profile-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 6000; display: none; justify-content: center; align-items: center;
    opacity: 0; transition: 0.3s;
}

.profile-container {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 24px;
    border: 2px solid #4ecca3;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(78, 204, 163, 0.2);
    display: flex; flex-direction: column;
    padding: 45px 40px;
    box-sizing: border-box;
    width: 90%; max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#profile-modal.show .profile-container { transform: scale(1); }

.prof-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px dashed #334155;
    padding-bottom: 15px; margin-bottom: 30px;
}

.prof-title {
    color: #f6d365; font-size: 20px; font-weight: 900; margin: 0;
    letter-spacing: 3px; text-transform: uppercase;
}

.prof-close {
    background: none; border: none; color: #94a3b8; font-size: 32px;
    line-height: 1; cursor: pointer; transition: 0.2s;
}
.prof-close:hover { color: #e94560; transform: scale(1.2); }

.prof-body { text-align: center; }

.prof-avatar {
    width: 110px; height: 110px;
    border-radius: 50%;
    background-color: #4ecca3;
    background-image: url('https://api.dicebear.com/7.x/adventurer/svg?seed=Felix');
    border: 4px solid #f6d365;
    box-shadow: 0 10px 25px rgba(246, 211, 101, 0.4);
    margin: 0 auto 20px auto; transition: transform 0.3s;
}
.prof-avatar:hover { transform: scale(1.05) rotate(5deg); }

#prof-name {
    color: white; font-size: 28px; font-weight: 900;
    margin: 0 0 5px 0; letter-spacing: 1px;
}

#prof-email { color: #94a3b8; margin: 0 0 15px 0; font-size: 15px; }

.prof-school-wrapper { margin-bottom: 35px; }

.prof-school-tag {
    background: rgba(78, 204, 163, 0.15); color: #4ecca3;
    padding: 8px 20px; border-radius: 20px;
    font-size: 14px; font-weight: bold;
    border: 1px solid rgba(78, 204, 163, 0.3);
    display: inline-block; letter-spacing: 1px;
}

.stat-box-container {
    display: flex; gap: 20px; justify-content: center; margin-bottom: 35px;
}

.stat-box {
    background: rgba(0,0,0,0.4); padding: 25px 10px;
    border-radius: 16px; border: 2px solid #334155;
    text-align: center; flex: 1; box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: 0.3s;
}
.stat-box:hover { background: #0f172a; transform: translateY(-5px); }

.stat-box.lvl { border-color: rgba(246, 211, 101, 0.5); }
.stat-box.lvl:hover { border-color: #f6d365; box-shadow: 0 10px 20px rgba(246, 211, 101, 0.2); }

.stat-box.xp { border-color: rgba(78, 204, 163, 0.5); }
.stat-box.xp:hover { border-color: #4ecca3; box-shadow: 0 10px 20px rgba(78, 204, 163, 0.2); }

.stat-label {
    font-size: 13px; color: #94a3b8; font-weight: bold;
    text-transform: uppercase; margin-bottom: 8px; display: block; letter-spacing: 2px;
}

.stat-val { font-size: 38px; font-weight: 900; color: white; display: block; line-height: 1; }
.stat-val.lvl { color: #f6d365; text-shadow: 0 0 15px rgba(246, 211, 101, 0.5); }
.stat-val.xp { color: #4ecca3; text-shadow: 0 0 15px rgba(78, 204, 163, 0.5); }

.prof-btn-close {
    font-size: 16px; padding: 15px; border-radius: 12px;
    background: transparent; color: #94a3b8; border: 2px solid #334155; transition: 0.3s;
}
.prof-btn-close:hover {
    background: #e94560; color: white; border-color: #e94560;
    box-shadow: 0 10px 20px rgba(233, 69, 96, 0.4);
}

/* HISTORY (Inside Dashboard) */
.history-list { display: flex; flex-direction: column; gap: 15px; overflow-y: auto;}
.hist-item { background: #0f172a; padding: 15px; border-radius: 8px; border-left: 5px solid #334155; }
.hist-item.correct { border-left-color: #4ecca3; } .hist-item.wrong { border-left-color: #e94560; }
.hist-status { font-weight: bold; font-size: 12px; padding: 2px 8px; border-radius: 5px; margin-left: 10px;}
.hist-status.correct { background: rgba(78, 204, 163, 0.2); color: #4ecca3; } .hist-status.wrong { background: rgba(233, 69, 96, 0.2); color: #e94560; }
.hist-details { background: #1e293b; padding: 10px; margin-top: 10px; border-radius: 8px; font-size: 13px;}
.hist-ans { color: #94a3b8; } .hist-ans span { color: white; font-weight: bold; }
.hist-exp { color: #f6d365; margin-top: 5px; border-top: 1px dashed #334155; padding-top: 10px; font-style: italic;}
.empty-history { text-align: center; color: #64748b; font-style: italic; padding: 20px; }

/* =========================================
   KOMANDER PORTAL EFFECTS
   ========================================= */
#particle-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; pointer-events: none;
}
.cyber-particle {
    position: absolute;
    background: rgba(104, 211, 145, 0.1);
    border: 1px solid rgba(104, 211, 145, 0.3);
    pointer-events: none;
    animation: floatUp linear infinite;
    box-shadow: 0 0 10px rgba(104, 211, 145, 0.2);
}
@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.glitch-card {
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.glitch-card:hover {
    transform: translateX(5px) scale(1.02);
    border-color: #e94560;
    box-shadow: -5px 0 20px rgba(233, 69, 96, 0.4);
    background: rgba(233, 69, 96, 0.1);
}
.glitch-card:hover::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(233, 69, 96, 0.2), transparent);
    animation: scanline 0.5s linear infinite;
}
@keyframes scanline { 100% { left: 200%; } }

.cursor-blink { animation: blink 1s step-end infinite; color: #fce166; }
@keyframes blink { 50% { opacity: 0; } }

/* Radar Progress Bar */
.radar-track { width: 100%; background: rgba(0,0,0,0.5); height: 8px; border-radius: 4px; margin-top: 5px; overflow: hidden; }
.radar-fill { height: 100%; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

/* --- CYBER-RIG AVATAR STYLES --- */
.prof-avatar-wrapper {
    position: relative; width: 140px; height: 140px; margin: 0 auto 20px auto;
    border-radius: 50%; border: 4px solid #334155;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; transition: 0.3s;
}
.prof-avatar-base {
    position: absolute; width: 100%; height: 100%;
    background-image: url('https://robohash.org/oyen?set=set4');
    background-size: cover; z-index: 2;
}
.prof-visor {
    position: absolute; width: 100%; height: 100%; z-index: 3;
    pointer-events: none; background-size: cover;
}

@keyframes pulseGold { 0% {box-shadow: 0 0 20px #fce166;} 50% {box-shadow: 0 0 40px #fce166;} 100% {box-shadow: 0 0 20px #fce166;} }

/* Shop Item Card */
.shop-item {
    background: #1e293b; border: 2px solid #334155; border-radius: 12px; padding: 20px;
    text-align: center; transition: 0.3s; display: flex; flex-direction: column; justify-content: space-between;
}
.shop-item:hover { transform: translateY(-5px); border-color: #e94560; box-shadow: 0 10px 20px rgba(233,69,96,0.2); }
.shop-item.owned { border-color: #4ecca3; opacity: 0.8; }
.shop-btn {
    width: 100%; padding: 10px; margin-top: 15px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s;
}
.btn-buy { background: #e94560; color: white; } .btn-buy:hover { background: #c81e3b; }
.btn-equip { background: #4ecca3; color: #0f172a; } .btn-equip:hover { background: #38a885; }
.btn-equipped { background: #334155; color: #94a3b8; cursor: not-allowed; }

/* --- CYBER-CITY WORLD MAP --- */
.cyber-map-container {
    width: 100%; height: 500px; position: relative;
    background: radial-gradient(circle, rgba(15,23,42,0) 0%, rgba(0,0,0,0.6) 100%);
    border: 2px solid rgba(78, 204, 163, 0.2); border-radius: 15px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    overflow: hidden;
}
.map-connections {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}
.map-node {
    position: absolute; width: 60px; height: 60px; z-index: 2;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: 0.3s; transform: translate(-50%, -50%);
}
.node-ring {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    border: 3px dashed #94a3b8; animation: spinCoin 10s linear infinite;
}
.node-core {
    width: 40px; height: 40px; background: #1e293b; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: 900; color: white; border: 2px solid #94a3b8; z-index: 3;
}
.node-label {
    position: absolute; top: 70px; text-align: center; width: 150px;
    font-weight: 900; color: white; text-shadow: 0 0 5px black;
}

/* Map Node States */
.map-node:hover { transform: translate(-50%, -50%) scale(1.2); z-index: 10; }

.cleared .node-ring { border-color: #4ecca3; box-shadow: 0 0 15px #4ecca3; animation: spinCoin 5s linear infinite; }
.cleared .node-core { background: rgba(78,204,163,0.2); border-color: #4ecca3; color: #4ecca3; }

.glitchy .node-ring { border-color: #e94560; animation: shakeError 0.5s infinite; }
.glitchy .node-core { background: rgba(233,69,96,0.2); border-color: #e94560; color: #e94560; }

.boss-core { background: #000; font-size: 20px; color: #e94560; }
.glitchy-boss .node-ring { border: 4px solid #e94560; animation: pulseGold 0.5s infinite; }

/* Positioning the nodes */
.node-1 { top: 20%; left: 20%; }
.node-2 { top: 50%; left: 50%; }
.node-3 { top: 30%; left: 80%; }
.node-4 { top: 80%; left: 50%; }
.node-boss { top: 85%; left: 85%; }

.btn-map-history {
    position: absolute; bottom: 20px; left: 20px; z-index: 5;
    background: rgba(0,0,0,0.6); border: 2px solid #fce166; color: #fce166;
    padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.btn-map-history:hover { background: #fce166; color: black; }

/* FORCE THE ANIMATION ON ALL SCREENS */
body {
    animation: combinedBG 20s linear infinite !important;
}

@keyframes combinedBG {
    0% { background-position: 0px 0px, 0% 50%; }
    50% { background-position: 200px 200px, 100% 50%; }
    100% { background-position: 400px 400px, 0% 50%; }
}

/* --- HACKED FAILURE EFFECT --- */
.hacked-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: repeating-linear-gradient(0deg, rgba(233,69,96,0.15) 0px, rgba(233,69,96,0.15) 2px, transparent 2px, transparent 4px);
    box-shadow: inset 0 0 100px rgba(233,69,96,0.8);
    z-index: 9999; display: none; pointer-events: none; mix-blend-mode: color-dodge;
}
.system-hacked { animation: extremeShake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes extremeShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); filter: hue-rotate(0deg); }
    20% { transform: translate(-10px, 5px) rotate(-2deg); filter: hue-rotate(-50deg); }
    40% { transform: translate(10px, -5px) rotate(2deg); filter: hue-rotate(50deg); }
    60% { transform: translate(-15px, 10px) rotate(-4deg); }
    80% { transform: translate(15px, -10px) rotate(4deg); }
}

/* --- 1. SYSTEM HACKED EFFECT --- */
.hacked-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: repeating-linear-gradient(0deg, rgba(233,69,96,0.2) 0px, rgba(233,69,96,0.2) 2px, transparent 2px, transparent 4px),
                radial-gradient(circle, transparent 50%, rgba(233,69,96,0.6) 100%);
    z-index: 9999; display: none; pointer-events: none; mix-blend-mode: color-dodge;
}
.system-hacked { animation: extremeShake 0.2s infinite; filter: contrast(150%) saturate(200%) hue-rotate(10deg); }

@keyframes extremeShake {
    0% { transform: translate(2px, 1px) rotate(0deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    40% { transform: translate(1px, -1px) rotate(0deg); }
    60% { transform: translate(-1px, 2px) rotate(-1deg); }
    80% { transform: translate(-1px, -2px) rotate(1deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* --- 2. CYBER-RIG MECHANICS --- */
.prof-frame { position: absolute; width: 100%; height: 100%; border-radius: 50%; z-index: 4; pointer-events: none; box-sizing: border-box; }

/* --- 3. THE 9 VISORS --- */
.visor_default { background: none; }
.visor_cyborg { background-image: radial-gradient(circle at 65% 35%, rgba(233,69,96,0.9) 8px, transparent 10px); }
.visor_hacker { background: rgba(78,204,163,0.4); border-bottom: 6px solid #4ecca3; }
.visor_neon { background: rgba(189,147,249,0.4); border-top: 6px solid #bd93f9; }
.visor_scouter { background-image: radial-gradient(circle at 35% 45%, rgba(78,204,163,0.8) 12px, transparent 15px); border-left: 4px solid white;}
.visor_vr { background: #1e293b; border-bottom: 2px solid #fce166; opacity: 0.9; clip-path: polygon(0 20%, 100% 20%, 100% 60%, 50% 80%, 0 60%); }
.visor_terminator { background-image: radial-gradient(circle at 65% 35%, #ff0000 5px, transparent 6px), radial-gradient(circle at 35% 35%, #ff0000 5px, transparent 6px); }
.visor_cyclops { background: linear-gradient(90deg, transparent 20%, rgba(233,69,96,0.9) 20%, rgba(233,69,96,0.9) 80%, transparent 80%); height: 20px!important; top: 35%!important; }
.visor_shades { background: black; height: 30px!important; top: 30%!important; opacity: 0.8; }
.visor_glitch { background: repeating-linear-gradient(90deg, rgba(78,204,163,0.5) 0px, transparent 5px); }

/* --- 4. THE 15 AURAS --- */
.aura_default { background: #1e293b; }
.aura_matrix { background: linear-gradient(180deg, #000 0%, #0f380f 100%); }
.aura_inferno { background: radial-gradient(circle, #e94560 0%, #4a0000 100%); }
.aura_gold { background: radial-gradient(circle, #fce166 0%, #b8860b 100%); }
.aura_void { background: radial-gradient(circle, #000 40%, #1a0033 100%); }
.aura_electric { background: radial-gradient(circle, #00d2ff 0%, #3a7bd5 100%); }
.aura_toxic { background: radial-gradient(circle, #a8ff78 0%, #78ffd6 100%); }
.aura_plasma { background: radial-gradient(circle, #f85032 0%, #e73827 100%); }
.aura_galactic { background: radial-gradient(circle, #4b6cb7 0%, #182848 100%); }
.aura_binary { background: repeating-linear-gradient(0deg, #000, #0f380f 10px); }
.aura_shadow { background: radial-gradient(circle, #434343 0%, #000000 100%); }
.aura_holy { background: radial-gradient(circle, #ffffff 0%, #fce166 100%); }
.aura_grid { background: repeating-linear-gradient(45deg, #1e293b 0px, #1e293b 10px, #334155 10px, #334155 20px); }
.aura_blood { background: radial-gradient(circle, #8a2387 0%, #e94057 50%, #f27121 100%); }
.aura_frost { background: radial-gradient(circle, #e0eafc 0%, #cfdef3 100%); }

/* --- 5. THE 10 FRAMES --- */
.frame_default { border: 4px solid #334155; }
.frame_bronze { border: 6px solid #cd7f32; box-shadow: 0 0 10px #cd7f32; }
.frame_silver { border: 6px solid #c0c0c0; box-shadow: 0 0 15px #c0c0c0; }
.frame_gold { border: 6px solid #ffd700; box-shadow: 0 0 20px #ffd700; }
.frame_diamond { border: 6px solid #00ffff; box-shadow: 0 0 25px #00ffff, inset 0 0 10px #00ffff; }
.frame_neon_pink { border: 4px solid #ff00ff; box-shadow: 0 0 20px #ff00ff, inset 0 0 10px #ff00ff; }
.frame_cyber_green { border: 4px dashed #4ecca3; animation: spinCoin 10s linear infinite; }
.frame_lava { border: 6px dotted #ff4500; animation: spinCoin 5s linear infinite; }
.frame_abyss { border: 8px solid #000; box-shadow: 0 0 30px #4b0082; }
.frame_rainbow { border: 6px solid transparent; background: linear-gradient(white, white) padding-box, linear-gradient(45deg, red, orange, yellow, green, blue, indigo, violet) border-box; }

/* =========================================
   RPG MONSTER BATTLE ANIMATIONS
   ========================================= */

/* 1. Idle Floating (Default State) */
.monster-idle {
    animation: monsterFloat 3s ease-in-out infinite;
}
@keyframes monsterFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.02); }
}

/* 2. Monster Getting Hit (Player Correct) */
.monster-hurt {
    animation: monsterFlinch 0.5s cubic-bezier(.36,.07,.19,.97) both;
    filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(5) !important;
}
@keyframes monsterFlinch {
    0% { transform: translateX(0); }
    20% { transform: translateX(25px) rotate(5deg); }
    40% { transform: translateX(-20px) rotate(-5deg); }
    60% { transform: translateX(15px) rotate(3deg); }
    80% { transform: translateX(-10px) rotate(-2deg); }
    100% { transform: translateX(0); }
}

/* 3. Monster Attacking (Player Wrong) */
.monster-attack {
    animation: monsterLunge 0.6s ease-in forwards;
}
@keyframes monsterLunge {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(40px) scale(1.1); } /* Pull back to wind up */
    50% { transform: translateX(-150px) scale(1.5); } /* LUNGE AT THE SCREEN */
    100% { transform: translateX(0) scale(1); }
}

/* 4. Player Attack Visual Effect (Digital Slash) */
.digital-slash {
    position: absolute;
    width: 150px; height: 150px;
    background: radial-gradient(circle, #4ecca3 0%, transparent 60%);
    border-radius: 50%; opacity: 0; z-index: 9999; pointer-events: none;
    box-shadow: 0 0 50px #4ecca3;
}
.slash-active {
    animation: slashHit 0.4s ease-out forwards;
}
@keyframes slashHit {
    0% { transform: scale(0.5) translate(-50px, -50px); opacity: 1; }
    50% { transform: scale(2) translate(20px, 20px); opacity: 0.8; }
    100% { transform: scale(3) translate(50px, 50px); opacity: 0; }
}

.rush-timer {
    font-size: 70px;
    font-weight: 900;
    color: #4ecca3;
    text-shadow: 0 0 20px rgba(78, 204, 163, 0.8);
    font-family: monospace;
    line-height: 1;
    transition: 0.2s;
}
.rush-timer.danger {
    color: #e94560;
    text-shadow: 0 0 30px rgba(233, 69, 96, 0.9);
    animation: extremeShake 0.3s infinite;
}
.time-popup {
    position: absolute;
    font-size: 35px;
    font-weight: 900;
    z-index: 10000;
    pointer-events: none;
    animation: floatUpFade 1s forwards;
}
.time-plus { color: #4ecca3; text-shadow: 0 0 15px black, 0 0 30px #4ecca3; }
.time-minus { color: #e94560; text-shadow: 0 0 15px black, 0 0 30px #e94560; }

@keyframes floatUpFade {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

/* --- GACHA & EXCLUSIVE ITEMS --- */
.gacha-btn-banner {
    background: linear-gradient(45deg, #1e293b, #0f172a);
    border: 2px dashed #fce166;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(252, 225, 102, 0.2);
    transition: 0.3s;
}
.gacha-btn-banner:hover {
    background: linear-gradient(45deg, #334155, #1e293b);
    box-shadow: 0 0 30px rgba(252, 225, 102, 0.5);
    transform: scale(1.02);
}

.gacha-glow-legendary { color: #fce166; text-shadow: 0 0 30px #fce166, 0 0 60px #ff8c00; animation: pulseGold 1s infinite; }
.gacha-glow-rare { color: #bd93f9; text-shadow: 0 0 30px #bd93f9; }
.gacha-glow-common { color: #94a3b8; }

/* Exclusive Legendary Items Styles */
.aura_omega { background: radial-gradient(circle, #ffffff 0%, #ffd700 40%, #ff8c00 100%); animation: spinCoin 3s linear infinite; }
.visor_god { background: linear-gradient(90deg, #ffd700, #ffffff, #ffd700); height: 12px !important; top: 40% !important; box-shadow: 0 0 20px #ffffff; }
.frame_godmode { border: 8px solid transparent; background: linear-gradient(#0f172a, #0f172a) padding-box, linear-gradient(45deg, #ffd700, #ff8c00, #ffffff) border-box; animation: spinCoin 2s linear infinite; }

/* =========================================
   NEW GAMIFIED SPLIT LAYOUTS (SEGOE UI)
   ========================================= */

/* Global Gamified Modals */
.retro-modal-container {
    background: #0f172a; border: 4px solid #4ecca3; border-radius: 12px;
    width: 95%; padding: 30px; box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 30px rgba(78,204,163,0.3);
    box-sizing: border-box;
}
.retro-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed #334155; padding-bottom: 15px; margin-bottom: 20px; }
.retro-header h2 { color: #fce166; margin: 0; font-size: 26px; letter-spacing: 2px; text-transform: uppercase; font-weight: 900; }
.close-btn { background: transparent; border: none; color: #94a3b8; font-size: 32px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: #e94560; transform: scale(1.2); }

/* Split Panels (Shop & Profile) */
.split-layout { display: flex; gap: 20px; }
.panel { background: #1e293b; border: 3px solid #334155; border-radius: 8px; padding: 25px; display: flex; flex-direction: column; }
.gacha-panel { flex: 1; align-items: center; justify-content: center; text-align: center; border-color: #fce166; }
.items-panel { flex: 2; border-color: #e94560; overflow: hidden; }
.avatar-panel { flex: 1; text-align: center; border-color: #4ecca3; }
.progress-panel { flex: 2; border-color: #bd93f9; }

/* Horizontal Store Scroll */
.horizontal-scroll { display: flex; overflow-x: auto; gap: 15px; padding-bottom: 15px; scrollbar-width: thin; scrollbar-color: #e94560 #0f172a; }
.horizontal-scroll .shop-item { min-width: 220px; flex-shrink: 0; }
.btn-gacha { background: #e94560; color: white; border: 2px solid white; padding: 15px; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; width: 100%; transition: 0.2s; }
.btn-gacha:hover { background: #c81e3b; box-shadow: 0 0 15px rgba(233,69,96,0.6); }

/* Profile Progress Bars */
.skill-row { margin-bottom: 20px; text-align: left; }
.skill-row span { font-size: 14px; font-weight: bold; color: #e2e8f0; margin-bottom: 8px; display: block; }
.progress-bar-bg { background: #0f172a; height: 16px; width: 100%; border: 2px solid #334155; border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 8px; transition: width 0.5s ease-out; }

/* New Battle Arena Layout */
.retro-battle-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: radial-gradient(circle at center, #1e293b 0%, #000 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 30px; box-sizing: border-box; z-index: 9000; }
.battle-hud { display: flex; justify-content: space-between; width: 100%; max-width: 900px; margin: 0 auto; }
.retro-hp-box { background: rgba(15,23,42,0.9); border: 3px solid #4ecca3; border-radius: 8px; padding: 15px; width: 350px; box-shadow: 0 0 20px rgba(78,204,163,0.2); }
.retro-hp-box.right { border-color: #e94560; box-shadow: 0 0 20px rgba(233,69,96,0.2); text-align: right; }
.hp-name { color: white; font-size: 18px; font-weight: 900; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.retro-hp-box.right .hp-name { color: #e94560; }
.retro-hp-box .hp-name { color: #4ecca3; }
.hp-bar-bg { background: #000; height: 22px; width: 100%; border: 2px solid #fff; border-radius: 12px; overflow: hidden; margin-bottom: 5px; }
.hp-fill { height: 100%; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.hp-fill.player { background: #4ecca3; box-shadow: inset 0 0 10px rgba(255,255,255,0.5); }
.hp-fill.monster { background: #e94560; box-shadow: inset 0 0 10px rgba(255,255,255,0.5); }
.hp-text { color: #94a3b8; font-size: 12px; font-weight: bold; }

.battle-stage {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 15%;
    margin-bottom: 20px;
    min-height: 250px; /* Forces the stage to stay open */
    background: linear-gradient(transparent 70%, rgba(78, 204, 163, 0.15) 70%);
    background-size: 100% 40px;
    border-bottom: 4px solid #334155;
}

.sprite {
    width: 220px;
    height: 250px;
    display: block; /* Ensures they do not turn invisible */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.8));
    image-rendering: pixelated;
    transition: transform 0.2s ease-out;
}

.retro-dialogue-box {
    background: rgba(15,23,42,0.95);
    border: 4px solid #fce166;
    border-radius: 12px;
    padding: 20px 30px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    height: auto; /* Allows all 4 answers to fit without being cut off */
    max-height: 40vh; /* Prevents it from pushing the screen off the edge */
    overflow-y: auto; /* Adds a scrollbar if answers are too long */
    box-shadow: 0 0 30px rgba(252,225,102,0.2);
    box-sizing: border-box;
}