* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #000;
  overflow: hidden;
}

body {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 22px;
  line-height: 1.18;
  color: #ffb000;
  cursor: default;
}

/* ======= CRT FRAME ======= */
#crt {
  position: fixed;
  inset: 0;
  padding: 18px 22px 30px;
  z-index: 1;
}

#screen {
  height: calc(100% - 32px);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 4px currentColor, 0 0 12px rgba(255, 176, 0, 0.35);
  scrollbar-width: none;
  padding-bottom: 18px;
}
#screen::-webkit-scrollbar { display: none; }

/* ======= SPLASH MODE (DOS BLUE) ======= */
body.splash-mode {
  background: #0000aa;
}
body.splash-mode #screen {
  color: #ffffff;
  text-shadow: 0 0 2px rgba(255,255,255,0.3);
  font-size: 21px;
}
body.splash-mode #scanlines { opacity: 0.15; }

.splash-pre {
  display: block;
  white-space: pre;
  text-align: center;
  margin-top: 12vh;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  font-feature-settings: "liga" 0;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

/* ======= TERMINAL MODE (AMBER) ======= */
body.term-mode {
  background: #0a0500;
  color: #ffb000;
}

#status-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  line-height: 26px;
  background: #aaaaaa;
  color: #000;
  padding: 0 10px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  letter-spacing: 1px;
  text-shadow: none;
  z-index: 2;
}
#status-bar.hidden { display: none; }

/* ======= EFFECTS ======= */
#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.20) 3px,
    rgba(0,0,0,0.20) 3px
  );
  z-index: 8;
  mix-blend-mode: multiply;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0) 50%,
    rgba(0,0,0,0.55) 100%
  );
  z-index: 9;
}

/* subtle CRT flicker */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 0.96; }
  48% { opacity: 1; }
  92% { opacity: 0.97; }
  93% { opacity: 1; }
}
#crt { animation: flicker 4s infinite; }

/* ======= BOOT GATE ======= */
#boot-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #ffb000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-shadow: 0 0 8px currentColor, 0 0 20px rgba(255,176,0,0.4);
}
#boot-gate.hidden { display: none; }

.boot-stack {
  text-align: center;
}
.boot-logo {
  font-size: 56px;
  letter-spacing: 6px;
  margin-bottom: 28px;
}
.boot-press {
  font-size: 22px;
  opacity: 0.75;
  letter-spacing: 2px;
}

.boot-warning {
  max-width: 760px;
  margin: 22px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 176, 0, 0.45);
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 1px;
  color: #ffd27a;
  opacity: 0.9;
}

.blink {
  display: inline-block;
  animation: blink 1.05s steps(2, end) infinite;
}
@keyframes blink { to { opacity: 0; } }

/* ======= CHAT TYPOGRAPHY ======= */
.ansi-art {
  display: block;
  white-space: pre;
  color: #00d6ff;
  text-shadow: 0 0 4px currentColor, 0 0 12px rgba(0, 214, 255, 0.4);
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-feature-settings: "liga" 0;
}

/* AMI/X warez-board colors. The frame defaults to bright cyan (the .ami-frame
   wrapper handles that); inner spans pop highlights in yellow/magenta/white. */
