@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Work+Sans:wght@400;600;800&display=swap');

:root {
    --bg-base: #f4f4f0;
    --bg-panel: #ffffff;
    --text-main: #0a0a0a;
    --border-color: #0a0a0a;
    --bauhaus-red: #D9291C;
    --bauhaus-blue: #005A9C;
    --bauhaus-yellow: #F2A900;
    --grid-dot: var(--grid-dot);
    --border-width: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    zoom: 0.9;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Work Sans', sans-serif;
    min-height: 111.111111vh; min-height: calc(100vh / 0.9);
    display: flex;
    flex-direction: column;
    /* Bauhaus subtle dot grid */
    background-image: radial-gradient(var(--grid-dot) 2px, transparent 2px);
    background-size: 30px 30px;
}

/* --- BAUHAUS LOADER --- */
.bauhaus-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
    background-image: radial-gradient(var(--grid-dot) 2px, transparent 2px);
    background-size: 30px 30px;
}
.bauhaus-loader.hide {
    transform: translateY(-100%);
}
.loader-box {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}
.loader-block {
    width: 45px;
    height: 45px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0 var(--border-color);
    animation: bounceBlock 0.9s infinite alternate ease-in-out;
}
.loader-block.red { background: var(--bauhaus-red); animation-delay: 0s; }
.loader-block.blue { background: var(--bauhaus-blue); animation-delay: 0.3s; }
.loader-block.yellow { background: var(--bauhaus-yellow); animation-delay: 0.6s; }

@keyframes bounceBlock {
    0% { transform: translateY(0); box-shadow: 4px 4px 0 var(--border-color); }
    100% { transform: translateY(-25px); box-shadow: 12px 29px 0 var(--border-color); }
}
.loader-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--text-main);
    letter-spacing: 6px;
    text-shadow: 3px 3px 0 var(--border-color);
}

/* --- CUSTOM RESET MODAL --- */
.reset-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s;
}
.reset-modal-overlay.active { opacity: 1; visibility: visible; }

.reset-modal-box {
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 12px 12px 0 var(--border-color);
    padding: 30px; max-width: 450px; width: 90%;
    max-height: 92vh;
    overflow-y: auto;
    text-align: left;
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.reset-modal-overlay.active .reset-modal-box { transform: translateY(0); }

.reset-modal-box h3 {
    color: var(--bauhaus-red); font-size: 1.8rem; font-weight: 800; text-transform: uppercase; margin-bottom: 15px;
    font-family: 'Space Mono', monospace;
}
.reset-modal-box p { font-size: 1rem; color: var(--text-main); margin-bottom: 25px; line-height: 1.5; font-weight: 600; }

.reset-modal-actions { display: flex; gap: 15px; justify-content: flex-end; }
.reset-modal-actions button {
    padding: 10px 20px; font-family: 'Space Mono', monospace; font-weight: 800; font-size: 0.9rem;
    cursor: pointer; border: 2px solid var(--border-color); text-transform: uppercase;
}
.btn-cancel { background: var(--bg-base); color: var(--text-main); box-shadow: 3px 3px 0 var(--border-color); }
.btn-cancel:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--border-color); }

.btn-confirm-reset { background: var(--bauhaus-red); color: white; box-shadow: 3px 3px 0 var(--border-color); }
.btn-confirm-reset:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--border-color); }


::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg-base); border-left: var(--border-width) solid var(--border-color); }
::-webkit-scrollbar-thumb { background: var(--bauhaus-red); border: 2px solid var(--border-color); }

/* --- HEADER --- */
header {
    background: var(--bg-base);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--bauhaus-red);
    border: var(--border-width) solid var(--border-color);
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    cursor: default;
    user-select: none;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.profile-container a, .profile-container button {
    background: var(--bg-base);
    border: var(--border-width) solid var(--border-color);
    color: var(--text-main);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 4px 4px 0 var(--border-color);
    transition: all 0.1s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-container a:hover, .profile-container button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--border-color);
}

.profile-container a { background: var(--bauhaus-blue); color: white; }
.profile-container button { background: var(--bauhaus-yellow); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    padding: 5px 15px;
    box-shadow: 4px 4px 0 var(--border-color);
    cursor: pointer;
    transition: all 0.1s;
}
.user-profile:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--border-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--text-main);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-radius: 0; /* Bauhaus blocks */
}

