/* ============================================================
   BENTO // WOPR  -- WarGames mainframe terminal theme
   Self-hosted VT323 phosphor CRT, scanlines, boot sequence,
   spinning tape reels, typewriter output.
   ============================================================ */
@font-face { font-family: "VT323"; src: url("/fonts/vt323.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("/fonts/share-tech-mono.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #020602;
  --phos: #38ff7a;
  --phos-dim: #1f7a42;
  --amber: #ffb000;
  --glow: 0 0 6px rgba(56, 255, 122, .65);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--phos);
  font-family: "VT323", "Courier New", monospace;
  font-size: 22px; line-height: 1.25; letter-spacing: .5px;
  text-shadow: var(--glow);
  display: flex; flex-direction: column; min-height: 100vh;
  overflow-x: hidden;
}

/* ---- CRT overlay: scanlines + vignette + flicker (above everything) ---- */
.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 90;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.26) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
  animation: flicker 6s infinite steps(60);
}
@keyframes flicker { 0%,97%,100% { opacity:1 } 98% { opacity:.85 } 99% { opacity:.95 } }

/* ---- boot sequence ---- */
.boot {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 6vh 8vw; gap: 18px;
}
.boot.hide { opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.bootlog { margin: 0; font-size: 26px; line-height: 1.35; color: var(--phos); text-shadow: var(--glow); white-space: pre-wrap; }
.bootgo { font-size: 24px; color: var(--amber); text-shadow: 0 0 6px rgba(255,176,0,.6); animation: blinkgo 1s steps(2) infinite; }
@keyframes blinkgo { 50% { opacity: 0 } }
.cursor { color: var(--phos); animation: blinkgo 1s steps(2) infinite; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 20px; border-bottom: 2px solid var(--phos-dim);
  position: sticky; top: 0; background: linear-gradient(#031003, #020602);
  text-transform: uppercase;
}

/* ---- spinning tape reels / "big disk" ---- */
.reel {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  background: repeating-conic-gradient(from 0deg, var(--phos) 0 6deg, #041a0c 6deg 18deg);
  border: 3px solid var(--phos); box-shadow: var(--glow), inset 0 0 14px #000;
  position: relative; animation: spin 2.6s linear infinite;
}
.reel.right { animation-duration: 3.4s; }
.reel i { position: absolute; inset: 26px; border-radius: 50%; background: #041a0c; border: 2px solid var(--phos); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- eyes ---- */
.face { display: flex; gap: 10px; flex: none; }
.eye {
  width: 34px; height: 40px; border-radius: 50%;
  background: #041a0c; border: 4px solid var(--phos);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow); animation: blink 5.5s infinite;
}
.pupil { width: 14px; height: 14px; border-radius: 50%; background: var(--phos); transition: transform .2s; }
@keyframes blink { 0%,92%,100% { height:40px } 95% { height:6px } }
.face.listening .eye { height: 44px; }
.face.thinking .pupil { animation: dart .9s infinite; }
.face.talking .eye { animation: talk .28s infinite; }
@keyframes dart { 0%{transform:translateX(-5px)} 50%{transform:translateX(5px)} 100%{transform:translateX(-5px)} }
@keyframes talk { 0%,100%{height:40px} 50%{height:22px} }

.who { flex: 1; }
.who h1 { margin: 0; font-size: 34px; letter-spacing: 3px; }
.who .sub { margin: 0; font-size: 16px; color: var(--phos-dim); letter-spacing: 2px; }
.who #status { margin: 2px 0 0; font-size: 16px; }
.who #status::before { content: "STATUS: "; color: var(--phos-dim); }

.ghost {
  background: transparent; color: var(--amber); text-shadow: 0 0 6px rgba(255,176,0,.6);
  border: 2px solid var(--amber); padding: 8px 14px;
  font-family: inherit; font-size: 18px; text-transform: uppercase; cursor: pointer;
}
.ghost:hover { background: var(--amber); color: #1a0f00; }

/* ---- terminal log ---- */
.log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 140px; }
.msg { max-width: 100%; }
.msg .who { font-size: 15px; color: var(--phos-dim); letter-spacing: 2px; text-transform: uppercase; }
.msg.you { color: var(--amber); text-shadow: 0 0 6px rgba(255,176,0,.55); }
.msg.you .who { color: var(--amber); opacity: .8; }
.msg.you > div:last-child::before { content: "» "; }

/* ---- composer (command line) ---- */
.composer { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 2px solid var(--phos-dim); max-width: 900px; width: 100%; margin: 0 auto; }
.prompt { color: var(--phos); font-size: 24px; }
.input {
  flex: 1; background: #030f06; border: 2px solid var(--phos-dim); color: var(--phos);
  font-family: inherit; font-size: 22px; padding: 8px 12px; text-transform: uppercase;
  text-shadow: var(--glow); caret-color: var(--phos);
}
.input::placeholder { color: var(--phos-dim); }
.input:focus { outline: none; border-color: var(--phos); box-shadow: var(--glow); }
.send, .mic { background: #030f06; color: var(--phos); border: 2px solid var(--phos); font-family: inherit; font-size: 18px; padding: 8px 16px; cursor: pointer; text-transform: uppercase; }
.send:hover, .mic:hover { background: var(--phos); color: #02110a; }
.mic.live { background: var(--amber); border-color: var(--amber); color: #1a0f00; animation: rec 1s infinite; }
@keyframes rec { 0%,100%{ box-shadow:0 0 0 0 rgba(255,176,0,.6) } 50%{ box-shadow:0 0 0 9px rgba(255,176,0,0) } }

.speakrow { color: var(--phos-dim); font-size: 16px; padding: 0 20px 16px; max-width: 900px; width: 100%; margin: 0 auto; text-transform: uppercase; letter-spacing: 2px; display: flex; align-items: center; gap: 22px; }
.speakrow label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.speakrow input { accent-color: var(--phos); }
#testvoice { margin-left: auto; }

.log::-webkit-scrollbar { width: 10px; }
.log::-webkit-scrollbar-thumb { background: var(--phos-dim); }

/* ---- amber (IMSAI) variant: classic amber CRT ---- */
body.amber {
  --phos: #ffb000;
  --phos-dim: #8a5a00;
  --amber: #74e0ff;     /* user/input accent flips to cool blue for contrast */
  --glow: 0 0 6px rgba(255, 176, 0, .6);
}

/* ---- center computer + terminal window ---- */
.stage { display: flex; align-items: flex-end; justify-content: center; gap: 26px; padding: 16px 20px 6px; }
.computer { display: flex; flex-direction: column; align-items: center; }
.monitor {
  position: relative; width: 208px; padding: 14px 14px 24px;
  background: #0a140a; border: 3px solid var(--phos);
  border-radius: 14px 14px 10px 10px;
  box-shadow: var(--glow), inset 0 0 18px #000;
}
.screen {
  width: 176px; height: 108px; margin: 0 auto;
  background: radial-gradient(circle at 50% 38%, #06210f, #020a05);
  border: 2px solid var(--phos-dim); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: inset 0 0 22px rgba(56, 255, 122, .28);
}
.brand { position: absolute; left: 14px; bottom: 6px; font-size: 14px; color: var(--phos-dim); letter-spacing: 2px; }
.led { position: absolute; right: 14px; bottom: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--phos); box-shadow: var(--glow); animation: blinkgo 1.4s steps(2) infinite; }
.neck { width: 48px; height: 14px; background: #0a140a; border: 3px solid var(--phos); border-top: none; }
.base { width: 130px; height: 16px; background: #0a140a; border: 3px solid var(--phos); border-radius: 4px 4px 7px 7px; }

.window {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  width: calc(100% - 40px); max-width: 900px; margin: 0 auto;
  border: 2px solid var(--phos-dim); border-radius: 6px;
  background: rgba(3, 15, 6, .4); overflow: hidden;
}
.winbar {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-bottom: 2px solid var(--phos-dim);
  font-size: 15px; color: var(--phos-dim); letter-spacing: 2px; text-transform: uppercase;
}
.wdot { width: 9px; height: 9px; border-radius: 50%; background: var(--phos-dim); display: inline-block; }

/* ---- LOGON / password screen ---- */
.login { position: fixed; inset: 0; z-index: 85; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 8vw; }
.login[hidden] { display: none; }
.loginbox { display: flex; flex-direction: column; gap: 14px; color: var(--phos); text-shadow: var(--glow); }
.login .logo { font-size: 30px; letter-spacing: 3px; margin-bottom: 12px; }
.login .logline { display: flex; align-items: center; gap: 10px; font-size: 26px; }
.loginput {
  background: #030f06; border: 2px solid var(--phos-dim); color: var(--phos);
  font-family: inherit; font-size: 26px; padding: 4px 10px;
  text-shadow: var(--glow); caret-color: var(--phos);
}
.loginput:focus { outline: none; border-color: var(--phos); box-shadow: var(--glow); }
.loginerr { color: var(--amber); text-shadow: 0 0 6px rgba(255, 176, 0, .6); font-size: 22px; }
