/* ==========================================================================
   SCIENCE LAB 3D — ADVANCED CYBERNETIC SCIENTIFIC STYLING SYSTEM
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

:root {
    --bg: #05060f;
    --bg-surface: #0a0c1e;
    --bg-panel: rgba(12, 16, 38, 0.88);
    --bg-card: rgba(18, 24, 56, 0.7);
    --border: rgba(99, 102, 241, 0.22);
    --border-bright: rgba(0, 240, 255, 0.45);
    
    --cyan: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.35);
    --magenta: #f72585;
    --purple: #7209b7;
    --indigo: #4361ee;
    --emerald: #10b981;
    --amber: #f59e0b;
    --crimson: #ef4444;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Canvas */
#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ==========================================================================
   HEADER NAVIGATION
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(6, 8, 22, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
}

.logo-icon-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(114, 9, 183, 0.25));
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
}

.logo-icon {
    font-size: 22px;
    animation: atomSpin 12s linear infinite;
}

@keyframes atomSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logo-meta {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff, var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-3d {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    background: linear-gradient(135deg, var(--magenta), var(--purple));
    border-radius: 4px;
    color: #fff;
    -webkit-text-fill-color: #fff;
    vertical-align: middle;
    margin-left: 4px;
}

.logo-sub {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Global Search Palette */
.global-search-wrap {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--text-dim);
}

#globalSearch {
    width: 100%;
    background: rgba(18, 24, 56, 0.6);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 15px 8px 34px;
    color: var(--text-main);
    font-size: 12px;
    transition: all 0.25s ease;
}

#globalSearch:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 15px var(--cyan-glow);
    background: rgba(18, 24, 56, 0.95);
}

.search-results-dropdown {
    position: absolute;
    top: 42px;
    left: 0;
    right: 0;
    max-height: 360px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    display: none;
    z-index: 2000;
}

.search-result-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: rgba(0, 240, 255, 0.12);
}

.search-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.search-item-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--cyan);
}

/* Nav Menu */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-item .icon {
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(67, 97, 238, 0.3));
    color: var(--cyan);
    border: 1px solid var(--border-bright);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.badge-count {
    font-size: 10px;
    font-weight: 700;
    background: var(--magenta);
    color: #fff;
    padding: 1px 5px;
    border-radius: 10px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan);
    transform: scale(1.05);
}

.menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
}

/* ==========================================================================
   MOBILE DRAWER NAVIGATION
   ========================================================================== */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    z-index: 2500;
    padding: 20px;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.mobile-nav.open {
    left: 0;
}

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

.mobile-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.mobile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.mobile-item {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.mobile-item:hover, .mobile-item.active {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--border-bright);
    color: var(--cyan);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   HUD TELEMETRY OVERLAY
   ========================================================================== */
.hud-telemetry {
    position: fixed;
    bottom: 16px;
    right: 20px;
    background: rgba(6, 8, 22, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 500;
    font-family: var(--font-mono);
    font-size: 11px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-label {
    color: var(--text-dim);
}

.hud-val {
    color: var(--cyan);
    font-weight: 700;
}

.status-running {
    color: var(--emerald);
}

/* ==========================================================================
   MAIN VIEWS & ROUTER
   ========================================================================== */
.main {
    padding-top: 64px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
    min-height: calc(100vh - 64px);
    position: relative;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 3D Scene Viewport */
.scene-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 64px);
    overflow: hidden;
}

.scene {
    width: 100%;
    height: 100%;
    outline: none;
}

/* ==========================================================================
   HOME HUB & DASHBOARD
   ========================================================================== */
.hero {
    text-align: center;
    padding: 70px 20px 50px;
    background: radial-gradient(circle at 50% 30%, rgba(67, 97, 238, 0.15) 0%, rgba(5, 6, 15, 0) 70%);
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid var(--border-bright);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--cyan) 0%, #a855f7 50%, var(--magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: clamp(14px, 2vw, 17px);
    color: var(--text-muted);
    max-width: 780px;
    margin: 0 auto 35px;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: #fff;
    box-shadow: 0 4px 18px rgba(67, 97, 238, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.6);
}

.btn-cyan {
    background: linear-gradient(135deg, #00f0ff, #0077b6);
    color: #05060f;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(0, 240, 255, 0.35);
}

.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.55);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.glow-btn {
    position: relative;
    overflow: hidden;
}

/* Stat Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 1300px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    transition: all 0.25s ease;
}

.stat-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.stat-icon {
    font-size: 26px;
    margin-bottom: 8px;
}

.stat-num {
    display: block;
    font-size: 36px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--cyan);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Section Headings */
.section-heading {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.section-heading h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-heading p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.feature-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--cyan);
    box-shadow: 0 15px 35px rgba(0, 240, 255, 0.15);
}

