:root {
    /* --- COLOR PALETTE: CYBERPUNK 2077 INSPIRED --- */
    --bg-deep: #05070a;
    --bg-dark: #0a0e14;
    --bg-panel: rgba(20, 25, 35, 0.6);
    --bg-panel-hover: rgba(30, 35, 45, 0.7);

    --border-color: rgba(60, 255, 230, 0.15);
    --border-highlight: rgba(60, 255, 230, 0.5);

    --text-primary: #e0faff;
    --text-secondary: #7aa5b8;
    --text-dim: #3a4b55;

    /* Accents */
    --neon-cyan: #00f3ff;
    --neon-pink: #bd00ff;
    --neon-blue: #2962ff;
    --neon-green: #00ff9d;
    --neon-red: #ff2a2a;
    --neon-yellow: #fcee0a;

    /* Glows */
    --glow-cyan: 0 0 10px rgba(0, 243, 255, 0.5);
    --glow-pink: 0 0 10px rgba(189, 0, 255, 0.5);
    --glow-green: 0 0 10px rgba(0, 255, 157, 0.4);

    /* Fonts */
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Orbitron', 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- SCROLLBARS --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #1f3a47;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}


/* --- GLOBAL BACKGROUND & EFFECTS --- */
.global-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0d121c 0%, #05070a 100%);
}

.cyber-grid-bg {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(1000px) rotateX(60deg) translateY(0);
    animation: gridMove 20s linear infinite;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 90%);
}

