/* =========================================
   FIRST LIGHT
   An android's first 60 seconds
   ========================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    font-family: 'Courier New', Courier, monospace;
    color: #fff;
}

#main-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* =========================================
   SENSOR READOUTS
   ========================================= */
.sensors {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s;
}

.sensors.visible {
    opacity: 1;
}

.sensor {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
}

.sensor-label {
    width: 70px;
    text-align: right;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.5s;
}

.sensor.active .sensor-label {
    color: rgba(255, 255, 255, 0.9);
}

.sensor-bar {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.sensor-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 2s ease, background 1s;
    background: rgba(255, 255, 255, 0.35);
}

.sensor.active .sensor-fill {
    background: #00e5ff;
}

.sensor-status {
    width: 50px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    transition: color 0.5s;
}

.sensor.active .sensor-status {
    color: #00e5ff;
}

/* =========================================
   MONOLOGUE
   ========================================= */
.monologue {
    position: fixed;
    bottom: 4rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    padding: 0 2rem;
}

.thought {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0);
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto;
    transition: color 1.5s ease;
}

.thought.visible {
    color: rgba(255, 255, 255, 0.85);
}

.thought.fading {
    color: rgba(255, 255, 255, 0);
}

.thought.bright {
    color: rgba(255, 255, 255, 0.9);
}

/* =========================================
   TIMER
   ========================================= */
.timer {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s;
}

.timer.visible {
    opacity: 1;
}

.timer-label {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.2rem;
}

.timer-value {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.1em;
}

/* =========================================
   START SCREEN
   ========================================= */
.start-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: #000;
    transition: opacity 2s;
}

.start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-inner {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.start-pre {
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.start-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    color: #fff;
    margin-bottom: 1rem;
}

.start-sub {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.start-btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s;
}

.start-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.start-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 1.5rem;
    letter-spacing: 0.1em;
}

/* =========================================
   END STATE
   ========================================= */
.end-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 50;
    padding: 2rem;
    opacity: 0;
    transition: opacity 3s;
}

.end-overlay.visible {
    opacity: 1;
}

.end-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.end-sub {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 2;
    max-width: 400px;
    margin: 0 auto;
}

.end-highlight {
    color: rgba(0, 229, 255, 0.85);
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    .sensors {
        top: 1rem;
        right: 1rem;
        gap: 0.4rem;
    }

    .sensor-bar {
        width: 40px;
    }

    .sensor-label {
        width: 55px;
        font-size: 0.8rem;
    }
}