.feat-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: rgba(67, 97, 238, 0.2);
    border: 1px solid rgba(67, 97, 238, 0.4);
    border-radius: 4px;
    color: #818cf8;
    margin-bottom: 14px;
}

.feat-badge.hot {
    background: rgba(247, 37, 133, 0.2);
    border-color: rgba(247, 37, 133, 0.4);
    color: var(--magenta);
}

.feat-badge.game {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--emerald);
}

.feat-icon {
    font-size: 38px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.feature-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.feat-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
}

.feature-card:hover .feat-link {
    gap: 8px;
}

.special-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(114, 9, 183, 0.15));
    border-color: rgba(16, 185, 129, 0.4);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    text-align: center;
    background: rgba(6, 8, 22, 0.9);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--cyan);
}

.footer-copy {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.footer-sub {
    font-size: 11px;
    color: var(--text-dim);
}

/* ==========================================================================
   INTERACTIVE SIDEBAR PANELS
   ========================================================================== */
.panel {
    position: fixed;
    top: 76px;
    width: 320px;
    max-height: calc(100vh - 96px);
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    overflow-y: auto;
    z-index: 600;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel::-webkit-scrollbar {
    width: 5px;
}

.panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.panel-left {
    left: 16px;
}

.wide-panel {
    width: 360px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.panel-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--cyan-glow);
    border-radius: 4px;
    color: var(--cyan);
}

.panel-section {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.panel-section h4 {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.panel-note {
    font-size: 11.5px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 10px;
}

.panel-input, .panel-select, .panel-select-lg {
    width: 100%;
    background: rgba(18, 24, 56, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 12.5px;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.panel-select-lg {
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-color: var(--border-bright);
    background: rgba(12, 16, 38, 0.95);
}

.panel-input:focus, .panel-select:focus, .panel-select-lg:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
}

/* Button Grids & Controls */
.btn-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}

.mode-btn, .ctrl-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-btn:hover, .ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mode-btn.active, .ctrl-btn.active {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(67, 97, 238, 0.3));
    border-color: var(--cyan);
    color: #fff;
    box-shadow: 0 0 10px var(--cyan-glow);
}

/* Chips Container */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip:hover {
    color: #fff;
    border-color: var(--border-bright);
}

.chip.active {
    background: var(--cyan);
    color: #05060f;
    border-color: var(--cyan);
    font-weight: 700;
}

/* Sliders */
.slider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    gap: 8px;
}

.slider-label input[type="range"] {
    flex: 1;
    accent-color: var(--cyan);
    height: 4px;
    cursor: pointer;
}

.val-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--cyan);
    min-width: 36px;
    text-align: right;
}

/* Checkboxes */
label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 6px;
}

input[type="checkbox"] {
    accent-color: var(--cyan);
    cursor: pointer;
}

/* Legend Grid */
.legend-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Reaction Metrics Card */
.reaction-metric {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.text-cyan { color: var(--cyan); }
.text-amber { color: var(--amber); }
.text-emerald { color: var(--emerald); }

/* Back Button */
.back-btn {
    position: fixed;
    top: 76px;
    right: 16px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 550;
    transition: all 0.2s ease;
}

.back-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateX(-2px);
}

