/* =========================================
   1. THE MINT BUTTON (high-CPS punchy core)
   ========================================= */
.big-button-container {
    width: 100%;
    height: 100%;
    max-height: min(50vh, 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    min-height: 0;
    padding: 4px;
}

:root {
    --mint-accent: #22c55e;
    --mint-glow: rgba(34, 197, 94, 0.45);
}

.big-button {
    width: var(--mint-size, 36vmin);
    height: var(--mint-size, 36vmin);
    min-width: 0;
    min-height: 0;
    max-width: min(450px, 100%);
    max-height: min(450px, 100%);
    border-radius: 50%;
    border: none;
    outline: none;

    background:
        radial-gradient(circle at 40% 34%, #323a34 0%, #141a16 36%, #070a08 70%, #000 100%);

    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--mint-accent) 45%, transparent),
        0 0 0 8px rgba(255, 255, 255, 0.03),
        0 30px 70px -16px rgba(0, 0, 0, 0.92),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -22px 46px rgba(0, 0, 0, 0.5);

    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    transform: translateZ(0);
    will-change: transform;
    flex: 0 0 auto;

    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mint-glyph {
    position: relative;
    z-index: 3;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: var(--mint-glyph-size, 14vmin);
    line-height: 1;
    color: #6b786f;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    transform: translateZ(0);
}

.mint-sheen {
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.12), transparent 44%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
}

.mint-shock {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    border: 3px solid var(--mint-accent);
    box-shadow: 0 0 18px var(--mint-glow);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.big-button::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: breathe 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.45; }
    50% { transform: scale(1.03); opacity: 0.16; }
}

.big-button:hover,
.big-button:focus-visible {
    box-shadow:
        0 0 0 6px color-mix(in srgb, var(--mint-accent) 28%, transparent),
        0 0 48px var(--mint-glow),
        0 30px 70px -16px rgba(0, 0, 0, 0.92),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.big-button:hover .mint-glyph,
.big-button:focus-visible .mint-glyph {
    color: var(--mint-accent);
    text-shadow: 0 0 22px var(--mint-glow);
}

.big-button.is-hit,
.big-button.is-hit-alt {
    transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
    .big-button::after,
    body.mania-mode .big-button,
    body.mania-mode::before,
    .combo-hud.hot #combo-count,
    .combo-hud.fever #combo-count,
    .combo-hud.max #combo-count { animation: none !important; }
}

body.mania-mode {
    --mint-accent: #eab308;
    --mint-glow: rgba(234, 179, 8, 0.55);
}
body.mania-mode::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background:
        radial-gradient(ellipse at center, transparent 42%, rgba(234, 179, 8, 0.16) 100%);
    animation: mania-wash 0.7s ease-in-out infinite alternate;
}
body.mania-ignite .panel-center {
    animation: mania-flash 0.55s ease-out;
}
body.mania-mode .big-button {
    animation: mania-throb 0.48s ease-in-out infinite alternate;
}
body.mania-mode .status-label {
    color: #eab308;
    text-shadow: 0 0 18px rgba(234, 179, 8, 0.65);
}
body.mania-mode .hype-fill {
    background: #eab308;
    box-shadow: 0 0 16px rgba(234, 179, 8, 0.85);
}
body.mania-mode .big-button:hover .mint-glyph {
    color: var(--gold);
    text-shadow: 0 0 28px var(--gold-glow);
}
@keyframes mania-wash {
    from { opacity: 0.55; }
    to { opacity: 1; }
}
@keyframes mania-throb {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
}
@keyframes mania-flash {
    0% { filter: brightness(1.65); }
    100% { filter: brightness(1); }
}

body.combo-hot::after,
body.combo-fever::after,
body.combo-max::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}
body.combo-hot::after { box-shadow: inset 0 0 90px rgba(234, 179, 8, 0.16); }
body.combo-fever::after { box-shadow: inset 0 0 110px rgba(251, 113, 133, 0.2); }
body.combo-max::after { box-shadow: inset 0 0 120px rgba(192, 132, 252, 0.24); }