.user-info { font-size: 0.9rem; font-weight: 800; text-transform: uppercase; }
.user-rank { color: var(--bauhaus-red); font-size: 0.75rem; }

/* --- AGENT ID CARD (3D DROPDOWN) --- */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 320px;
    perspective: 1000px;
    z-index: 1000;
    display: none;
}
.profile-dropdown.active { display: block; }

.id-card-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.id-card-inner {
    position: relative;
    width: 100%;
    height: 480px;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.profile-dropdown:hover .id-card-inner {
    transform: rotateY(180deg);
}
.id-card-front, .id-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 8px 8px 0 var(--border-color);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}
.id-card-back {
    transform: rotateY(180deg);
    background: var(--bg-base);
}
/* Card Header */
.id-card-header {
    background: var(--border-color);
    color: var(--bg-panel);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.id-card-header h4 { font-size: 1rem; font-weight: 800; margin: 0; }
.barcode { font-family: 'Space Mono', monospace; letter-spacing: -2px; font-size: 1.2rem; font-weight: 700; }
/* Card Body */
.id-card-body {
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
}
.id-avatar-large {
    width: 70px; height: 70px;
    background: var(--bauhaus-red); color: white;
    font-size: 2.5rem; font-weight: 800;
    display: flex; justify-content: center; align-items: center;
    border: 3px solid var(--border-color);
}
.id-details h3 { font-size: 1.4rem; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; }
.id-label { font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }
.id-rank { font-size: 0.9rem; font-weight: 700; color: var(--bauhaus-blue); text-transform: uppercase; }
/* Card Footer */
.id-card-footer {
    padding: 10px 16px;
    border-top: var(--border-width) solid var(--border-color);
    background: rgba(0,0,0,0.03);
    flex-shrink: 0;
}
.id-next-mission { font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; }
.mission-bar-bg { width: 100%; height: 10px; border: 2px solid var(--border-color); background: var(--bg-panel); }
.mission-bar-fill { height: 100%; background: var(--bauhaus-yellow); width: 0%; transition: width 0.3s; }
/* Settings (Back) */
.settings-body { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; flex: 1; overflow-y: auto; }
.bauhaus-input {
    width: 100%; padding: 8px; border: 2px solid var(--border-color); background: var(--bg-panel); color: var(--text-main);
    font-family: 'Space Mono', monospace; font-weight: 700; outline: none;
}
.avatar-selector { display: flex; justify-content: space-between; font-size: 1.5rem; margin-top: 5px; }
.avatar-selector span { cursor: pointer; border: 2px solid transparent; padding: 5px; transition: border 0.2s; user-select: none; }
.avatar-selector span:hover, .avatar-selector span.selected { border-color: var(--border-color); background: rgba(0,0,0,0.05); }
.btn-save-profile {
    background: var(--bauhaus-blue); color: white; border: 2px solid var(--border-color); font-weight: 800;
    padding: 10px; cursor: pointer; text-transform: uppercase; margin-top: auto; box-shadow: 3px 3px 0 var(--border-color);
}
.btn-save-profile:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--border-color); }
.btn-reset {
    background: var(--bauhaus-red); color: white; border: var(--border-width) solid var(--border-color); width: 100%;
    padding: 8px 12px; font-weight: 800; text-transform: uppercase; cursor: pointer; box-shadow: 3px 3px 0 var(--border-color);
    font-family: 'Space Mono', monospace; font-size: 0.8rem; box-sizing: border-box; margin: 0;
}
.btn-reset:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--border-color); }

/* --- MAIN LAYOUT --- */
main {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 5%;
    width: 100%;
    flex-grow: 1;
}

