:root {
  color-scheme: dark;
  --bg: #03070d;
  --bg-soft: rgba(7, 16, 28, 0.78);
  --panel: rgba(6, 12, 21, 0.84);
  --panel-strong: rgba(8, 18, 30, 0.92);
  --line: rgba(123, 255, 175, 0.14);
  --line-strong: rgba(123, 255, 175, 0.3);
  --text: #eafaf0;
  --muted: #9cb4a8;
  --accent: #7bffaf;
  --accent-strong: #2eff84;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(46, 255, 132, 0.08), transparent 24%),
    linear-gradient(180deg, #02050a 0%, #06111b 48%, #03060b 100%);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

.screen-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image:
    linear-gradient(transparent 0%, rgba(123, 255, 175, 0.08) 50%, transparent 100%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: screen;
}

.background-glow {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.24;
  pointer-events: none;
}

.background-glow-left {
  top: -10rem;
  left: -10rem;
  background: rgba(46, 255, 132, 0.62);
}

.background-glow-right {
  right: -10rem;
  bottom: 2rem;
  background: rgba(60, 198, 255, 0.28);
}

.section,
.site-footer {
  position: relative;
  z-index: 1;
}

.section {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0 0;
}

.terminal-window {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.hero-window {
  min-height: auto;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.2rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.terminal-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.terminal-dots {
  display: flex;
  gap: 0.45rem;
}

.terminal-dots span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.terminal-dots span:nth-child(1) {
  background: #ff5f57;
}

.terminal-dots span:nth-child(2) {
  background: #febc2e;
}

.terminal-dots span:nth-child(3) {
  background: #28c840;
}

.terminal-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.terminal-link {
  color: var(--accent);
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.terminal-button {
  min-height: 2.15rem;
  padding: 0.45rem 0.9rem;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(123, 255, 175, 0.08);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.terminal-button:hover,
.terminal-button:focus-visible,
.terminal-button[aria-expanded="true"] {
  color: #03110a;
  background: var(--accent);
  border-color: rgba(123, 255, 175, 0.8);
}

.terminal-link:hover,
.terminal-link:focus-visible {
  color: var(--accent-strong);
}

.terminal-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.2rem 2.2rem 3.4rem;
}

.terminal-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(123, 255, 175, 0.035) 50%,
    transparent 100%
  );
  animation: scanline 7s linear infinite;
  pointer-events: none;
}

.site-footer {
  color: var(--muted);
}

.minimal-layout {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}

.avatar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.avatar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 168px);
  aspect-ratio: 1;
  padding: 0.45rem;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(83, 157, 146, 0.2), rgba(7, 18, 29, 0.7) 72%);
  border: 12px solid rgba(78, 136, 128, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(153, 255, 226, 0.16),
    0 0 24px rgba(75, 184, 163, 0.12);
}

.avatar-wrap::before,
.avatar-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.avatar-wrap::before {
  inset: -14px;
  border: 2px solid rgba(74, 160, 145, 0.32);
}

.avatar-wrap::after {
  inset: -26px;
  border: 1px dashed rgba(74, 160, 145, 0.26);
  opacity: 0.72;
}

.avatar-light {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: conic-gradient(
    from 90deg,
    transparent 0%,
    rgba(128, 255, 223, 0.05) 18%,
    rgba(128, 255, 223, 0.9) 26%,
    rgba(128, 255, 223, 0.18) 33%,
    transparent 42%
  );
  animation: spinLight 4s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  pointer-events: none;
}

.avatar-light::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(128, 255, 223, 0.22);
}

.avatar-image {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid rgba(249, 252, 251, 0.92);
  box-shadow: 0 0 24px rgba(128, 255, 223, 0.12);
  filter: saturate(0.86) contrast(1.04);
}

.minimal-title {
  margin: 0.15rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.2;
  color: var(--text);
  text-align: center;
  text-shadow: 0 0 18px rgba(123, 255, 175, 0.18);
}

.intro-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  max-width: 44rem;
  margin-top: 0.25rem;
}

.intro-text {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

.intro-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 0 12px rgba(123, 255, 175, 0.3);
  transition:
    color 160ms ease,
    text-shadow 160ms ease;
}

.intro-text a:hover,
.intro-text a:focus-visible {
  color: var(--accent-strong);
  text-shadow: 0 0 18px rgba(123, 255, 175, 0.55);
}

.game-panel {
  width: min(100%, 940px);
  margin-top: 1.2rem;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid rgba(123, 255, 175, 0.18);
  border-radius: var(--radius-md);
  background: rgba(5, 14, 24, 0.36);
  box-shadow: inset 0 0 24px rgba(123, 255, 175, 0.03);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.game-eyebrow {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.game-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-button {
  min-height: 2.15rem;
  padding: 0.45rem 0.85rem;
  color: #03110a;
  border: 1px solid rgba(123, 255, 175, 0.9);
  border-radius: 999px;
  background: var(--accent);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.game-button:hover,
.game-button:focus-visible {
  transform: translateY(-1px);
}

.game-button-secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(123, 255, 175, 0.08);
}

.game-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.game-meta,
.game-score {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.game-score span {
  color: var(--accent);
}

.runner-canvas {
  display: block;
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(123, 255, 175, 0.18);
  background:
    linear-gradient(180deg, rgba(0, 14, 25, 0.78), rgba(3, 10, 18, 0.96)),
    radial-gradient(circle at top, rgba(123, 255, 175, 0.08), transparent 50%);
  cursor: pointer;
}

.qr-grid {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.9rem;
  width: min(100%, 1100px);
  margin: 1.1rem auto 0;
}

.qr-grid[hidden] {
  display: none;
}

.qr-card {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(176px, 17vw, 246px);
  padding: 0.35rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.qr-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: clamp(168px, 16vw, 238px);
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
  background: transparent;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 100%;
  padding: 0.6rem 1rem 0.8rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  background: linear-gradient(180deg, transparent, rgba(2, 5, 10, 0.8));
  pointer-events: none;
}

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes spinLight {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .game-panel {
    width: 100%;
  }

  .qr-grid {
    gap: 0.7rem;
    width: 100%;
  }

  .terminal-body {
    padding: 1.4rem 1.4rem 3rem;
  }
}

@media (max-width: 640px) {
  .terminal-bar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.7rem 1rem;
  }

  .terminal-bar-left {
    justify-content: center;
  }

  .terminal-link {
    width: 100%;
    text-align: center;
    font-size: 0.82rem;
  }

  .terminal-actions {
    width: 100%;
    justify-content: center;
    gap: 0.6rem;
  }

  .terminal-body {
    padding: 1rem 1rem 2.6rem;
  }

  .game-header,
  .game-status {
    flex-direction: column;
    align-items: stretch;
  }

  .game-actions {
    justify-content: stretch;
  }

  .game-button {
    width: 100%;
  }

  .qr-grid {
    gap: 0.35rem;
  }

  .qr-card {
    min-height: 96px;
    padding: 0.2rem;
  }

  .qr-card img {
    max-height: 92px;
  }

  .avatar-wrap {
    width: min(100%, 132px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .terminal-body::after,
  .avatar-light {
    animation: none;
  }

  .button,
  .qr-card {
    transition: none;
  }
}
