:root {
  --matrix-bg: #020409;
  --matrix-bg-secondary: rgba(2, 12, 16, 0.75);
  --matrix-green: #3cff9a;
  --matrix-green-soft: rgba(60, 255, 154, 0.3);
  --matrix-red: #ff3765;
  --matrix-white: #e0f6ff;
  --matrix-text: rgba(224, 246, 255, 0.86);
  --matrix-font: "Orbitron", "Segoe UI", sans-serif;
  --container-width: min(1100px, 92vw);
  --border-glow: 0 0 24px rgba(60, 255, 154, 0.4);
  --hero-height: clamp(85px, 13vh, 130px);
  --neon-blue: #00baff;
  --neon-blue-2: #00a2ff;
  --neon-green: #39ff14;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  color: var(--matrix-text);
  background: var(--matrix-bg);
  font-family: var(--matrix-font);
  line-height: 1.6;
}

body {
  position: relative;
  overflow-x: hidden;
}

a {
  color: var(--matrix-green);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(16, 48, 32, 0.4),
    transparent 70%
  );
}

#matrix-rain {
  width: 100%;
  height: 100%;
  display: block;
}

.hero {
  position: relative;
  z-index: 1;
  padding: clamp(0.95rem, 2.6vw, 1rem) 0 clamp(0.55rem, 1.8vw, 0.9rem);
  background: linear-gradient(
    180deg,
    rgba(2, 7, 12, 0.94) 0%,
    rgba(2, 11, 18, 0.72) 82%,
    rgba(2, 11, 18, 0.58) 100%
  );
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(60, 255, 154, 0.2);
  box-shadow: var(--border-glow);
  min-height: var(--hero-height);
  display: flex;
  align-items: center;
}

.hero__container {
  width: min(95vw, 1280px);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero__logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.3rem, 0.9vw, 0.6rem);
  padding: clamp(0.3rem, 0.8vh, 0.5rem) clamp(1.4rem, 3.2vw, 2.2rem);
  border-radius: 18px;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  letter-spacing: clamp(0.18rem, 0.72vw, 0.32rem);
  background: linear-gradient(90deg, #1fffe4 0%, #39ff14 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(48, 255, 210, 0.62),
    0 0 46px rgba(16, 190, 160, 0.5);
  isolation: isolate;
}

.hero__logo::before {
  content: "";
  position: absolute;
  inset: -48% -26%;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(44, 255, 214, 0.55),
    rgba(6, 18, 16, 0) 68%
  );
  filter: blur(30px);
  opacity: 0.7;
  z-index: -1;
}

#brand {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
#brand .logo {
  font-family: "Orbitron", monospace;
  font-weight: 900;
  font-size: 40px;
  letter-spacing: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px var(--neon-blue), 0 0 36px var(--neon-blue-2);
}

.hero__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: inherit;
}

.hero__glyph--letter {
  font-size: clamp(2.3rem, 4.8vw, 3.6rem);
}

.hero__glyph--dot {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  margin: 0 clamp(0.12rem, 0.45vw, 0.32rem);
}

.hero__glyph--zero {
  width: clamp(3.2rem, 6.2vw, 4.8rem);
  height: clamp(3.2rem, 6.2vw, 4.8rem);
}

.hero__zero-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24%;
  background: radial-gradient(
    circle,
    rgba(32, 222, 211, 0.6),
    rgba(8, 26, 22, 0.92)
  );
  box-shadow: inset 0 0 18px rgba(20, 150, 136, 0.7),
    0 0 34px rgba(34, 220, 200, 0.6);
}

.hero__zero-square {
  position: relative;
  width: 72%;
  height: 72%;
  border-radius: 18%;
  border: 3px solid rgba(60, 255, 210, 0.95);
  background: linear-gradient(
    145deg,
    rgba(20, 190, 170, 0.9),
    rgba(6, 22, 20, 0.95)
  );
  box-shadow: inset 0 0 22px rgba(22, 255, 214, 0.6);
}

.hero__zero-slash {
  position: absolute;
  inset: 18% 36%;
  background: rgba(6, 20, 18, 0.94);
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(4, 14, 12, 0.65);
}

