/* Uptime! - Game Styles */

/* Pixel Font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    overflow: hidden;
    font-family: 'Press Start 2P', cursive;
}

/* Font size utilities for pixel font (it's quite large by default) */
.text-xs { font-size: 6px; }
.text-sm { font-size: 8px; }
.text-md { font-size: 10px; }
.text-lg { font-size: 12px; }
.text-xl { font-size: 16px; }

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #eee;
}

.loading-content h1 {
    font-size: 48px;
    margin-bottom: 40px;
    color: #4a9eff;
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
}

.loading-bar-container {
    width: min(400px, 80vw);
    height: 24px;
    background: #333;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 2px solid #4a9eff;
}

/* Mobile responsive loading screen */
@media (max-width: 600px) {
    .loading-content h1 {
        font-size: 32px;
        margin-bottom: 24px;
    }

    #loading-text {
        font-size: 12px;
    }
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4a9eff, #00d4ff);
    transition: width 0.2s ease;
}

#loading-text {
    font-size: 16px;
    color: #888;
}

/* Game Container */
#game-container {
    display: none;
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0a15;
}

#game-container.active {
    display: flex;
}

/* Game Wrapper - Contains UI layer with embedded canvas */
#game-wrapper {
    position: relative;
    /* Base size: 768x576 total (includes 28px infobar + 32px taskbar = 60px) */
    width: 768px;
    height: 576px;
    /* Will be scaled by JavaScript */
    /* Clip UI elements that animate outside bounds (e.g., startmenu) */
    overflow: hidden;
}

/* UI Layer - Main flexbox container for all UI elements */
#ui-layer {
    width: 100%;
    height: 100%;
    /* Flexbox layout: infobar, canvas-area, taskbar */
    display: flex;
    flex-direction: column;
    /* Layer itself is NOT clickable - allows canvas to receive events */
    pointer-events: none;
    /* UI uses system fonts, not pixel font */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
}

/* Canvas Area - Contains canvas and window overlays */
.canvas-area {
    flex: 1;
    position: relative;
    /* Allow canvas clicks to pass through */
    pointer-events: none;
}

#game-canvas {
    /* Canvas fills the canvas-area */
    width: 100%;
    height: 100%;
    /* Pixel-perfect rendering */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #000;
    /* Canvas receives pointer events */
    pointer-events: auto;
}

/* Only actual UI elements are clickable */
#ui-layer .infobar,
#ui-layer .taskbar,
#ui-layer .window-area.active,
#ui-layer .startmenu[data-state="open"],
#ui-layer .alert-container.has-alert {
    pointer-events: auto;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Debug Info */
#debug-info {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #0f0;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
}

/* ===================
   HUD is now canvas-based - see js/ui/HUD.js
   No CSS styles needed for HUD anymore
   =================== */
