:root {
    --p-neon: #bc13fe; --g-neon: #39ff14; --b-neon: #00f3ff;
    --danger: #ff003c; --toxic: #ccff00;
    --glass: rgba(10, 10, 10, 0.85);
}

* { box-sizing: border-box; }

body {
    background: #050505; color: #fff; margin: 0; padding: 0;
    font-family: 'Rajdhani', sans-serif; height: 100vh; width: 100vw;
    display: flex; flex-direction: column; 
    overflow: hidden; user-select: none; position: fixed;
}

.ca-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 0 10px;
    background: linear-gradient(90deg, #030803 0%, #071407 40%, #050505 100%);
    border-bottom: 1px solid var(--g-neon);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.28), inset 0 -1px 0 rgba(57, 255, 20, 0.15);
    overflow: hidden;
}

.ca-live-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    padding: 0 8px;
    border: 1px solid var(--g-neon);
    border-radius: 3px;
    background: rgba(0, 20, 0, 0.85);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.25);
    white-space: nowrap;
}

.live-led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--g-neon);
    box-shadow: 0 0 8px var(--g-neon);
    animation: liveBlink 0.9s ease-in-out infinite;
}

.live-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    letter-spacing: 1px;
    color: var(--g-neon);
    text-shadow: 0 0 6px var(--g-neon);
}

.ca-marquee {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.ca-track {
    display: flex;
    width: max-content;
    animation: tickerSlide 22s linear infinite;
}

.ca-unit {
    display: inline-flex;
    align-items: center;
    padding: 0 28px 0 0;
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    color: #c8ffc8;
    white-space: nowrap;
}

.ca-unit b {
    color: var(--g-neon);
    text-shadow: 0 0 8px var(--g-neon);
    font-weight: 400;
}

.ca-unit i {
    font-style: normal;
    color: #fff;
}

.ca-copy {
    position: relative;
    flex-shrink: 0;
    height: 22px;
    min-width: 46px;
    padding: 0 10px;
    border: 1px solid var(--g-neon);
    border-radius: 4px;
    background: #041204;
    color: var(--g-neon);
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    animation: copyGlow 1.2s ease-in-out infinite;
    z-index: 2;
}

.ca-copy:hover {
    background: var(--g-neon);
    color: #000;
}

.ca-copy.copied {
    border-color: #fff;
    color: #000;
    background: var(--g-neon);
    animation: none;
}

.ca-pulse {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.7);
    animation: pulseRing 1.4s ease-out infinite;
    pointer-events: none;
}

.ca-scan {
    position: absolute;
    top: 0;
    left: -20%;
    width: 18%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.18), transparent);
    animation: scanSweep 3.6s linear infinite;
    pointer-events: none;
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(0.75); }
}

@keyframes tickerSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes copyGlow {
    0%, 100% { box-shadow: 0 0 6px var(--g-neon); }
    50% { box-shadow: 0 0 16px var(--g-neon), 0 0 28px rgba(57, 255, 20, 0.5); }
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(57, 255, 20, 0); }
    100% { box-shadow: 0 0 0 0 rgba(57, 255, 20, 0); }
}

@keyframes scanSweep {
    0% { transform: translateX(0); }
    100% { transform: translateX(700%); }
}

.tok-mini {
    flex-shrink: 0;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    height: 22px;
    line-height: 20px;
    padding: 0 8px;
    border: 1px solid;
    background: #050505;
    white-space: nowrap;
    z-index: 2;
}

.buy-high {
    border-color: var(--g-neon);
    color: var(--g-neon);
    text-shadow: 0 0 8px var(--g-neon);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
    animation: buyPulse 1.6s ease-in-out infinite;
}

.buy-high:hover {
    background: var(--g-neon);
    color: #000;
    text-shadow: none;
}

.buy-high-main {
    display: block;
    width: fit-content;
    margin: 0 auto 12px;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 36px;
    border: 2px solid var(--g-neon);
    color: var(--g-neon);
    background: rgba(0, 0, 0, 0.7);
    text-shadow: 0 0 8px var(--g-neon);
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.4), inset 0 0 12px rgba(57, 255, 20, 0.12);
    animation: buyPulse 1.6s ease-in-out infinite;
}

.buy-high-main:hover {
    background: var(--g-neon);
    color: #000;
    text-shadow: none;
}

