* {
  box-sizing: border-box;
}

:root {
  --bg: #020617;
  --panel: rgba(3, 7, 18, 0.92);
  --panel2: rgba(15, 23, 42, 0.9);
  --green: #22c55e;
  --lime: #a3e635;
  --cyan: #22d3ee;
  --blue: #38bdf8;
  --red: #ef4444;
  --orange: #fb923c;
  --yellow: #facc15;
  --purple: #a855f7;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Consolas, Monaco, "Courier New", monospace;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(34, 197, 94, 0.18),
      transparent 32%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(34, 211, 238, 0.16),
      transparent 35%
    ),
    linear-gradient(135deg, #020617, #030712 55%, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 197, 94, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 197, 94, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
  pointer-events: none;
}

body::after {
  content: "01101011 01100101 01111001 00100000 01100010 01110010 01100101 01100001 01100011 01101000";
  position: fixed;
  left: 0;
  right: 0;
  top: 16px;
  color: rgba(34, 197, 94, 0.18);
  font-size: 13px;
  letter-spacing: 8px;
  white-space: nowrap;
  animation: crawl 18s linear infinite;
  pointer-events: none;
}

@keyframes crawl {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.mobile-block {
  display: none;
  padding: 32px;
  text-align: center;
}

.app {
  width: min(1180px, 94vw);
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--green);
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 13px;
  text-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
}

h1 {
  margin: 8px 0;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1;
  text-transform: uppercase;
  color: #dcfce7;
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

.subtitle {
  max-width: 820px;
  margin: 0 auto;
  color: #cbd5e1;
  line-height: 1.5;
  font-size: 16px;
}

.terminal-shell {
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.96),
    rgba(3, 7, 18, 0.98)
  );
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 24px;
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.6),
    inset 0 0 70px rgba(34, 197, 94, 0.06),
    0 0 45px rgba(34, 197, 94, 0.1);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(34, 197, 94, 0.28);
  padding: 12px 16px;
  color: #bbf7d0;
  font-size: 13px;
}

.dots {
  display: flex;
  gap: 7px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--red);
}
.dot:nth-child(2) {
  background: var(--yellow);
}
.dot:nth-child(3) {
  background: var(--green);
}

.terminal-content {
  padding: 22px;
}

.top-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: inset 0 0 30px rgba(34, 197, 94, 0.025);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stat-box {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.stat-box small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  margin-bottom: 5px;
}

.stat-box span {
  color: #dcfce7;
  font-weight: 900;
  font-size: 24px;
  text-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

.ai-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 14px;
  align-items: center;
}

.avatar {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 31px;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.18),
    rgba(34, 211, 238, 0.16)
  );
  border: 1px solid rgba(34, 197, 94, 0.28);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.14);
}

.ai-name {
  font-size: 21px;
  color: #dcfce7;
  font-weight: 900;
  margin-bottom: 5px;
}

.ai-desc {
  color: #cbd5e1;
  line-height: 1.45;
  font-size: 14px;
}

.mood-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(34, 197, 94, 0.11);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #bbf7d0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  margin-top: 9px;
  text-transform: uppercase;
}

.breach-panel {
  position: relative;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}

.breach-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025) 0 1px,
    transparent 1px 8px
  );
  pointer-events: none;
  opacity: 0.55;
}

.lane {
  position: relative;
  z-index: 1;
  margin: 16px 0;
}

.lane-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-weight: 900;
  font-size: 14px;
}

.progress-track {
  position: relative;
  height: 34px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.25),
    rgba(34, 197, 94, 0.8)
  );
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
  transition: width 0.15s linear;
}

.ai-fill {
  background: linear-gradient(
    90deg,
    rgba(239, 68, 68, 0.25),
    rgba(239, 68, 68, 0.85)
  );
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.3);
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #f8fafc;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.story-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 18px;
  padding: 20px;
  font-size: 20px;
  line-height: 1.75;
  margin-bottom: 14px;
  min-height: 145px;
}

.correct {
  color: var(--green);
}
.incorrect {
  color: var(--red);
  background: rgba(239, 68, 68, 0.16);
  text-decoration: underline;
  border-radius: 3px;
}
.current {
  background: rgba(34, 197, 94, 0.24);
  color: #fff;
  border-radius: 3px;
  animation: blink 0.9s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.4;
  }
}

.commentary {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  background: linear-gradient(
    135deg,
    rgba(22, 101, 52, 0.35),
    rgba(8, 47, 73, 0.35)
  );
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 18px;
  padding: 13px;
  margin-bottom: 14px;
  min-height: 72px;
}

.commentary-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.18);
  font-size: 25px;
}

.commentary-text {
  color: #dcfce7;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 125px;
  resize: none;
  border-radius: 18px;
  border: 2px solid rgba(34, 197, 94, 0.2);
  background: rgba(2, 6, 23, 0.92);
  color: #dcfce7;
  padding: 17px;
  font-size: 18px;
  line-height: 1.55;
  outline: none;
  caret-color: var(--green);
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.12);
}

.warning {
  margin-top: 11px;
  color: var(--yellow);
  text-align: center;
  font-weight: 900;
  min-height: 24px;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  color: #02130a;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.16);
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.ghost-btn {
  color: #dcfce7;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.results {
  display: none;
  margin-top: 16px;
  background: rgba(2, 6, 23, 0.96);
  border: 1px solid rgba(34, 197, 94, 0.32);
  border-radius: 22px;
  padding: 22px;
  text-align: center;
  animation: popIn 0.4s ease both;
}

@keyframes popIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.results h2 {
  margin: 0 0 8px;
  color: #dcfce7;
  font-size: 38px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.28);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 17px 0;
}

.rank-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.11);
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-weight: 900;
}

.shake {
  animation: shake 0.22s ease;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@media (max-width: 900px) {
  .top-grid {
    grid-template-columns: 1fr;
  }
  .stats,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  body {
    display: block;
  }
  .app {
    display: none;
  }
  .mobile-block {
    display: block;
  }
}

@keyframes jumpZoom {
  from {
    transform: scale(0.1);
    opacity: 0;
  }

  to {
    transform: scale(1.4);
    opacity: 1;
  }
}

@keyframes jumpFlash {
  0% {
    background: black;
  }

  50% {
    background: #300000;
  }

  100% {
    background: black;
  }
}
