:root {
  --bg-top: #1a0b3d;
  --bg-bottom: #0a0118;
  --neon: #00f0ff;
  --neon-2: #ff2d9b;
  --ink: #e9e6ff;
  --banner-h: 56px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-bottom);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  /* keep content clear of notches + the AdMob banner strip */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  background: radial-gradient(120% 80% at 50% -10%, var(--bg-top), var(--bg-bottom) 70%);
}

/* ── Scoreboard ───────────────────────────────────────────── */
#scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 6px;
  flex: 0 0 auto;
}

.score {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(28px, 8vw, 52px);
  min-width: 1.4em;
  text-align: center;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon), 0 0 26px rgba(0, 240, 255, 0.5);
}
#cpuScore {
  color: var(--neon-2);
  text-shadow: 0 0 10px var(--neon-2), 0 0 26px rgba(255, 45, 155, 0.5);
}

.brand {
  font-size: clamp(11px, 3vw, 15px);
  letter-spacing: 0.32em;
  opacity: 0.55;
  font-weight: 700;
}

/* ── Stage / canvas ───────────────────────────────────────── */
#stage {
  position: relative;
  flex: 1 1 auto;
  margin: 0 16px;
  min-height: 0;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  background: rgba(255, 255, 255, 0.015);
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.18) inset;
  touch-action: none;
}

/* ── Overlay (menu / game over) ───────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(10, 1, 24, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  transition: opacity 0.25s ease;
}
.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlayTitle {
  font-size: clamp(30px, 9vw, 64px);
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(0, 240, 255, 0.35));
}

#overlaySubtitle {
  opacity: 0.8;
  font-size: clamp(14px, 4vw, 18px);
}

.btn {
  margin-top: 6px;
  padding: 14px 34px;
  font-size: clamp(15px, 4.5vw, 19px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--bg-bottom);
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.45);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.btn:active {
  transform: scale(0.96);
}

.hint {
  margin-top: 4px;
  font-size: clamp(11px, 3.2vw, 13px);
  opacity: 0.5;
}

.site-links {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.65;
}
.site-links a {
  color: var(--neon);
  text-decoration: none;
}
.site-links a:hover {
  text-decoration: underline;
}
.site-links span {
  margin: 0 6px;
  opacity: 0.4;
}

/* ── Banner strip ─────────────────────────────────────────── */
#banner {
  flex: 0 0 var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  /* leave room below for the OS nav / safe area */
  padding-bottom: env(safe-area-inset-bottom);
}

#adPlaceholder {
  width: 100%;
  max-width: 360px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.4;
  border: 1px dashed rgba(233, 230, 255, 0.25);
  border-radius: 8px;
}

/* On native, the real AdMob banner overlays the footer — hide the placeholder. */
body:not(.ads-web) #adPlaceholder {
  display: none;
}

/* ── Menu options ─────────────────────────────────────────── */
#options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 2px 0;
}
.optrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.optlabel {
  width: 80px;
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
}
.optbtns {
  display: flex;
  gap: 6px;
}
.opt {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.2s ease;
}
.opt:hover {
  border-color: rgba(0, 240, 255, 0.5);
}
.opt.active {
  color: var(--bg-bottom);
  background: linear-gradient(90deg, var(--neon), var(--neon-2));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

@media (max-width: 460px), (max-height: 560px) {
  .optlabel { width: 64px; }
  .opt { padding: 6px 11px; font-size: 12px; }
  #overlayTitle { font-size: clamp(26px, 8vw, 48px); }
}