.welcome-panel {
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 12px 12px 0 var(--border-color);
    padding: 40px;
    margin-bottom: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.welcome-text h1 {
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 15px;
}

.welcome-text p {
    font-size: 1.1rem;
    font-weight: 600;
    max-width: 600px;
    line-height: 1.4;
}

.welcome-progress {
    min-width: 300px;
    background: var(--bg-base);
    border: var(--border-width) solid var(--border-color);
    padding: 25px;
    box-shadow: 6px 6px 0 var(--bauhaus-blue);
}

.progress-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    width: 16.66%;
    background: var(--bauhaus-red);
    border-right: var(--border-width) solid var(--border-color);
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--border-color);
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.stat-card {
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 8px 8px 0 var(--border-color);
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.stat-card:nth-child(1) { box-shadow: 8px 8px 0 var(--bauhaus-red); }
.stat-card:nth-child(2) { box-shadow: 8px 8px 0 var(--bauhaus-blue); }
.stat-card:nth-child(3) { box-shadow: 8px 8px 0 var(--bauhaus-yellow); }
.stat-card:nth-child(4) { box-shadow: 8px 8px 0 var(--border-color); }

.stat-val {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: -2px;
}

.stat-lbl {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- ROADMAP --- */
.roadmap-container {
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 12px 12px 0 var(--border-color);
    padding: 50px;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

/* Geometric background decoration in roadmap */
.roadmap-container::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: var(--bauhaus-yellow);
    border: var(--border-width) solid var(--border-color);
    z-index: 0;
}

.roadmap-svg-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    z-index: 1;
}

.roadmap-line {
    fill: none;
    stroke: var(--border-color);
    stroke-width: var(--border-width);
}

.roadmap-line-active {
    fill: none;
    stroke: var(--bauhaus-red);
    stroke-width: 6;
}

.roadmap-nodes {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    align-items: center;
    padding: 0 20px;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.node-dot {
    width: 32px; height: 32px;
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0 var(--border-color);
    transition: all 0.2s;
}

/* Alternate geometric shapes for nodes */
.node:nth-child(odd) .node-dot { border-radius: 0; }
.node:nth-child(even) .node-dot { border-radius: 50%; }

.node.active .node-dot { background: var(--bauhaus-yellow); }
.node.completed .node-dot { background: var(--bauhaus-blue); box-shadow: 4px 4px 0 var(--border-color); }
.node.secret-node .node-dot { background: #9333ea; border-color: #c084fc; box-shadow: 0 0 12px rgba(147, 51, 234, 0.4), 4px 4px 0 var(--border-color); }
.node.secret-node.completed .node-dot { background: #10b981; border-color: #34d399; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4), 4px 4px 0 var(--border-color); }

.node-label {
    margin-top: 15px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    background: var(--bg-panel);
    padding: 4px 8px;
    border: 2px solid var(--border-color);
}

/* --- MODULES --- */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
    margin-bottom: 40px;
    border-bottom: var(--border-width) solid var(--border-color);
    padding-bottom: 10px;
    display: inline-block;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.module-card {
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 10px 10px 0 var(--border-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    position: relative;
}

.module-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 14px 14px 0 var(--border-color);
}

/* Geometric headers on cards */
.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 15px;
    background: var(--border-color);
    border-bottom: var(--border-width) solid var(--border-color);
}
.module-card.active::before { background: var(--bauhaus-yellow); }
.module-card.completed::before { background: var(--bauhaus-blue); }

.module-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

.module-badge {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 4px 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-panel);
    box-shadow: 2px 2px 0 var(--border-color);
}
.badge-active { background: var(--bauhaus-yellow); }
.badge-completed { background: var(--bauhaus-blue); color: white;}
.badge-locked { background: #ccc; }

.module-num {
    font-size: 3rem;
    font-weight: 800;
    color: var(--border-color);
    line-height: 1;
}

.module-title {
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.module-desc {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 30px;
}

.card-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.module-meta {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.8rem;
}

.btn-launch {
    background: var(--bauhaus-red);
    color: white;
    border: var(--border-width) solid var(--border-color);
    padding: 10px 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--border-color);
    transition: all 0.1s;
}
.btn-launch:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--border-color);
}

.btn-locked {
    background: #e0e0e0;
    color: #666;
    border: var(--border-width) solid var(--border-color);
    padding: 10px 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--border-color);
}

/* --- FOOTER --- */
footer.site-footer {
    background: var(--bg-panel);
    border-top: var(--border-width) solid var(--border-color);
    padding: 40px 5%;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
    display: inline-block;
    padding: 10px 20px;
    background: var(--bauhaus-yellow);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 6px 6px 0 var(--border-color);
}

.footer-desc {
    font-weight: 600;
    font-size: 1.1rem;
    max-width: 600px;
}

.footer-divider {
    width: 100%;
    height: var(--border-width);
    background: var(--border-color);
    margin: 20px 0;
}

.footer-bottom {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-weight: 700;
}

