:root {
  --bg-dark: #03060e;
  --bg-mid: #07142a;
  --panel: rgba(8, 22, 22, 0.84);
  --panel-border: rgba(129, 189, 37, 0.7);
  --text-main: #e9f6dc;
  --text-muted: #b7c6aa;
  --accent: #97ea47;
  --accent-soft: #e9cf4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
}

body {
  overflow-x: hidden;
  font-family: "VT323", monospace;
}

html.manual-nav,
body.manual-nav {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.manual-nav .closing {
  display: none;
}

.experience {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(61, 113, 84, 0.25) 0%, transparent 46%),
    radial-gradient(circle at 80% 18%, rgba(20, 81, 112, 0.2) 0%, transparent 40%),
    linear-gradient(180deg, #02040a 0%, #061425 55%, #05110f 100%);
}

.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  border-top: 1px solid rgba(130, 178, 88, 0.18);
  border-bottom: 1px solid rgba(130, 178, 88, 0.18);
}

#treeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hero {
  position: absolute;
  top: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 5;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.85);
}

.hero-brand {
  margin: 0;
  font-size: clamp(1.4rem, 2.1vw, 2rem);
  color: #8df547;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0.95rem 0 0.35rem;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1rem, 2.65vw, 2.1rem);
  line-height: 1.35;
  color: #f1f7ee;
}

.hero-subtitle {
  margin: 0.35rem 0;
  color: var(--accent-soft);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  letter-spacing: 0.08em;
}

.hero-hint {
  display: inline-block;
  margin: 0.85rem 0 0;
  padding: 0.32rem 0.8rem;
  border: 2px solid rgba(148, 235, 68, 0.55);
  background: rgba(0, 0, 0, 0.44);
  color: #e8f7d5;
  font-size: 1.1rem;
  letter-spacing: 0.09em;
  animation: pulse 1.3s ease-in-out infinite;
}