.tg-btn {
    border-color: var(--b-neon);
    color: var(--b-neon);
}

.tg-btn:hover {
    background: var(--b-neon);
    color: #000;
}

.dex-link {
    border-color: var(--p-neon);
    color: var(--p-neon);
}

.dex-link:hover {
    background: var(--p-neon);
    color: #000;
}

@keyframes buyPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(57, 255, 20, 0.3); }
    50% { box-shadow: 0 0 16px rgba(57, 255, 20, 0.7); }
}

.research-monitor {
    position: absolute;
    top: calc(50% - 300px);
    left: calc(5% - 10px); 
    width: 220px;
    height: 160px;
    background: #000;
    border: 2px solid #333;
    border-radius: 6px;
    z-index: 15;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.monitor-header {
    background: #111;
    color: #555;
    font-size: 10px;
    padding: 4px 8px;
    border-bottom: 1px solid #333;
    display: flex; align-items: center; gap: 5px;
    font-family: 'Orbitron';
}

.rec-dot { width: 6px; height: 6px; background: red; border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.monitor-screen {
    flex-grow: 1;
    background: radial-gradient(circle, #0a1a0a 0%, #000 90%);
    padding: 8px;
    color: var(--g-neon);
    font-family: 'VT323', monospace; 
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    white-space: pre-wrap;
    text-shadow: 0 0 2px var(--g-neon);
    opacity: 0.9;
}

.monitor-glare {
    position: absolute; inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.fan-wrapper { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.fan { 
    position: absolute; 
    width: 200px; 
    opacity: 0.5; mix-blend-mode: screen; 
}

.fan-left { top: 50%; left: 5%; transform: translateY(-50%); }
.fan-right { top: 50%; right: 5%; transform: translateY(-50%); }
.fan-mobile { display: none; }


/* FIXED: buttons are now position:fixed with crazy high z-index → guaranteed clickable */
.fan-button {
    position: fixed;                    /* ← changed from absolute */
    width: 200px;
    height: 60px;
    background: rgba(10, 10, 10, 0.95);
    border: 3px solid var(--b-neon);
    border-radius: 8px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    text-shadow: 0 0 10px currentColor;
    box-shadow: 0 0 20px currentColor;
    z-index: 9999;                      /* ← insane z-index so nothing can cover them */
    pointer-events: auto !important;
    text-decoration: none !important;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}
.fan-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px currentColor;
}
.fan-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 40%;
    height: 300%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-25deg);
    animation: shine 2.5s linear infinite;
}
@keyframes shine {
    0% { transform: translateX(-150%) skewX(-25deg); }
    100% { transform: translateX(300%) skewX(-25deg); }
}

/* specific colors */
.dex-btn {
    left: 5%;
    top: calc(50% + 115px);
    border-color: var(--g-neon);
    color: var(--g-neon);
}
.pump-btn {
    right: 5%;
    top: calc(50% + 115px);
    border-color: var(--p-neon);
    color: var(--p-neon);
}


.uv-lamps {
    position: fixed; top: 30px; left: 50%; transform: translateX(-50%);
    width: 320px; height: 50px; background: #111; border-radius: 0 0 25px 25px;
    z-index: 100; border: 1px solid #333; transition: 0.3s;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.8);
}
.uv-active .uv-lamps { border-color: var(--p-neon); box-shadow: 0 0 40px var(--p-neon), inset 0 0 20px var(--p-neon); }
.uv-lamps.overheat { border-color: var(--danger); box-shadow: 0 0 60px var(--danger), inset 0 0 30px var(--danger); animation: shake 0.5s infinite; }
.timer-integrated { font-family: 'Orbitron'; font-size: 11px; color: #555; display: flex; gap: 8px; margin-top: 2px; }
.timer-digits { color: #888; letter-spacing: 1px; }
.uv-active .timer-digits { color: #fff; text-shadow: 0 0 5px #fff; }
.uv-lamps.overheat .timer-digits { color: var(--danger); }


.uv-overlay { position: fixed; inset: 0; z-index: 5; opacity: 0; pointer-events: none; background: radial-gradient(circle at top, rgba(188, 19, 254, 0.4), transparent 70%); transition: opacity 0.2s; }
.uv-active .uv-overlay { opacity: 1; }
.heat-overlay { position: fixed; inset: 0; z-index: 6; opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, transparent 90%); transition: opacity 1s ease; }
body.heat-active .heat-overlay { opacity: 1; animation: alarmPulse 1s infinite; }
.toxic-overlay { position: fixed; inset: 0; z-index: 7; opacity: 0; pointer-events: none; background: radial-gradient(circle, rgba(204, 255, 0, 0.3) 0%, transparent 90%); box-shadow: inset 0 0 150px var(--toxic); transition: opacity 0.5s ease; }
body.toxic-active .toxic-overlay { opacity: 1; animation: toxicPulse 0.4s infinite alternate; }

@keyframes shake { 0% { transform: translateX(-51%); } 50% { transform: translateX(-49%); } 100% { transform: translateX(-50%); } }
.uv-active .uv-lamps { top: 30px; }
.uv-lamps.overheat { top: 30px; }
@keyframes alarmPulse { 0% { opacity: 0.3; background-color: rgba(255,0,0,0.1); } 50% { opacity: 0.8; background-color: rgba(255,0,0,0.3); } 100% { opacity: 0.3; background-color: rgba(255,0,0,0.1); } }
@keyframes toxicPulse { from { filter: hue-rotate(0deg); opacity: 0.8; } to { filter: hue-rotate(20deg); opacity: 1; } }


.hud-top { display: flex; justify-content: center; gap: 15px; margin-top: 88px; z-index: 10; position: relative;}
.sensor { padding: 10px 20px; border-radius: 8px; text-align: center; border: 1px solid #333; background: var(--glass); backdrop-filter: blur(5px); }
.sensor .label { display: block; font-size: 10px; color: #888; margin-bottom: 5px; }
.sensor .val { font-family: 'Orbitron'; font-size: 16px; text-shadow: 0 0 5px currentColor; }
.neon-g { color: var(--g-neon); } .neon-b { color: var(--b-neon); }
.scene { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 10; overflow: hidden; }
.sloth-container { position: relative; width: 350px; max-width: 90%; }
#main-character { width: 100%; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(0,0,0,0.8)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.animation-gif { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 5; pointer-events: none; }


.radio-dock {
    position: absolute; right: calc(5% + 10px); top: calc(50% - 300px); 
    width: 180px; padding: 15px; border-radius: 12px; border: 1px solid var(--b-neon);
    z-index: 20; background: rgba(0,0,0,0.95);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}
.visualizer { display: flex; justify-content: space-between; align-items: flex-end; height: 40px; margin-bottom: 12px; border-bottom: 1px solid #333; padding-bottom: 5px; }
.v-bar { width: 12px; background: #333; border-radius: 2px 2px 0 0; height: 2px; transition: height 0.05s ease; }
.radio-on .v-bar:nth-child(odd) { background: var(--p-neon); box-shadow: 0 0 5px var(--p-neon); }
.radio-on .v-bar:nth-child(even) { background: var(--b-neon); box-shadow: 0 0 5px var(--b-neon); }
.tuner-info { text-align: center; margin-bottom: 10px; background: #111; padding: 8px; border-radius: 4px; border: 1px solid #333;}
.freq { font-family: 'Orbitron'; font-size: 20px; }
.track-name { font-size: 9px; color: #666; white-space: nowrap; overflow: hidden; text-transform: uppercase; margin-top: 2px;}
.tuner-ctrl { display: flex; justify-content: space-between; gap: 5px; }
.tuner-ctrl button { background: #222; border: 1px solid #444; color: #fff; cursor: pointer; padding: 8px; flex-grow: 1; font-family: 'Orbitron'; transition: 0.2s; }
.tuner-ctrl button:hover { background: #333; border-color: #666; }
.pwr-btn { color: #ff003c !important; border-color: #500 !important; font-size: 10px; }
.radio-on .pwr-btn { text-shadow: 0 0 5px #ff003c; border-color: #ff003c !important; }

/* --- FOOTER --- */
.footer-ui { background: rgba(0,0,0,0.95); padding: 20px; border-top: 1px solid #222; position: relative; z-index: 50;}
.action-bar { display: flex; justify-content: center; gap: 15px; margin-bottom: 15px; }
.btn-main { padding: 18px 30px; border: 2px solid; background: rgba(0,0,0,0.5); color: #fff; font-family: 'Orbitron'; cursor: pointer; transition: 0.2s; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.water { border-color: var(--b-neon); box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.2); }
.water:active { background: var(--b-neon); color: #000; }
.uv { border-color: var(--p-neon); box-shadow: inset 0 0 10px rgba(188, 19, 254, 0.2); }
.uv:active { background: var(--p-neon); color: #000; }
.fert { border-color: var(--g-neon); box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.2); }
.fert:active { background: var(--g-neon); color: #000; }
.mint { border-color: var(--p-neon); box-shadow: inset 0 0 10px rgba(188, 19, 254, 0.2); text-decoration: none; }
.mint:active { background: var(--p-neon); color: #000; }
.market { border-color: var(--g-neon); box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.2); text-decoration: none; }
.market:active { background: var(--g-neon); color: #000; }
.license { border-color: var(--p-neon); box-shadow: inset 0 0 10px rgba(188, 19, 254, 0.2); text-decoration: none; }
.license:active { background: var(--p-neon); color: #000; }
.select { border-color: #555; box-shadow: none; opacity: 0.5; }
.btn-main:disabled { opacity: 0.3; cursor: not-allowed; border-color: #555; box-shadow: none; }
.links-grid { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.links-grid a { color: #555; text-decoration: none; font-size: 10px; border: 1px solid #222; padding: 5px 10px; transition: 0.2s; }
.links-grid a:hover { color: var(--g-neon); border-color: var(--g-neon); background: rgba(57, 255, 20, 0.1); }


@media (max-width: 800px) {
    .research-monitor { display: none; } 
    .fan-left, .fan-right { display: none; }
    .fan-mobile { display: block; width: 90vw; max-width: 300px; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 0; opacity: 0.15; }
    
    /* mobile positioning */
    .dex-btn, .pump-btn {
        width: 42%;
        height: 52px;
        font-size: 15px;
        top: calc(50% + 165px);
    }
    .dex-btn { left: 8%; }
    .pump-btn { right: 8%; }
    
    .radio-dock { position: relative; right: auto; top: auto; width: 85%; margin: 10px auto; order: -1; }
    .hud-top { margin-top: 86px; padding: 10px; flex-wrap: wrap; gap: 10px; justify-content: center; }
    .sensor { padding: 5px 10px; min-width: 60px; }
    .sensor .val { font-size: 14px; }
    .action-bar { flex-direction: column; width: 85%; margin: 0 auto 15px auto; }
    .btn-main { width: 100%; padding: 15px; }
    .uv-lamps { width: 90%; }
    .live-text { display: none; }
    .tok-mini { padding: 0 6px; font-size: 8px; }
    .ca-unit { font-size: 14px; }
    .buy-high-main { font-size: 14px; padding: 10px 22px; margin: 0 auto 10px; }
    .sloth-container { width: 100%; max-width: none; }
    .links-grid { gap: 5px; }
    .scene { justify-content: flex-start; overflow-y: auto; }
    #main-character { height: auto; width: 100%; object-fit: contain; }
}

.license-page {
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

.license-monitor {
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.license-container {
    width: 90%;
    max-width: 800px;
    margin: 80px auto 40px;
    padding: 40px 30px;
    border: 2px solid var(--b-neon);
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.3);
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.6;
}

.license-container h1 {
    font-family: 'Orbitron';
    text-align: center;
    color: var(--p-neon);
    margin-bottom: 30px;
    text-shadow: 0 0 15px var(--p-neon);
}

.license-text ul {
    margin: 15px 0 25px 30px;
    color: var(--g-neon);
}

.contract-info {
    margin-top: 30px;
    padding: 15px;
    background: rgba(0,0,0,0.6);
    border: 1px solid #333;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    line-height: 1.8;
}

.back-btn {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
    padding: 18px 50px;
    font-size: 1.1rem;
    border-color: var(--g-neon);
    background: rgba(0,0,0,0.5);
}

.back-btn:hover {
    background: var(--g-neon);
    color: #000;
    box-shadow: 0 0 30px var(--g-neon);
}

@media (max-width: 800px) {
    .license-container { padding: 25px 20px; margin: 60px 5% 30px; }
    .license-container h1 { font-size: 1.6rem; }
}