.watermark {
    background: var(--bauhaus-blue);
    color: white;
    padding: 10px 20px;
    border: var(--border-width) solid var(--border-color);
    box-shadow: 4px 4px 0 var(--border-color);
    text-transform: uppercase;
}
.watermark .highlight { color: var(--bauhaus-yellow); }

/* --- CHEAT DRAWER --- */
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10,10,10,0.8);
    z-index: 2000;
    display: none;
}
.drawer-overlay.active { display: block; }

.cheat-drawer {
    position: fixed; top: 0; right: -500px; width: 450px; max-width: 100%; height: 100%;
    background: var(--bg-base);
    border-left: var(--border-width) solid var(--border-color);
    z-index: 2500;
    padding: 30px;
    display: flex; flex-direction: column;
    transition: right 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: -10px 0 0 rgba(0,0,0,0.1);
}
.cheat-drawer.active { right: 0; }

.drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: var(--border-width) solid var(--border-color);
    padding-bottom: 20px; margin-bottom: 20px;
    flex-shrink: 0;
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}
.drawer-header h3 { font-size: 1.8rem; font-weight: 800; text-transform: uppercase; }
.drawer-close {
    background: var(--bauhaus-red); color: white;
    border: var(--border-width) solid var(--border-color);
    width: 40px; height: 40px; font-weight: 800; cursor: pointer;
    box-shadow: 4px 4px 0 var(--border-color);
}
.drawer-close:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--border-color); }

.cheat-section {
    background: var(--bg-panel);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 6px 6px 0 var(--border-color);
    padding: 20px; margin-bottom: 20px;
}
.cheat-section h4 {
    font-size: 1.2rem; font-weight: 800; text-transform: uppercase;
    border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px;
}
.cheat-cmd-box {
    background: var(--border-color); color: var(--bg-base);
    padding: 10px; font-family: 'Space Mono', monospace; font-size: 0.85rem;
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
}
.cheat-cmd {
    word-break: break-all;
    flex: 1;
}
.btn-copy-cmd {
    background: var(--bauhaus-yellow); color: var(--border-color);
    border: 2px solid var(--border-color); font-weight: 700; padding: 2px 8px; cursor: pointer;
    flex-shrink: 0;
}
.cheat-desc { font-weight: 600; font-size: 0.85rem; margin-bottom: 5px; margin-top: 15px; }
[data-theme="dark"] {
    --bg-base: #111111;
    --bg-panel: #1a1a1a;
    --bg-chat: #1a1a1a;
    --text-main: #f4f4f0;
    --text-muted: #aaaaaa;
    --border-dim: #f4f4f0;
    --border-color: #f4f4f0;
    --grid-dot: #333333;
}

[data-theme="matrix"] {
    --bg-base: #020804;
    --bg-panel: #051208;
    --bg-chat: #051208;
    --text-main: #00ff66;
    --text-muted: #22c55e;
    --border-color: #00ff66;
    --border-dim: #00ff66;
    --bauhaus-red: #00ff66;
    --bauhaus-blue: #15803d;
    --bauhaus-yellow: #86efac;
    --grid-dot: #003311;
}

[data-theme="cyberpunk"] {
    --bg-base: #0b0514;
    --bg-panel: #140924;
    --bg-chat: #140924;
    --text-main: #00f0ff;
    --text-muted: #c084fc;
    --border-color: #ffe600;
    --border-dim: #ffe600;
    --bauhaus-red: #ff0055;
    --bauhaus-blue: #00f0ff;
    --bauhaus-yellow: #ffe600;
    --grid-dot: #2e1065;
}

[data-theme="synthwave"] {
    --bg-base: #0d061a;
    --bg-panel: #180c2e;
    --bg-chat: #180c2e;
    --text-main: #ff71ce;
    --text-muted: #b983ff;
    --border-color: #ff007f;
    --border-dim: #ff007f;
    --bauhaus-red: #ff007f;
    --bauhaus-blue: #01cdfe;
    --bauhaus-yellow: #05ffa1;
    --grid-dot: #3b0764;
}

.profile-container .theme-btn {
    background: var(--text-main);
    color: var(--bg-base);
}