.ami-frame    { color: #00d6ff; text-shadow: 0 0 4px currentColor, 0 0 12px rgba(0,214,255,0.45); }
.ami-title    { color: #ffd24a; text-shadow: 0 0 6px currentColor; }
.ami-tag      { color: #ff66cc; text-shadow: 0 0 6px currentColor; }
.ami-label    { color: #c8c8c8; }
.ami-value    { color: #ffffff; text-shadow: 0 0 3px currentColor; }
.ami-sig      { color: #ff66cc; }
.ami-ok       { color: #5fff5f; text-shadow: 0 0 4px currentColor; }
.ami-warn     { color: #ff5f5f; text-shadow: 0 0 4px currentColor; }
.ami-prompt   { color: #ffd24a; text-shadow: 0 0 4px currentColor; }
.ami-deny     { color: #ff4040; text-shadow: 0 0 6px currentColor; font-weight: 700; }
.ami-break    { color: #ff66cc; text-shadow: 0 0 6px currentColor; font-weight: 700; }

.speaker-sysop   { color: #ffd24a; text-shadow: 0 0 4px currentColor; }
.speaker-you     { color: #ffffff; text-shadow: 0 0 3px currentColor; }
.system-msg      { color: #888; }
.error-msg       { color: #ff4040; text-shadow: 0 0 4px currentColor; }
.typing-dots     { color: #888; font-style: italic; }
.user-input      { color: #ffffff; text-shadow: 0 0 3px currentColor; }
.connect-msg     { color: #00ff66; text-shadow: 0 0 4px currentColor; }

.cursor {
  display: inline-block;
  width: 0.55em;
  background: currentColor;
  color: transparent;
  animation: blink 1.05s steps(2, end) infinite;
}

/* ===================================================================== */
/* TIME TRAVEL SEQUENCE — flash → starfield → year counter → fade        */
/* ===================================================================== */

#flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: #fff;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 30ms linear;
}
#flash-overlay.hidden { display: none; }

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  background: #000;
  transition: opacity 0.6s ease-out;
}
#starfield.hidden       { display: none; }
#starfield.fade-out     { opacity: 0; }

#time-travel-text {
  position: fixed;
  inset: 0;
  z-index: 51;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: 'VT323', 'Courier New', monospace;
  letter-spacing: 3px;
  transition: opacity 0.6s ease-out;
}
#time-travel-text.hidden    { display: none; }
#time-travel-text.fade-out  { opacity: 0; }

#time-travel-text .tt-line {
  color: #00ffff;
  font-size: 56px;
  text-shadow:
    0 0 6px currentColor,
    0 0 18px currentColor,
    0 0 36px rgba(0, 255, 255, 0.6);
  animation: tt-pulse 0.42s ease-in-out infinite alternate;
}

#time-travel-text .tt-year-row {
  margin-top: 22px;
  font-size: 26px;
  color: #ffd24a;
  text-shadow: 0 0 6px currentColor, 0 0 18px rgba(255, 210, 74, 0.5);
  display: flex;
  gap: 16px;
  align-items: baseline;
}
#time-travel-text .tt-year-row.tt-current { margin-top: 8px; }
#time-travel-text .tt-label { color: #888; font-size: 22px; }
#time-travel-text .tt-arrow { color: #ff66cc; }
#time-travel-text .tt-target { color: #ff66cc; font-weight: bold; }
#time-travel-text .tt-year   { color: #ffffff; min-width: 5ch; text-align: left; }

@keyframes tt-pulse {
  from { opacity: 0.75; transform: scale(0.99); letter-spacing: 3px; }
  to   { opacity: 1.0;  transform: scale(1.03); letter-spacing: 6px; }
}

/* ===================================================================== */
/* PC DESK SCENE — establishing shot, walk-up, sit-down, dive-into-screen */
/* ===================================================================== */

#pc-scene {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(ellipse at 50% 65%, #221a12 0%, #0a0805 70%, #000 100%);
  overflow: hidden;
  perspective: 1400px;
  perspective-origin: 50% 60%;
}
#pc-scene.hidden { display: none; }

#pc-scene .pc-wall {
  position: absolute;
  inset: 0 0 38% 0;
  background:
    repeating-linear-gradient(0deg,   rgba(255,200,140,0.02) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #2a1e14 0%, #1a120a 100%);
  pointer-events: none;
}

#pc-scene .pc-desk {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background:
    linear-gradient(180deg, #4a3622 0%, #2a1c10 60%, #120a06 100%);
  box-shadow: inset 0 12px 24px rgba(0,0,0,0.6);
}
#pc-scene .pc-desk::before {
  content: '';
  position: absolute;
  left: -10%; right: -10%; top: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,200,140,0.25) 50%, transparent 100%);
}

#pc-scene .pc-environment {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 600px;
  height: 520px;
  margin-left: -300px;
  transform-origin: 50% 75%;
  animation: pc-walk-up 3.4s cubic-bezier(0.4, 0.05, 0.2, 1) forwards;
}

@keyframes pc-walk-up {
  0% {
    transform: scale(0.16) translateY(140px);
    filter: blur(3px) brightness(0.45) saturate(0.7);
  }
  25% {
    filter: blur(1.5px) brightness(0.7) saturate(0.85);
  }
  85% {
    transform: scale(0.95) translateY(8px);
  }
  92% {
    transform: scale(1.02) translateY(-2px);     /* tiny "sit-down" overshoot */
    filter: blur(0) brightness(1) saturate(1);
  }
  100% {
    transform: scale(1) translateY(0);
    filter: blur(0) brightness(1) saturate(1);
  }
}

#pc-scene .pc-monitor {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
}

#pc-scene .pc-bezel {
  position: relative;
  width: 380px;
  height: 290px;
  background:
    linear-gradient(180deg, #d8cfb0 0%, #b8af90 50%, #9a9072 100%);
  border-radius: 16px 16px 12px 12px;
  padding: 26px 26px 50px 26px;
  box-sizing: border-box;
  box-shadow:
    inset 0 0 0 2px #6e6650,
    inset 0 -6px 12px rgba(0,0,0,0.35),
    inset 0 2px 0 rgba(255,255,255,0.18),
    0 12px 36px rgba(0,0,0,0.7),
    0 4px 12px rgba(0,0,0,0.5);
}

#pc-scene .pc-screen-area {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #050505 0%, #000 100%);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    inset 0 0 28px rgba(0,0,0,0.95),
    inset 0 0 6px rgba(50,40,30,1),
    0 0 0 2px #2a2218;
}

#pc-scene .pc-splash-text {
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 6.5px;
  line-height: 1;
  color: #ffffff;
  background: #0000aa;
  padding: 6px 4px;
  margin: 0;
  white-space: pre;
  position: absolute;
  inset: 3px;
  -webkit-font-smoothing: none;
  font-weight: 700;
  text-shadow: 0 0 1px rgba(255,255,255,0.6);
  opacity: 0;
  animation: splash-flicker-on 1.4s ease-in 1.6s forwards;
}

@keyframes splash-flicker-on {
  0%   { opacity: 0; }
  8%   { opacity: 0.4; }
  12%  { opacity: 0; }
  20%  { opacity: 0.7; }
  26%  { opacity: 0.15; }
  35%  { opacity: 1; }
  40%  { opacity: 0.5; }
  100% { opacity: 1; }
}

#pc-scene .pc-scanlines-mini {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 1px,
    rgba(0,0,0,0.35) 1px 2px
  );
  mix-blend-mode: multiply;
}

#pc-scene .pc-glare {
  position: absolute;
  top: 4%;
  left: 6%;
  width: 38%;
  height: 28%;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(8px);
}

#pc-scene .pc-led {
  position: absolute;
  bottom: 18px;
  right: 24px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff44;
  box-shadow:
    0 0 4px #00ff44,
    0 0 10px rgba(0,255,68,0.6);
  animation: led-pulse 2s ease-in-out infinite;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

#pc-scene .pc-brand {
  position: absolute;
  bottom: 14px;
  left: 24px;
  font-family: 'VT323', monospace;
  font-size: 13px;
  color: #5a5340;
  letter-spacing: 1.5px;
}

#pc-scene .pc-stand {
  width: 110px;
  height: 22px;
  background: linear-gradient(180deg, #c4bb9c 0%, #8a8264 100%);
  margin: -2px auto 0;
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.4);
}

