:root {
  --bg: #07090f;
  --surface: #0d1117;
  --card: #111827;
  --border: #1e2d40;
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --accent3: #10b981;
  --text: #e2e8f0;
  --muted: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --mono: "JetBrains Mono", monospace;
  --sans: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at top left, rgba(0,212,255,0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(124,58,237,0.22), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  padding: 2rem;
}

.grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30,45,64,0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,45,64,0.22) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
  pointer-events: none;
}

.glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(0,212,255,0.09);
  filter: blur(80px);
  animation: floatGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes floatGlow {
  from { transform: translate(-120px, -80px); }
  to { transform: translate(160px, 120px); }
}

.nf-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.nf-card {
  background: rgba(13,17,23,0.78);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(24px);
  box-shadow: 0 0 80px rgba(0,212,255,0.1);
}

.top-row,
.intel-header,
.intel-map-top,
.actions,
.secret-shell {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-row,
.intel-map-top {
  justify-content: space-between;
  align-items: center;
}

.top-row {
  margin-bottom: 1.5rem;
}

.badge,
.logo,
.funny-line,
.panel-header,
.panel-body,
.btn,
.secret-shell input,
.shell-output,
.footer {
  font-family: var(--mono);
}

.badge {
  font-size: 0.72rem;
  color: var(--accent3);
  border: 1px solid rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.08);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.logo {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: clamp(5rem, 16vw, 10rem);
  line-height: 0.85;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.7rem);
  letter-spacing: -0.04em;
  margin-bottom: 0.9rem;
}

.subtitle {
  color: #94a3b8;
  max-width: 660px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 1rem;
}

.funny-line {
  margin-top: 1rem;
  color: var(--accent);
  font-size: 0.82rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

.panel {
  background: rgba(17,24,39,0.82);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.panel-header {
  background: rgba(13,17,23,0.95);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.panel-header span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.d1 { background: #ff5f57; }
.d2 { background: #febc2e; }
.d3 { background: #28c840; }

.panel-body {
  padding: 1.15rem;
  font-size: 0.78rem;
  line-height: 1.85;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.intel-panel {
  margin: 0 0 2rem;
  background:
    linear-gradient(135deg, rgba(0,212,255,0.08), rgba(124,58,237,0.08)),
    rgba(17,24,39,0.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 24px 60px rgba(0,0,0,0.18);
}

.intel-header {
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.intel-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intel-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 14px var(--accent3);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.intel-item {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(30,45,64,0.9);
  border-radius: 14px;
  background: rgba(2,6,23,0.34);
}

.intel-label {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.intel-value {
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.intel-value.accent,
.cyan {
  color: var(--accent);
}

.intel-value.warning,
.warning {
  color: var(--warning);
}

.intel-status,
.intel-fallback {
  padding: 1rem;
  border-radius: 14px;
}

.intel-status {
  border: 1px solid rgba(0,212,255,0.25);
  background: rgba(0,212,255,0.055);
}

.intel-status div + div {
  margin-top: 0.35rem;
}

.intel-fallback {
  display: none;
  margin-bottom: 1rem;
  border: 1px solid rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.09);
  color: var(--warning);
}

.intel-map {
  margin: 0 0 1rem;
  border: 1px solid rgba(0,212,255,0.22);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(2,6,23,0.42);
}

.intel-map-top {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.74);
}

.intel-map-title {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.intel-map-status {
  color: var(--muted);
  font-size: 0.72rem;
}

.intel-map-frame {
  width: 100%;
  height: 240px;
  border: 0;
  display: none;
  filter: saturate(0.9) contrast(1.05);
}

.intel-map-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

.prompt { color: var(--accent3); }
.cmd { color: var(--text); }
.danger { color: var(--danger); }
.purple { color: #a78bfa; }
.muted { color: var(--muted); }

.scan-bar {
  width: 100%;
  height: 10px;
  background: #020617;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
}

.scan-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: scan 2.5s ease forwards;
}

@keyframes scan {
  to { width: 100%; }
}

.game-box {
  position: relative;
  height: 190px;
  border: 1px dashed rgba(0,212,255,0.38);
  border-radius: 16px;
  background:
    radial-gradient(circle at center, rgba(0,212,255,0.06), transparent 50%),
    rgba(0,212,255,0.025);
  overflow: hidden;
  margin-top: 0.7rem;
}

.game-title {
  font-size: 0.72rem;
  color: var(--accent);
  padding: 0.75rem;
  position: relative;
  z-index: 2;
}

#bug {
  position: absolute;
  width: 48px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--danger), #f97316);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 28px rgba(239,68,68,0.4);
  transition: transform 0.15s;
  z-index: 3;
}

#bug:hover {
  transform: scale(1.12) rotate(8deg);
}

.score,
.achievement,
.shell-output,
.footer {
  text-align: center;
}

.score {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.achievement,
.easter {
  display: none;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border-radius: 12px;
  font-size: 0.76rem;
}

.achievement {
  background: rgba(245,158,11,0.09);
  border: 1px solid rgba(245,158,11,0.35);
  color: var(--warning);
  text-align: center;
}

.secret-shell {
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.secret-shell input {
  background: #020617;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  min-width: min(100%, 260px);
  outline: none;
}

.secret-shell input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0,212,255,0.12);
}

.shell-output {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  min-height: 22px;
}

.actions {
  justify-content: center;
  margin-top: 1.8rem;
}

.btn {
  padding: 0.85rem 1.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.25s;
  border: 0;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #07090f;
  font-weight: 700;
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 30px rgba(0,212,255,0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-ghost:hover {
  background: rgba(0,212,255,0.08);
  transform: translateY(-2px);
}

.easter {
  border: 1px solid rgba(16,185,129,0.4);
  background: rgba(16,185,129,0.08);
  color: var(--accent3);
  line-height: 1.8;
  text-align: center;
}

.footer {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.8;
}

.footer span {
  color: var(--accent);
}

@media (max-width: 820px) {
  body {
    padding: 1.25rem;
  }

  .panel-grid,
  .intel-grid {
    grid-template-columns: 1fr;
  }

  .nf-card {
    padding: 1.5rem;
  }

  .panel-body {
    font-size: 0.72rem;
  }

  .game-box {
    height: 165px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 0.8rem;
  }

  .grid {
    background-size: 52px 52px;
  }

  .nf-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .badge,
  .logo {
    font-size: 0.62rem;
  }

  h1 {
    font-size: clamp(4rem, 28vw, 6.4rem);
  }

  h2 {
    font-size: clamp(1.35rem, 8vw, 2rem);
  }

  .subtitle {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .funny-line {
    font-size: 0.72rem;
  }

  .top-row,
  .intel-map-top,
  .actions,
  .secret-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header {
    padding: 0.75rem;
  }

  .panel-body {
    padding: 0.9rem;
    font-size: 0.67rem;
  }

  .intel-live {
    font-size: 0.64rem;
  }

  .intel-map-frame {
    height: 210px;
  }

  .btn,
  .secret-shell input {
    width: 100%;
    text-align: center;
  }

  .footer {
    font-size: 0.64rem;
  }
}