@keyframes gridMove {
    0% {
        transform: perspective(1000px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(1000px) rotateX(60deg) translateY(50px);
    }
}

.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.top-left {
    top: -200px;
    left: -200px;
    background: var(--neon-blue);
}

.bottom-right {
    bottom: -200px;
    right: -200px;
    background: var(--neon-pink);
}


/* --- UTILITIES --- */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        filter: blur(5px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-panel-bottom {
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--border-color);
}

.highlight {
    color: var(--neon-cyan);
}

.success,
.up {
    color: var(--neon-green) !important;
}

.danger,
.down {
    color: var(--neon-red) !important;
}

.neutral {
    color: var(--text-secondary) !important;
    text-shadow: none !important;
}

.highlight-val {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* --- BUTTONS & INPUTS --- */
.cyber-btn {
    position: relative;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    font-family: var(--font-display);
    font-size: 0.9rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.cyber-btn:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    color: #fff;
    transform: translateY(-2px);
}

.cyber-btn:active {
    transform: translateY(0);
}

.cyber-btn.primary {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    font-weight: 700;
}

.cyber-btn.primary:hover {
    background: var(--neon-cyan);
    color: #000;
}

.cyber-btn.danger {
    border-color: rgba(255, 42, 42, 0.3);
    color: var(--neon-red);
}

.cyber-btn.danger:hover {
    border-color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.4);
    background: rgba(255, 42, 42, 0.1);
    color: #fff;
}

.cyber-btn.small {
    padding: 5px 10px;
    font-size: 0.75rem;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.cyber-btn.xs {
    padding: 2px 6px;
    font-size: 0.7rem;
    clip-path: none;
    border-radius: 2px;
}

.cyber-input,
.cyber-select {
    background: rgba(10, 15, 20, 0.6);
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    padding: 10px;
    width: 100%;
    outline: none;
    transition: 0.2s;
}

.cyber-input:focus,
.cyber-select:focus {
    border-color: var(--neon-cyan);
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.cyber-select.small {
    padding: 5px 10px;
    font-size: 0.75rem;
    height: auto;
    font-family: var(--font-display);
    /* Match button font */
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}


/* --- MAIN MENU --- */
#main-menu {
    justify-content: center;
    align-items: center;
}

.menu-layout {
    display: flex;
    gap: 60px;
    align-items: center;
    z-index: 10;
}

.menu-intro {
    text-align: right;
    max-width: 400px;
}

.cyber-badge {
    display: inline-block;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    font-size: 0.7rem;
    padding: 2px 8px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    box-shadow: var(--glow-pink);
}

.game-logo {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.game-logo .year {
    display: block;
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 10px;
    margin-top: 5px;
}

.menu-card {
    width: 450px;
    padding: 40px;
    background: rgba(20, 25, 35, 0.8);
}

.menu-header h2 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.btn-icon {
    font-size: 1.8rem;
}

.btn-text-group {
    display: flex;
    flex-direction: column;
}

.btn-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-desc {
    font-size: 0.7rem;
    opacity: 0.7;
    font-family: var(--font-mono);
    text-transform: none;
}

.menu-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.menu-row button {
    flex: 1;
}


/* --- TICKER --- */
.ticker-tape-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    z-index: 20;
    border-top: 1px solid var(--border-color);
    background: #000;
}

.ticker-tape {
    display: inline-flex;
    white-space: nowrap;
    animation: scroll 40s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-tape span {
    margin-right: 50px;
    color: #888;
}

.ticker-tape span .up,
.ticker-tape span .down {
    font-weight: bold;
    margin-left: 5px;
}


/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-box {
    width: 600px;
    max-width: 95vw;
    padding: 30px;
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.1);
    background: #0d1117;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-family: var(--font-display);
    color: var(--neon-cyan);
    margin: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.stock-selector-container {
    height: 200px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    margin-top: 10px;
    overflow-y: auto;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Active Indicator List */
#active-ind-list {
    min-height: 100px;
    max-height: 150px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    padding: 5px;
    margin-bottom: 20px;
}

.ind-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    margin-bottom: 5px;
    border-left: 3px solid transparent;
    font-size: 0.85rem;
}

.ind-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ind-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.btn-remove-ind {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-remove-ind:hover {
    color: var(--neon-red);
}

/* Stock List Item Styles (Dynamic JS) */
.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #222;
    cursor: pointer;
}

.stock-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stock-item.selected {
    background: rgba(0, 243, 255, 0.1);
    border-left: 2px solid var(--neon-cyan);
}

.browser-row {
    cursor: pointer;
    transition: background 0.2s;
}

.browser-row:hover {
    background: rgba(0, 243, 255, 0.1);
}


/* --- GAME HUD TOP --- */
.hud-top {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.92;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.logo-link:focus-visible {
    outline: 1px solid var(--border-highlight);
    outline-offset: 4px;
    border-radius: 6px;
}

.logo-mini .logo-icon {
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
}

.logo-image {
    display: block;
    height: 46px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.logo-text {
    line-height: 1;
}

.logo-text .main {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
}

.logo-text .sub {
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: var(--neon-pink);
}

.global-search {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    width: 250px;
}

.global-search input {
    background: transparent;
    border: none;
    color: #fff;
    flex: 1;
    font-family: var(--font-mono);
    outline: none;
    margin-left: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.global-search .icon {
    color: var(--text-secondary);
}

/* Search Autocomplete */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10, 15, 20, 0.95);
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.search-dropdown.hidden {
    display: none;
}

.search-item {
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.search-item:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
}

.search-item .s-sym {
    font-weight: bold;
    color: var(--neon-cyan);
}

.search-item .s-name {
    font-size: 0.75rem;
    opacity: 0.7;
}

.hud-center {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.stat-card .label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-card .value {
    font-family: var(--font-mono);
    font-size: 1rem;
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 20px;
}


#date-display {
    margin-right: 10px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.game-time {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    border-radius: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
}

.status-dot.online {
    background: var(--neon-green);
    box-shadow: var(--glow-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}


/* --- MAIN TRADING GRID --- */
.app-layout {
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
    /* Minus ticker */
}

.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 1fr 250px;
    gap: 10px;
    padding: 10px;
    overflow: visible;
}

/* CHART AREA */
.chart-area {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* Ensure drawers pop out */
}

.chart-header {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 15px;
}

#active-symbol-header {
    font-family: var(--font-display);
    color: #fff;
    margin-right: 10px;
    min-width: 80px;
}

.chart-tools-scroll {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    /* flex: 1; Removed so it doesn't push the select box away */
    min-width: 0;
    /* Fix for flex item overflow */
    scrollbar-width: none;
    margin-right: 10px;
}

.chart-type-wrapper {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 5px;
    min-width: 100px;
}

#chart-type-select {
    width: 100%;
    min-width: 100px;
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    outline: none;
}

#chart-type-select:focus {
    box-shadow: none;
}

.tool-btn,
.draw-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.1s;
    white-space: nowrap;
}

.tool-btn:hover,
.draw-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.tool-btn.active,
.draw-btn.active {
    color: var(--neon-cyan);
    border-color: rgba(0, 243, 255, 0.3);
    background: rgba(0, 243, 255, 0.05);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: nowrap;
    /* Prevent wrapping */
    flex-shrink: 0;
    white-space: nowrap;
    max-width: none;
}

.drawing-tools-mini {
    display: flex;
    border-right: 1px solid var(--border-color);
    padding-right: 10px;
    margin-right: 10px;
}

.speed-control {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    border-radius: 20px;
    padding: 2px 5px;
    gap: 0;
    /* Gap handled by borders/padding */
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
    height: 32px;
    /* Fixed height for consistency */
}

/* Inner items (Buttons & Selects) */
.speed-control .cyber-btn,
.speed-control .cyber-select {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    clip-path: none !important;
    padding: 0 10px !important;
    height: 100%;
    border-radius: 0;
    margin: 0;
}

/* Separator Line */
.speed-control>*:not(:last-child) {
    border-right: 1px solid rgba(0, 243, 255, 0.3) !important;
}

#speed-select {
    min-width: 60px;
    width: auto;
    text-align: center;
    text-align-last: center;
}