.level-track {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.level-card {
  --x: 0px;
  --y: 100vh;
  --s: 0.94;
  --a: 0;
  position: absolute;
  width: min(35vw, 370px);
  min-width: 250px;
  padding: 0.85rem 0.95rem;
  transform: translate3d(var(--x), var(--y), 0) scale(var(--s));
  transform-origin: top left;
  opacity: var(--a);
  border: 2px solid rgba(134, 197, 52, 0.42);
  background:
    linear-gradient(180deg, rgba(13, 40, 42, 0.94) 0%, rgba(7, 22, 22, 0.94) 100%);
  box-shadow:
    0 0 0 1px rgba(53, 91, 26, 0.5),
    0 0 25px rgba(0, 0, 0, 0.3);
  transition: opacity 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.level-card h2 {
  margin: 0 0 0.45rem;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  line-height: 1.4;
  color: var(--accent);
}

.level-card p {
  margin: 0;
  font-size: clamp(1.35rem, 1.65vw, 1.75rem);
  line-height: 1.12;
  color: var(--text-main);
  letter-spacing: 0.01em;
}

.level-card.is-active {
  border-color: rgba(161, 245, 73, 0.95);
  box-shadow:
    0 0 0 1px rgba(165, 255, 77, 0.72),
    0 0 28px rgba(153, 255, 71, 0.18);
}

.status {
  position: absolute;
  left: clamp(0.9rem, 2.2vw, 2rem);
  bottom: clamp(0.9rem, 2.4vh, 1.5rem);
  z-index: 7;
  pointer-events: none;
  border: 2px solid rgba(160, 231, 73, 0.5);
  background: rgba(3, 11, 17, 0.8);
  padding: 0.62rem 0.75rem;
  min-width: min(48vw, 290px);
}

.status-label {
  margin: 0;
  color: #93b57c;
  font-size: 1rem;
  letter-spacing: 0.13em;
}

.status-value {
  margin: 0.1rem 0 0;
  color: #d9f9b8;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.64rem, 1vw, 0.8rem);
  line-height: 1.5;
}

.stage-nav {
  position: absolute;
  right: clamp(0.9rem, 2.1vw, 1.7rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}

.pixel-nav-btn {
  width: 4.25rem;
  height: 4.25rem;
  border: 2px solid rgba(157, 237, 74, 0.7);
  background: linear-gradient(180deg, rgba(10, 34, 27, 0.98), rgba(5, 19, 17, 0.98));
  color: #d1ff9b;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 1.4rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
  box-shadow:
    0 0 0 1px rgba(53, 94, 27, 0.6),
    inset 0 0 0 1px rgba(182, 253, 111, 0.1);
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pixel-nav-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(187, 255, 96, 0.95);
  color: #f2ffdf;
}

.pixel-nav-btn:active {
  transform: translateY(0);
}

.pixel-nav-btn:disabled {
  cursor: not-allowed;
  transform: none;
  border-color: rgba(112, 131, 85, 0.55);
  color: rgba(186, 204, 162, 0.55);
}

.stage-counter {
  margin: 0;
  min-width: 5.6rem;
  text-align: center;
  border: 2px solid rgba(156, 224, 80, 0.45);
  background: rgba(2, 11, 16, 0.78);
  color: #d8f2bf;
  font-family: "Press Start 2P", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 0.52rem 0.42rem;
}

.contact-pop {
  position: absolute;
  left: 50%;
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  z-index: 11;
  opacity: 0;
  pointer-events: none;
  border: 2px solid rgba(157, 237, 74, 0.72);
  background: linear-gradient(180deg, rgba(5, 22, 24, 0.96), rgba(3, 13, 16, 0.96));
  box-shadow:
    0 0 0 1px rgba(50, 90, 28, 0.62),
    0 0 24px rgba(124, 207, 59, 0.16);
  min-width: min(88vw, 420px);
  text-align: center;
  padding: 0.62rem 0.74rem;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.contact-pop.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.contact-pop p {
  margin: 0;
  color: #c7d5bf;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.contact-pop a {
  display: inline-block;
  margin-top: 0.2rem;
  color: #9ff960;
  text-decoration: none;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.54rem, 1.2vw, 0.7rem);
  line-height: 1.55;
}

.contact-pop a:hover {
  color: #d4ff9a;
}

.closing {
  margin: 0 auto;
  width: min(920px, calc(100% - 2rem));
  transform: translateY(-1px);
  border: 2px solid rgba(133, 190, 54, 0.5);
  background: linear-gradient(180deg, rgba(7, 16, 20, 0.96), rgba(2, 9, 12, 0.96));
  padding: 1rem 1rem 1.1rem;
  text-align: center;
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1.05;
  color: #d7e8cc;
}

.closing p {
  margin: 0;
}

.closing .accent {
  margin-top: 0.38rem;
  color: #8cf14b;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.72rem, 1.5vw, 0.98rem);
  line-height: 1.55;
}

@keyframes pulse {
  0% {
    transform: translateY(0);
    opacity: 0.88;
  }
  50% {
    transform: translateY(-2px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 0.88;
  }
}

@media (max-width: 980px) {
  .hero {
    top: 1.3rem;
    width: calc(100% - 1.6rem);
  }

  .level-card {
    width: min(62vw, 300px);
    min-width: 0;
    padding: 0.58rem 0.65rem;
  }

  .level-card h2 {
    font-size: clamp(0.5rem, 2.2vw, 0.63rem);
  }

  .level-card p {
    font-size: clamp(0.94rem, 3.6vw, 1.14rem);
    line-height: 1.08;
  }

  .status {
    right: 0.7rem;
    left: 0.7rem;
    min-width: 0;
  }

  .stage-nav {
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
  }

  .pixel-nav-btn {
    width: 3.4rem;
    height: 3.4rem;
    font-size: 1.1rem;
  }

  .stage-counter {
    min-width: 4.6rem;
    font-size: 0.62rem;
  }

  .contact-pop {
    bottom: calc(0.6rem + env(safe-area-inset-bottom));
    min-width: min(92vw, 340px);
    padding: 0.52rem 0.55rem;
  }

  .contact-pop p {
    font-size: 0.92rem;
  }

  .contact-pop a {
    font-size: 0.56rem;
  }
}
