:root,
[data-theme="obsidian"] {
    --bg-void: #030508;
    --bg-panel: rgba(7, 12, 22, 0.84);
    --bg-panel-solid: #070c16;
    --bg-elevated: rgba(14, 23, 42, 0.9);
    --accent-primary: #00f0ff;
    --accent-primary-rgb: 0, 240, 255;
    --accent-secondary: #7000ff;
    --accent-secondary-rgb: 112, 0, 255;
    --accent-tertiary: #00ff9d;
    --accent-danger: #ff1744;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #475569;
    --border-color: rgba(0, 240, 255, 0.28);
    --border-bright: rgba(0, 240, 255, 0.85);
    --glow-shadow: 0 0 28px rgba(0, 240, 255, 0.28);
    --theme-name: "NEURAL_OBSIDIAN";
}

[data-theme="amber"] {
    --bg-void: #080501;
    --bg-panel: rgba(20, 12, 3, 0.86);
    --bg-panel-solid: #140c03;
    --bg-elevated: rgba(34, 20, 5, 0.92);
    --accent-primary: #ffb000;
    --accent-primary-rgb: 255, 176, 0;
    --accent-secondary: #ff5500;
    --accent-secondary-rgb: 255, 85, 0;
    --accent-tertiary: #ffd700;
    --accent-danger: #ff2a2a;
    --text-main: #fffbeb;
    --text-muted: #d97706;
    --text-dim: #78350f;
    --border-color: rgba(255, 176, 0, 0.3);
    --border-bright: rgba(255, 176, 0, 0.88);
    --glow-shadow: 0 0 28px rgba(255, 176, 0, 0.3);
    --theme-name: "VECTRA-86_AMBER";
}

[data-theme="crimson"] {
    --bg-void: #070204;
    --bg-panel: rgba(20, 5, 11, 0.86);
    --bg-panel-solid: #14050b;
    --bg-elevated: rgba(36, 8, 18, 0.92);
    --accent-primary: #ff1744;
    --accent-primary-rgb: 255, 23, 68;
    --accent-secondary: #ff9100;
    --accent-secondary-rgb: 255, 145, 0;
    --accent-tertiary: #00e5ff;
    --accent-danger: #ff1744;
    --text-main: #fff1f2;
    --text-muted: #fda4af;
    --text-dim: #881337;
    --border-color: rgba(255, 23, 68, 0.32);
    --border-bright: rgba(255, 23, 68, 0.9);
    --glow-shadow: 0 0 28px rgba(255, 23, 68, 0.34);
    --theme-name: "SYNAPSE_CRIMSON";
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-void);
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    position: relative;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb), 0.65);
    border-radius: 2px;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body {
    background-color: var(--bg-void);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    transition: background-color 0.35s ease, color 0.25s ease;
    line-height: 1.6;
}

::selection {
    background: rgba(var(--accent-primary-rgb), 0.35);
    color: #ffffff;
}

.font-mono-code {
    font-family: 'JetBrains Mono', monospace;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

[data-cipher] {
    font-variant-numeric: tabular-nums;
    display: inline-block;
    vertical-align: bottom;
    max-width: 100%;
}

@media (min-width: 640px) {
    [data-cipher] {
        contain: layout paint;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 639px) {
    [data-cipher] {
        white-space: normal;
        word-break: break-word;
    }
}

#crt-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 250;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.38) 50%),
        radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.68) 100%);
    background-size: 100% 3px, 100% 100%;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

body.crt-disabled #crt-overlay {
    opacity: 0;
}

.cyber-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px -6px rgba(0, 0, 0, 0.75), inset 0 0 20px rgba(var(--accent-primary-rgb), 0.04);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.22s ease;
}

.cyber-panel:hover {
    border-color: var(--border-bright);
    box-shadow: var(--glow-shadow), inset 0 0 24px rgba(var(--accent-primary-rgb), 0.08);
}

.accent-text {
    color: var(--accent-primary);
}

.accent-glow-text {
    color: var(--accent-primary);
    text-shadow: 0 0 16px rgba(var(--accent-primary-rgb), 0.6), 0 0 32px rgba(var(--accent-primary-rgb), 0.25);
}

.accent-border {
    border-color: var(--border-color);
}

.cyber-btn {
    position: relative;
    background: rgba(var(--accent-primary-rgb), 0.09);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.cyber-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.22);
    border-color: var(--border-bright);
    box-shadow: var(--glow-shadow);
    transform: translateY(-1.5px);
}

.cyber-btn-solid {
    background: var(--accent-primary);
    color: #030508;
    font-weight: 800;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 24px rgba(var(--accent-primary-rgb), 0.48);
    transition: all 0.18s ease;
}

.cyber-btn-solid:hover {
    filter: brightness(1.12);
    box-shadow: 0 0 34px rgba(var(--accent-primary-rgb), 0.78);
    transform: translateY(-1.5px);
}

.cyber-btn-classified {
    background: rgba(255, 23, 68, 0.12);
    border: 1px solid rgba(255, 23, 68, 0.55);
    color: #fda4af;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.18s ease;
}

