@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --bg: #050810;
  --surface: #0c1220;
  --text: #e9f1ff;
  --muted: rgba(233, 241, 255, 0.75);
  --accent: #33ffcc;
  --accent-2: #7cc7ff;
  --danger: #ff6b6b;
  --warn: #f6c161;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(51, 255, 204, 0.08), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(124, 199, 255, 0.08), transparent 30%),
    linear-gradient(145deg, #050810, #04060c 55%, #0b1220);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(circle at var(--mx, 45%) var(--my, 40%), rgba(51, 255, 204, 0.1), transparent 38%);
  mix-blend-mode: screen;
  opacity: 0.65;
  animation: pulse 6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.85; }
}

.terminal {
  width: min(1100px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 10%, rgba(51, 255, 204, 0.06), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(124, 199, 255, 0.06), transparent 24%);
  opacity: 0.9;
}

.terminal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7affd6);
  box-shadow: 0 0 0 8px rgba(51, 255, 204, 0.18), 0 0 16px rgba(51, 255, 204, 0.65);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.micro {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 14px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.pill--accent {
  border-color: rgba(51, 255, 204, 0.6);
  background: linear-gradient(135deg, rgba(51, 255, 204, 0.18), rgba(124, 199, 255, 0.16));
}

.log {
  position: relative;
  z-index: 1;
  margin: 12px 0 14px;
  padding: 12px;
  height: clamp(380px, 60vh, 620px);
  overflow: auto;
  font-size: 15px;
  display: grid;
  gap: 8px;
}

.log__line {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.log__line .meta {
  color: var(--muted);
  font-size: 13px;
}

.log__line.success { color: #a8ffdf; }
.log__line.warn { color: var(--warn); }
.log__line.error { color: var(--danger); }
.log__line.info { color: var(--accent-2); }

.prompt {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.prompt label {
  font-weight: 700;
  color: var(--accent);
}

.prompt input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
}

.prompt button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(51, 255, 204, 0.35);
  background: linear-gradient(135deg, rgba(51, 255, 204, 0.4), rgba(124, 199, 255, 0.4));
  color: #041016;
  font-weight: 700;
  cursor: pointer;
}

.hint {
  color: var(--muted);
}

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  margin-left: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.badge.ok { border-color: rgba(51, 255, 204, 0.45); color: #9dffd8; }
.badge.bad { border-color: rgba(255, 107, 107, 0.45); color: #ffc5c5; }

.bonus-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(26, 46, 70, 0.9), rgba(6, 10, 20, 0.96));
  backdrop-filter: blur(6px);
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 16px;
}

.bonus-card {
  width: min(960px, 94vw);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.bonus-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.bonus-head .timer {
  font-family: "JetBrains Mono", monospace;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.bonus-nets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 10px 0 12px;
}

.bonus-net {
  position: relative;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 2px dashed rgba(51, 255, 204, 0.45);
  display: grid;
  place-items: center;
  color: #e8eefc;
  background: rgba(51, 255, 204, 0.05);
}

.bonus-net .net-label {
  text-align: center;
  font-weight: 600;
}

.bonus-spawn {
  position: relative;
  min-height: 140px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.bonus-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  margin: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: "JetBrains Mono", monospace;
  cursor: grab;
  animation: fall 8s linear infinite;
}

.bonus-chip.selected {
  border-color: rgba(255, 209, 102, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.3);
}

.bonus-chip.ok { background: rgba(51, 255, 204, 0.25); border-color: rgba(51, 255, 204, 0.6); }
.bonus-chip.bad { background: rgba(255, 107, 107, 0.25); border-color: rgba(255, 107, 107, 0.6); }

@media (max-width: 720px) {
  .bonus-overlay {
    align-items: start;
    overflow-y: auto;
  }

  .bonus-card {
    width: min(520px, 94vw);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .bonus-nets {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
  }

  .bonus-net .net-label {
    font-size: 12px;
  }

  .bonus-spawn {
    min-height: 110px;
  }

  .bonus-chip {
    font-size: 12px;
    padding: 5px 8px;
  }
}

@keyframes fall {
  0% { transform: translateY(-10%); opacity: 0.9; }
  90% { transform: translateY(40%); opacity: 1; }
  100% { transform: translateY(55%); opacity: 0.4; }
}

@media (max-width: 720px) {
  body { padding: 10px; }
  .terminal { padding: 12px; }
  .terminal__top { flex-direction: column; align-items: flex-start; }
  .status { width: 100%; justify-content: flex-start; }
  .log { height: 55vh; }
}
