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

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

  :root {
    --green: #33ff33;
    --green-dim: #1a8c1a;
    --green-glow: rgba(51,255,51,0.15);
    --amber: #ffb000;
    --bg: #0a0a0a;
    --scanline: rgba(0,0,0,0.07);
  }

  html, body {
    height: 100%;
    background-image: /img/greenbg.png;
    background-repeat: no-repeat;
    background-attachment: fixed; 
    background-size: 100% 100%;
    font-family: 'Share Tech Mono', monospace;
    overflow: hidden;
  }

  /* CRT monitor outer shell */
  .monitor-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    # background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%);
  }

  .monitor {
    position: relative;
    width: min(98vw, 960px);
    height: min(96vh, 700px);
    background: #DDDDDD;
    border-radius: 22px 22px 28px 28px;
    box-shadow:
      0 0 0 3px #2a2a2a,
      0 0 0 6px #111,
      0 8px 60px rgba(0,0,0,0.9),
      inset 0 2px 4px rgba(255,255,255,0.05);
    padding: 18px 18px 52px 18px;
    display: flex;
    flex-direction: column;
  }

  .monitor::after {
    content: '';
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 8px;
    background: #222;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  }

  /* Brand label */
  .brand {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: #444;
    letter-spacing: 4px;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .screen-bezel {
    flex: 1;
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow:
      inset 0 0 30px rgba(0,0,0,0.8),
      inset 0 0 2px rgba(51,255,51,0.1);
    border: 2px solid #000;
  }

  /* Scanlines overlay */
  .screen-bezel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      0deg,
      var(--scanline) 0px,
      var(--scanline) 1px,
      transparent 1px,
      transparent 3px
    );
    pointer-events: none;
    z-index: 10;
  }

  /* CRT curvature vignette */
  .screen-bezel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    z-index: 11;
  }

  /* Phosphor flicker */
  @keyframes flicker {
    0%   { opacity: 1; }
    92%  { opacity: 1; }
    93%  { opacity: 0.94; }
    94%  { opacity: 1; }
    96%  { opacity: 0.97; }
    100% { opacity: 1; }
  }

  .screen-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    animation: flicker 8s infinite;
    overflow: hidden;
  }

  /* Top bar */
  .topbar {
    background: var(--green-dim);
    color: #000;
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 2px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1px;
    flex-shrink: 0;
  }

  /* Output area */
  #output {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 10px;
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    line-height: 1.55;
    text-shadow: 0 0 6px var(--green);
    scroll-behavior: smooth;
  }

  #output::-webkit-scrollbar { width: 5px; }
  #output::-webkit-scrollbar-track { background: #000; }
  #output::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 2px; }

  .line { white-space: pre-wrap; word-break: break-word; pointer-events: none; }
  .linehtml { white-space: initial; word-break: break-word; pointer-events: none; }
  .line.prompt { color: var(--green); }
  .line.cmd-echo { color: #aaffaa; }
  .line.output { color: #ccffcc; }
  .line.err { color: #ff5555; text-shadow: 0 0 6px #ff0000; }
  .line.info { color: var(--amber); text-shadow: 0 0 6px var(--amber); }
  .line.header { color: var(--green); font-weight: bold; }
  .line.blank { height: 0.8em; }
  .line.cat-content {
    background: rgba(51,255,51,0.04);
    border-left: 2px solid var(--green-dim);
    margin: 4px 0;
    padding: 6px 10px;
    color: #b8ffb8;
    white-space: pre-wrap;
  }
  .cat-html {
    background: rgba(51,255,51,0.04);
    border-left: 2px solid var(--green-dim);
    margin: 4px 0;
    padding: 6px 10px;
    color: #b8ffb8;
    white-space: initial;
  }

  .file-link {
    color: var(--amber);
    text-shadow: 0 0 6px var(--amber);
    cursor: pointer;
    text-decoration: underline;
  }
  .file-link:hover { color: #fff; }
  .dir-entry { color: #55aaff; text-shadow: 0 0 6px #0066ff; }
  .file-entry { color: #ccffcc; }
  .exe-entry { color: #ff9955; }

  /* Inline input line — lives inside #output, flows with content */
  .input-line {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
  }

  .ps1 {
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    text-shadow: 0 0 6px var(--green);
    white-space: nowrap;
    margin-right: 4px;
    flex-shrink: 0;
  }

  #cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--green);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    text-shadow: 0 0 6px var(--green);
    caret-color: var(--green);
    padding: 0;
    margin: 0;
    min-width: 2px;
  }

  /* Boot sequence */
  .boot-line {
    animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
  }
  .cursor-blink {
    display: inline-block;
    width: 9px;
    height: 15px;
    background: var(--green);
    vertical-align: middle;
    animation: blink 1s step-end infinite;
  }