#speed-select:focus {
    box-shadow: none;
}

/* --- CHART BODY & LEFT TOOLBAR --- */
.chart-body {
    flex: 1;
    display: flex;
    overflow: visible;
    /* Allow drawers to pop out */
    position: relative;
    height: 100%;
}

.left-toolbar {
    width: 52px;
    background: rgba(10, 14, 20, 0.4);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 5px;
    z-index: 100;
}

.left-toolbar .draw-btn {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.left-toolbar .draw-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.left-toolbar .draw-btn.active {
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.08);
    /* box-shadow: inset 3px 0 0 var(--neon-cyan); */
    border-left: 2px solid var(--neon-cyan);
}

.left-toolbar .sep {
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.chart-viewport {
    flex: 1;
    position: relative;
    background: #080b10;
    cursor: crosshair;
    overflow: hidden;
    /* Ensure canvas doesn't overflow flex container */
}


/* SIDEBAR (Right) */
.side-panel {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

/* Order Entry */
.active-trade-panel {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--neon-cyan);
    /* Highlighted panel */
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.05);
}

.panel-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 0.8rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.live-price-tag {
    text-align: right;
}

.live-price-tag .price {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

/* Account Stats in Panel */
.account-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
}

.panel-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-stat-item:last-child {
    border-right: none;
}

.panel-stat-item .label {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-stat-item .value {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    font-family: var(--font-mono);
}


.trade-form {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.trade-modes {
    display: flex;
    gap: 5px;
    background: #000;
    padding: 3px;
    border-radius: 4px;
}

.mode-btn {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 6px;
    color: #666;
    transition: 0.2s;
    border-radius: 2px;
}

.mode-btn:hover {
    color: #fff;
}

.mode-btn input {
    display: none;
}

.mode-btn:has(input:checked) {
    background: var(--neon-blue);
    color: white;
    font-weight: bold;
}

.bp-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
    border-bottom: 1px dashed #333;
    padding-bottom: 5px;
}

.bp-bar .val {
    color: var(--neon-green);
    font-family: var(--font-mono);
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-group {
    flex: 1;
}

.input-group.full {
    width: 100%;
}

.input-group label,
.lev-row label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 4px;
}

.trade-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.trade-btn {
    padding: 15px 0;
    border: none;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.9rem;
    transition: 0.2s;
    opacity: 0.9;
}

.trade-btn:hover {
    opacity: 1;
    transform: scale(1.02);
}

.trade-btn.buy {
    background: var(--neon-green);
    color: #000;
    box-shadow: var(--glow-green);
}

.trade-btn.sell {
    background: var(--neon-red);
    box-shadow: 0 0 10px rgba(255, 42, 42, 0.4);
}

.order-cost-est {
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    margin-top: 5px;
}


/* Market Data Panel */
.market-info-panel {
    height: auto;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    border-bottom: 1px solid #1a202a;
    padding-bottom: 2px;
}

.data-item.full {
    grid-column: 1 / -1;
}

.data-item .lbl {
    color: #666;
}

.data-item .val {
    font-family: var(--font-mono);
    color: #ddd;
}


/* POSITIONS (Bottom) */
.positions-panel {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    flex: 1;
    overflow: auto;
}

/* --- POSITIONS TABLE REWRITE --- */
.cyber-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
    /* Enforce strict column widths */
}

