 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
     font-family: 'Courier New', Courier, monospace;
 }

 body {
     overflow: hidden;
     background: #02030a;
     color: #fff;
     user-select: none;
 }

 canvas {
     display: block;
     image-rendering: pixelated;
      position: fixed;
    inset: 0;
    z-index: 1;
 }

 #hud, #controls, #dialogueBox{
    z-index: 6000;
}



 /*MAIN MENU*/
 #mainMenu {
       z-index: 5000;
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    align-items: center;
}

.menu-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(
            rgba(0,0,0,0.65),
            rgba(0,0,0,0.8)
        );

    backdrop-filter: blur(2px);
}

.menu-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
     display: flex;
    flex-direction: column;
    align-items: center;   /* ⭐ key fix */
    justify-content: center;

    text-align: center;
}

.game-title {
    font-size: 64px;
    margin-bottom: 10px;
    color: #ffcc00;
    text-shadow: 0 0 15px rgba(255, 120, 0, 0.8);
    animation: pulse 2s infinite;
}

.game-subtitle {
    font-size: 20px;
    margin-bottom: 40px;
    color: #dddddd;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-buttons button {
    width: 260px;
    padding: 15px;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: white;
    transition: 0.3s ease;
    border: 2px solid rgba(255,255,255,0.2);
}

.menu-buttons button:hover {
    transform: scale(1.05);
    background: rgba(255,180,0,0.2);
    border-color: orange;
}


/* CUTSCENE*/

 /* UI MANAGEMENT */
 #hud {
     position: fixed;
     top: 15px;
     left: 15px;
     background: rgba(4, 7, 20, 0.85);
     border: 2px solid #34d399;
     border-radius: 8px;
     padding: 15px;
     width: 320px;
     z-index: 10;
     pointer-events: none;
     box-shadow: 0 0 15px rgba(52, 211, 153, 0.2);
 }

 .hud-title {
     color: #34d399;
     font-size: 16px;
     font-weight: bold;
     margin-bottom: 8px;
     text-transform: uppercase;
     letter-spacing: 1px;
 }

 .stat-container {
     margin-bottom: 10px;
 }

 .stat-label {
     font-size: 11px;
     color: #9ca3af;
     display: flex;
     justify-content: space-between;
 }

 .bar {
     height: 12px;
     background: #111827;
     border: 1px solid #374151;
     border-radius: 4px;
     overflow: hidden;
     margin-top: 3px;
 }

 .fill {
     height: 100%;
     width: 100%;
     transition: width 0.1s ease;
 }

 #signalFill {
     background: #10b981;
 }

 #stressFill {
     background: #ef4444;
     width: 0%;
 }

 /* TRANSITION AND CONTROL INFO */
 #controls {
     position: fixed;
     top: 15px;
     right: 15px;
     background: rgba(4, 7, 20, 0.85);
     border: 1px solid #4b5563;
     border-radius: 6px;
     padding: 10px 15px;
     font-size: 12px;
     color: #d1d5db;
     text-align: right;
     line-height: 1.6;
     z-index: 10;
 }

 .highlight {
     color: #f59e0b;
 }

 .key {
     background: #374151;
     padding: 1px 5px;
     border-radius: 3px;
     border-bottom: 2px solid #1f2937;
     color: white;
 }

 /* VISUAL STORY DIALOGUE SYSTEM */
 #dialogueBox {
     position: fixed;
     bottom: 25px;
     left: 50%;
     transform: translateX(-50%);
     width: 700px;
     max-width: 92%;
     background: rgba(2, 3, 10, 0.95);
     border: 3px solid #34d399;
     box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
     border-radius: 12px;
     padding: 20px;
     z-index: 100;
     display: none;
 }

 #dialogueSpeaker {
     font-size: 16px;
     font-weight: bold;
     color: #f59e0b;
     margin-bottom: 8px;
     text-transform: uppercase;
     letter-spacing: 1px;
 }

 #dialogueText {
     font-size: 14px;
     line-height: 1.6;
     color: #e5e7eb;
     min-height: 45px;
 }

 #dialoguePrompt {
     font-size: 11px;
     color: #6b7280;
     text-align: right;
     margin-top: 8px;
     animation: pulse 1.5s infinite;
 }

 /* SCREEN OVERLAYS */
 .screen {
     position: fixed;
     inset: 0;
     background: #02030a;
     display: flex;
     flex-direction: column;
     justify-content: center;
     align-items: center;
     z-index: 200;
     text-align: center;
     padding: 20px;
 }

 .screen h1 {
     font-size: 48px;
     color: #34d399;
     letter-spacing: 4px;
     margin-bottom: 15px;
 }

 .screen p {
     font-size: 14px;
     color: #9ca3af;
     max-width: 500px;
     line-height: 1.6;
     margin-bottom: 25px;
 }

 button {
     background: #10b981;
     color: #02030a;
     border: none;
     padding: 12px 30px;
     font-size: 16px;
     font-weight: bold;
     cursor: pointer;
     font-family: inherit;
     border-radius: 6px;
     box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
     transition: all 0.2s;
 }

 button:hover {
     background: #34d399;
     transform: translateY(-2px);
 }

 #winScreen,
 #loseScreen {
     display: none;
 }

 @keyframes pulse {

     0%,
     100% {
         opacity: 0.4;
     }

     50% {
         opacity: 1;
     }
 }

 .fade-in {
    opacity: 0;
    animation: fadeInText 2s ease forwards;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

