/* Neuriosity — shared game kit (styles)
   Everything every game has in common: the play surface, HUD, results
   screen, buttons and the email capture block.

   All sizing derives from --gu (game unit), which NeuriosityGame sets via
   ResizeObserver to min(width, height) / 100 of the play area. That is why a
   game looks identical on a phone, a desktop and in fullscreen.

   Per-game styles live in assets/games/<slug>/<slug>.css and should only
   describe that game's own playfield. */

.neu-game {
  --gu: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--gu) * 3);
  width: 100%;
  height: 100%;
  padding: calc(var(--gu) * 3.5);
  color: var(--navy, #062b63);
  font-family: inherit;
  text-align: center;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

.neu-game *,
.neu-game *::before,
.neu-game *::after { box-sizing: border-box; }

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

.neu-hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--gu) * 4);
  width: 100%;
  max-width: calc(var(--gu) * 86);
}

.neu-hud__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.neu-hud__item span {
  color: var(--ink-soft, #526b8e);
  font-size: calc(var(--gu) * 2.5);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.neu-hud__item strong {
  font-size: calc(var(--gu) * 5.4);
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Lives: filled pips that grey out as they are spent. */
.neu-lives { display: flex; gap: calc(var(--gu) * 1.2); }

.neu-lives i {
  width: calc(var(--gu) * 2.6);
  height: calc(var(--gu) * 2.6);
  background: var(--coral, #f15f6d);
  border-radius: 50%;
  transition: background 200ms ease, transform 200ms ease;
}

.neu-lives i.is-lost {
  background: rgba(6, 43, 99, 0.14);
  transform: scale(0.72);
}

/* Progress dots: empty pips that fill as rounds complete. */
.neu-dots { display: flex; gap: calc(var(--gu) * 1.2); }

.neu-dots i {
  width: calc(var(--gu) * 2.6);
  height: calc(var(--gu) * 2.6);
  background: rgba(6, 43, 99, 0.14);
  border-radius: 50%;
  transition: background 200ms ease, transform 200ms ease;
}

.neu-dots i.is-done {
  background: var(--neu-accent, var(--blue, #0878e8));
  transform: scale(1.05);
}

/* ---------- Status line ---------- */

.neu-status {
  min-height: calc(var(--gu) * 5);
  color: var(--ink-soft, #526b8e);
  font-size: calc(var(--gu) * 3.1);
  font-weight: 600;
}

.neu-status strong { color: var(--navy, #062b63); font-weight: 800; }

/* ---------- Chips (per-attempt readouts) ---------- */

.neu-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--gu) * 1.2);
  min-height: calc(var(--gu) * 5);
}

.neu-chip {
  padding: calc(var(--gu) * 0.7) calc(var(--gu) * 1.8);
  color: var(--navy, #062b63);
  font-size: calc(var(--gu) * 2.4);
  font-weight: 800;
  background: #fff;
  border: calc(var(--gu) * 0.24) solid rgba(8, 120, 232, 0.24);
  border-radius: 999px;
}

.neu-chip--muted { color: var(--ink-soft, #526b8e); opacity: 0.65; }

/* ---------- Results ---------- */

/* Every size here has an absolute floor as well as a --gu size. In a 4:3
   frame at phone width --gu is about 2.8px, which left this screen rendering
   its text at eight pixels and its email field at twenty-three — on the one
   screen in the whole site that asks the visitor to do something. The floors
   win on a phone, the --gu sizes win everywhere else, and because the screen
   is now taller than a phone frame it scrolls: score and Play Again sit at
   the top, the signup below them. */
.neu-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, calc(var(--gu) * 82));
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: neu-fade 320ms ease;
}

@keyframes neu-fade {
  from { opacity: 0; transform: translateY(calc(var(--gu) * 2)); }
  to { opacity: 1; transform: none; }
}

.neu-results__kicker {
  color: var(--ink-soft, #526b8e);
  font-size: max(11px, calc(var(--gu) * 2.6));
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.neu-results__score {
  margin: calc(var(--gu) * 0.6) 0 0;
  color: var(--neu-accent, var(--blue, #0878e8));
  font-size: max(40px, calc(var(--gu) * 13));
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.neu-results__score small {
  font-size: max(15px, calc(var(--gu) * 4.2));
  font-weight: 700;
  letter-spacing: -0.02em;
}

.neu-results__label {
  margin: calc(var(--gu) * 0.4) 0 0;
  font-size: max(15px, calc(var(--gu) * 4));
  font-weight: 800;
  letter-spacing: -0.02em;
}

.neu-results__meta {
  margin: calc(var(--gu) * 1.2) 0 0;
  color: var(--ink-soft, #526b8e);
  font-size: max(12px, calc(var(--gu) * 2.8));
}

.neu-results__meta b { color: var(--navy, #062b63); }

.neu-best-flag {
  display: inline-block;
  margin-top: calc(var(--gu) * 1.2);
  padding: calc(var(--gu) * 0.7) calc(var(--gu) * 2);
  color: #8a5b00;
  font-size: max(11px, calc(var(--gu) * 2.5));
  font-weight: 800;
  background: var(--yellow, #ffc835);
  border-radius: 999px;
}

/* ---------- Buttons ---------- */

.neu-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--gu) * 1.6);
  margin-top: calc(var(--gu) * 2.6);
}

.neu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--gu) * 1);
  min-height: max(44px, calc(var(--gu) * 8));
  padding: 0 max(18px, calc(var(--gu) * 3.4));
  color: #fff;
  font: inherit;
  font-size: max(14px, calc(var(--gu) * 2.9));
  font-weight: 800;
  text-decoration: none;
  background: var(--neu-accent, var(--blue, #0878e8));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.neu-btn:hover,
.neu-btn:focus-visible {
  background: var(--navy, #062b63);
  transform: translateY(calc(var(--gu) * -0.3));
}

.neu-btn--ghost {
  color: var(--navy, #062b63);
  background: transparent;
  border: calc(var(--gu) * 0.28) solid rgba(6, 43, 99, 0.22);
}

.neu-btn--ghost:hover,
.neu-btn--ghost:focus-visible { color: #fff; background: var(--navy, #062b63); }

/* ---------- Email capture ----------
   The single conversion surface shared by every game. Editing it here
   changes it across the whole site. */

.neu-capture {
  width: 100%;
  margin-top: calc(var(--gu) * 3);
  padding: calc(var(--gu) * 2.6);
  background: rgba(255, 255, 255, 0.82);
  border: calc(var(--gu) * 0.26) solid rgba(8, 120, 232, 0.2);
  border-radius: calc(var(--gu) * 3);
}

.neu-capture__title {
  margin: 0;
  font-size: max(15px, calc(var(--gu) * 3.1));
  font-weight: 800;
  letter-spacing: -0.02em;
}

.neu-capture__sub {
  margin: calc(var(--gu) * 0.6) 0 calc(var(--gu) * 1.8);
  color: var(--ink-soft, #526b8e);
  font-size: max(12px, calc(var(--gu) * 2.5));
  line-height: 1.4;
}

.neu-capture__row { display: flex; gap: calc(var(--gu) * 1.2); }

.neu-capture input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  height: max(44px, calc(var(--gu) * 8));
  padding: 0 max(14px, calc(var(--gu) * 2.4));
  color: var(--navy, #062b63);
  font: inherit;
  font-size: max(16px, calc(var(--gu) * 2.8));
  background: #fff;
  border: calc(var(--gu) * 0.26) solid rgba(6, 43, 99, 0.18);
  border-radius: 999px;
}

.neu-capture input[type="email"]:focus-visible {
  outline: calc(var(--gu) * 0.5) solid var(--blue-bright, #19a4f3);
  outline-offset: calc(var(--gu) * 0.3);
}

.neu-capture__note {
  margin: calc(var(--gu) * 1.2) 0 0;
  color: var(--ink-soft, #526b8e);
  font-size: max(11px, calc(var(--gu) * 2.2));
}

.neu-capture[data-done="true"] .neu-capture__row { display: none; }

@media (max-width: 620px) {
  .neu-capture__row { flex-direction: column; }
  .neu-capture .neu-btn { justify-content: center; }
}

/* ---------- Utilities ---------- */

.neu-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .neu-game *, .neu-game *::before, .neu-game *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
