:root {
  --bg-space: #05030f;
  --bg-grid: #141226;
  --scanline: rgba(255, 255, 255, 0.04);
  --pixel-green: #9aff87;
  --pixel-cyan: #53f7ff;
  --pixel-orange: #ff9f4a;
  --pixel-red: #ff4e4e;
  --text: #f1f6ff;
  --panel: rgba(5, 8, 20, 0.88);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Press Start 2P", monospace;
  color: var(--text);
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 3px,
      var(--scanline) 3px 4px
    ),
    radial-gradient(circle at 30% 10%, #191338 0%, #080512 38%, #020106 100%);
  overflow-x: hidden;
}

.site-shell {
  width: min(1200px, 100vw);
  margin: 0 auto;
  padding: 16px;
}

.game-shell {
  min-height: calc(100svh - 32px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.hud {
  border: 3px solid var(--pixel-cyan);
  padding: 14px;
  background: rgba(5, 4, 15, 0.75);
  box-shadow: 0 0 0 3px #17143a inset, 0 0 20px rgba(83, 247, 255, 0.25);
}

.hud h1 {
  margin: 0;
  font-size: clamp(0.8rem, 2.4vw, 1rem);
  line-height: 1.6;
  color: var(--pixel-cyan);
}

.hud p {
  margin: 10px 0 0;
  font-size: clamp(0.5rem, 1.6vw, 0.65rem);
  line-height: 1.7;
}

.playfield {
  position: relative;
  border: 4px solid var(--pixel-green);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 15%, rgba(83, 247, 255, 0.15), transparent 35%),
    radial-gradient(circle at 20% 75%, rgba(255, 159, 74, 0.15), transparent 40%),
    linear-gradient(180deg, #0d0a1f 0%, #06030f 100%);
  cursor: none;
}

.playfield::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(83, 247, 255, 0.18) 100%),
    linear-gradient(90deg, transparent 95%, rgba(83, 247, 255, 0.1) 100%);
  background-size: 32px 32px;
  opacity: 0.25;
  pointer-events: none;
}

.ship {
  position: absolute;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%) rotate(0deg);
  pointer-events: none;
  z-index: 5;
}

.ship::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%);
  background: var(--pixel-cyan);
  box-shadow: 0 0 12px rgba(83, 247, 255, 0.8);
}

.ship::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  left: 50%;
  top: 72%;
  transform: translateX(-50%);
  background: var(--pixel-orange);
  clip-path: polygon(50% 100%, 100% 0, 0 0);
}

.comet {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9bf, #ff9f4a 60%, #cf4f26);
  box-shadow: 0 0 18px rgba(255, 117, 67, 0.45);
}

.comet::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 16px;
  right: 75%;
  top: 35%;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 191, 140, 0.75), transparent 80%);
  transform: rotate(-15deg);
}

.portal {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 102px;
  min-height: 38px;
  padding: 0 8px;
  border: 2px solid var(--pixel-cyan);
  color: var(--pixel-cyan);
  text-decoration: none;
  font-size: 0.55rem;
  line-height: 1.2;
  background: rgba(3, 8, 21, 0.8);
  box-shadow: 0 0 0 2px #12213c inset;
  transition: transform 120ms linear;
}

.portal:hover {
  transform: scale(1.05);
}

.status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  margin: 0;
  max-width: min(700px, 85%);
  color: var(--pixel-green);
  font-size: clamp(0.48rem, 1.3vw, 0.6rem);
  line-height: 1.6;
  z-index: 7;
}

.status.warn {
  color: var(--pixel-orange);
}

.status.alert {
  color: var(--pixel-red);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding-bottom: 8px;
}

.target-link {
  border: 2px solid var(--pixel-green);
  color: var(--pixel-green);
  text-decoration: none;
  padding: 7px 9px;
  font-size: 0.5rem;
  background: rgba(7, 10, 19, 0.8);
}

.content-zone {
  margin-top: 24px;
  padding: 18px;
  border: 3px solid var(--pixel-cyan);
  background:
    linear-gradient(180deg, rgba(10, 16, 40, 0.9), rgba(5, 8, 19, 0.95)),
    var(--panel);
  box-shadow: 0 0 0 3px #131e40 inset;
}

.zone-header {
  margin-bottom: 14px;
}

.zone-kicker {
  margin: 0;
  color: var(--pixel-orange);
  font-size: 0.52rem;
}

.content-zone h2 {
  margin: 8px 0 0;
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  color: var(--pixel-cyan);
}

.content-zone h3 {
  margin: 0 0 10px;
  color: var(--pixel-green);
  font-size: 0.62rem;
}

.zone-panel {
  border: 2px solid var(--pixel-green);
  background: rgba(8, 12, 28, 0.86);
  padding: 12px;
}

.zone-panel p {
  margin: 0 0 12px;
  font-size: 0.56rem;
  line-height: 1.9;
}

.zone-panel p:last-child {
  margin-bottom: 0;
}

.project-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skills-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skills-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px;
  border: 2px dashed rgba(83, 247, 255, 0.5);
  font-size: 0.54rem;
  text-align: center;
}

@media (max-width: 900px) {
  .project-grid,
  .skills-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 10px;
  }

  .game-shell {
    min-height: calc(100svh - 20px);
    gap: 8px;
  }

  .playfield {
    border-width: 3px;
  }

  .portal {
    min-width: 90px;
    min-height: 34px;
    font-size: 0.48rem;
  }

  .content-zone {
    margin-top: 16px;
    padding: 14px;
  }
}
