/* ═══════════════════════════════════════════════════════════
   BIOS BOOT — Hyper-realistic 90s CRT terminal
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    --amber:      #FFB000;
    --amber-dim:  #A06800;
    --amber-glow: #FF8C00;
    --green:      #00FF41;
    --green-dim:  #00AA2A;
    --white:      #E8E8D0;
    --gray:       #888878;
    --blue-bg:    #0000AA;
    --blue-light: #5555FF;
    --cyan:       #55FFFF;
    --red:        #FF5555;
    --yellow:     #FFFF55;
    --crt-bg:     #080808;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    background: #000;
    overflow: hidden;
    cursor: none; /* hide cursor — feels more authentic */
}

/* ── CRT monitor shell ── */
#monitor {
    position: relative;
    width: 100%; height: 100%;
    background: var(--crt-bg);

    /* subtle barrel distortion illusion via perspective */
    transform-style: preserve-3d;
}

/* ── Phosphor glow filter ── */
#monitor {
    filter: brightness(1.05) contrast(1.1);
}

/* ── CRT scanlines (always on top) ── */
#monitor::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.22) 2px,
        rgba(0,0,0,0.22) 4px
    );
}

/* ── CRT vignette + slight flicker ── */
#crtVignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9001;
    background: radial-gradient(
        ellipse at center,
        transparent 60%,
        rgba(0,0,0,0.75) 100%
    );
    animation: subtleFlicker 8s infinite;
}

@keyframes subtleFlicker {
    0%,100%   { opacity: 1; }
    92%       { opacity: 1; }
    92.5%     { opacity: 0.85; }
    93%       { opacity: 1; }
    97%       { opacity: 1; }
    97.3%     { opacity: 0.9; }
    97.6%     { opacity: 1; }
}

/* ── Screen flash on phase transition ── */
@keyframes screenFlash {
    0%   { opacity: 0; }
    15%  { opacity: 0.6; }
    100% { opacity: 0; }
}
.flash-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    pointer-events: none;
    z-index: 8999;
    animation: screenFlash 0.25s ease-out forwards;
}

/* ════════════════════════════════════════════════════════════
   BASE SCREEN STYLES
════════════════════════════════════════════════════════════ */
.screen {
    display: none;
    position: absolute;
    inset: 0;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   START SCREEN
════════════════════════════════════════════════════════════ */
#startScreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: var(--amber);
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    letter-spacing: 3px;
    text-shadow: 0 0 12px var(--amber), 0 0 24px var(--amber-glow);
    cursor: pointer;
    position: absolute;
    inset: 0;
}
#startScreen span {
    animation: blink 1.1s step-end infinite;
}

/* ════════════════════════════════════════════════════════════
   BIOS / POST SCREEN  (classic black-on-gray Award style)
════════════════════════════════════════════════════════════ */
#biosScreen {
    background: #000;
    padding: 0;
    color: var(--amber);
}

/* Top bar */
#biosTopBar {
    background: var(--amber);
    color: #000;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 2px 10px;
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.5px;
}

/* Main BIOS content area */
#biosBody {
    padding: 12px 18px;
    display: flex;
    gap: 16px;
}

/* Logo box — left column */
#biosLogoBox {
    border: 1px solid var(--amber-dim);
    width: 200px;
    min-width: 200px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    box-shadow: inset 0 0 20px rgba(255,176,0,0.06);
}
#biosLogoBox .logo-brand {
    font-size: 26px;
    font-weight: bold;
    color: var(--amber);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--amber);
}
#biosLogoBox .logo-sub {
    font-size: 11px;
    color: var(--amber-dim);
    letter-spacing: 1px;
}
#biosLogoBox .logo-divider {
    width: 100%;
    border-top: 1px solid var(--amber-dim);
    margin: 6px 0;
}
#biosLogoBox .logo-copy {
    font-size: 9px;
    color: var(--amber-dim);
    text-align: center;
    line-height: 1.6;
}

/* Right column: scrolling POST text */
#biosTextCol {
    flex: 1;
    color: var(--amber);
    font-size: 13px;
    line-height: 1.55;
}
#biosTextCol .dim   { color: var(--amber-dim); }
#biosTextCol .ok    { color: var(--green); text-shadow: 0 0 6px var(--green); }
#biosTextCol .warn  { color: var(--yellow); text-shadow: 0 0 6px var(--yellow); }
#biosTextCol .err   { color: var(--red); text-shadow: 0 0 6px var(--red); }
#biosTextCol .hi    { color: var(--white); }
#biosTextCol .cyan  { color: var(--cyan); text-shadow: 0 0 6px var(--cyan); }

/* Separator */
#biosSep {
    border: none;
    border-top: 1px solid var(--amber-dim);
    margin: 8px 18px;
    box-shadow: 0 0 4px var(--amber-dim);
}

