:root {
  --vw-pink: #ff4fcf;
  --vw-cyan: #3be9ff;
  --vw-blue: #1a1b48;
  --vw-ink: #090414;
  --vw-peach: #ffb36b;
  --vw-grid: rgba(59, 233, 255, 0.18);
  --vw-panel: rgba(9, 4, 20, 0.78);
  --vw-text: #f6d8ff;
}

body {
  min-height: 100vh;
  color: var(--vw-text);
  background:
    radial-gradient(1000px 520px at 50% 5%, rgba(255, 79, 207, 0.22), transparent 60%),
    radial-gradient(900px 500px at 80% 90%, rgba(59, 233, 255, 0.2), transparent 60%),
    linear-gradient(180deg, #1d1d52 0%, #160c2f 38%, #0a0519 70%, #05020f 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--vw-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--vw-grid) 1px, transparent 1px);
  background-size: 62px 62px;
  opacity: 0.35;
  transform: perspective(350px) rotateX(62deg) translateY(30%);
  transform-origin: center bottom;
}

.back-projects {
  margin-left: auto;
}

.game-container {
  width: 100%;
  max-width: 860px;
  margin: 2rem auto;
  padding: 1.25rem;
  border: 1px solid rgba(255, 79, 207, 0.55);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(24, 14, 52, 0.75), var(--vw-panel));
  box-shadow:
    0 0 0 1px rgba(59, 233, 255, 0.22) inset,
    0 20px 45px rgba(0, 0, 0, 0.4),
    0 0 35px rgba(255, 79, 207, 0.22);
  backdrop-filter: blur(6px);
}

.game-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.game-subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vw-cyan);
  text-shadow: 0 0 10px rgba(59, 233, 255, 0.8);
}

.game-header h1 {
  margin: 0;
  font-family: "Cabinet Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 4.8vw, 2.55rem);
  line-height: 1.1;
  letter-spacing: 0.09em;
  color: #ffd6f8;
  text-shadow:
    0 0 8px rgba(255, 79, 207, 0.9),
    0 0 24px rgba(255, 79, 207, 0.45),
    0 0 42px rgba(59, 233, 255, 0.3);
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
  font-family: "General Sans", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-stats > div {
  text-align: center;
  padding: 0.55rem 0.4rem;
  border: 1px solid rgba(59, 233, 255, 0.4);
  border-radius: 0.75rem;
  color: var(--vw-cyan);
  background: rgba(8, 12, 36, 0.6);
  text-shadow: 0 0 12px rgba(59, 233, 255, 0.8);
}

#gameCanvas {
  display: block;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #1a2052 0%, #151041 45%, #09061d 100%);
  border: 2px solid rgba(255, 79, 207, 0.75);
  border-radius: 0.9rem;
  box-shadow:
    0 0 0 1px rgba(59, 233, 255, 0.38),
    0 0 28px rgba(255, 79, 207, 0.35),
    0 0 45px rgba(59, 233, 255, 0.16);
  margin: 0 auto 1.2rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.game-over {
  text-align: center;
  font-family: "Cabinet Grotesk", sans-serif;
  color: #ffd5e4;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 0.8rem;
  text-shadow: 0 0 14px rgba(255, 80, 160, 0.8);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.9rem;
  justify-content: center;
}

.btn-game {
  position: relative;
  overflow: hidden;
  padding: 0.82rem 1.45rem;
  min-width: 185px;
  border: 1px solid rgba(255, 179, 107, 0.8);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 79, 207, 0.2), rgba(59, 233, 255, 0.2));
  color: #fff0fb;
  font-family: "General Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.btn-game::before {
  content: "";
  position: absolute;
  inset: -30% auto -30% -35%;
  width: 30%;
  transform: rotate(12deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
  transition: left 0.35s ease;
}

.btn-game:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--vw-cyan);
  box-shadow: 0 0 15px rgba(59, 233, 255, 0.45), 0 0 28px rgba(255, 79, 207, 0.35);
}

.btn-game:hover::before {
  left: 120%;
}

.btn-game:active {
  transform: translateY(0) scale(0.98);
}

.game-controls {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(59, 233, 255, 0.45);
  background: linear-gradient(180deg, rgba(7, 12, 38, 0.82), rgba(7, 8, 26, 0.92));
  box-shadow: 0 0 0 1px rgba(255, 79, 207, 0.2) inset;
}

.game-controls h3 {
  margin: 0 0 0.65rem;
  font-family: "Cabinet Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--vw-peach);
}

.controls-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "General Sans", sans-serif;
  font-size: 0.9rem;
}

.controls-list li {
  padding: 0.35rem 0.45rem;
  border-left: 2px solid rgba(255, 79, 207, 0.6);
  background: rgba(255, 79, 207, 0.08);
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: none;
  color: var(--vw-cyan);
  border: 1px solid rgba(59, 233, 255, 0.7);
  border-radius: 999px;
  padding: 0.58rem 1rem;
  font-family: "General Sans", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.back-link:hover {
  color: #081029;
  background: var(--vw-cyan);
  box-shadow: 0 0 18px rgba(59, 233, 255, 0.45);
}

@media (max-width: 760px) {
  .game-container {
    margin: 1.2rem auto;
    padding: 1rem 0.85rem;
  }

  .game-stats {
    gap: 0.5rem;
    font-size: 0.73rem;
  }

  .btn-game {
    width: 100%;
    min-width: 0;
  }

  .controls-list {
    grid-template-columns: 1fr;
  }
}