/* Base Cell Styling */
.cyber-table th,
.cyber-table td {
    padding: 10px 5px;
    /* Compact horizontal padding */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Handle overflow gracefully */
    white-space: nowrap;
}

.cyber-table th {
    position: sticky;
    top: 0;
    background: #0f151e;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid var(--border-color);
    z-index: 5;
    /* Ensure headers stay on top */
}

/* --- COLUMN DEFINITIONS (Total 100%) --- */

/* 1. TICKER (16%) */
.cyber-table th:nth-child(1),
.cyber-table td:nth-child(1) {
    width: 16%;
    text-align: left;
    padding-left: 10px;
}

/* 2. SIZE (8%) */
.cyber-table th:nth-child(2),
.cyber-table td:nth-child(2) {
    width: 8%;
    text-align: right;
}

/* 3. ENTRY (10%) */
.cyber-table th:nth-child(3),
.cyber-table td:nth-child(3) {
    width: 10%;
    text-align: right;
}

/* 4. DIVIDENDS (8%) */
.cyber-table th:nth-child(4),
.cyber-table td:nth-child(4) {
    width: 8%;
    text-align: right;
}

/* 5. MARKET (10%) */
.cyber-table th:nth-child(5),
.cyber-table td:nth-child(5) {
    width: 10%;
    text-align: right;
}

/* 6. TP (9%) - Right Align */
.cyber-table th:nth-child(6),
.cyber-table td:nth-child(6) {
    width: 9%;
    text-align: right;
    cursor: pointer;
}

/* 7. SL (9%) - Right Align */
.cyber-table th:nth-child(7),
.cyber-table td:nth-child(7) {
    width: 9%;
    text-align: right;
    cursor: pointer;
}

/* 8. P&L $ (10%) */
.cyber-table th:nth-child(8),
.cyber-table td:nth-child(8) {
    width: 10%;
    text-align: right;
}

/* 9. P&L % (8%) */
.cyber-table th:nth-child(9),
.cyber-table td:nth-child(9) {
    width: 8%;
    text-align: right;
}

/* 10. ACTION (12%) */
.cyber-table th:nth-child(10),
.cyber-table td:nth-child(10) {
    width: 12%;
    text-align: center;
}

/* Row Hover Effect */
.cyber-table tr:hover td {
    background: rgba(0, 243, 255, 0.03);
}

/* Bank Modal Specifics */
.bank-skin {
    border-color: var(--neon-yellow);
    box-shadow: 0 0 30px rgba(252, 238, 10, 0.15);
}

.bank-tabs-cyber {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #666;
    padding: 15px;
    cursor: pointer;
    font-family: var(--font-display);
}

.tab-btn.active {
    color: var(--neon-yellow);
    border-bottom: 2px solid var(--neon-yellow);
    background: rgba(252, 238, 10, 0.05);
}

.bank-content {
    display: none;
}

.bank-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.bank-display {
    background: #000;
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed #333;
    text-align: center;
    margin-bottom: 20px;
}

.big-stat .lbl {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.big-stat .val {
    font-size: 2.5rem;
    font-family: var(--font-mono);
    color: #fff;
}

.bank-display.warning-mode .val {
    color: var(--neon-red);
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* FEEDBACK MSG */
.feedback-msg {
    font-size: 0.8rem;
    margin-top: 5px;
    min-height: 1.2em;
    text-align: center;
}


/* --- HUD BUTTONS --- */
.hud-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-display);
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.hud-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    border-color: var(--neon-cyan);
}

.hud-btn.micro {
    font-size: 0.7rem;
    padding: 2px 6px;
    border: 1px solid #444;
}


/* --- ACTION BUTTONS (Cyber Style) --- */
.action-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.cyber-btn.table-action {
    padding: 4px 10px;
    font-size: 0.75rem;
    line-height: 1;
    min-width: 60px;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.cyber-btn.table-action.edit {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.cyber-btn.table-action.edit:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: var(--glow-cyan);
}

.cyber-btn.table-action.close {
    background: rgba(255, 42, 42, 0.1);
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.cyber-btn.table-action.close:hover {
    background: var(--neon-red);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.4);
}

/* --- MAILBOX SYSTEM --- */
.hud-btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--neon-red);
    border-radius: 50%;
    margin-left: 5px;
    box-shadow: 0 0 5px var(--neon-red);
    animation: pulse 2s infinite;
    vertical-align: middle;
}

.badge-dot.hidden {
    display: none;
}

