@font-face {
  font-family: 'Terminal';
  src: local('JetBrains Mono'), local('Fira Code'), local('Courier New');
}

:root {
  --bg: #000000;
  --green: #00ff41;
  --green-dim: #0a3d1a;
  --green-mid: #00b32d;
  --amber: #ffb000;
  --blue: #4fc3f7;
  --font: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  font-family: var(--font);
}

#crypto {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 65, 0.035) 0px,
    rgba(0, 255, 65, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.crt-flicker {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(0, 255, 65, 0.02);
  animation: flicker 6s infinite;
}

@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.85; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

body.red-flash::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: rgba(255, 0, 0, 0.12);
  animation: redPulse 0.22s ease-out;
}

@keyframes redPulse {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

body.shake {
  animation: shake 0.22s linear;
}

@keyframes shake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 3px); }
  100% { transform: translate(0, 0); }
}

.terminal {
  position: relative;
  z-index: 4;
  max-width: 720px;
  margin: 6vh auto;
  border: 1px solid var(--green-mid);
  border-radius: 8px;
  background: rgba(0, 8, 3, 0.82);
  box-shadow:
    0 0 20px rgba(0, 255, 65, 0.25),
    0 0 60px rgba(0, 255, 65, 0.08),
    inset 0 0 40px rgba(0, 255, 65, 0.04);
  backdrop-filter: blur(1px);
  max-height: 88vh;
  overflow-y: auto;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--green-dim);
  background: rgba(0, 20, 8, 0.6);
  border-radius: 8px 8px 0 0;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.85;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 10px;
  color: var(--green-mid);
  font-size: 12px;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.terminal-body {
  padding: 28px 30px 34px;
  color: var(--green);
}

h1.glitch {
  font-size: clamp(22px, 4.5vw, 34px);
  margin: 0 0 22px;
  text-shadow: 0 0 8px var(--green), 0 0 18px rgba(0, 255, 65, 0.6);
  letter-spacing: 2px;
  position: relative;
}

h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  background: transparent;
}

h1.glitch::before {
  color: #ff00c1;
  clip-path: inset(0 0 0 0);
  animation: glitchTop 3.5s infinite linear;
  opacity: 0.7;
}

h1.glitch::after {
  color: #00e5ff;
  animation: glitchBottom 3.5s infinite linear;
  opacity: 0.7;
}

@keyframes glitchTop {
  0%, 90%, 100% { clip-path: inset(0 0 90% 0); transform: translate(0, 0); }
  92% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, -1px); }
  94% { clip-path: inset(40% 0 30% 0); transform: translate(2px, 1px); }
  96% { clip-path: inset(5% 0 80% 0); transform: translate(-1px, 0); }
}

@keyframes glitchBottom {
  0%, 90%, 100% { clip-path: inset(90% 0 0 0); transform: translate(0, 0); }
  92% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 1px); }
  94% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, -1px); }
  96% { clip-path: inset(80% 0 5% 0); transform: translate(1px, 0); }
}

.typed-line {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--green-mid);
  min-height: 1.4em;
  white-space: pre-wrap;
  word-break: break-word;
}

.typed-line .cursor-inline {
  display: inline-block;
  width: 8px;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}

.prompt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 24px;
  font-size: 14px;
}

.prompt {
  color: var(--green);
}

.cursor {
  animation: blink 1s steps(1) infinite;
  color: var(--green);
}

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

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
}

.menu-item {
  color: var(--green);
  text-decoration: none;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--green-dim);
  border-radius: 4px;
  transition: all 0.15s ease;
  background: rgba(0, 255, 65, 0.02);
}

.menu-item:hover {
  background: rgba(0, 255, 65, 0.12);
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
  transform: translateX(4px);
}

.status-line {
  font-size: 12px;
  color: var(--green-dim);
  border-top: 1px solid var(--green-dim);
  padding-top: 14px;
  letter-spacing: 0.5px;
}

.status-line .ok {
  color: var(--green);
  text-shadow: 0 0 6px var(--green);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 4px;
}

.breach-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #000000;
  color: var(--green);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
}

.breach-screen.hidden {
  display: none;
}

.breach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--green-dim);
  flex-shrink: 0;
}

.breach-title {
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--green-mid);
}

.breach-close {
  background: transparent;
  border: 1px solid var(--green-dim);
  color: var(--green);
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.breach-close:hover {
  border-color: var(--green);
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.35);
}

.breach-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  cursor: text;
}

.breach-output {
  flex: 1;
  margin: 0;
  padding: 20px 24px 8px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

.breach-output .cursor-inline {
  display: inline-block;
  width: 8px;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}

.boot-init {
  color: var(--blue);
  text-shadow: 0 0 6px rgba(79, 195, 247, 0.5);
}

.qa-question {
  color: var(--green);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.6);
  font-weight: normal;
  font-size: 0.95em;
}

.qa-answer {
  color: var(--green);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.6);
  font-size: 0.95em;
}

.loader-line {
  color: var(--green);
  display: inline-block;
  width: 1ch;
}

.breach-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  position: relative;
}

.breach-prompt {
  color: var(--green-mid);
  font-size: 14px;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

.breach-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--font);
  font-size: 16px;
  caret-color: var(--green);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
  padding: 0;
}

.breach-input::selection {
  background: rgba(0, 255, 65, 0.3);
}

.breach-input:disabled {
  opacity: 0.4;
}

@media (max-width: 600px) {
  .terminal {
    margin: 3vh 12px;
    max-width: none;
  }
  .terminal-body {
    padding: 20px 18px 26px;
  }
  .breach-output {
    padding: 16px 16px 6px;
    font-size: 13px;
  }
  .breach-input-row {
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
