:root {
  --bg: #0a0d0a;
  --fg: #33ff66;
  --fg-dim: #1c8f3c;
  --red: #ff3b3b;
  --font: "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

.hidden { display: none !important; }

/* ---------- Terminal shell ---------- */

.terminal {
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #050705;
  border: none;
  border-radius: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  background: #0f130f;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--fg-dim);
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title {
  margin-left: 10px;
  font-size: 12px;
  color: var(--fg-dim);
}

.screen {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screen::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.boot-log {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px 0;
  color: var(--fg-dim);
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.prompt-label {
  color: var(--fg);
  font-weight: bold;
}

.code-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 4px;
  caret-color: var(--fg);
}

.login-error {
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
  min-height: 16px;
}

/* ---------- Chat ---------- */

.chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.chat-msg {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(6px);
  animation: msg-in 0.25s ease forwards;
}

@keyframes msg-in {
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg .sender {
  display: block;
  font-size: 11px;
  color: var(--fg-dim);
  margin-bottom: 3px;
}

.chat-msg.from-A {
  align-self: flex-start;
  background: rgba(51, 255, 102, 0.08);
  border: 1px solid var(--fg-dim);
}

.chat-msg.from-B {
  align-self: flex-end;
  background: rgba(51, 255, 102, 0.16);
  border: 1px solid var(--fg);
  text-align: right;
}

.chat-msg.from-B .sender { text-align: right; }

.typing-indicator {
  align-self: flex-start;
  font-size: 12px;
  color: var(--fg-dim);
  font-style: italic;
}

.typing-indicator.right { align-self: flex-end; }

/* ---------- Security alerts ---------- */

.alerts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.alert-box {
  position: absolute;
  min-width: 260px;
  max-width: 360px;
  background: #1a0000;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: var(--font);
  font-size: 13px;
  font-weight: bold;
  padding: 12px 16px;
  border-radius: 4px;
  box-shadow: 0 0 25px rgba(255, 59, 59, 0.6);
  animation: alert-pop 0.15s ease-out;
}

.alert-box .alert-title {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

@keyframes alert-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Blackout (apagado tipo CRT) ---------- */

.blackout {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
}

.crt-flash {
  position: fixed;
  inset: 0;
  z-index: 101;
  background: #fff;
  transform-origin: center;
  animation: crt-off 0.6s cubic-bezier(0.55, 0, 0.85, 1) forwards;
}

@keyframes crt-off {
  0% {
    transform: scaleY(1) scaleX(1);
    filter: brightness(3);
    opacity: 1;
  }
  55% {
    transform: scaleY(0.01) scaleX(1);
    filter: brightness(4);
    opacity: 1;
  }
  80% {
    transform: scaleY(0.01) scaleX(0.12);
    filter: brightness(2);
    opacity: 1;
  }
  100% {
    transform: scaleY(0.01) scaleX(0);
    filter: brightness(1);
    opacity: 0;
  }
}