.cyber-btn-classified:hover {
    background: rgba(255, 23, 68, 0.24);
    border-color: #ff1744;
    box-shadow: 0 0 22px rgba(255, 23, 68, 0.4);
    color: #ffffff;
}

.hud-corners {
    position: relative;
}
.hud-corners::before,
.hud-corners::after {
    content: '';
    position: absolute;
    width: 11px;
    height: 11px;
    border-color: var(--accent-primary);
    pointer-events: none;
    opacity: 0.85;
    transition: all 0.25s ease;
}
.hud-corners::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--accent-primary);
    border-left: 2px solid var(--accent-primary);
}
.hud-corners::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--accent-primary);
    border-right: 2px solid var(--accent-primary);
}
.hud-corners:hover::before,
.hud-corners:hover::after {
    width: 18px;
    height: 18px;
    opacity: 1;
}

.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.tilt-card-glare {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        480px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(var(--accent-primary-rgb), 0.16),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.tilt-card:hover .tilt-card-glare {
    opacity: 1;
}

.milestone-body {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, margin-top 0.25s ease;
    margin-top: 0;
}

.milestone-card.expanded .milestone-body {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0.85rem;
}

.milestone-body-inner {
    overflow: hidden;
}

.milestone-card.expanded {
    border-color: var(--border-bright);
    box-shadow: var(--glow-shadow), inset 0 0 24px rgba(var(--accent-primary-rgb), 0.06);
}

@media (pointer: fine) {
    body.custom-cursor-active {
        cursor: none;
    }
    body.custom-cursor-active a,
    body.custom-cursor-active button,
    body.custom-cursor-active input,
    body.custom-cursor-active textarea,
    body.custom-cursor-active select,
    body.custom-cursor-active [data-magnetic] {
        cursor: none;
    }
}

@media (pointer: coarse) {
    #cursor-outer,
    #cursor-inner {
        display: none !important;
    }
}

#cursor-outer {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1.5px dashed rgba(var(--accent-primary-rgb), 0.75);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: width 0.15s ease, height 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

#cursor-outer.cursor-locked {
    width: 44px;
    height: 44px;
    border: 2px solid #ff1744;
    border-radius: 8px;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 0 20px rgba(255, 23, 68, 0.6);
}

#cursor-outer.cursor-clicking {
    width: 20px;
    height: 20px;
    border: 2px solid #00ff9d;
    background-color: rgba(0, 255, 157, 0.25);
    transform: translate(-50%, -50%) scale(0.9);
}

#cursor-inner {
    position: fixed;
    top: 0;
    left: 0;
    width: 5px;
    height: 5px;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-primary);
}

@keyframes glitchSlice {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
    20% { clip-path: inset(12% 0 65% 0); transform: translate(-6px, 2px); }
    40% { clip-path: inset(62% 0 10% 0); transform: translate(6px, -2px); }
    60% { clip-path: inset(30% 0 40% 0); transform: translate(-4px, 0); }
    80% { clip-path: inset(80% 0 5% 0); transform: translate(4px, 2px); }
}

.glitch-active {
    animation: glitchSlice 0.28s steps(2, end) infinite;
    text-shadow: -3px 0 #ff1744, 3px 0 #00f0ff;
}

.tactical-wing {
    position: fixed;
    top: 80px;
    bottom: 76px;
    z-index: 45;
    width: 184px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 1535px) {
    .tactical-wing {
        width: 158px;
    }
}

@media (max-width: 1279px) {
    .tactical-wing {
        display: none !important;
    }
}

.wing-nav-btn.active {
    background: rgba(var(--accent-primary-rgb), 0.16);
    border-color: var(--border-bright);
    color: #ffffff;
    box-shadow: var(--glow-shadow);
}

.wing-nav-btn.active .wing-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    transform: scale(1.25);
}

.eq-bar {
    background: var(--accent-primary);
    transform-origin: bottom;
    transition: height 0.06s ease;
    box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.5);
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-slow-spin {
    animation: slowRotate 16s linear infinite;
}

.pulse-core-active {
    box-shadow: 0 0 38px rgba(var(--accent-primary-rgb), 0.85), inset 0 0 20px rgba(var(--accent-primary-rgb), 0.45) !important;
    border-color: var(--accent-primary) !important;
    transform: scale(1.08);
}

.bgm-panel-collapsed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    visibility: hidden;
}

.bgm-panel-expanded {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.track-btn-active {
    background: rgba(var(--accent-primary-rgb), 0.2) !important;
    border-color: var(--border-bright) !important;
    box-shadow: var(--glow-shadow);
}

.wing-panel-left,
.wing-panel-right {
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    will-change: transform;
}

.wing-panel-left.wing-collapsed {
    transform: translateX(calc(-100% - 1.5rem));
    opacity: 0;
    pointer-events: none;
}

.wing-panel-right.wing-collapsed {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    pointer-events: none;
}

.wing-toggle-tab {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 45;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.14em;
    transition: all 0.2s ease;
}

.wing-toggle-left {
    left: 0;
    border-left: none;
    border-radius: 0 0.75rem 0.75rem 0;
}

.wing-toggle-right {
    right: 0;
    border-right: none;
    border-radius: 0.75rem 0 0 0.75rem;
}