/* ================================================================
   AMIBIOS Boot Screen — Full Enhanced CSS
   CRT effects, scanlines, phosphor glow, glitch, setup menu,
   boot menu, Konami overlay
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  user-select: none;
}

/* ── Phase System ──────────────────────────────────── */
.phase { position: fixed; inset: 0; display: none; background: #000; z-index: 10; }
.phase.active { display: block; }

/* ── BIOS Screen ───────────────────────────────────── */
.bios-screen {
  width: 100vw; height: 100vh;
  background: #000080;
  color: #c0c0c0;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: clamp(10px, 1.35vw, 14px);
  line-height: 1.52;
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  /* Phosphor glow */
  text-shadow: 0 0 2px rgba(192,192,192,0.55);
  animation: crt-on 0.28s ease-out forwards;
}

/* Scanlines */
.bios-screen::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,0.09) 2px, rgba(0,0,0,0.09) 4px
  );
  pointer-events: none; z-index: 200;
}

/* Vignette */
.bios-screen::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.5) 100%);
  pointer-events: none; z-index: 201;
}

/* CRT on animation */
@keyframes crt-on {
  from { filter: brightness(0); transform: scaleY(0.02) scaleX(1.08); }
  55%  { transform: scaleY(1.008); }
  to   { filter: brightness(1); transform: scaleY(1) scaleX(1); }
}

/* CRT off animation */
.crt-off {
  animation: crt-off 0.24s ease-in forwards !important;
}
@keyframes crt-off {
  from { filter: brightness(1); transform: scaleY(1); }
  40%  { filter: brightness(2.5) contrast(4); transform: scaleY(0.008) scaleX(1.12); }
  to   { filter: brightness(0); transform: scaleY(0) scaleX(0); opacity: 0; }
}