.mail-skin {
    border-color: #aaa;
    /* Silver/Neutral */
    box-shadow: 0 0 30px rgba(200, 200, 200, 0.1);
}

.mail-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 15px;
    margin-top: 10px;
    height: 100%;
}

.mail-sidebar {
    width: 250px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.mail-tools {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.7rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.mail-list {
    flex: 1;
    overflow-y: auto;
}

.mail-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.7;
}

.mail-item:hover {
    background: rgba(0, 243, 255, 0.05);
    opacity: 1;
    border-left: 2px solid var(--neon-cyan);
}

.mail-item.unread {
    opacity: 1;
    background: rgba(0, 243, 255, 0.02);
    border-left: 2px solid var(--neon-red);
}

.mail-item.selected {
    background: rgba(0, 243, 255, 0.1);
    border-left: 2px solid var(--neon-cyan);
    opacity: 1;
}

.mail-item .m-sender {
    display: block;
    font-size: 0.75rem;
    color: #fff;
    font-weight: bold;
    margin-bottom: 2px;
}

.mail-item .m-sub {
    display: block;
    font-size: 0.8rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-item .m-date {
    display: block;
    font-size: 0.65rem;
    color: #666;
    margin-top: 4px;
    font-family: var(--font-mono);
}

.mail-content {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.placeholder-msg {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-family: var(--font-display);
    letter-spacing: 2px;
}

.mail-reader {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mail-reader.hidden {
    display: none;
}

.mail-meta h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #fff;
    font-family: var(--font-display);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
}

.mail-body {
    flex: 1;
    font-family: var(--font-mono);
    line-height: 1.5;
    color: #ddd;
    font-size: 0.9rem;
    padding: 10px 0;
    white-space: pre-wrap;
    /* Preserve line breaks */
}

.mail-actions-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
    display: flex;
    justify-content: flex-end;
}

/* Added XS Button Style */
.cyber-btn.xs {
    font-size: 0.7rem;
    padding: 4px 8px;
    height: auto;
    min-width: unset;
    line-height: normal;
}

/* --- BANK UI EXTENSIONS --- */
.bank-cols {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    height: 400px;
    /* Fixed height for scroll area */
}

.bank-col-left {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bank-col-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.bank-sub-header {
    color: var(--neon-blue);
    font-size: 0.9rem;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(41, 98, 255, 0.3);
    padding-bottom: 5px;
}

.earn-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.earn-item {
    background: rgba(0, 0, 0, 0.3);
    transition: 0.2s;
}

.earn-item:hover {
    background: rgba(41, 98, 255, 0.1);
}

.est-return-box {
    background: rgba(0, 255, 157, 0.1);
    border: 1px dashed var(--neon-green);
    padding: 10px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9rem;
}

.sub-est {
    font-size: 0.8rem;
    color: #888;
}

.glass-panel-inset {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.full-width {
    width: 100%;
}

/* --- NEW DRAWING TOOLBAR --- */
.left-toolbar {
    overflow: visible !important;
    /* Allow drawers to pop out */
}

.tool-group {
    position: relative;
    margin-bottom: 5px;
}

.tool-group .tool-drawer {
    display: none;
    position: absolute;
    left: 55px;
    /* Clear the sidebar */
    top: 0;
    min-width: 200px;
    background: #111;
    border: 1px solid #333;
    border-left: 2px solid var(--neon-cyan);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    padding: 10px;
    z-index: 9999 !important;
    /* Always on top */
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.8);
}

.tool-group.open .tool-drawer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fadeIn 0.1s ease-out;
}

.drawer-header {
    font-size: 0.7em;
    color: #666;
    padding: 4px 8px;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
    margin-bottom: 4px;
}

.drawer-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: #aeaeae;
    cursor: pointer;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    transition: all 0.2s;
}

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

.drawer-item .icon {
    width: 20px;
    display: inline-block;
    color: #4CAF50;
    /* Accent color */
    margin-right: 8px;
    text-align: center;
}

/* --- INDICATORS BUTTON FIX --- */
#btn-indicators {
    font-size: 0.7rem;
    padding: 6px 8px;
    min-width: auto;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 200;
    margin-right: 5px !important;
}

.chart-controls {
    z-index: 200;
    position: relative;
    flex-wrap: wrap;
    /* Allow wrap if really needed, though height might grow */
}

