body{
    background-color: black;
    margin: 0; 
    user-select: none; 
    overflow: hidden;
    font-family: 'Orbitron', sans-serif;
    cursor: none;
}
.custom-cursor {
    position: absolute;
    pointer-events: none;
    font-size: 15px;
    transform: translate(-50%, -50%);
    color: cyan;
}
.game-canvas {
    background-color: black;
    border-left: 1px solid white;
    border-right: 1px solid white;
    padding-bottom: 1px;
}
button {
    cursor: none;
    font-family: 'Orbitron', sans-serif;
}



/* --- HOME SCREEN, PAUSE SCREEN --- */
.home-screen{
    position: absolute;
    top: 53px;
    color: white;

    display: flex;
    flex-flow: column nowrap;
    height: 100%;
    width: 50%;

    min-width: 750px;
}
.pause-screen{
    position: absolute;
    top: 130px;
    color: white;

    display: none;
    flex-flow: column nowrap;
    gap: 20px;
}
.home-screen .name {
    font-size: 50px;
    display: flex;
    flex-flow: row nowrap;
    margin-bottom: 20px;
}

.home-screen .buttons {
    font-size: 50px;
    display: flex;
    flex-flow: column nowrap;
    gap: 20px;
}
.home-screen button, .pause-screen button{
    width: 250px;
    background: none;
    color: grey;
    border: none;
    font-size: 30px;
    height: 50px;
    transition: all 0.5s ease;
    text-align: left;
    border-bottom: 1px solid grey;
}
.home-screen button:hover, .pause-screen button:hover{
    color: white;
    border-bottom: 1px solid white;
    animation: 1s ease;
    width: 270px;
    transform: translate(3px, -3px);
}


/* --- CONTROLS PANEL (Redesigned) --- */
.controls-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 40%;
    min-width: 400px;
    height: 90%;
    padding-right: 60px;
    padding-left: 30px;
    padding-top: 30px;

    background: rgba(10, 10, 20, 0.9);
    border: 2px solid cyan;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);

    display: none;
    flex-direction: column;
    gap: 30px;
    z-index: 1200;

    animation: fadeIn 0.3s ease-out forwards;
}