/* ==========================================================================
   MODAL / INFO BOXES
   ========================================================================== */
.info-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 440px;
    width: 90%;
    max-height: calc(100vh - 120px);
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    z-index: 700;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Info Box Content Styling */
.info-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.info-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.info-symbol {
    font-size: 16px;
    font-family: var(--font-mono);
    color: var(--cyan);
    font-weight: 700;
}

.info-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    background: rgba(0, 240, 255, 0.15);
    border-radius: 4px;
    color: var(--cyan);
    margin-bottom: 14px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.info-stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.info-stat-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.info-stat-value {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.info-desc-box {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.info-formula-card {
    background: rgba(114, 9, 183, 0.15);
    border: 1px solid rgba(114, 9, 183, 0.4);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #e0aaff;
    margin-top: 10px;
}

/* ==========================================================================
   GAME HUD & OVERLAYS
   ========================================================================== */
.game-hud {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(6, 8, 22, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 650;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.hud-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.hud-num {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: var(--cyan);
}

/* Interactive Game Sub-HUD & Specific Telemetry */
.game-sub-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    font-size: 12px;
}

.game-sub-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 80px;
}

.game-sub-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}

.game-sub-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
}

.game-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.game-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f0ff, #38bdf8);
    transition: width 0.15s ease-out;
}

/* Mobile Arcade Touch Controls */
.mobile-arcade-controls {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 0;
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 850;
    pointer-events: none;
}

.mobile-stick-cluster {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.mobile-action-cluster {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    pointer-events: auto;
}

.mobile-ctrl-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(56, 189, 248, 0.4);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(0, 240, 255, 0.15);
    user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s ease, background 0.08s ease;
}

.mobile-ctrl-btn:active, .mobile-ctrl-btn.active {
    transform: scale(0.92);
    background: rgba(56, 189, 248, 0.35);
    border-color: #00f0ff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
}

.mobile-ctrl-btn.action-fire {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.9));
    border: 2px solid #f87171;
    font-size: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.mobile-ctrl-btn.action-fire:active, .mobile-ctrl-btn.action-fire.active {
    transform: scale(0.92);
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.8);
}

.mobile-ctrl-btn.action-emp {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.85), rgba(126, 34, 206, 0.85));
    border: 2px solid #c084fc;
    font-size: 13px;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.mobile-ctrl-btn.action-emp:active, .mobile-ctrl-btn.action-emp.active {
    transform: scale(0.92);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.8);
}

@media (max-width: 900px) {
    .mobile-arcade-controls {
        display: flex;
    }
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    border: 2px solid var(--crimson);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.5);
    animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.game-over h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--crimson);
    margin-bottom: 12px;
}

.game-over p {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 24px;
}

/* Status Message Banner */
.status-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 24, 56, 0.9);
    border: 1px solid var(--border-bright);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 800;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--cyan);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1080px) {
    .nav {
        display: none;
    }
    
    .menu-btn {
        display: block;
    }
    
    .global-search-wrap {
        max-width: 240px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 14px;
    }
    
    .logo-sub {
        display: none;
    }
    
    .global-search-wrap {
        display: none;
    }
    
    .panel {
        top: auto;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-height: 42vh;
        border-radius: var(--radius-md);
    }
    
    .wide-panel {
        width: calc(100% - 20px);
    }
    
    .back-btn {
        top: 70px;
        right: 10px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .game-hud {
        top: 70px;
        padding: 6px 14px;
        gap: 15px;
    }
    
    .hud-num {
        font-size: 14px;
    }
    
    .hud-telemetry {
        display: none;
    }
    
    .info-box {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-height: 60vh;
    }
}


/* ==========================================================
   🎮 MASSIVE FEATURED ARCADE ARENA & OVERSIZED GAME CARDS
   ========================================================== */
.arcade-showcase-section {
    max-width: 1440px;
    margin: 44px auto 65px;
    padding: 0 20px;
}

.arcade-hero-banner {
    position: relative;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(67, 97, 238, 0.28), transparent 70%),
                linear-gradient(180deg, rgba(16, 24, 60, 0.94) 0%, rgba(6, 9, 24, 0.98) 100%);
    border: 1.5px solid rgba(0, 240, 255, 0.38);
    border-radius: 24px;
    padding: 50px 38px 42px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 45px rgba(0, 240, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(28px);
    overflow: hidden;
}

.arcade-hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4%;
    right: 4%;
    height: 2.5px;
    background: linear-gradient(90deg, transparent, #00f0ff 25%, #f72585 50%, #a855f7 75%, transparent);
}

.arcade-header-content {
    text-align: center;
    max-width: 920px;
    margin: 0 auto 42px;
}

.arcade-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(0, 240, 255, 0.14);
    border: 1px solid rgba(0, 240, 255, 0.45);
    padding: 7px 22px;
    border-radius: 999px;
    margin-bottom: 16px;
    box-shadow: 0 4px 18px rgba(0, 240, 255, 0.22);
}