.chart-header {
    overflow: visible !important;
    /* Allow popups/buttons to hang out */
    z-index: 150;
    position: relative;
}

/* --- INDICATORS MODAL --- */
.indicators-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    height: 400px;
}

.indicators-list {
    border-right: 1px solid var(--border-color);
    padding-right: 10px;
    overflow-y: auto;
}

.indicator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.indicator-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ind-name {
    font-weight: 500;
    color: var(--text-primary);
}

.active-indicators-panel {
    padding-left: 10px;
    display: flex;
    flex-direction: column;
}

.active-indicators-panel h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.active-list {
    overflow-y: auto;
    flex: 1;
}

.active-ind-item {
    background: rgba(41, 98, 255, 0.1);
    border: 1px solid var(--neon-blue);
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.active-ind-item .remove-btn {
    background: none;
    border: none;
    color: var(--neon-red);
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
}

.active-ind-item .remove-btn:hover {
    background: rgba(255, 0, 0, 0.1);
    border-radius: 3px;
}

.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding-top: 20px;
    font-style: italic;
}

/* --- MOBILE RESPONSIVENESS (iPhone / Android) --- */

/* 1. Portrait Mode (Vertical Stack) */
@media screen and (max-width: 768px) {

    /* --- NEW HUD LAYOUT --- */
    .hud-top {
        flex-direction: column;
        height: auto;
        padding: 5px;
        gap: 5px;
        background: var(--bg-deep);
        /* Ensure clear bg */
    }

    /* Row 1: Logo + Search + Assets */
    .hud-left {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        /* Allow wrapping if needed, but try one line */
        justify-content: space-between;
        align-items: center;
        gap: 5px;
        padding-bottom: 5px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .logo-mini {
        width: auto;
        margin: 0;
    }

    .logo-image {
        height: 42px;
        max-width: 200px;
    }

    .logo-mini .logo-text {
        display: none;
    }

    /* Hide text to save space, keep Icon */

    .global-search {
        flex: 1;
        /* Take remaining space */
        width: auto;
        min-width: 120px;
    }

    #btn-add-symbol {
        width: auto;
        margin: 0 !important;
        white-space: nowrap;
    }

    /* Row 2: Stats Grid (Consolidated) */
    .hud-center {
        width: 100%;
        display: flex;
        justify-content: space-around;
        /* Distribute evenly */
        align-items: center;
        gap: 5px;
        background: rgba(0, 40, 60, 0.3);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 5px;
    }

    .stat-card {
        background: transparent;
        border: none;
        /* Remove individual borders */
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        /* Separator */
        flex: 1;
        /* Equal widths */
    }

    .stat-card:last-child {
        border-right: none;
    }

    .stat-card .label {
        font-size: 0.55em;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        margin-bottom: 2px;
    }

    .stat-card .value {
        font-size: 0.9em;
        font-weight: bold;
    }

    /* Custom Grid Areas for 3 items in 4 slots */
    /* Child 1: Equity, Child 2: P&L, Child 3: Balance */
    .hud-center .stat-card:nth-child(1) {
        grid-column: 1;
    }

    .hud-center .stat-card:nth-child(2) {
        grid-column: 2;
    }

    .hud-center .stat-card:nth-child(3) {
        grid-column: 1;
    }

    /* Row 3: Time & Nav */
    .hud-right {
        width: 100%;
        flex-direction: column;
        gap: 5px;
    }

    .game-time {
        width: 100%;
        justify-content: space-between;
        background: rgba(0, 40, 60, 0.3);
        border: 1px solid var(--border-color);
        padding: 10px;
    }

    .hud-btn-group {
        width: 100%;
        display: block;
        /* Just block or flex is fine */
    }

    .hud-btn-group .cyber-btn {
        width: 100%;
        /* Full width menu button */
        padding: 10px 0;
        text-align: center;
        flex-direction: row;
        /* Icon next to text */
        justify-content: center;
        gap: 10px;
        font-size: 0.9em;
        height: auto;
    }

    .main-grid {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .chart-area {
        height: 50vh;
        /* Fixed height for chart on mobile */
        min-height: 300px;
        width: 100%;
    }

    /* Search Bar area */
    .global-search {
        width: 100%;
    }

    #btn-add-symbol {
        width: 100%;
        justify-content: center;
        margin-left: 0 !important;
        margin-top: 5px;
    }

    /* Market Panel (Right Side) */
    .side-panel {
        width: 100%;
        height: auto;
        max-height: 40vh;
        /* Limit height when stacked */
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    /* Open Positions Table */
    .positions-panel {
        overflow-x: auto;
        /* Scroll horizontally */
    }

    /* Modals */
    .modal-box {
        width: 95vw !important;
        max-height: 85vh;
        overflow-y: auto;
        padding: 10px;
    }

    /* Symbol Browser Table */
    #symbol-browser-modal .table-container {
        max-height: 50vh !important;
    }
}