.theme-btn-floating {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--text-main);
    color: var(--bg-base);
    border: var(--border-width) solid var(--border-dim);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 15px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 4px 4px 0 var(--border-dim);
    transition: all 0.1s;
    z-index: 9999;
}
.theme-btn-floating:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--border-dim);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 1024px) {
    main {
        padding: 0 4%;
        margin: 30px auto;
    }
    .welcome-panel {
        gap: 30px;
        padding: 30px;
    }
    .modules-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }

    .logo {
        justify-content: center;
    }

    .logo-text {
        font-size: 1.15rem;
    }

    .profile-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        gap: 6px;
        padding: 4px 0 6px 0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .profile-container::-webkit-scrollbar {
        display: none;
    }

    .profile-container a, .profile-container button {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: fit-content !important;
        min-width: unset;
        font-size: 0.72rem;
        padding: 5px 10px;
        white-space: nowrap;
        border-width: 1.5px;
    }

    .user-profile {
        flex: 0 0 auto;
        padding: 4px 8px;
        box-sizing: border-box;
    }

    .profile-dropdown {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(340px, 92vw);
    }

    .profile-dropdown.active {
        display: block;
    }

    main {
        padding: 0 10px;
        margin: 12px auto;
    }

    .welcome-panel {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 12px;
        margin-bottom: 18px;
        box-shadow: 3px 3px 0 var(--border-color);
        gap: 12px;
    }

    .welcome-text h1 {
        font-size: 1.35rem;
        letter-spacing: -0.5px;
    }

    .welcome-text p {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .welcome-progress {
        min-width: 0 !important;
        width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 12px 10px;
        box-shadow: 3px 3px 0 var(--border-color);
    }

    .stat-val {
        font-size: 1.8rem;
    }

    .stat-lbl {
        font-size: 0.68rem;
    }

    .section-title {
        font-size: 1.35rem;
        margin-bottom: 16px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 30px;
    }

    .module-card {
        padding: 14px 12px;
        box-shadow: 4px 4px 0 var(--border-color);
    }

    .module-card:hover {
        transform: none;
        box-shadow: 4px 4px 0 var(--border-color);
    }

    .module-num {
        font-size: 1.6rem;
    }

    .module-title {
        font-size: 1.15rem;
    }

    .card-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn-launch, .btn-locked {
        width: 100%;
        text-align: center;
        justify-content: center;
        display: block;
    }

    /* Roadmap timeline mobile layout */
    .roadmap-container {
        padding: 24px 18px;
        margin-bottom: 40px;
        box-shadow: 8px 8px 0 var(--border-color);
    }

    .roadmap-container::before {
        width: 90px;
        height: 90px;
        top: -30px;
        right: -30px;
    }

    .roadmap-svg-wrapper {
        height: auto;
        margin-top: 20px;
    }

    .roadmap-svg-wrapper svg {
        display: none; /* Hide hardcoded SVG line on mobile */
    }

    .roadmap-nodes {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0;
        height: auto;
    }

    .node {
        background: var(--bg-base);
        border: var(--border-width) solid var(--border-color);
        padding: 12px;
        box-shadow: 4px 4px 0 var(--border-color);
        cursor: pointer;
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .node-dot {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        box-shadow: 2px 2px 0 var(--border-color);
    }

    .node-label {
        margin-top: 0;
        border: none;
        padding: 0;
        background: transparent;
        font-size: 0.75rem;
    }

    /* Cheat Drawer Mobile */
    .cheat-drawer {
        width: 100%;
        max-width: 100vw;
        right: -100%;
        padding: 20px 15px;
    }

    .cheat-drawer.active {
        right: 0;
    }

    .drawer-header h3 {
        font-size: 1.3rem;
    }

    .cheat-cmd-box {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn-copy-cmd {
        align-self: flex-end;
        padding: 4px 12px;
    }

    /* Site Footer Mobile */
    footer.site-footer {
        padding: 30px 15px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .watermark {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13.5px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .roadmap-nodes {
        grid-template-columns: 1fr;
    }

    .profile-container a, .profile-container button {
        width: auto !important;
        max-width: fit-content !important;
        flex: 0 0 auto !important;
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}



/* Touchscreen Card Flip Support */
.card-flip-btn {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1.5px solid var(--border-color);
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--border-color);
    transition: transform 0.1s;
    user-select: none;
}
.card-flip-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--border-color);
}
.card-flip-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--border-color);
}
.id-card-inner.flipped {
    transform: rotateY(180deg);
}