.btn {
  border: 1px solid rgba(60, 255, 154, 0.5);
  color: var(--matrix-green);
  font: inherit;
  background: rgba(4, 12, 10, 0.7);
  padding: 0.75rem 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn--primary {
  background: linear-gradient(
    90deg,
    rgba(60, 255, 154, 0.85),
    rgba(20, 140, 90, 0.85)
  );
  color: #041409;
  box-shadow: 0 0 16px rgba(60, 255, 154, 0.35);
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(60, 255, 154, 0.35);
}

.stage {
  position: relative;
  z-index: 1;
  width: min(95vw, 1280px);
  margin: 0 auto;
  padding: clamp(1.2rem, 2.4vh, 2rem) 0 3.5rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vh, 3.5rem);
}

.stage__canvas {
  position: relative;
  border: 1px solid rgba(60, 255, 154, 0.35);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 6, 10, 0.65);
  backdrop-filter: blur(4px);
  box-shadow: var(--border-glow);
  width: 100%;
  height: clamp(420px, 74vh, 850px);
  min-height: clamp(380px, 48vh, 560px);
  max-height: 850px;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: radial-gradient(
    circle at 50% 20%,
    rgba(24, 80, 64, 0.2),
    rgba(0, 6, 10, 0.9)
  );
}

.hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: 100%;
  padding: clamp(1.25rem, 3vh, 1.75rem) clamp(1rem, 2vw, 1.5rem)
    clamp(1rem, 2vh, 1.5rem);
  align-items: flex-start;
  justify-content: flex-start;
}

.hud-overlay__panel {
  background: rgba(2, 6, 10, 0.7);
  border: 1px solid rgba(60, 255, 154, 0.25);
  padding: 0.65rem 0.95rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  text-shadow: 0 0 6px rgba(60, 255, 154, 0.45);
  flex: 1 1 200px;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(2.3rem, 3.4vh, 2.8rem);
}

.hud-overlay__panel--status {
  border-color: rgba(255, 55, 101, 0.45);
  color: var(--matrix-red);
}

.hud-overlay__button {
  pointer-events: auto;
  order: -1;
  margin-right: auto;
  padding: 0.65rem 1.8rem;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  align-self: flex-start;
  flex: 0 0 auto;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(2.3rem, 3.4vh, 2.8rem);
}

.stage__info {
  background: rgba(2, 6, 12, 0.7);
  border: 1px solid rgba(60, 255, 154, 0.15);
  border-radius: 10px;
  padding: clamp(1.5rem, 4vw, 2rem);
  box-shadow: var(--border-glow);
  width: min(95vw, 1000px);
  margin: 0 auto;
}

.stage__info h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-shadow: 0 0 8px rgba(60, 255, 154, 0.4);
}

.controls-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  list-style: none;
}

.controls-list__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: rgba(224, 246, 255, 0.8);
  font-size: 0.96rem;
  line-height: 1.6;
}

.controls-list__term {
  font-weight: 700;
  color: var(--matrix-green);
  letter-spacing: 0.04em;
}

.controls-list__value {
  flex: 1 1 auto;
}

.footer {
  background: rgba(1, 4, 6, 0.92);
  border-top: 1px solid rgba(60, 255, 154, 0.15);
  padding: 2rem 0 3rem;
  color: rgba(224, 246, 255, 0.5);
  text-align: center;
}

.footer__container {
  width: min(95vw, 1280px);
  margin: 0 auto;
}

@media (max-width: 900px) {
  .stage__canvas {
    height: clamp(300px, 56vh, 600px);
  }

  .hud-overlay {
    padding: clamp(1.5rem, 5vh, 2.2rem) 1rem 1rem;
    gap: 0.75rem;
  }

  .hud-overlay__panel {
    flex: 1 1 160px;
    min-width: 160px;
  }

  .hud-overlay__button {
    margin-right: 0;
    margin-left: 0;
    order: 4;
  }

  .hero__logo {
    letter-spacing: 0.18em;
  }
}

@media (max-width: 640px) {
  .hero__container {
    width: 95vw;
  }

  .hero__logo {
    font-size: clamp(2.2rem, 10vw, 3.4rem);
    padding: 0.7rem 1.1rem;
  }

  .stage {
    width: 95vw;
    padding-bottom: 3rem;
  }

  .stage__canvas {
    min-height: clamp(260px, 52vh, 540px);
  }

  .hud-overlay {
    padding: clamp(1.75rem, 10vh, 2.5rem) 0.75rem 0.75rem;
    gap: 0.6rem;
  }

  .hud-overlay__panel {
    flex: 1 1 140px;
    min-width: 140px;
  }

  .hud-overlay__button {
    order: 4;
    margin-right: 0;
    margin-left: 0;
    width: 100%;
    text-align: center;
    letter-spacing: 0.18em;
  }
}