/* 2. Landscape Mode (Condensed) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hud-top {
        height: 40px;
        /* Slim Header */
        padding: 0 10px;
    }

    .logo-mini .logo-text,
    .hud-center .label {
        display: none;
        /* Hide labels/text to save space */
    }

    .stat-card {
        padding: 2px 10px;
        font-size: 0.8em;
    }

    .cyber-btn.small {
        padding: 2px 8px;
        font-size: 0.7em;
    }

    /* Hide some less critical elements if needed */
    .logo-mini {
        gap: 5px;
    }

    .logo-image {
        height: 30px;
        max-width: 150px;
    }
}

/* --- MOBILE RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {

    /* Top HUD */
    .hud-top {
        height: auto;
        padding: 5px 10px;
        flex-wrap: wrap;
        gap: 5px;
    }

    .hud-left {
        gap: 10px;
    }

    .logo-text .main {
        font-size: 0.9rem;
    }

    .logo-text .sub {
        display: none;
    }

    .logo-image {
        height: 36px;
        max-width: 180px;
    }

    .hud-center {
        order: 3;
        /* Move time to bottom row if needed, or keep centered */
        width: 100%;
        justify-content: space-between;
        margin-top: 5px;
        gap: 5px;
    }

    .game-time {
        font-size: 0.75rem;
        padding: 2px 8px;
        flex: 1;
        justify-content: center;
    }

    .hud-right {
        gap: 10px;
    }

    /* Main Grid & Layout */
    .app-layout {
        height: calc(100vh - 40px);
        overflow-y: auto;
    }

    .main-grid {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .chart-area {
        height: 60vh;
        /* Fixed height for chart on mobile */
        min-height: 400px;
        margin-bottom: 10px;
    }

    .side-panel {
        height: auto;
        width: 100%;
    }

    /* Chart Header & Tools */
    .chart-header {
        overflow-x: auto;
        padding: 0 5px;
        gap: 5px;
    }

    .chart-header::-webkit-scrollbar {
        display: none;
    }

    #active-symbol-header {
        font-size: 1rem;
    }

    .chart-tools-scroll {
        margin-right: 5px;
    }

    .chart-controls {
        gap: 5px;
    }

    /* Hide text on some buttons for space */
    #btn-indicators,
    #btn-pnl-view {
        font-size: 0;
        padding: 5px;
    }

    #btn-indicators::before {
        content: "fx";
        font-size: 0.8rem;
    }

    #btn-pnl-view::before {
        content: "P&L";
        font-size: 0.8rem;
    }

    /* Order Entry Panel */
    .active-trade-panel {
        margin-bottom: 60px;
        /* Space for ticker */
    }

    .trade-actions {
        grid-template-columns: 1fr 1fr;
    }

    .account-stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    /* Left Toolbar */
    .left-toolbar {
        width: 40px;
    }

    .left-toolbar .draw-btn {
        width: 30px;
        height: 30px;
    }
}

/* --- VISUAL EFFECTS OVERHAUL --- */
.cyber-btn,
.glass-panel {
    /* Set default position for glare if JS fails or before load */
    --x: 50%;
    --y: 50%;
}

/* Interactive Glare on Buttons */
.cyber-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--x) var(--y), rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.cyber-btn:hover::after {
    opacity: 1;
}

/* Glitch Text Effect Base */
.glitch-text {
    position: relative;
    display: inline-block;
}

/* Scrollbar Refinement */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* --- BUTTON STANDARDIZATION --- */
/* Ensure tool-btn doesn't override cyber-btn styles when combined */
.cyber-btn.tool-btn {
    border: 1px solid var(--border-color);
    background: rgba(0, 243, 255, 0.05);
}

.cyber-btn.tool-btn.active,
.cyber-btn.tool-btn:hover {
    border-color: var(--neon-cyan);
    color: #fff;
    background: rgba(0, 243, 255, 0.1);
}
