/* ---------------- GLOBAL ---------------- */
body {
    background: #000;
    color: #e0e0ff;
    font-family: Arial, sans-serif;
    text-align: center;
    padding: 0;
    margin: 0;
    position: relative;
    overflow-x: hidden;
}

/* ---------------- SIDEBAR (PERMANENT + AUTO-WIDTH) ---------------- */
#sidebar {
    width: auto;
    min-width: max-content;
    display: inline-block;

    background: rgba(0, 20, 30, 0.6);
    border-right: 2px solid #00aaff55;
    backdrop-filter: blur(6px);

    padding: 10px 12px;
    box-shadow: 4px 0 20px #003355;

    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 10;

    text-align: center;
}

#sidebar h2 {
    color: #c8faff;
    text-shadow: 0 0 10px #00aaff;
    margin-bottom: 20px;
}

/* ---------------- SIDEBAR BUTTONS ---------------- */
.sidebarBtn {
    width: auto;
    display: block;
    padding: 12px 18px;
    margin-bottom: 12px;

    background: #0a0f14;
    border: 1px solid #00aaff55;
    color: #e0e0ff;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.25s;
}

.sidebarBtn:hover {
    background: #11222f;
    box-shadow: 0 0 12px #00aaff;
}

/* ---------------- MAIN CONTENT WRAPPER ---------------- */
:root {
    --sidebar-width: 260px;
}

#content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 20px;
}

/* ---------------- STARFIELD ---------------- */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;

    background-image:
        radial-gradient(2px 2px at 20% 30%, #00ffcc55, transparent),
        radial-gradient(2px 2px at 80% 70%, #00aaff55, transparent),
        radial-gradient(2px 2px at 50% 90%, #9d63ff55, transparent);

    animation: starTwinkle 14s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes starTwinkle {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ---------------- ANIMATED NEBULA ---------------- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;

    background:
        radial-gradient(circle at 30% 40%, rgba(0,255,200,0.18), transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(0,170,255,0.18), transparent 60%),
        radial-gradient(circle at 50% 80%, rgba(157,99,255,0.18), transparent 60%);

    filter: blur(40px);
    animation: nebulaFloat 22s ease-in-out infinite alternate;
    opacity: 0.85;
}

@keyframes nebulaFloat {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(30px,-20px) scale(1.05); }
    100% { transform: translate(-20px,20px) scale(1.03); }
}

/* ---------------- TOP BAR ---------------- */
#topBar {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    text-align: left;
    margin-bottom: 25px;
}

#gameTitle {
    margin: 0;
    font-size: 34px;
    color: #c8faff;
    text-shadow: 0 0 12px #00aaff, 0 0 20px #9d63ff;
    border-bottom: 2px solid #00ffcc;
    padding-bottom: 8px;
    display: inline-block;
}

/* ---------------- HUD BAR ---------------- */
#hud {
    background: rgba(0, 255, 200, 0.06);
    border: 1px solid #00ffcc55;
    padding: 14px;
    border-radius: 12px;
    margin-top: 12px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;

    font-size: 15px;
    box-shadow: 0 0 15px #00aaff55;
}

/* ---------------- GAME PANEL ---------------- */
#game {
    background: rgba(0, 255, 200, 0.05);
    border: 2px solid #00aaff55;
    border-radius: 16px;
    padding: 22px;

    width: 100%;
    max-width: 1100px;
    margin: auto;

    box-shadow: 0 0 25px #00aaff55;
    backdrop-filter: blur(5px);
}

/* ---------------- BUTTONS ---------------- */
button {
    background: linear-gradient(135deg, #00aaff, #9d63ff);
    border: none;
    padding: 14px 20px;
    margin: 0;
    color: white;
    font-size: 17px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.25s;
    width: 100%;
    box-shadow: 0 0 12px #003355;
}

button:hover {
    background: linear-gradient(135deg, #00ffcc, #9d63ff);
    transform: scale(1.05);
    box-shadow: 0 0 18px #00ffcc;
}

/* ---------------- DANGER BUTTON ---------------- */
.dangerBtn {
    background: linear-gradient(135deg, #660000, #ff3333);
    box-shadow: 0 0 18px #ff3333;
}

.dangerBtn:hover {
    background: linear-gradient(135deg, #990000, #ff6666);
    box-shadow: 0 0 26px #ff6666;
}

/* ---------------- TOP-RIGHT RESET BUTTON ---------------- */
.topRightReset {
    position: fixed;
    top: 20px;
    right: 20px;
    width: auto;
    padding: 10px 18px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0.9;
}

.topRightReset:hover {
    opacity: 1;
}

/* ---------------- LIST LAYOUT FOR UPGRADES ---------------- */
.upgradeList {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* ---------------- TAB CONTENT ---------------- */
.tab {
    display: none;
    margin-top: 18px;
    padding: 12px;
    border-top: 1px solid #00ffcc55;
}

.tab.active {
    display: block;
}

/* ---------------- HEADERS ---------------- */
h3 {
    margin-top: 10px;
    color: #c8faff;
    text-shadow: 0 0 10px #00aaff;
}


/* ---------------- BUY MODE BAR ---------------- */
#buyMode {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;

    background: rgba(0, 255, 200, 0.05);
    border: 1px solid #00ffcc55;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 0 12px #00aaff55;
}

/* ---------------- BUY MODE BUTTONS ---------------- */
.buyBtn {
    width: auto;
    padding: 8px 16px;
    font-size: 15px;
    border-radius: 8px;

    background: #0a0f14;
    border: 1px solid #00aaff55;
    color: #e0e0ff;

    cursor: pointer;
    transition: 0.25s;
}

.buyBtn:hover {
    background: #11222f;
    box-shadow: 0 0 10px #00aaff;
}

/* ACTIVE BUY MODE BUTTON */
.buyBtn.active {
    background: linear-gradient(135deg, #00aaff, #00ffcc);
    color: #000;
    border-color: #00ffcc;
    box-shadow: 0 0 15px #00ffcc;
    transform: scale(1.05);
}

/* ---------------- UPGRADE BUTTON SPACING ---------------- */
.upgradeList button {
    text-align: center;
    line-height: 1.4;
    padding: 16px 20px;
}



.achievementPopup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,255,200,0.15);
    border: 1px solid #00ffcc;
    padding: 12px 18px;
    border-radius: 10px;
    color: #c8faff;
    font-size: 16px;
    box-shadow: 0 0 12px #00ffcc;
    display: none;
    z-index: 99999;
}
