@font-face {
  font-family: 'Comfortaa';
  src: url('Comfortaa-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

  :root {
    --pink: #ff2d9b;
    --purple: #9b30ff;
    --teal: #00ffe7;
    --dark: #050510;
    --screen-glow: rgba(255, 45, 155, 0.15);
    --crt-green: #39ff14;
  }


body {
  aspect-ratio: 2.5 / 1;
  max-height: 100vh;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}
  
#bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #1b0026 0%, #0a0010 60%, #000 100%);
  z-index: 0;
}

  /*
    The screen sits in the CENTER of the image.
    Tweak these 4 values to dial in exact fit:
    - left/right margin: ~31% from each side → width ~38%
    - top: ~6% from top
    - height: ~52% of viewport height
  */
  #monitor-screen {
    position: fixed;
    left: 31%;
    width: 38%;
    top: 6%;
    height: 52%;
    z-index: 10;

    /* your content styles */
    background: rgba(0, 0, 10, 0.85);
    color: #ff2d9b;
    font-family: monospace;
    overflow-y: auto;
    padding: 12px;
    border-radius: 6px;
    box-sizing: border-box;
  }

  /* Custom cursor */
  .cursor {
    position: fixed;
    width: 14px;
    height: 14px;
    border: 2px solid var(--pink);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    mix-blend-mode: screen;
  }
  .cursor::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 4px; height: 4px;
    background: var(--pink);
    border-radius: 50%;
  }

  /* ── BACKGROUND ── */
  #bg-layer {
    position: fixed;
    inset: 0;
    background:
      repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 45, 155, 0.04) 3px 4px),
      repeating-linear-gradient(90deg, transparent 0 3px, rgba(155, 48, 255, 0.03) 3px 4px),
      radial-gradient(circle at 30% 20%, rgba(255, 45, 155, 0.18), transparent 50%),
      radial-gradient(circle at 70% 80%, rgba(155, 48, 255, 0.15), transparent 50%);
    z-index: 0;
  }
  /* vignette */
  #bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,5,0.85) 100%);
  }

  /* ── SCANLINE OVERLAY (full screen) ── */
  #scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.08) 2px,
      rgba(0,0,0,0.08) 4px
    );
    pointer-events: none;
    z-index: 50;
    animation: scanroll 8s linear infinite;
  }
  @keyframes scanroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 400px; }
  }

  /* ── SCREEN AREA ── */
  /* 
    The monitor screen in the image is roughly:
    - horizontally centered, ~38% wide of the image
    - vertically: top ~8%, bottom ~60% of image height
    We use viewport units to pin it.
  */
  #screen-frame {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -56%);
    width: min(40vw, 520px);
    height: min(30vw, 390px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
  }

  /* CRT phosphor effect behind content */
  #screen-inner {
    position: relative;
    flex: 1;
    background: rgba(3, 3, 20, 0.92);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
      inset 0 0 40px rgba(255,45,155,0.08),
      inset 0 0 80px rgba(0,0,0,0.6);
  }

  /* CRT screen glass reflection */
  #screen-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      135deg,
      rgba(255,255,255,0.04) 0%,
      transparent 50%
    );
    pointer-events: none;
    z-index: 100;
    border-radius: 6px;
  }

  /* Pixel noise texture */
  #screen-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 99;
    animation: flicker 0.15s infinite;
  }
  @keyframes flicker {
    0%,100% { opacity: 0.03; }
    50% { opacity: 0.05; }
  }

  /* ── TERMINAL CONTENT ── */
  #terminal-content {
    position: relative;
    z-index: 20;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
  }

  #boot-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  #main-terminal {
    display: none;
    flex: 1;
    flex-direction: column;
    height: 100%;
  }

  #output-log {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scroll-behavior: smooth;
  }
  #output-log::-webkit-scrollbar { width: 3px; }
  #output-log::-webkit-scrollbar-track { background: transparent; }
  #output-log::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 2px; }

  .log-line {
    font-size: clamp(10px, 1.4vw, 14px);
    line-height: 1.5;
    margin-bottom: 2px;
    animation: fadein 0.3s ease;
  }
  @keyframes fadein { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; } }

  .log-user { color: var(--teal); }
  .log-mommy { color: var(--pink); }
  .log-system { color: rgba(255,255,255,0.35); font-size: 0.8em; }
  .log-warning { color: #ffd700; }

  /* Input row */
  #input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,45,155,0.2);
    margin-top: 4px;
  }

  #prompt-symbol {
    color: var(--pink);
    font-size: clamp(12px, 1.6vw, 16px);
    flex-shrink: 0;
    animation: blink 1s step-end infinite;
  }
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

  #user-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--teal);
    font-family: 'VT323', monospace;
    font-size: clamp(12px, 1.6vw, 16px);
    caret-color: var(--teal);
  }

  #send-btn {
    background: transparent;
    border: 1px solid var(--pink);
    color: var(--pink);
    font-family: 'VT323', monospace;
    font-size: clamp(10px, 1.3vw, 13px);
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
  }
  #send-btn:hover {
    background: var(--pink);
    color: #000;
    box-shadow: 0 0 12px var(--pink);
  }

  /* Boot screen styles */
  .boot-title {
    font-family: 'VT323', monospace;
    font-size: clamp(18px, 3vw, 32px);
    color: var(--pink);
    text-shadow: 0 0 20px var(--pink), 0 0 40px rgba(255,45,155,0.5);
    letter-spacing: 4px;
    margin-bottom: 8px;
  }
  .boot-sub {
    font-size: clamp(9px, 1.2vw, 12px);
    color: rgba(255,255,255,0.3);
    letter-spacing: 2px;
    margin-bottom: 20px;
  }
  .boot-text {
    font-size: clamp(9px, 1.3vw, 13px);
    color: var(--pink);
    opacity: 0.7;
    letter-spacing: 1px;
  }

  #boot-btn {
    margin-top: 18px;
    background: transparent;
    border: 1px solid var(--pink);
    color: var(--pink);
    font-family: 'VT323', monospace;
    font-size: clamp(12px, 1.8vw, 18px);
    padding: 6px 24px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s;
    animation: pulse-border 2s ease-in-out infinite;
  }
  @keyframes pulse-border {
    0%,100% { box-shadow: 0 0 5px var(--pink); }
    50% { box-shadow: 0 0 20px var(--pink), 0 0 40px rgba(255,45,155,0.3); }
  }
  #boot-btn:hover {
    background: var(--pink);
    color: #000;
    box-shadow: 0 0 30px var(--pink);
  }

  /* Thinking indicator */
  #thinking {
    display: none;
    color: var(--pink);
    font-size: clamp(9px, 1.2vw, 12px);
    opacity: 0.7;
    animation: thinking-pulse 0.8s ease-in-out infinite;
    margin-bottom: 2px;
  }
  @keyframes thinking-pulse {
    0%,100% { opacity: 0.4; }
    50% { opacity: 1; }
  }

  /* ── SIDE PANELS (desktop) ── */
  #left-panel, #right-panel {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(140px, 13vw, 180px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 30;
    opacity: 0;
    transition: opacity 1s ease 2s;
  }
  #left-panel { left: 2vw; }
  #right-panel { right: 2vw; text-align: right; }
  #left-panel.visible, #right-panel.visible { opacity: 1; }

  .side-widget {
    background: rgba(5,5,20,0.85);
    border: 1px solid rgba(255,45,155,0.3);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: clamp(8px, 1vw, 11px);
  }
  .side-widget-title {
    color: var(--pink);
    letter-spacing: 2px;
    font-size: clamp(9px, 1.1vw, 12px);
    margin-bottom: 4px;
    text-transform: uppercase;
  }
  .side-widget-val {
    color: rgba(255,255,255,0.6);
    font-size: clamp(8px, 0.9vw, 10px);
    line-height: 1.6;
  }

  #heat-bar-wrap {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
  }
  #heat-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-radius: 2px;
    transition: width 0.5s ease, background 0.5s;
    box-shadow: 0 0 8px var(--pink);
  }

  /* ── BOTTOM STATUS ── */
  #bottom-status {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 6px 20px;
    font-size: clamp(8px, 0.9vw, 10px);
    color: rgba(255,255,255,0.2);
    z-index: 30;
    letter-spacing: 2px;
  }
  #bottom-status span { color: var(--pink); opacity: 0.6; }

  /* ── GLITCH EFFECT ── */
  .glitch-line {
    animation: glitch 0.3s steps(2) forwards;
    position: relative;
  }
  @keyframes glitch {
    0% { transform: translateX(0); clip-path: inset(0 0 95% 0); }
    20% { transform: translateX(-3px); clip-path: inset(20% 0 60% 0); }
    40% { transform: translateX(3px); clip-path: inset(50% 0 30% 0); }
    60% { transform: translateX(-2px); clip-path: inset(70% 0 10% 0); }
    100% { transform: translateX(0); clip-path: inset(0); }
  }

  /* ── MOBILE ADAPTATIONS ── */
  @media (max-width: 700px) {
    #screen-frame {
      width: 88vw;
      height: 56vw;
      top: 50%;
      transform: translate(-50%, -70%);
    }
    #left-panel, #right-panel { display: none; }
    #bottom-status { font-size: 8px; gap: 10px; }
    .log-line { font-size: 11px; }
    #user-input { font-size: 12px; }
  }

  /* Distortion overlay for "Mommy awakens" */
  #distort-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    background: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255,45,155,0.03) 2px,
      rgba(255,45,155,0.03) 4px
    );
    transition: opacity 0.5s;
  }
  #distort-overlay.active { opacity: 1; animation: distort 0.5s steps(3) forwards; }
  @keyframes distort {
    0% { transform: skewX(0); opacity: 1; }
    25% { transform: skewX(-2deg) translateX(4px); }
    50% { transform: skewX(1deg) translateX(-2px); }
    75% { transform: skewX(-0.5deg); }
    100% { transform: skewX(0); opacity: 0; }
  }

  /* Typing indicator dots */
  .dot-anim::after {
    content: '...';
    animation: dots 1.2s steps(3, end) infinite;
  }
  @keyframes dots {
    0%,20% { content: '.'; }
    40% { content: '..'; }
    60%,100% { content: '...'; }
  }

  /* Worm badge */
  .worm-badge {
    display: inline-block;
    font-size: 0.75em;
    background: rgba(155,48,255,0.2);
    border: 1px solid var(--purple);
    color: var(--purple);
    padding: 0 4px;
    border-radius: 2px;
    margin-left: 4px;
    vertical-align: middle;
  }