:root {
  color-scheme: dark;
  color: #8cff90;
  background: #020202;
  font-family: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: #001100;
  background-image:
    url("matrix-bg.gif"),
    linear-gradient(135deg, rgba(0, 10, 0, 0.8), rgba(0, 20, 0, 0.96));
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-attachment: fixed;
  background-blend-mode: overlay;
}

.terminal {
  width: min(760px, 100%);
  padding: 2.25rem;
  border: 1px solid rgba(140, 255, 144, 0.35);
  border-radius: 24px;
  box-shadow: 0 0 2rem rgba(0, 255, 140, 0.12);
  background: rgba(5, 10, 5, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
  min-height: 320px;
}

.chat-terminal {
  padding: 1.5rem;
  max-width: 740px;
}

.chat-window {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-log {
  min-height: 260px;
  max-height: 380px;
  width: 100%;
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid rgba(140, 255, 144, 0.2);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0.6rem rgba(0, 0, 0, 0.2);
}

.chat-message {
  margin-bottom: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.chat-message.user {
  align-self: flex-end;
  background: rgba(140, 255, 144, 0.12);
  border: 1px solid rgba(140, 255, 144, 0.25);
}

.chat-message.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(140, 255, 144, 0.12);
}

.chat-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.chat-recipient-wrapper {
  min-width: 180px;
  width: min(100%, 320px);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-status {
  margin: 0;
  opacity: 0.88;
  font-size: 0.95rem;
}

.chat-status.error {
  color: #ff6c6c;
}

.chat-input-wrapper {
  display: flex;
  gap: 0.8rem;
  width: 100%;
}

.chat-input-wrapper input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(140, 255, 144, 0.28);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.15);
  color: #8cff90;
}

.chat-input-wrapper button {
  padding: 0.85rem 1.2rem;
  border: 1px solid rgba(140, 255, 144, 0.4);
  border-radius: 16px;
  background: rgba(8, 20, 8, 0.92);
  color: #8cff90;
  cursor: pointer;
}

.chat-input-wrapper button:hover,
.chat-input-wrapper button:focus {
  background: rgba(12, 30, 12, 1);
}

.chat-message.public {
  align-self: flex-start;
  background: rgba(140, 255, 144, 0.08);
  border: 1px solid rgba(140, 255, 144, 0.18);
}

.chat-message.private {
  align-self: flex-start;
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.14);
}

.chat-message.hidden {
  display: none;
}

.message-meta {
  display: block;
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.message-text {
  display: block;
}

.hidden {
  display: none !important;
}

.terminal h1,
.terminal p,
.terminal ul {
  width: min(720px, 100%);
}

.terminal p {
  margin: 0 0 1rem;
}

.terminal p:last-child {
  margin-bottom: 0;
}

.terminal ul {
  margin: 1rem 0 1.5rem;
}

.text-block {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  width: min(70%, 720px);
  margin: auto;
  background: rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: scale(0.96);
  text-align: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: opacity, transform;
  pointer-events: none;
}

.text-block.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

h1 {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(0, 255, 128, 0.35);
}

p, li {
  line-height: 1.85;
  letter-spacing: 0.04em;
}

ul {
  padding-left: 1.5rem;
  margin: 1rem 0 1.5rem;
}

li {
  margin: 0.6rem 0;
}

a {
  color: #8cff90;
  text-decoration: none;
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.12rem;
  width: 100%;
  height: 1px;
  background: rgba(140, 255, 144, 0.35);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease-in-out;
}

a:hover::after,
 a:focus::after {
  transform: scaleX(1);
}

.glitch {
  display: inline-block;
  position: relative;
  color: #8cff90;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.7;
  clip-path: inset(0 0 0 0);
}

.glitch::before {
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
  color: rgba(0, 255, 128, 0.65);
  z-index: -1;
}

.glitch::after {
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
  color: rgba(0, 255, 255, 0.45);
  z-index: -2;
}

@keyframes glitch-anim-1 {
  0% { transform: translate(0.2rem, -0.04rem); }
  25% { transform: translate(-0.1rem, 0.05rem); }
  50% { transform: translate(0.08rem, -0.08rem); }
  75% { transform: translate(-0.02rem, 0.04rem); }
  100% { transform: translate(0.1rem, 0.1rem); }
}

@keyframes glitch-anim-2 {
  0% { transform: translate(-0.12rem, 0.06rem); }
  25% { transform: translate(0.05rem, -0.05rem); }
  50% { transform: translate(-0.08rem, 0.1rem); }
  75% { transform: translate(0.02rem, -0.03rem); }
  100% { transform: translate(-0.05rem, 0.08rem); }
}

small {
  display: block;
  margin-top: 1.5rem;
  opacity: 0.75;
  font-size: 0.95rem;
}


#matrix-rain{opacity:.7;}
.terminal{z-index:1;}