/* ── Top Bar ───────────────────────────────────────── */
.top-bar {
  display: flex; justify-content: space-between;
  color: #fff; padding: 1px 2px;
  border-bottom: 1px solid #5555aa;
  margin-bottom: 7px; flex-shrink: 0;
  font-weight: bold; letter-spacing: 0.02em;
}
.tb-left  { color: #ffffff; }
.tb-right { color: #ffff54; }

/* ── CPU Line ──────────────────────────────────────── */
.cpu-line { color: #fff; margin-bottom: 5px; min-height: 1.5em; font-weight: bold; }

/* ── Memory Block ──────────────────────────────────── */
.mem-block { margin-bottom: 7px; }
.mem-test-line { color: #ffff54; min-height: 1.5em; }
.mem-ok-line   { color: #55ff55; font-weight: bold; }
.mem-count     { color: #ffff54; font-weight: bold; font-size: 1.05em; }

.mem-bar-outer {
  display: inline-block; width: 120px; height: 9px;
  border: 1px solid #aaaaff; vertical-align: middle;
  margin-left: 8px; position: relative; top: -1px;
}
.mem-bar-inner { height: 100%; background: #55ff55; width: 0%; transition: width 0.04s linear; }

/* ── POST Lines ────────────────────────────────────── */
.post-lines { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.post-line  { display: flex; gap: 8px; animation: fadein 0.08s ease-in; }
.post-line .label { color: #aaaaff; min-width: 260px; flex-shrink: 0; }
.status-ok   { color: #55ff55; }
.status-warn { color: #ffff54; }
.status-fail { color: #ff5555; font-weight: bold; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ── Bottom Bar ────────────────────────────────────── */
.bottom-bar {
  display: flex; justify-content: space-between;
  color: #55ff55; padding: 3px 2px;
  border-top: 1px solid #5555aa;
  margin-top: auto; flex-shrink: 0; font-size: 0.88em;
}
.sum-bottom { color: #ffff54; }

/* ── Summary Screen ────────────────────────────────── */
.summary-body {
  flex: 1; display: flex; flex-direction: row; gap: 18px;
  padding: 8px 2px; overflow: hidden;
}

/* AMI ASCII Logo */
.ami-logo { display: flex; flex-direction: column; min-width: 210px; flex-shrink: 0; }
.ami-art  {
  color: #ffff54; font-size: clamp(8px, 1vw, 12px);
  line-height: 1.3; font-weight: bold;
  text-shadow: 0 0 7px rgba(255,255,84,0.75);
}
.ami-tagline { color: #fff; font-size: 0.82em; padding-left: 2px; margin-top: 3px; }
.ami-ver     { color: #aaaaff; margin-top: 1px; }

/* Summary Table */
.summary-table { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.srow   { display: flex; gap: 0; }
.sspacer { height: 7px; }
.slabel { color: #aaaaff; min-width: 185px; flex-shrink: 0; }
.scolon { color: #c0c0c0; margin-right: 6px; flex-shrink: 0; }
.sval   { color: #fff; }

/* Boot Order */
.boot-order-block { min-width: 175px; flex-shrink: 0; }
.bo-title   { color: #ffff54; font-weight: bold; margin-bottom: 5px; border-bottom: 1px solid #5555aa; padding-bottom: 2px; }
.boot-order-item { color: #c0c0c0; padding-left: 3px; margin-bottom: 2px; }

/* ── Glitch Lines ──────────────────────────────────── */
.glitch-line {
  position: absolute;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85em;
  pointer-events: none;
  z-index: 150;
  opacity: 0.85;
  white-space: nowrap;
}

/* ── Full Overlay (Setup + Boot Menu base) ─────────── */
.full-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.0);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
}

/* ── BIOS Setup Menu ───────────────────────────────── */
.setup-box {
  width: min(800px, 96vw);
  background: #000080;
  border: 2px solid #aaaaff;
  color: #c0c0c0;
  font-size: clamp(10px, 1.3vw, 14px);
  box-shadow: 0 0 40px rgba(0,0,170,0.9), inset 0 0 20px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  text-shadow: 0 0 2px rgba(192,192,192,0.5);
}

.setup-title {
  background: #aaaaaa;
  color: #000080;
  text-align: center;
  font-weight: bold;
  padding: 3px 0;
  letter-spacing: 0.1em;
  font-size: 1.05em;
}

.setup-tabs {
  display: flex; background: #000080;
  border-bottom: 1px solid #aaaaff;
}
.stab {
  flex: 1; text-align: center; padding: 4px 0;
  color: #c0c0c0; cursor: default;
  border-right: 1px solid #5555aa;
  font-size: 0.92em;
}
.stab:last-child { border-right: none; }
.stab.active {
  background: #aaaaaa; color: #000080; font-weight: bold;
}

.setup-content {
  display: flex; flex-direction: row; flex: 1;
  min-height: 220px;
}

.setup-items {
  flex: 1; padding: 8px 10px;
  border-right: 1px solid #5555aa;
  display: flex; flex-direction: column; gap: 2px;
}

.sitem {
  display: flex; justify-content: space-between;
  padding: 2px 5px; color: #c0c0c0;
  cursor: default;
}
.sitem.sel {
  background: #aaaaaa; color: #000080; font-weight: bold;
}
.sval { color: #ffff54; }
.sitem.sel .sval { color: #000080; }

.setup-helpbox {
  width: 200px; flex-shrink: 0;
  padding: 8px 10px;
  border-left: 1px solid #5555aa;
  display: flex; flex-direction: column; gap: 6px;
}
.shelp-title { color: #ffff54; font-weight: bold; border-bottom: 1px solid #5555aa; padding-bottom: 4px; font-size: 0.88em; }
.shelp-text  { color: #c0c0c0; font-size: 0.85em; line-height: 1.5; }

.setup-footer {
  background: #000050; color: #55ff55;
  padding: 4px 10px; font-size: 0.82em;
  display: flex; gap: 16px;
  border-top: 1px solid #5555aa;
  flex-wrap: wrap;
}

/* ── Boot Menu ─────────────────────────────────────── */
.bootmenu-box {
  background: #000080;
  border: 2px solid #aaaaff;
  padding: 0;
  min-width: 300px;
  box-shadow: 0 0 30px rgba(0,0,170,0.85);
  font-size: clamp(10px, 1.3vw, 14px);
  text-shadow: 0 0 2px rgba(192,192,192,0.5);
}

.bm-title {
  background: #aaaaaa; color: #000080;
  text-align: center; font-weight: bold;
  padding: 4px 16px; letter-spacing: 0.05em;
}

.bm-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 2px; }

.bm-item {
  color: #c0c0c0; padding: 3px 8px; cursor: default;
}
.bm-item.sel {
  background: #aaaaaa; color: #000080; font-weight: bold;
}

.bm-footer {
  background: #000050; color: #55ff55;
  padding: 4px 16px; font-size: 0.82em;
  border-top: 1px solid #5555aa;
}

/* ── Konami Message ────────────────────────────────── */
.konami-msg {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 9999;
  color: #ffff54;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(14px, 2vw, 22px);
  font-weight: bold;
  text-align: center;
  text-shadow: 0 0 12px rgba(255,255,84,0.9), 0 0 3px rgba(255,255,84,1);
  background: #000080;
  border: 2px solid #ffff54;
  padding: 16px 28px;
  animation: konami-flash 3.5s ease-in-out forwards;
  pointer-events: none;
}

@keyframes konami-flash {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.85); }
  12%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.05); }
}

/* ── Error row pulse ───────────────────────────────── */
.error-row { animation: err-pulse 0.6s ease-in-out; }
@keyframes err-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
  