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

body {
  background: #0a0e27;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e8eaed;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#back-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  z-index: 40;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(95, 99, 104, 0.7);
  transition: background 0.2s;
  line-height: 1;
}

#back-btn:hover {
  background: #80868b;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* ---------- HUD ---------- */

#hud {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 10;
  pointer-events: none;
}

.hud-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#score {
  font-size: 40px;
  font-weight: 800;
  color: #00e5ff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.55);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

#mult {
  font-size: 20px;
  font-weight: 800;
  color: #b388ff;
  text-shadow: 0 0 14px rgba(179, 136, 255, 0.6);
}

.hud-row.sub {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #9aa0a6;
  letter-spacing: 0.4px;
}

#coins {
  color: #ffd54f;
}

#district {
  color: #ff2d95;
  opacity: 0.85;
}

#powerups {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--c);
}

.pu .bar {
  width: 92px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.pu .bar > i {
  display: block;
  height: 100%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}

.hidden {
  display: none !important;
}

#touch-hint {
  position: fixed;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  color: rgba(232, 234, 237, 0.45);
  z-index: 10;
  pointer-events: none;
}

/* ---------- Overlays ---------- */

#start-screen,
#pause-screen,
#gameover-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 24px;
  text-align: center;
}

#start-screen {
  background: radial-gradient(ellipse at 50% 45%, #1b2a4a 0%, #0a0e27 70%);
}

#pause-screen,
#gameover-screen {
  background: rgba(6, 9, 24, 0.78);
}

#start-screen h1 {
  font-size: 60px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #00e5ff;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.55), 0 0 70px rgba(255, 45, 149, 0.35);
  margin-bottom: 14px;
}

#start-screen p {
  font-size: 16px;
  color: #9aa0a6;
  line-height: 1.7;
  margin-bottom: 26px;
  max-width: 520px;
}

#start-btn,
.panel button {
  background: #00e5ff;
  border: none;
  padding: 16px 48px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #06121a;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.35);
  transition: background 0.15s, transform 0.1s;
}

#start-btn:hover,
.panel button:hover {
  background: #62efff;
}

#start-btn:active,
.panel button:active {
  transform: scale(0.95);
}

.legend {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px 34px;
  font-size: 13px;
  color: #5f6368;
}

.legend b {
  color: #9aa0a6;
}

.pickups {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.pickups span {
  color: var(--c);
  opacity: 0.9;
}

.panel {
  background: #12172e;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 16px;
  padding: 38px 46px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.panel h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff2d95;
  margin-bottom: 10px;
  text-shadow: 0 0 24px rgba(255, 45, 149, 0.4);
}

#pause-screen .panel h2 {
  color: #00e5ff;
  text-shadow: 0 0 24px rgba(0, 229, 255, 0.4);
}

.panel p {
  font-size: 17px;
  color: #e8eaed;
  margin-bottom: 6px;
  line-height: 1.6;
}

.panel .best-line {
  font-size: 14px;
  color: #9aa0a6;
  margin-bottom: 22px;
}

.panel button {
  padding: 12px 36px;
  font-size: 16px;
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  #start-screen h1 { font-size: 40px; }
  #start-screen p { font-size: 14px; }
  #score { font-size: 30px; }
  .legend { grid-template-columns: auto; gap: 5px; }
  .panel { padding: 28px 26px; }
  #hud { top: 10px; left: 12px; }
}

/* Footer link back to the arcade (internal linking / SEO) */
.site-footer {
  position: fixed;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 12px;
  line-height: 1;
  pointer-events: auto;
}
.site-footer a {
  color: #9aa0a6;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.site-footer a:hover { opacity: 1; text-decoration: underline; }

/* Page heading (SEO + screen readers) */
.page-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e8eaed;
}

@media (max-width: 700px) {
  /* keep clear of the on-screen controls, which sit bottom-centre */
  .site-footer {
    left: 10px;
    bottom: 8px;
    transform: none;
    font-size: 11px;
  }
}
