:root {
  --bg: #000000;
  --text: #c0c0c0;
  --text-bright: #ffffff;
  --text-dim: #909090;
  --error: #ff5555;
  --success: #55ff55;
  --warn: #ffff55;
  --titlebar: #000080;
}

[data-theme="green"] {
  --text: #00cc00;
  --text-bright: #66ff66;
  --text-dim: #00aa00;
  --titlebar: #003300;
}
[data-theme="amber"] {
  --text: #ffb000;
  --text-bright: #ffd060;
  --text-dim: #cc8800;
  --titlebar: #4d3500;
}
[data-theme="ice"] {
  --text: #a0d8ef;
  --text-bright: #ffffff;
  --text-dim: #6090b0;
  --titlebar: #001a33;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'VT323', 'Consolas', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: text;
}

.seo-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nojs {
  padding: 40px 32px;
  max-width: 720px;
  margin: 0 auto;
  font-size: 22px;
  line-height: 1.5;
  color: var(--text);
}
.nojs h1 { color: var(--text-bright); font-size: 32px; margin-bottom: 16px; }
.nojs h2 { color: var(--warn); font-size: 24px; margin: 24px 0 8px; }
.nojs p  { margin-bottom: 12px; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.25) 3px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 100;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 99;
}

.terminal {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px 32px;
  font-size: 22px;
  line-height: 1.4;
  max-width: 1200px;
  margin: 0 auto;
  word-wrap: break-word;
}

.titlebar {
  background: var(--titlebar);
  color: #ffffff;
  padding: 4px 8px;
  margin: -24px -32px 16px -32px;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.titlebar-buttons { display: flex; gap: 4px; }
.titlebar-btn {
  background: #c0c0c0; color: #000;
  width: 24px; height: 18px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  border: 1px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  cursor: default;
}

.line { white-space: pre-wrap; min-height: 1.4em; }
.line-error   { color: var(--error); }
.line-success { color: var(--success); }
.line-warn    { color: var(--warn); }
.line-dim     { color: var(--text-dim); }
.line-bright  { color: var(--text-bright); }

.skip-hint {
  position: fixed;
  bottom: 12px;
  right: 16px;
  color: var(--text-dim);
  font-size: 16px;
  z-index: 200;
  user-select: none;
  opacity: 0.8;
}
.skip-hint.gone { display: none; }

.input-line {
  display: none;
  align-items: baseline;
  gap: 8px;
  min-height: 1.4em;
}
.prompt-symbol { color: var(--text); flex-shrink: 0; }
.input-field {
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-family: inherit;
  font-size: inherit;
  flex: 1;
  outline: none;
  caret-color: transparent;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--text-bright);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1.06s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.glitch { animation: glitch 0.3s ease-in-out; }
@keyframes glitch {
  0%, 100% { transform: translate(0); filter: hue-rotate(0); }
  20% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  40% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
  60% { transform: translate(-1px, -1px); filter: hue-rotate(180deg); }
  80% { transform: translate(1px, 1px); filter: hue-rotate(0); }
}

.dots::after {
  content: '';
  animation: dots 1.4s steps(4) infinite;
}
@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

::selection { background: var(--text); color: var(--bg); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-dim); }

.static-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence baseFrequency='0.9'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  transition: opacity 0.2s;
}
.static-overlay.active { opacity: 0.08; }

@media (max-width: 600px) {
  .terminal { padding: 16px 18px; font-size: 18px; }
  .titlebar { margin: -16px -18px 12px -18px; font-size: 14px; }
  .skip-hint { font-size: 13px; bottom: 8px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
  .glitch, .static-overlay { animation: none !important; }
  .cursor { animation: none; }
  .dots::after { animation-duration: 3s; }
}