/* Title bar */
.controls-panel .title-container {
    width: 100%;
    font-size: 40px;
    font-weight: bold;
    color: cyan;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

/* Exit button */
.controls-panel button {
    position: absolute;
    top: 15px;
    right: 15px;

    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.controls-panel button img {
    width: 60px;
}

.controls-panel button:hover {
    transform: scale(1.15);
}

/* Layout for each control row */
.controls-panel .control {
    display: flex;
    justify-content: space-between;
    align-items: center;

    width: 100%;
    padding: 12px 20px;

    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.15s ease, background 0.25s ease;
}

.controls-panel .control:hover {
    background: rgba(0, 255, 255, 0.12);
    transform: scale(1.02);
}

/* Key name */
.controls-panel .key {
    width: 35%;
    font-size: 20px;
    color: cyan;
    text-shadow: 0 0 8px cyan;
}

/* Description */
.controls-panel .action {
    width: 60%;
    text-align: right;
    font-size: 20px;
    color: white;
    letter-spacing: 0.5px;
}


/* --- HOME BUTTON --- */
.home-button-container {
    position: absolute;
    display: none;
    top: 15px;
}
.home-button-container button {
    background: none;
    cursor: none;
    border: none;
}
.home-button-container button:hover {
    transform: scale(1.1);
}
.home-button-container button img {
    width: 120px;
}



/* --- STATS --- */
.game-loop{
    display: none;
}

.stats{
    top: 20px;
    position: absolute;
    display: flex;
    flex-flow: row nowrap;
    gap: 10px;
}
.stats div {
    display: flex;
    flex-flow: column nowrap;
    gap: 5px;
}

.stats .map-canvas {
    border: 0.5px solid white;
    background-color: black;
}
.stats .percentage-container {
    display: flex;
    flex-flow: row nowrap;
    font-size: 10px;
    justify-content: space-between;
    color: white;
}

.stats .health-container {
    width: 220px;
    height: 20px;
}
.stats .energy-bar {
    width: 220px;
    height: 20px;
    background-color: rgba(0,255,255,1);
}

.stats .health-container {
    display: flex;
    flex-flow: row nowrap;
    gap: 5px;
}
.stats .health-container .health-bar {
    width: 40px;
    height: 20px;
    background-color: white;
}



/* --- COINS --- */
.coins-display {
    bottom: 20px;
    position: absolute;
    display: flex;
    flex-flow: row nowrap;
    gap: 30px;
    border-bottom: 1px solid white ;
    color: white;
}
.coins-display img {
    width: 20px;
}



/* --- ENTITIES --- */
.entities-display {
    position: absolute;
    /* width: 100px; */
    height: 108px;
    bottom: 15px;
    display: flex;
    flex-flow: row nowrap;
    gap: 20px;
}
.spawner-display, .tower-display {
    border: 0.5px solid white;
    background-color: black;
    width: 100px;
}
.spawner-display {
    transform: scale(1.2);
}
.tower-display {
    opacity: 0;
}
.entity-icon{
    width: 90px;
}  
.price-display {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 3px;
    margin-right: 10px;
}
.key-notation{
    color: white;
    font-size: 10px;
    margin-left: 5%;
}
.price-icon {
    width: 12px;
    margin-left: 40%;
}
.price-counter{
    color: white;
    font-size: 12px;
}



/* --- OPTIONS PANEL --- */
.options-panel {
    cursor: default;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    min-width: 450px;

    width: 40%;
    height: 90%;
    padding: 30px 40px;
    background: rgba(10, 10, 20, 0.9);
    border: 2px solid cyan;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

/* --- Title Bar --- */
.options-panel .title-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    font-size: 40px;
    font-weight: bold;
    color: cyan;
    /* text-shadow: 0 0 10px rgba(0, 255, 255, 0.8); */
    letter-spacing: 1px;
}

.options-panel .title-container button {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.options-panel .title-container button:hover {
    transform: scale(1.2);
}

.options-panel .title-container button img {
    width: 60px;
}

/* --- Containers --- */
.options-panel .containers {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

/* --- Upper and Lower Sections --- */
.options-panel .upper-container,
.options-panel .lower-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- Individual Options --- */
.options-panel .option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.options-panel .option:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.02);
}

/* --- Text Labels --- */
.options-panel .option .name {
    font-size: 22px;
    color: white;
    letter-spacing: 0.5px;
}

/* --- Checkboxes --- */
.options-panel .option-check input[type="checkbox"] {
    width: 25px;
    height: 25px;
    accent-color: cyan;
    cursor: pointer;
}

/* --- Range Sliders --- */
.options-panel .option-range input[type="range"] {
    width: 150px;
    cursor: pointer;
    accent-color: cyan;
}

/* --- Small unit labels (s, %) --- */
.options-panel .option-range .name:last-child {
    font-size: 20px;
    color: #aaa;
}
.options-panel {
    animation: fadeIn 0.3s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.option-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Style the range input */
.option-range input[type="range"] {
    width: 150px;
    height: 6px;
    background: rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

/* Range thumb styling */
.option-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: cyan;
    box-shadow: 0 0 10px cyan;
    transition: transform 0.15s;
}
.option-range input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* The numeric value beside the unit */
.range-value {
    font-size: 22px;
    color: cyan;
    min-width: 40px;
    text-align: right;
    text-shadow: 0 0 8px cyan;
}

/* The “s” and “%” units */
.option-range .name:last-child {
    font-size: 20px;
    color: #aaa;
}
/* --- SAVE CHANGES BUTTON --- */
.save-changes-button {
    align-self: center;
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 22px;
    font-weight: bold;
    color: cyan;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid cyan;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transition: all 0.25s ease;
}

/* Hover effect */
.save-changes-button:hover {
    background: cyan;
    color: #0a0a14;
    transform: scale(1.05);
    box-shadow: 0 0 25px cyan, 0 0 50px rgba(0, 255, 255, 0.3);
}

/* Pressed effect */
.save-changes-button:active {
    transform: scale(0.98);
    box-shadow: 0 0 10px cyan;
}

/* If you want it fixed to the bottom of the panel */
.options-panel .save-changes-button {
    margin-top: 10px;
    width: fit-content;
    align-self: center;
}







/* --- RESULTS-DISPLAY --- */
.results-display {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 40%;
    height: auto;
    min-height: 320px;
    padding: 30px 20px;

    background: rgba(20, 20, 30, 0.5);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(100, 100, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.results-display .result {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-display .result:last-child {
    border-bottom: none;
}

.results-display .result span:first-child {
    color: #7fe7ff;
    font-weight: 500;
}

.results-display .result span:last-child {
    color: #ffffff;
    font-weight: 600;
}

.revive-buttton {
    margin-top: 25px;
    padding: 12px 28px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    font-weight: 600;
    color: #fff;
    background: rgb(0,255,255);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    display: none;
    flex-flow: row nowrap;
    align-items: center;
    gap: 5px;

    animation: pulse 0.7s linear infinite;
}
@keyframes pulse{
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.add-icon {
    width: 30px;
}
.revive-buttton:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 224, 255, 0.5);
    background:none;
    border: 1px solid cyan;
}

.revive-buttton:active {
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(0, 224, 255, 0.3);
}




/* --- MESSAGE-LOG --- */
.message-log {
  position: absolute;
  top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 25px;
  pointer-events: none; /* So it doesn’t block clicks */
}


/* --- FOOTER LINKS --- */
.footer-links {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    margin-top: 40px;

   /* position: absolute;
    bottom: 60px;*/
    cursor: none;
}

.footer-links a {
    color: rgba(0, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: none;
}

.footer-links a:hover {
    color: rgb(0, 255, 255);
    text-shadow: 0 0 8px cyan;
}

.footer-links span {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
    font-size: 20px;
}