#pc-scene .pc-base {
  width: 220px;
  height: 14px;
  background: linear-gradient(180deg, #b8af90 0%, #6e6650 100%);
  margin: -2px auto 0;
  border-radius: 4px;
  box-shadow:
    0 8px 20px rgba(0,0,0,0.7),
    inset 0 -2px 4px rgba(0,0,0,0.5);
}

#pc-scene .pc-keyboard {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) rotateX(28deg);
  transform-origin: top center;
  width: 460px;
  height: 90px;
  background: linear-gradient(180deg, #d4ccb0 0%, #a89e80 100%);
  border-radius: 8px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.2),
    inset 0 -3px 6px rgba(0,0,0,0.3),
    0 10px 20px rgba(0,0,0,0.7);
  padding: 10px 12px;
  box-sizing: border-box;
}

#pc-scene .pc-keys {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0.20) 0 1px,
      transparent     1px 22px),
    repeating-linear-gradient(0deg,
      rgba(0,0,0,0.20) 0 1px,
      transparent     1px 18px),
    linear-gradient(180deg, #c8bf9c 0%, #a89e80 100%);
  border-radius: 4px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}

#pc-scene .pc-mouse {
  position: absolute;
  right: 30px;
  bottom: 40px;
  width: 50px;
  height: 70px;
  background: linear-gradient(180deg, #d4ccb0 0%, #9a9072 100%);
  border-radius: 18px 18px 22px 22px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.6);
  transform: rotate(-8deg);
}
#pc-scene .pc-mouse::before {
  content: '';
  position: absolute;
  top: 6px; left: 12px; right: 12px;
  height: 2px;
  background: rgba(0,0,0,0.25);
  border-radius: 2px;
}

#pc-scene .pc-mug {
  position: absolute;
  left: 20px;
  bottom: 42px;
  width: 38px;
  height: 46px;
  background: linear-gradient(180deg, #6a3020 0%, #3a1810 100%);
  border-radius: 4px 4px 6px 6px;
  box-shadow:
    inset 0 4px 6px rgba(0,0,0,0.5),
    inset 0 -2px 4px rgba(0,0,0,0.4),
    0 6px 14px rgba(0,0,0,0.6);
}
#pc-scene .pc-mug::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 8px;
  width: 14px;
  height: 22px;
  border: 4px solid #6a3020;
  border-left: none;
  border-radius: 0 14px 14px 0;
}
#pc-scene .pc-mug::after {
  /* steam */
  content: '~';
  position: absolute;
  top: -14px;
  left: 12px;
  color: rgba(255,255,255,0.18);
  font-family: monospace;
  font-size: 18px;
  animation: mug-steam 2.6s ease-in-out infinite;
}
@keyframes mug-steam {
  0%   { transform: translateY(2px) translateX(0);   opacity: 0.05; }
  50%  { transform: translateY(-8px) translateX(3px); opacity: 0.35; }
  100% { transform: translateY(-18px) translateX(-2px); opacity: 0; }
}

/* DIVE INTO SCREEN — final transition */
#pc-scene.dive .pc-environment {
  animation: pc-dive 1.3s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}

@keyframes pc-dive {
  0% {
    transform: scale(1) translateY(0);
    filter: blur(0) brightness(1);
  }
  100% {
    transform: scale(28) translateY(-20px);
    filter: blur(10px) brightness(2.4);
  }
}

#pc-scene.dive {
  animation: pc-dive-bg 1.3s ease-in forwards;
}
@keyframes pc-dive-bg {
  0%   { background: radial-gradient(ellipse at 50% 65%, #221a12 0%, #0a0805 70%, #000 100%); }
  60%  { background: #0000aa; }
  100% { background: #000; opacity: 0; }
}
