:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #333; /* Dark Grey */
    --background-color: #222; /* Dark background */
    --text-color: #f4f4f4; /* Light text */
    --accent-color: #FFC107; /* Amber for accents */
    --font-family: 'Poppins', sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
}

body {
    padding: 0; /* Remove body padding, manage space via JS */
    position: relative; /* For pseudo-elements and touch overlays */
}

/* Simple Cityscape Silhouette */
body::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15%; /* Adjust height as needed */
    background: linear-gradient(to bottom, transparent, rgba(20, 20, 20, 0.8) 30%, #111 100%);
    /* Optional: Add some jaggedness */
    /* clip-path: polygon(0% 100%, 0% 40%, 5% 45%, 10% 35%, ... 100% 40%, 100% 100%); */
    z-index: 0; /* Behind main content */
}

/* Twinkling Lights using box-shadow */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    background: transparent; /* Element itself is invisible */
    z-index: 0; /* Behind main content */
    /* Multiple shadows for stars/lights */
    box-shadow: 
        /* Format: x y blur size color */
        /* Adjust positions (%) and add more for desired density */
        5vw 10vh 0 1px var(--accent-color),
        15vw 40vh 0 2px white,
        25vw 20vh 0 1px var(--accent-color),
        35vw 60vh 0 1px white,
        45vw 5vh 0 2px white,
        55vw 70vh 0 1px var(--accent-color),
        65vw 25vh 0 1px white,
        75vw 50vh 0 2px white,
        85vw 15vh 0 1px var(--accent-color),
        95vw 65vh 0 1px white;
    animation: twinkle 3s infinite alternate ease-in-out;
}

@keyframes twinkle {
    0% { box-shadow: 
            5vw 10vh 0 1px rgba(255, 193, 7, 0.5),
            15vw 40vh 0 2px rgba(255, 255, 255, 0.3),
            /* ... repeat for all shadows, adjusting opacity ... */
            25vw 20vh 0 1px rgba(255, 193, 7, 0.5),
            35vw 60vh 0 1px rgba(255, 255, 255, 0.3),
            45vw 5vh 0 2px rgba(255, 255, 255, 0.3),
            55vw 70vh 0 1px rgba(255, 193, 7, 0.5),
            65vw 25vh 0 1px rgba(255, 255, 255, 0.3),
            75vw 50vh 0 2px rgba(255, 255, 255, 0.3),
            85vw 15vh 0 1px rgba(255, 193, 7, 0.5),
            95vw 65vh 0 1px rgba(255, 255, 255, 0.3);
     }
    100% { box-shadow: 
            5vw 10vh 0 1px var(--accent-color),
            15vw 40vh 0 2px white,
            /* ... repeat for all shadows ... */
            25vw 20vh 0 1px var(--accent-color),
            35vw 60vh 0 1px white,
            45vw 5vh 0 2px white,
            55vw 70vh 0 1px var(--accent-color),
            65vw 25vh 0 1px white,
            75vw 50vh 0 2px white,
            85vw 15vh 0 1px var(--accent-color),
            95vw 65vh 0 1px white;
     }
}

h1#game-title {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 0;
    margin: 0;
    background-color: rgba(34, 34, 34, 0.8); /* Slight background for visibility */
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.8rem; /* Adjusted base size */
    text-align: center;
    z-index: 10; /* High z-index */
    box-sizing: border-box;
}

#game-container {
    position: absolute; /* JS will set top, left, width, height */
    display: flex; /* To center canvas inside */
    justify-content: center;
    align-items: center;
    z-index: 1;
}

canvas#gameCanvas {
    /* ... border, display, touch-action, aspect-ratio remain ... */
    /* width, height are effectively controlled by JS via container scaling */
    border: none;
    display: block;
    width: auto;
    height: auto;
    aspect-ratio: 800 / 600;
    touch-action: none;
    /* z-index not strictly needed if container handles layering */
}

#footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 10px;
    margin: 0;
    background-color: rgba(34, 34, 34, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-sizing: border-box;
}

#stats-display {
    /* ... styles like font-size, colors remain ... */
    /* background-color: var(--secondary-color); NO, use footer-bar bg */
    border-radius: 0; /* No specific radius */
    font-size: 0.9rem;
    padding: 0;
    flex-grow: 1;
    text-align: center;
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.3); NO */
}

#facility-display {
    text-align: right;
    margin-left: 10px;
}

#facility-display canvas#facilityCanvas {
    /* ... border, background-color, border-radius ... */
    border: 1px solid var(--secondary-color);
    background-color: rgba(51, 51, 51, 0.7);
    border-radius: 5px;
    display: inline-block; /* Align with button */
    vertical-align: middle;
}

#fullscreen-btn {
    /* ... styles ... */
    padding: 5px 8px;
    font-size: 1.2rem;
    vertical-align: middle;
    margin-left: 5px;
    /* position: absolute; NO */
}

/* Mobile touch controls */
.touch-area {
    position: fixed;
    top: 0;
    width: 50vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem; 
    color: rgba(255, 255, 0, 0.3); /* YELLOW, semi-transparent for debugging */
    user-select: none;
    z-index: 2; 
}
#touch-left { left: 0; pointer-events: auto; /* Make active */ }
#touch-right{ right: 0; pointer-events: auto; /* Make active */ }

/* Fullscreen button style */
#fullscreen-btn {
    position: absolute; /* Position relative to facility-display */
    bottom: 5px;
    left: 5px; /* Place it to the left of the facility canvas */
    background-color: rgba(50, 50, 50, 0.7);
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 4; /* Above other overlays */
}

.mobile-only-btn { display: block; }

/* Show controls only on small screens */
@media (min-width: 768px) {
    .touch-area { display: none; }
    .mobile-only-btn { display: none; } /* Hide fullscreen btn on larger screens */
}

/* --- Responsive Adjustments --- */

/* General Mobile Portrait */
@media (orientation: portrait) and (max-width: 767px) {
    h1#game-title { font-size: 1.3rem; padding: 8px 0; }
    #footer-bar { padding: 5px 8px; flex-direction: column-reverse; align-items: center; }
    #stats-display { font-size: 0.75rem; margin-top: 5px; width: 100%; }
    #facility-display { margin-left: 0; margin-bottom: 5px; }
    #facility-display canvas#facilityCanvas { width: 100px; height: 100px; }
    #fullscreen-btn { font-size: 1rem; }
}

/* Landscape phones with very small height – hide overlays */
@media (orientation: landscape) and (max-height: 450px) {
    h1#game-title, #footer-bar { display: none; }
    .touch-area { font-size: 1.5rem; color: rgba(255,255,255,0.2); }
}

/* Tablet (adjust base sizes if needed) */
@media (min-width: 768px) {
    h1#game-title { font-size: 2rem; padding: 12px 0; }
    #footer-bar { padding: 10px 15px; }
    #stats-display { font-size: 1rem; }
}

/* Desktop (adjust base sizes if needed) */
@media (min-width: 1024px) {
    h1#game-title { font-size: 2.2rem; padding: 15px 0; }
    #footer-bar { padding: 12px 20px; }
    #stats-display { font-size: 1.1rem; }
} 