.skin-dock {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    z-index: 12;
}
.skin-swatch {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.16);
    background: var(--swatch, #22c55e);
    box-shadow: 0 0 10px color-mix(in srgb, var(--swatch, #22c55e) 45%, transparent);
    cursor: pointer;
}
.skin-swatch.is-on {
    box-shadow:
        0 0 0 2px #040605,
        0 0 0 4px var(--swatch, #22c55e);
}
.skin-swatch.is-locked {
    filter: grayscale(1) brightness(0.45);
    box-shadow: none;
    cursor: not-allowed;
}
body[data-mint-height="tiny"] .skin-dock {
    margin-top: 6px;
    gap: 6px;
}
body[data-mint-height="tiny"] .skin-swatch {
    width: 14px;
    height: 14px;
}

/* =========================================
   2. UPGRADE CARDS (Data Blades)
   ========================================= */
.upgrade {
    background: linear-gradient(90deg, #111 0%, #0c0c0c 100%);
    border: 1px solid #1f1f1f;
    padding: 16px 20px; margin-bottom: 10px;
    border-radius: 10px;
    
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; position: relative; overflow: hidden;
    
    /* Smooth slide animation */
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
}

/* Signal Bar */
.upgrade::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: #222; transition: width 0.2s, background 0.3s;
}

.upgrade:hover {
    background: #161816;
    border-color: rgba(255, 255, 255, 0.14);
    z-index: 5;
}
.upgrade:hover::before { width: 5px; }

/* Visual States */
.upgrade.locked { opacity: 0.3; pointer-events: none; filter: grayscale(1); }
.upgrade.affordable::before { background: var(--green); box-shadow: 4px 0 20px var(--green-glow); }
.upgrade.affordable-max::before { background: var(--gold); box-shadow: 4px 0 20px var(--gold-glow); }

/* Typography */
.upg-info h4 { font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 4px; letter-spacing: 0.3px; }
.upg-info p { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 8px; font-family: var(--font-mono); }
.rate-boost { color: var(--green); font-weight: 600; }

.upg-cost { text-align: right; }
.cost-text { font-family: var(--font-mono); font-weight: 700; color: #777; font-size: 0.9rem; transition: color 0.3s; }
.upgrade.affordable .cost-text { color: #fff; }

.count-badge { 
    display: inline-block;
    background: #1f1f1f; color: #888;
    padding: 3px 8px; border-radius: 6px;
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
    margin-top: 5px; min-width: 32px; text-align: center;
}


/* =========================================
   3. NAV READOUT (money counter)
   ========================================= */
.nav-readout {
    margin: 2px 0 clamp(14px, 2.6vh, 30px);
    max-width: 100%;
}

.nav-line {
    display: block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--mint-balance-size, clamp(2.4rem, 6vw, 3.6rem));
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #f0fdf4;
    text-shadow:
        0 0 24px rgba(34, 197, 94, 0.28),
        0 1px 0 rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    overflow: visible;
}

.nav-dollar {
    color: #4ade80;
    margin-right: 0.04em;
}

.nav-value {
    color: inherit;
}

.nav-unit {
    display: inline;
    margin-left: 0.12em;
    padding: 0.12em 0.34em;
    border-radius: 0.28em;
    font-size: 0.38em;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: middle;
    color: #111827;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.nav-unit:empty {
    display: none;
}

.nav-readout.is-spend .nav-value { color: #fecaca; }
.nav-readout.is-gain .nav-value { color: #bbf7d0; }

/* Prestige Card */
.prestige-container {
    background: linear-gradient(135deg, #111 0%, #0a0a0a 100%);
    border: 1px solid #222;
    padding: 20px; border-radius: 16px; margin-bottom: 24px;
    position: relative; overflow: hidden;
}
.prestige-rank { 
    color: var(--gold); font-weight: 800; font-size: 1rem; 
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.prestige-sub { 
    font-size: 0.75rem; color: #777; 
    display: flex; gap: 10px; align-items: center; 
}
.prestige-pill {
    background: rgba(234, 179, 8, 0.08); border: 1px solid rgba(234, 179, 8, 0.2);
    color: var(--gold); padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 0.7rem;
}
.next-rank-bar { 
    width: 100%; height: 4px; background: #222; 
    border-radius: 2px; margin-top: 16px; overflow: hidden; 
}
.next-rank-fill { 
    height: 100%; background: var(--gold); 
    box-shadow: 0 0 15px var(--gold-glow); 
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Stat Rows */
.stat-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9rem; padding: 16px 0; 
    border-bottom: 1px solid #1a1a1a; margin-bottom: 24px;
}
.stat-label { color: #666; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.5px; }
.stat-value { font-family: var(--font-mono); font-weight: 700; color: #fff; }

/* Hype */
.hype-container { margin-top: auto; }
.hype-label { 
    display: flex; justify-content: space-between; font-size: 0.7rem; 
    color: #666; margin-bottom: 8px; font-weight: 700; letter-spacing: 0.5px;
}
.hype-track { width: 100%; height: 3px; background: #1a1a1a; border-radius: 2px; overflow: hidden; }
.hype-fill { 
    height: 100%; width: 0%; 
    background: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.6); 
    transition: width 0.1s linear; 
}

/* Status Label */
.status-label {
    margin-top: 32px; 
    font-family: var(--font-mono); color: #333; 
    letter-spacing: 3px; font-size: 0.75rem; font-weight: 700;
    pointer-events: none;
}

/* News Ticker */
.news-bar {
    position: absolute; bottom: 40px; 
    width: 90%; max-width: 550px; height: 36px;
    background: #080808; border: 1px solid #222;
    border-radius: 100px; overflow: hidden; 
    display: flex; align-items: center; pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.news-content {
    white-space: nowrap; padding-left: 100%;
    font-family: var(--font-mono); font-size: 0.75rem; color: #888;
    font-weight: 500; animation: ticker 30s linear infinite;
}
@keyframes ticker { 100% { transform: translateX(-100%); } }


/* =========================================
   4. BUTTONS & INPUTS
   ========================================= */
/* Prestige Button States */
.prestige-btn {
    width: 100%;
    background: linear-gradient(180deg, #1a1a1a, #101010);
    border: 1px solid #2a2a2a;
    color: #666;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    transition: all 0.2s;
    cursor: not-allowed;
}
.prestige-btn.ready {
    background: linear-gradient(180deg, #f5d76e, var(--gold));
    color: #111;
    border-color: #f0c93a;
    box-shadow: 0 8px 28px rgba(234, 179, 8, 0.28);
    cursor: pointer;
}
.prestige-btn.ready:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.opt-btn {
    width: 100%;
    background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
    border: 1px solid #262626;
    color: #888;
    padding: 14px;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: all 0.2s;
    cursor: pointer;
}
.opt-btn:hover { background: #1c1c1c; border-color: #3a3a3a; color: #fff; }

/* Buy Controls */
.buy-controls {
    display: flex; gap: 4px; 
    background: #000; padding: 4px; border-radius: 10px; border: 1px solid #222;
}
.buy-amt {
    flex: 1; padding: 8px; 
    color: #555; font-weight: 700; font-size: 0.75rem;
    border-radius: 6px; transition: 0.2s; cursor: pointer;
}
.buy-amt:hover { color: #fff; }
.buy-amt.active { background: #222; color: #fff; }
.buy-amt.active-max { background: var(--gold); color: #000; box-shadow: 0 0 10px var(--gold-glow); }

/* Modal Styles */
.modal { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.62); align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(8px); }
.modal.open { opacity: 1; }
.modal-content { background: #101412; border: 1px solid rgba(255,255,255,0.08); padding: 32px 28px; width: 90%; max-width: 440px; border-radius: 20px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,0.45); transform: scale(0.98); transition: transform 0.2s ease; }
.modal.open .modal-content { transform: scale(1); }
.modal-info-box { background: rgba(255,255,255,0.03); padding: 24px; border-radius: 12px; margin-bottom: 24px; text-align: left; font-size: 0.85rem; border: 1px solid #1f1f1f; }
.save-textarea { width: 100%; height: 120px; background: #000; border: 1px solid #222; color: var(--green); font-family: var(--font-mono); padding: 16px; margin: 24px 0; border-radius: 10px; resize: none; }
.close-modal { position: absolute; top: 20px; right: 24px; font-size: 28px; color: #444; cursor: pointer; }
.close-modal:hover { color: #fff; }

.lvl-up-btn {
    background: transparent;
    border: 0;
    color: #6d756f;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 0 0;
    margin-top: 4px;
    display: inline-block;
    transition: color 0.15s;
    font-family: var(--font-mono);
}

.lvl-up-btn.ready {
    background: transparent;
    color: var(--gold);
    box-shadow: none;
    cursor: pointer;
}

.lvl-up-btn:active { transform: scale(0.95); }

/* =========================================
   R&D — Neural Lattice
   ========================================= */

.rd-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
}

.rd-hud {
    position: relative;
    padding: 14px 14px 12px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 197, 94, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(16, 22, 18, 0.95), rgba(8, 10, 9, 0.98));
    border: 1px solid rgba(34, 197, 94, 0.18);
    overflow: hidden;
}

.rd-hud::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(34, 197, 94, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.04) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.5;
    pointer-events: none;
    animation: rd-grid-drift 18s linear infinite;
}

@keyframes rd-grid-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 18px 18px, 18px 18px; }
}

.rd-hud-main { position: relative; z-index: 1; }
.rd-hud-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(34, 197, 94, 0.75);
    font-family: var(--font-mono);
    font-weight: 700;
}
.rd-hud-title {
    margin-top: 2px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #f4f7f5;
    letter-spacing: 0.02em;
}

.rd-hud-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.rd-stat {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.rd-stat span {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b786f;
    font-family: var(--font-mono);
}
.rd-stat strong {
    display: block;
    margin-top: 3px;
    font-size: 0.95rem;
    color: #fff;
    font-family: var(--font-mono);
}

.rd-progress {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.rd-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14532d, #22c55e 55%, #86efac);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
    transition: width 0.45s cubic-bezier(0.22, 0.8, 0.2, 1);
}

.rd-legend {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.rd-legend span {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-mono);
}
.rd-legend [data-b="click"] { color: #67e8f9; border-color: rgba(103, 232, 249, 0.25); background: rgba(6, 182, 212, 0.08); }
.rd-legend [data-b="finance"] { color: #fbbf24; border-color: rgba(251, 191, 36, 0.25); background: rgba(234, 179, 8, 0.08); }
.rd-legend [data-b="infra"] { color: #4ade80; border-color: rgba(74, 222, 128, 0.25); background: rgba(34, 197, 94, 0.08); }
.rd-legend [data-b="mania"] { color: #c084fc; border-color: rgba(192, 132, 252, 0.25); background: rgba(168, 85, 247, 0.08); }
.rd-legend [data-b="apex"] { color: #f8fafc; border-color: rgba(248, 250, 252, 0.2); background: rgba(255, 255, 255, 0.05); }

.rd-viewport {
    position: relative;
    width: 100%;
    height: min(52vh, 460px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-color: #050807;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(34, 197, 94, 0.1), transparent 48%),
        radial-gradient(ellipse at 85% 90%, rgba(59, 130, 246, 0.06), transparent 42%),
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    overflow: auto;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.75);
    scrollbar-width: thin;
    scrollbar-color: #2a3a30 transparent;
}
.rd-viewport::-webkit-scrollbar { width: 6px; height: 6px; }
.rd-viewport::-webkit-scrollbar-thumb {
    background: #2f3f35;
    border-radius: 4px;
}

.rd-scan {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.55), transparent);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
    animation: rd-scan 5s ease-in-out infinite;
}
@keyframes rd-scan {
    0%, 100% { top: 4%; opacity: 0.15; }
    50% { top: 92%; opacity: 0.9; }
}

.rd-canvas {
    position: relative;
    margin: 18px auto 40px;
    filter: drop-shadow(0 0 24px rgba(34, 197, 94, 0.05));
}

.tech-tree-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.tech-nodes-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.tech-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1.6;
    stroke-linecap: round;
    transition: stroke 0.4s ease, opacity 0.4s ease;
}
.tech-line.lit {
    stroke: rgba(255, 255, 255, 0.16);
}
.tech-line.active {
    stroke-width: 2.2;
    opacity: 1;
    filter: drop-shadow(0 0 4px currentColor);
    stroke-dasharray: 6 8;
    animation: rd-flow 1.1s linear infinite;
}
.tech-line.branch-click.active { stroke: #22d3ee; color: #22d3ee; }
.tech-line.branch-finance.active { stroke: #eab308; color: #eab308; }
.tech-line.branch-infra.active,
.tech-line.branch-core.active { stroke: #22c55e; color: #22c55e; }
.tech-line.branch-mania.active { stroke: #a855f7; color: #a855f7; }
.tech-line.branch-apex.active { stroke: #f8fafc; color: #f8fafc; }

@keyframes rd-flow {
    to { stroke-dashoffset: -28; }
}

.tech-node {
    position: absolute;
    width: 54px;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
}
.tech-node:focus-visible .tech-node-core {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.tech-node-core {
    position: relative;
    width: 44px;
    height: 48px;
    display: grid;
    place-items: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #1a1f1c;
    transition: transform 0.22s cubic-bezier(0.22, 0.8, 0.2, 1), filter 0.22s ease;
}
.tech-node-core::before {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: inherit;
    background: linear-gradient(160deg, #121814, #070908 70%);
}
.tech-node-mark {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    font-weight: 800;
    color: #4b564f;
    transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}

.tech-node-label {
    max-width: 78px;
    font-size: 0.58rem;
    line-height: 1.15;
    text-align: center;
    color: #66706a;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    pointer-events: none;
}

.tech-node.is-locked {
    opacity: 0.38;
    filter: grayscale(0.85);
    cursor: default;
}
.tech-node.is-available .tech-node-core {
    background: #dce7e0;
    animation: rd-node-pulse 1.8s ease-in-out infinite;
}
.tech-node.is-available .tech-node-core::before {
    background: linear-gradient(160deg, #1a2420, #0b100d 72%);
}
.tech-node.is-available .tech-node-mark { color: #fff; }
.tech-node.is-available .tech-node-label {
    opacity: 1;
    transform: none;
    color: #c9d4cd;
}
.tech-node.is-available:hover .tech-node-core,
.tech-node.is-selected .tech-node-core {
    transform: scale(1.1);
}

.tech-node.is-researched .tech-node-core {
    filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.35));
}
.tech-node.is-researched .tech-node-mark {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
}
.tech-node.is-researched .tech-node-label {
    opacity: 1;
    transform: none;
    color: #86efac;
}

.tech-node.branch-click.is-available .tech-node-core { background: #67e8f9; }
.tech-node.branch-finance.is-available .tech-node-core { background: #fbbf24; }
.tech-node.branch-infra.is-available .tech-node-core,
.tech-node.branch-core.is-available .tech-node-core { background: #4ade80; }
.tech-node.branch-mania.is-available .tech-node-core { background: #c084fc; }
.tech-node.branch-apex.is-available .tech-node-core { background: #f8fafc; }

.tech-node.branch-click.is-researched .tech-node-mark { color: #67e8f9; text-shadow: 0 0 10px rgba(34, 211, 238, 0.7); }
.tech-node.branch-finance.is-researched .tech-node-mark { color: #fbbf24; text-shadow: 0 0 10px rgba(234, 179, 8, 0.7); }
.tech-node.branch-mania.is-researched .tech-node-mark { color: #c084fc; text-shadow: 0 0 10px rgba(168, 85, 247, 0.7); }
.tech-node.branch-apex.is-researched .tech-node-mark { color: #fff; text-shadow: 0 0 12px rgba(255, 255, 255, 0.55); }

.tech-node.is-selected .tech-node-label {
    opacity: 1;
    color: #fff;
}
.tech-node.is-unlocking .tech-node-core {
    animation: rd-unlock 0.7s cubic-bezier(0.2, 0.85, 0.25, 1.2);
}
.tech-node.is-unlocking::after {
    content: '';
    position: absolute;
    top: 22px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.8);
    animation: rd-ring-burst 0.7s ease-out forwards;
}

@keyframes rd-node-pulse {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
    50% { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.35)); }
}
@keyframes rd-unlock {
    0% { transform: scale(0.7); }
    55% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
@keyframes rd-ring-burst {
    0% { opacity: 1; transform: scale(0.4); }
    100% { opacity: 0; transform: scale(4.5); }
}

.rd-dock {
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(14, 18, 16, 0.98), rgba(8, 10, 9, 0.98));
    animation: rd-dock-in 0.28s cubic-bezier(0.22, 0.8, 0.2, 1);
}
@keyframes rd-dock-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.rd-dock-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.rd-dock-branch,
.rd-dock-status {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}
.rd-dock-branch { color: #86efac; }
.rd-dock.branch-click .rd-dock-branch { color: #67e8f9; }
.rd-dock.branch-finance .rd-dock-branch { color: #fbbf24; }
.rd-dock.branch-mania .rd-dock-branch { color: #c084fc; }
.rd-dock.branch-apex .rd-dock-branch { color: #f8fafc; }
.rd-dock-status { color: #6b786f; }
.rd-dock.is-available .rd-dock-status { color: #fff; }
.rd-dock.is-researched .rd-dock-status { color: #4ade80; }

.rd-dock-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}
.rd-dock-desc {
    margin-top: 4px;
    font-size: 0.78rem;
    color: #8a948d;
    line-height: 1.4;
}

.rd-dock-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}
.rd-dock-cost span {
    display: block;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #66706a;
    font-family: var(--font-mono);
}
.rd-dock-cost strong {
    font-size: 1rem;
    color: #fff;
    font-family: var(--font-mono);
}
.rd-dock-btn {
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.2), rgba(20, 83, 45, 0.35));
    color: #ecfdf5;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.rd-dock.can-buy .rd-dock-btn {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}
.rd-dock-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.28);
}
.rd-dock-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #333;
    background: #141414;
    color: #777;
    box-shadow: none;
}
.rd-dock-done {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4ade80;
    font-family: var(--font-mono);
}

@media (prefers-reduced-motion: reduce) {
    .rd-hud::before,
    .rd-scan,
    .tech-line.active,
    .tech-node.is-available .tech-node-core,
    .tech-node.is-unlocking .tech-node-core,
    .tech-node.is-unlocking::after,
    .rd-dock {
        animation: none !important;
    }
}

/* =========================================
   PORTFOLIO DASHBOARD (Asset Management)
   ========================================= */

.portfolio-card {
    background: linear-gradient(135deg, #0f0f11 0%, #08080a 100%);
    border: 1px solid #222;
    border-left: 4px solid #eab308; /* Gold Accent */
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
}

.portfolio-card:hover {
    background: #141416;
    transform: translateX(6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.portfolio-card.affordable {
    border-color: #444;
}
.portfolio-card.affordable:hover {
    border-color: #eab308;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.15);
}

/* Left Side: Info */
.port-info {
    display: flex; flex-direction: column; gap: 8px; flex: 1;
}

.port-header {
    display: flex; align-items: center; gap: 10px;
}
.port-header h4 {
    margin: 0; font-size: 1rem; color: #fff; font-weight: 700;
}
.port-level {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.port-stats {
    display: flex; gap: 15px; font-size: 0.7rem; color: #666;
    font-family: 'JetBrains Mono', monospace;
}
.stat-item strong { color: #ccc; }

/* Right Side: Action */
.port-action {
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    min-width: 90px; text-align: right;
}

.upgrade-preview {
    font-size: 0.6rem; color: #22c55e; font-weight: 700;
    opacity: 0; transform: translateY(5px);
    transition: all 0.2s;
}
.portfolio-card:hover .upgrade-preview {
    opacity: 1; transform: translateY(0);
}

.port-btn {
    background: #1a1a1a;
    color: #555;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    border: 1px solid #333;
    transition: all 0.2s;
}

.portfolio-card.affordable .port-btn {
    background: #eab308;
    color: #000;
    border-color: #eab308;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}

/* --- v1.1 DEAL FLOW UI --- */
.combo-hud {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 12;
}
.combo-hud.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.combo-hud #combo-count {
    display: block;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.6rem;
    color: var(--mint-accent);
    text-shadow: 0 0 20px var(--mint-glow);
    letter-spacing: 1px;
}
.combo-hud.warm #combo-count { font-size: 1.9rem; }
.combo-hud.hot #combo-count {
    font-size: 2.15rem;
    color: var(--gold);
    text-shadow: 0 0 24px var(--gold-glow);
    animation: combo-glow 0.35s ease-in-out infinite alternate;
}
.combo-hud.fever #combo-count {
    font-size: 2.4rem;
    color: #fb7185;
    text-shadow: 0 0 26px rgba(251, 113, 133, 0.7);
    animation: combo-glow 0.28s ease-in-out infinite alternate;
}
.combo-hud.max #combo-count {
    font-size: 2.7rem;
    color: #fff;
    text-shadow: 0 0 28px rgba(192, 132, 252, 0.85);
    animation: combo-glow 0.22s ease-in-out infinite alternate;
}
.combo-hud.bump #combo-count {
    animation: combo-bump 0.16s cubic-bezier(0.2, 0.85, 0.2, 1);
}
.combo-hud.bump.hot #combo-count,
.combo-hud.bump.fever #combo-count,
.combo-hud.bump.max #combo-count {
    animation:
        combo-bump 0.16s cubic-bezier(0.2, 0.85, 0.2, 1),
        combo-glow 0.32s ease-in-out infinite alternate;
}
.combo-hud .combo-sub {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #666;
}
.combo-hud.hot .combo-sub { color: #eab308; }
.combo-hud.fever .combo-sub { color: #fb7185; }
.combo-hud.max .combo-sub { color: #e9d5ff; }
@keyframes combo-glow {
    from { filter: brightness(0.85); }
    to { filter: brightness(1.25); }
}
@keyframes combo-bump {
    0% { transform: scale(0.78); }
    65% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.changelog-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cl-entry {
    border-left: 2px solid var(--green);
    padding-left: 14px;
}
.cl-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.cl-ver {
    font-weight: 900;
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.cl-date {
    font-size: 0.65rem;
    color: #555;
    font-family: var(--font-mono);
    margin-left: auto;
}
.cl-entry ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cl-entry li {
    font-size: 0.72rem;
    color: #999;
    padding: 3px 0;
    line-height: 1.4;
}
.cl-entry li::before {
    content: '▸ ';
    color: #444;
}

.achievements-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ach-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #222;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}
.ach-row.done {
    border-color: rgba(234, 179, 8, 0.25);
    background: rgba(234, 179, 8, 0.05);
}
.ach-name {
    font-weight: 800;
    font-size: 0.8rem;
    color: #ccc;
}
.ach-row.done .ach-name { color: var(--gold); }
.ach-desc {
    font-size: 0.65rem;
    color: #666;
    margin-top: 2px;
}
.ach-reward {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
}
.ach-row.done .ach-reward { color: var(--green); }

/* Toasts / tooltip / analytics (moved out of JS injection) */
#toast-container {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
    z-index: 10000; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
.toast {
    background: rgba(10, 10, 10, 0.9); border: 1px solid #333; color: #fff;
    padding: 8px 16px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    font-family: 'Outfit', sans-serif; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px); animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.success { border-color: rgba(34, 197, 94, 0.3); color: #4ade80; }
.toast.error { border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
@keyframes toast-in { from { transform: translateY(20px) scale(0.9); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-10px); opacity: 0; } }

#ui-tooltip {
    position: fixed; pointer-events: none; z-index: 11000;
    background: rgba(0, 0, 0, 0.95); border: 1px solid #333;
    padding: 10px 14px; border-radius: 8px; font-size: 0.7rem; color: #ccc;
    font-family: 'JetBrains Mono', monospace; box-shadow: 0 10px 40px rgba(0,0,0,1);
    opacity: 0; transition: opacity 0.1s;
}

.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; text-align: left; margin-top: 20px; }
.analytics-card { background: rgba(255,255,255,0.03); border: 1px solid #222; border-radius: 12px; padding: 15px; }
.analytics-card h5 { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px; color: #666; margin-bottom: 10px; }
.graph-container { height: 100px; width: 100%; position: relative; }
.stat-big { font-size: 1.2rem; font-weight: 800; color: #fff; font-family: 'JetBrains Mono'; }
.stat-sub { font-size: 0.6rem; color: #555; }

.shop-tabs { display: flex; gap: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--panel-border); padding-bottom: 12px; }
.tab-btn { font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; color: #444; cursor: pointer; transition: color 0.2s; position: relative; }
.tab-btn.active { color: var(--text-main); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -13px; left: 0; right: 0; height: 2px; background: var(--green); box-shadow: 0 0 10px var(--green-glow); }
.tab-btn#btn-tab-staff.active::after { background: #3b82f6; box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.portfolio-empty { text-align: center; padding: 40px 20px; color: #444; font-family: 'JetBrains Mono'; font-size: 0.8rem; }

.staff-card {
    background: linear-gradient(90deg, #0a111a 0%, #05080c 100%); border: 1px solid #1a2a3a;
    padding: 16px 20px; margin-bottom: 10px; border-radius: 10px;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; position: relative; overflow: hidden; transition: 0.2s;
}
.staff-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #3b82f6; box-shadow: 4px 0 20px rgba(59, 130, 246, 0.4); }
.staff-card:hover { border-color: rgba(96, 165, 250, 0.55); background: #0c1828; }
.staff-card.hired { opacity: 0.6; cursor: default; pointer-events: none; border-color: transparent; }
.staff-card.hired::before { background: #555; box-shadow: none; }