.arcade-main-title {
    font-size: clamp(32px, 5.2vw, 52px);
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.12;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #ffffff 10%, #00f0ff 45%, #f72585 75%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.arcade-subtitle {
    font-size: 16.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

.arcade-hub-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.arcade-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.arcade-hub-btn.primary {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: #fff;
    border: 1px solid rgba(99, 102, 241, 0.7);
    box-shadow: 0 6px 25px rgba(67, 97, 238, 0.5);
}

.arcade-hub-btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 35px rgba(67, 97, 238, 0.75);
    border-color: #00f0ff;
}

.arcade-hub-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.arcade-hub-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 3 MASSIVE GAME CARDS GRID */
.arcade-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 15px;
}

@media (max-width: 1150px) {
    .arcade-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .arcade-cards-grid {
        grid-template-columns: 1fr;
    }
    .arcade-hero-banner {
        padding: 30px 16px 26px;
    }
    .arcade-showcase-section {
        padding: 0 12px;
        margin: 25px auto 40px;
    }
}

.arcade-game-card {
    position: relative;
    background: linear-gradient(180deg, rgba(16, 22, 54, 0.88) 0%, rgba(8, 12, 30, 0.96) 100%);
    border: 1.5px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.arcade-game-card:hover {
    transform: translateY(-10px) scale(1.015);
    border-color: var(--theme-color);
    box-shadow: 0 25px 60px -10px var(--theme-glow), 0 0 30px var(--theme-soft);
}

.arcade-card-visual {
    height: 250px;
    position: relative;
    overflow: hidden;
    background: #020308;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
}

.arcade-card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.arcade-game-card:hover .arcade-card-visual img {
    transform: scale(1.08);
}

.arcade-card-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(14, 20, 48, 0.96) 100%);
    pointer-events: none;
}

.arcade-visual-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--theme-color);
    color: #05060f;
    z-index: 2;
    box-shadow: 0 4px 15px var(--theme-glow);
}

.arcade-visual-status {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f1f5f9;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.arcade-visual-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.9);
    pointer-events: none;
}

.arcade-game-card:hover .arcade-visual-play-overlay {
    opacity: 1;
    transform: scale(1);
}

.arcade-play-disc {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--theme-color);
    color: #05060f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 0 35px var(--theme-glow);
    padding-left: 4px;
}

.arcade-card-content {
    padding: 28px 26px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.arcade-game-title {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.arcade-game-tagline {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--theme-color);
    margin-bottom: 14px;
    text-transform: uppercase;
}

.arcade-game-desc {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.arcade-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.arcade-pill {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
}

.arcade-controls-note {
    font-size: 12.5px;
    color: #94a3b8;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--theme-color);
}

.arcade-play-btn {
    width: 100%;
    padding: 15px 22px;
    border-radius: var(--radius-md);
    background: var(--theme-color);
    color: #05060f;
    font-size: 14.5px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 6px 22px var(--theme-glow);
}

.arcade-game-card:hover .arcade-play-btn {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--theme-glow);
}

