:root {
  --neon-blue: #0df6ff;
  --neon-pink: #ff3fcf;
  --neon-green: #55ff8f;
  --neon-gold: #ffe36d;
  --neon-red: #ff5f5f;
  --bg-base: #050510;
  --bg-panel: rgba(10, 18, 28, 0.88);
  --bg-soft: rgba(11, 24, 36, 0.72);
  --border-soft: rgba(255, 255, 255, 0.14);
  --text-main: #f5fbff;
  --text-dim: rgba(226, 240, 255, 0.74);
  --display-font: "Press Start 2P", cursive;
  --ui-font: "VT323", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(13, 246, 255, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 63, 207, 0.18), transparent 24%),
    linear-gradient(180deg, #03040a 0%, #050510 48%, #08101d 100%);
  color: var(--text-main);
  font-family: var(--ui-font);
  overflow: hidden;
  position: relative;
  touch-action: manipulation;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.project-back-link,
.project-meta-card {
  position: fixed;
  z-index: 40;
  text-decoration: none;
  border: 1px solid var(--border-soft);
  background: rgba(4, 10, 18, 0.75);
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.project-back-link {
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--text-main);
  font-size: 1.55rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-back-link:hover {
  color: var(--text-main);
  transform: translateY(-1px);
  border-color: rgba(13, 246, 255, 0.5);
}

.project-meta-card {
  right: 18px;
  top: 18px;
  min-width: 240px;
  padding: 14px 16px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
}

.project-meta-label {
  color: var(--neon-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1.15rem;
}

.project-meta-card strong {
  font-family: var(--display-font);
  font-size: 0.92rem;
  line-height: 1.5;
}

.project-meta-copy {
  color: var(--text-dim);
  font-size: 1.35rem;
}

.neon-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 86px 22px 24px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.hero-panel,
.screen-card,
.hud,
.mobile-controls {
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.hero-panel {
  border-radius: 28px;
  padding: 28px 24px;
  display: grid;
  gap: 16px;
  align-self: start;
}

.hero-kicker,
.section-label,
.hud-label,
.panel-label,
.controls-title {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-gold);
}

.hero-title,
.main-title,
.result-title {
  font-family: var(--display-font);
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.4;
  text-shadow:
    2px 2px 0 rgba(255, 63, 207, 0.85),
    -2px -2px 0 rgba(13, 246, 255, 0.85);
}

.hero-text {
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pills span,
.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(13, 246, 255, 0.35);
  background: rgba(13, 246, 255, 0.08);
  color: var(--neon-blue);
  font-size: 1.12rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill.accent {
  border-color: rgba(255, 63, 207, 0.35);
  background: rgba(255, 63, 207, 0.08);
  color: #ffc8ef;
}

.app-shell {
  position: relative;
  min-width: 0;
}

.screen {
  min-height: calc(100vh - 110px);
  display: none;
  align-items: stretch;
  justify-content: center;
}

.screen.active {
  display: flex;
}

.screen-card {
  width: 100%;
  border-radius: 32px;
  padding: 30px;
}

.status-line,
.currency-panel,
.hero-actions,
.shop-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.main-title {
  margin-top: 28px;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1.15;
  text-shadow:
    3px 3px 0 var(--neon-pink),
    -3px -3px 0 var(--neon-blue);
  animation: glitchShift 4s infinite;
}

.subtitle {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 1.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@keyframes glitchShift {
  0%,
  92%,
  100% {
    transform: translate(0, 0);
  }
  94% {
    transform: translate(-2px, 2px);
  }
  96% {
    transform: translate(2px, -2px);
  }
}

.currency-panel,
.shop-coins {
  margin-top: 24px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 227, 109, 0.28);
  font-size: 1.65rem;
}

.currency-panel strong,
.shop-coins strong {
  color: var(--neon-gold);
}

.panel-divider {
  color: rgba(255, 255, 255, 0.35);
}

.hero-actions {
  margin-top: 26px;
}

.cyber-button,
.hud-button,
.mobile-btn {
  font-family: var(--display-font);
  text-transform: uppercase;
  color: var(--text-main);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cyber-button {
  min-height: 56px;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
  line-height: 1.5;
}

.cyber-button.primary {
  border-color: rgba(13, 246, 255, 0.45);
  background: linear-gradient(135deg, rgba(13, 246, 255, 0.18), rgba(13, 246, 255, 0.04));
  box-shadow: 0 0 0 rgba(13, 246, 255, 0);
}

.cyber-button.secondary {
  border-color: rgba(255, 63, 207, 0.45);
  background: linear-gradient(135deg, rgba(255, 63, 207, 0.18), rgba(255, 63, 207, 0.04));
}

.cyber-button.tertiary,
.hud-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.cyber-button:hover,
.hud-button:hover,
.mobile-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.24);
}

.lang-module {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.lang-chip {
  min-width: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--ui-font);
  font-size: 1.45rem;
  padding: 8px 12px;
  cursor: pointer;
}

.lang-chip.active {
  color: var(--text-main);
  border-color: rgba(85, 255, 143, 0.55);
  background: rgba(85, 255, 143, 0.12);
}

.controls-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.controls-grid article {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.controls-grid p {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 1.35rem;
  line-height: 1.25;
}

.shop-card {
  display: grid;
  gap: 20px;
}

.shop-topline h2 {
  font-family: var(--display-font);
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 8px;
}

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

.skin-card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 14px;
}

.skin-card.owned {
  border-color: rgba(85, 255, 143, 0.38);
}

.skin-card.equipped {
  border-color: rgba(255, 227, 109, 0.55);
  box-shadow: 0 0 30px rgba(255, 227, 109, 0.12);
}

.skin-preview {
  height: 150px;
  border-radius: 18px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  display: grid;
  place-items: center;
}

.mini-tank {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 0 22px currentColor;
}

.mini-tank::before,
.mini-tank::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
}

.mini-tank::before {
  top: -18px;
  width: 14px;
  height: 30px;
  background: currentColor;
}

.mini-tank::after {
  inset: 12px;
  background: rgba(255, 255, 255, 0.22);
}

.skin-copy h3 {
  font-family: var(--display-font);
  font-size: 0.76rem;
  line-height: 1.5;
}

.skin-copy p {
  margin-top: 8px;
  font-size: 1.28rem;
  color: var(--text-dim);
}

.skin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.skin-cost {
  font-size: 1.5rem;
  color: var(--neon-gold);
}

.skin-action {
  min-width: 160px;
}

.hud {
  border-radius: 24px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.hud-box {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 6px;
}

.hud-box strong {
  font-size: 1.8rem;
}

.hud-button {
  border-radius: 18px;
  font-size: 0.72rem;
  min-height: 100%;
}

.game-wrapper {
  margin-top: 14px;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1px rgba(13, 246, 255, 0.08);
}

#gameCanvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 2;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(1, 3, 8, 0.62);
}

.pause-overlay.hidden {
  display: none;
}

.overlay-card,
.result-card {
  text-align: center;
}

.overlay-card {
  width: min(92%, 420px);
  padding: 26px;
  border-radius: 28px;
  background: rgba(4, 11, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-card h2 {
  margin-top: 12px;
  font-family: var(--display-font);
  font-size: 0.88rem;
  line-height: 1.6;
}

.overlay-card p {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 1.35rem;
}

.mobile-controls {
  margin-top: 14px;
  border-radius: 24px;
  padding: 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.mobile-dpad {
  display: grid;
  gap: 8px;
}

.mobile-row {
  display: flex;
  gap: 8px;
}

.mobile-btn {
  min-width: 64px;
  min-height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
}

.mobile-btn.fire {
  min-width: 120px;
  border-color: rgba(255, 63, 207, 0.38);
  background: rgba(255, 63, 207, 0.14);
}

.result-card {
  max-width: 720px;
  margin: auto;
}

.result-title {
  margin-top: 10px;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  line-height: 1.5;
}

.result-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-grid div {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-grid span {
  display: block;
  color: var(--text-dim);
  font-size: 1.3rem;
}

.result-grid strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: var(--neon-gold);
}

@media (max-width: 1180px) {
  .neon-shell {
    grid-template-columns: 1fr;
    padding-top: 116px;
  }

  .hero-panel {
    gap: 12px;
  }
}

@media (max-width: 900px) {
  body {
    overflow-y: auto;
  }

  .project-meta-card {
    left: 18px;
    right: 18px;
    top: 72px;
    min-width: 0;
  }

  .project-back-link {
    top: 14px;
    left: 14px;
  }

  .neon-shell {
    padding: 170px 14px 20px;
  }

  .screen {
    min-height: 0;
  }

  .screen-card {
    padding: 22px;
  }

  .controls-grid,
  .skins-grid,
  .result-grid,
  .hud {
    grid-template-columns: 1fr;
  }

  .mobile-controls {
    display: flex;
  }
}

@media (max-width: 640px) {
  .project-meta-card {
    border-radius: 16px;
  }

  .hero-actions,
  .shop-topline,
  .status-line {
    flex-direction: column;
    align-items: stretch;
  }

  .cyber-button,
  .hud-button {
    width: 100%;
  }

  .mobile-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-row {
    justify-content: center;
  }

  .mobile-btn,
  .mobile-btn.fire {
    width: 100%;
    min-width: 0;
  }
}
