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

html, body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #222 0, #050505 60%, #000 100%);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  color: #00ff7f;
}

/* Monitor shell */
.monitor {
  position: relative;
  width: min(900px, 95vw);
  aspect-ratio: 4 / 3;
  background: #111;
  border-radius: 18px;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.9),
    0 20px 60px rgba(0, 0, 0, 0.9);
  padding: 14px;
}

.monitor-frame {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #2c2c2c, #1c1c1c 40%, #101010 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.8),
    inset 0 0 30px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* Slight wear/age */
.monitor::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 15px;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.06) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.45) 0, transparent 55%);
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
}

.monitor-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 18px 22px 30px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Screen */
.screen {
  position: relative;
  flex: 1;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 0%, #004000 0, #000 60%);
  overflow: hidden;
  padding: 16px;
  color: #00ff7f;
  text-shadow: 0 0 4px rgba(0, 255, 127, 0.6);
  box-shadow:
    inset 0 0 25px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(0, 255, 127, 0.15);
}

/* Screen overlays */
.screen-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.scanlines::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 1px,
    transparent 2px
  );
  background-size: 100% 3px;
  opacity: 0.45;
  mix-blend-mode: multiply;
}

.vignette::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
    transparent 0,
    transparent 55%,
    rgba(0,0,0,0.7) 100%);
}

/* Story area */
.story-output {
  position: relative;
  height: calc(100% - 40px);
  overflow-y: auto;
  padding-right: 4px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.story-output p {
  margin-bottom: 4px;
  white-space: pre-wrap;
}

/* Scrollbar */
.story-output::-webkit-scrollbar {
  width: 6px;
}
.story-output::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
}
.story-output::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 127, 0.4);
}

/* Input row */
.input-row {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prompt {
  color: #00ff7f;
}

#word-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #00ff7f;
  font: inherit;
  caret-color: transparent;
}

#word-input::placeholder {
  color: rgba(0, 255, 127, 0.3);
}

/* Blinking block cursor */
.cursor {
  display: inline-block;
  width: 0.6ch;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Small screens */
@media (max-width: 600px) {
  .monitor-inner {
    padding: 14px;
  }
  .screen {
    padding: 12px;
  }
  .story-output {
    font-size: 0.85rem;
  }
}

/* Boot screen overlay */
#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #00ff5e;
  text-shadow: 0 0 4px rgba(0, 255, 94, 0.5);
  font-family: "Courier New", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  box-sizing: border-box;
  transition: opacity 0.6s ease;
}

/* Subtle scanline-ish effect */
#boot-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 94, 0.03),
    rgba(0, 255, 94, 0.03) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
}

#boot-inner {
  max-width: 900px;
  width: 100%;
}

#boot-output {
  white-space: pre-wrap;
  line-height: 1.4;
  min-height: 10rem;
}

#boot-hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Hide boot screen when done */
.boot-hidden {
  opacity: 0;
  pointer-events: none;
}

/* App starts invisible, fades in after boot */
#app {
  opacity: 0;
  transition: opacity 0.6s ease;
}

#app.app-visible {
  opacity: 1;
}