/* Detect section (below separator) */
#biosDetect {
    padding: 4px 18px;
    font-size: 13px;
    color: var(--amber);
    line-height: 1.6;
}
#biosDetect .ok   { color: var(--green); text-shadow: 0 0 6px var(--green); }
#biosDetect .warn { color: var(--yellow); }
#biosDetect .dim  { color: var(--amber-dim); }
#biosDetect .cyan { color: var(--cyan); }
#biosDetect .hi   { color: var(--white); }

/* Memory count */
#memBar {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin: 2px 0;
}
#memProgress {
    display: inline-block;
    height: 10px;
    background: var(--amber);
    width: 0%;
    max-width: 220px;
    transition: width 0.04s linear;
    box-shadow: 0 0 6px var(--amber);
    vertical-align: middle;
}

/* Bottom status bar */
#biosBottomBar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: var(--amber);
    color: #000;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 10px;
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.3px;
}

/* Keyboard lock indicators */
#keystatus {
    display: flex;
    gap: 10px;
}
#keystatus span {
    opacity: 0.3;
    font-size: 11px;
}
#keystatus span.active {
    opacity: 1;
}

/* Energy Star logo position */
#energyLogo {
    position: absolute;
    bottom: 28px;
    right: 18px;
    width: 48px;
    opacity: 0.7;
    filter: sepia(1) hue-rotate(20deg) saturate(3);
}

/* ════════════════════════════════════════════════════════════
   BLACK SCREEN
════════════════════════════════════════════════════════════ */
#blackScreen {
    background: #000;
}

/* ════════════════════════════════════════════════════════════
   HARDWARE / DOS SCREEN  (amber terminal)
════════════════════════════════════════════════════════════ */
#hardwareScreen {
    background: #000;
    padding: 14px 20px;
}

#hardwareText {
    color: var(--amber);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
    text-shadow: 0 0 7px var(--amber-glow);
}
#hardwareText .ok    { color: var(--green); text-shadow: 0 0 6px var(--green); }
#hardwareText .hi    { color: var(--white); text-shadow: 0 0 4px #fff; }
#hardwareText .dim   { color: var(--amber-dim); text-shadow: none; }
#hardwareText .warn  { color: var(--yellow); text-shadow: 0 0 6px var(--yellow); }
#hardwareText .err   { color: var(--red); text-shadow: 0 0 8px var(--red); }
#hardwareText .cyan  { color: var(--cyan); text-shadow: 0 0 6px var(--cyan); }

/* BIOS icon — bottom right of hardware screen */
#hardwareIcon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    object-fit: contain;
    opacity: 0.5;
    filter: sepia(1) hue-rotate(10deg) saturate(4);
    image-rendering: pixelated;
}

/* ════════════════════════════════════════════════════════════
   WINDOWS 95 SCREEN
════════════════════════════════════════════════════════════ */
#windowsScreen {
    background: #000;
    padding: 14px 20px;
}

#windowsText {
    color: var(--amber);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
    text-shadow: 0 0 7px var(--amber-glow);
}
#windowsText .ok   { color: var(--green); text-shadow: 0 0 6px var(--green); }
#windowsText .hi   { color: var(--white); }
#windowsText .dim  { color: var(--amber-dim); text-shadow: none; }
#windowsText .warn { color: var(--yellow); }

/* Win95 progress bar — bottom center */
#win95progress {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    text-align: center;
}
#win95Label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--amber-dim);
    margin-bottom: 5px;
    letter-spacing: 1px;
}
#win95BarOuter {
    width: 100%;
    height: 14px;
    border: 1px solid var(--amber-dim);
    background: #000;
    box-shadow: 0 0 8px rgba(255,176,0,0.2);
}
#win95BarInner {
    height: 100%;
    width: 0%;
    background: var(--amber);
    box-shadow: 0 0 10px var(--amber);
    transition: none;
}

/* ════════════════════════════════════════════════════════════
   SHARED — blinking cursor block
════════════════════════════════════════════════════════════ */
#cursor, #cursorHardware, #cursorWindows {
    display: inline-block;
    width: 9px;
    height: 15px;
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
    animation: blink 0.55s step-end infinite;
    vertical-align: bottom;
    margin-left: 1px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ════════════════════════════════════════════════════════════
   SCREEN TRANSITION — fade/flicker in
════════════════════════════════════════════════════════════ */
@keyframes screenOn {
    0%   { opacity: 0; filter: brightness(3); }
    10%  { opacity: 1; filter: brightness(1.8); }
    20%  { opacity: 0.7; }
    35%  { opacity: 1; filter: brightness(1.2); }
    100% { opacity: 1; filter: brightness(1); }
}
.screen-on {
    animation: screenOn 0.35s ease-out forwards;
}

/* CMOS error highlight */
.cmos-err {
    color: var(--yellow);
    text-shadow: 0 0 8px var(--yellow);
    animation: errPulse 1.5s ease-in-out 2;
}
@keyframes errPulse {
    0%,100% { opacity: 1; }
    50%     { opacity: 0.4; }
}