:root { --cyan: #00f2ff; --pink: #ff0077; --green: #39d353; --gold: #ffcc00; --bg-black: #020202; --panel-bg: rgba(12, 12, 12, 0.85); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; overflow-x: hidden; background: var(--bg-black); color: #fff; font-family: 'Rajdhani', sans-serif; -webkit-font-smoothing: antialiased; }

/* GPU Backgrounds */
.nebula-bg { position: fixed; inset: 0; z-index: -5; background: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.05), transparent); animation: pulseBg 15s infinite alternate; will-change: transform; transform: translateZ(0); }
@keyframes pulseBg { from { transform: scale(1) translateZ(0); } to { transform: scale(1.15) translateZ(0); } }
.crt-scanlines { position: fixed; inset: 0; z-index: 100; pointer-events: none; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%); background-size: 100% 4px; }

/* Ultra UI Entry Animations */
@keyframes slideDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); } }

.animate-slide-down { animation: slideDown 0.8s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.8s ease-out forwards; }
.animate-slide-right { animation: slideRight 0.8s ease-out forwards; }
.animate-slide-left { animation: slideLeft 0.8s ease-out forwards; }
.animate-fade-in { animation: fadeIn 1.2s ease-out forwards; }
.animate-pop { animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

/* Grid Layout */
.arcade-grid-layout { display: grid; grid-template-columns: 280px 1fr 280px; gap: 20px; max-width: 1550px; margin: 0 auto; padding: 20px; min-height: 100vh; }

@media (min-width: 1025px) {
    .mobile-only { display: none !important; }
    canvas { width: 850px; height: 500px; border: 4px solid #1a1a1a; }
}
@media (max-width: 1024px) {
    .arcade-grid-layout { display: flex; flex-direction: column; align-items: center; padding: 10px; width: 100%; }
    .mobile-hide { display: none !important; }
    .game-stage { order: 1; width: 100%; display: flex; flex-direction: column; align-items: center; }
    .game-panel { order: 2; width: 100%; margin-top: 20px; }
    .absolute-bottom-footer { order: 3; width: 100%; text-align: center; }
    
    canvas { width: 95vw; height: auto; aspect-ratio: 1/1; max-height: 380px; border: 2px solid #222; touch-action: none; }
    .joypad-interface { display: flex; flex-direction: column; align-items: center; margin-top: 20px; width: 100%; }
    .joy-row { display: flex; gap: 10px; margin-top: 10px; }
    .joy-key { width: 65px; height: 65px; background: #111; border: 2.5px solid var(--cyan); color: var(--cyan); border-radius: 12px; font-size: 1.6rem; touch-action: manipulation; user-select: none; transition: 0.1s; box-shadow: 0 4px 10px rgba(0,242,255,0.2); }
    .joy-key:active { transform: scale(0.9); background: var(--cyan); color: #000; }
}

/* Header & HUD */
.header-hud { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid #1a1a1a; width: 100%; }
.brand-title { font-family: 'Orbitron'; font-size: 2rem; color: var(--cyan); text-shadow: 0 0 15px var(--cyan); font-weight: 900; }
.brand-title span { color: #fff; font-size: 0.9rem; border: 1px solid #fff; padding: 2px 6px; margin-left: 5px; }
.live-data { display: flex; gap: 15px; }
.hud-item { background: #000; border: 2px solid var(--cyan); padding: 8px 25px; border-radius: 50px; font-family: 'Orbitron'; font-size: 0.9rem; font-weight: bold; }
.hud-item.pink { border-color: var(--pink); color: var(--pink); }

/* Game Stage */
.canvas-container { position: relative; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 0 60px rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; transform: translateZ(0); }
.start-curtain { position: absolute; inset: 0; background: rgba(0,0,0,0.92); z-index: 10; display: flex; justify-content: center; align-items: center; cursor: pointer; backdrop-filter: blur(4px); }
.start-box { text-align: center; border: 2px dashed #444; padding: 40px; border-radius: 15px; background: rgba(0,0,0,0.5); }
.neon-title { color: var(--green); font-family: 'Orbitron'; font-size: 2.2rem; margin-bottom: 5px; text-shadow: 0 0 10px var(--green); }
.pulse-box { animation: pulseGlow 2s infinite alternate; }
@keyframes pulseGlow { from { box-shadow: 0 0 10px rgba(57, 211, 83, 0.1); } to { box-shadow: 0 0 30px rgba(57, 211, 83, 0.4); } }

/* Panels */
.ui-panel { background: var(--panel-bg); border: 1px solid #222; padding: 20px; border-radius: 15px; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); backdrop-filter: blur(10px); }
.panel-head { font-family: 'Orbitron'; color: var(--green); font-size: 0.9rem; margin-bottom: 15px; border-left: 4px solid var(--green); padding-left: 10px; }
.mission-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.m-card { background: #000; border: 1.5px solid #222; border-radius: 10px; display: flex; align-items: center; gap: 12px; padding: 8px; cursor: pointer; transition: 0.3s; will-change: transform; }
.m-card:hover { border-color: var(--cyan); transform: translateX(5px); box-shadow: 0 5px 15px rgba(0,242,255,0.2); }
.m-card.active { border-color: var(--pink); box-shadow: inset 0 0 15px rgba(255,0,119,0.2); }
.m-img { width: 70px; height: 45px; border-radius: 6px; overflow: hidden; }
.m-img img { width: 100%; height: 100%; object-fit: cover; }
.m-info b { font-family: 'Orbitron'; font-size: 0.75rem; color: #fff; }

/* Leaderboard Permanent Fix */
.lb-header { display: grid; grid-template-columns: 45px 1fr 65px; font-size: 0.75rem; color: #555; margin-bottom: 12px; font-weight: bold; padding-bottom: 5px; border-bottom: 1px solid #222; }
.custom-scroll { list-style: none; height: 350px; overflow-y: auto; padding-right: 5px; }
.custom-scroll li { display: grid; grid-template-columns: 45px 1fr 65px; padding: 14px 0; border-bottom: 1px solid #1a1a1a; font-size: 0.9rem; }
.custom-scroll b { color: var(--gold); text-align: right; font-weight: 900; }
.purge-btn { background: none; border: none; color: var(--pink); text-decoration: underline; font-size: 0.75rem; cursor: pointer; margin-top: 15px; transition: 0.2s; }
.purge-btn:hover { color: #fff; }

/* Modals */
.system-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.95); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(8px); }
.failure-modal { background: #000; border: 4px solid var(--pink); padding: 40px; border-radius: 20px; text-align: center; box-shadow: 0 0 80px rgba(255,0,119,0.6); width: 90%; max-width: 450px; }
.blink-red { font-family: 'Orbitron'; font-size: 2.2rem; color: var(--pink); margin-bottom: 25px; animation: blink 0.4s infinite alternate; }
@keyframes blink { from { opacity: 0.5; } to { opacity: 1; text-shadow: 0 0 20px var(--pink); } }
.report-row { display: flex; justify-content: space-between; border-bottom: 1px solid #222; padding: 12px 0; font-size: 1.3rem; }
.report-row b { color: var(--cyan); font-weight: 900; }
.v-btn { padding: 14px 35px; border: 2px solid var(--cyan); background: rgba(0,242,255,0.05); color: var(--cyan); font-family: 'Orbitron'; font-weight: bold; cursor: pointer; border-radius: 8px; margin: 8px; transition: 0.3s; touch-action: manipulation; }
.v-btn:hover { background: var(--cyan); color: #000; box-shadow: 0 0 25px var(--cyan); transform: translateY(-3px); }
.v-btn.secondary-neon { border-color: var(--gold); color: var(--gold); background: rgba(255,204,0,0.05); }
.v-btn.secondary-neon:hover { background: var(--gold); box-shadow: 0 0 25px var(--gold); }

/* Milestone */
.milestone-container { position: fixed; top: -150px; left: 50%; transform: translateX(-50%); background: var(--green); color: #000; padding: 15px 40px; border-radius: 50px; text-align: center; font-family: 'Orbitron'; font-weight: 900; transition: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 2000; opacity: 0; pointer-events: none; box-shadow: 0 0 40px var(--green); }
.milestone-container.show { top: 40px; opacity: 1; }

/* Enhanced Bottom Footer */
.absolute-bottom-footer { grid-column: 1 / -1; border-top: 1px solid #222; padding: 60px 0 40px; margin-top: 50px; width: 100%; background: linear-gradient(to top, #0a0a0a, transparent); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 50px; padding: 0 20px; }
.footer-column h3 { color: var(--cyan); font-family: 'Orbitron'; margin-bottom: 20px; font-size: 1.2rem; }
.footer-column p { color: #888; font-size: 0.95rem; line-height: 1.7; }
.footer-legal { text-align: center; margin-top: 60px; border-top: 1px solid #1a1a1a; padding-top: 40px; }

/* ENLARGED DEVELOPER CREDIT */
.dev-credit { font-family: 'Orbitron'; font-size: 1.3rem; color: var(--cyan); letter-spacing: 2px; text-shadow: 0 0 10px rgba(0,242,255,0.4); }
.dev-credit b { font-size: 1.8rem; font-weight: 900; color: #fff; }
.footer-legal small { color: #444; font-size: 0.8rem; letter-spacing: 3px; }

.hidden { display: none !important; }