:root {
  --lime: #c6ff2e;
  --navy: #0b1433;
  --ink: #f7f5ef;
  --muted: rgba(247, 245, 239, 0.66);
  --glass: rgba(10, 16, 40, 0.55);
  --line: rgba(247, 245, 239, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #101c44;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---------- top bar ---------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  pointer-events: none;
}

.top > * {
  pointer-events: auto;
}

.back {
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.22em;
  font-weight: 500;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s var(--ease);
}

.back:hover {
  border-color: var(--lime);
}

.concept {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: blur(8px);
}

.icon-first {
  margin-left: auto;
}

.icon-btn.off {
  color: rgba(247, 245, 239, 0.35);
  text-decoration: line-through;
}

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

#hud[hidden] {
  display: none;
}

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px max(20px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.hud-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.hud-score strong {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hud-mult {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(22px, 4vw, 34px);
  color: var(--lime);
  text-shadow: 0 0 18px rgba(198, 255, 46, 0.6);
  opacity: 0.25;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

.hud-mult.on {
  opacity: 1;
}

.hud-mult.pop {
  transform: scale(1.35);
}

.hud-energy {
  width: min(38vw, 260px);
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(247, 245, 239, 0.14);
  overflow: hidden;
  border: 1px solid rgba(247, 245, 239, 0.18);
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #8fdc00, var(--lime));
  box-shadow: 0 0 14px rgba(198, 255, 46, 0.7);
  transform-origin: left;
  transition: transform 0.12s linear;
}

.bar i.low {
  background: linear-gradient(90deg, #ff4b3a, #ff9a3a);
  box-shadow: 0 0 14px rgba(255, 90, 60, 0.8);
}

/* ---------- screens ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 80px 18px 60px;
  background: radial-gradient(80% 70% at 50% 45%, rgba(11, 20, 51, 0.15), rgba(11, 20, 51, 0.6));
  animation: fade 0.6s var(--ease);
}

.screen[hidden] {
  display: none;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
}

.card {
  width: min(440px, 100%);
  text-align: center;
  padding: 34px 28px 30px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 30px 80px rgba(5, 8, 25, 0.45);
}

.brand {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: var(--lime);
}

h1 {
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  font-weight: 400;
  font-size: clamp(56px, 15vw, 96px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  font-style: italic;
  background: linear-gradient(180deg, #ffffff 30%, #ffd2a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(255, 140, 80, 0.35));
}

.tagline {
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 15px;
}

.cta {
  display: inline-block;
  min-width: 190px;
  padding: 16px 30px;
  border-radius: 999px;
  border: 0;
  background: var(--lime);
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 40px rgba(198, 255, 46, 0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 50px rgba(198, 255, 46, 0.5);
}

.ghost {
  padding: 15px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  transition: border-color 0.3s var(--ease);
}

.ghost:hover {
  border-color: var(--ink);
}

.how {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.how li {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.over-title {
  margin: 4px 0 10px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.final > span {
  display: block;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(54px, 14vw, 80px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.final small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.final b {
  color: var(--ink);
}

.reward {
  margin: 22px 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(198, 255, 46, 0.55);
  background: rgba(198, 255, 46, 0.06);
}

.code {
  margin: 2px 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.code code {
  font-family: ui-monospace, Menlo, monospace;
  color: var(--lime);
  letter-spacing: 0.06em;
}

.note {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.actions .cta {
  min-width: 0;
}

.studio {
  display: inline-block;
  margin-top: 20px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 245, 239, 0.3);
  padding-bottom: 2px;
}

.studio:hover {
  color: var(--lime);
  border-color: var(--lime);
}

.disclaimer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 16;
  margin: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(247, 245, 239, 0.5);
  pointer-events: none;
}

body.playing .disclaimer {
  display: none;
}

/* ---------- feedback ---------- */

#flash {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(circle, transparent 40%, rgba(255, 60, 40, 0.55));
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

#flash.hit {
  opacity: 1;
  transition: none;
}

#toast {
  position: fixed;
  left: 50%;
  top: 72px;
  z-index: 30;
  transform: translate(-50%, -10px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
}

@media (max-width: 520px) {
  .concept {
    display: none;
  }

  .hud-energy {
    width: 42vw;
  }

  .card {
    padding: 28px 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
}

/* ---------- embed (homepage live preview) ---------- */

body.embed .top,
body.embed .screen,
body.embed #hud,
body.embed .disclaimer,
body.embed #toast {
  display: none !important;
}

body.embed #c {
  cursor: default;
  pointer-events: none;
}

/* ---------- juice ---------- */

.pop {
  position: fixed;
  z-index: 11;
  transform: translate(-50%, -50%);
  font-family: "Archivo Black", sans-serif;
  font-size: 20px;
  color: var(--lime);
  text-shadow: 0 0 14px rgba(198, 255, 46, 0.7), 0 2px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
  animation: popUp 1s var(--ease) forwards;
}

.pop.big {
  font-size: 30px;
  color: #fff;
}

@keyframes popUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -190%) scale(1);
  }
}

.ring-flash {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 40vmin;
  height: 40vmin;
  margin: -20vmin 0 0 -20vmin;
  border-radius: 50%;
  border: 6px solid var(--lime);
  box-shadow: 0 0 40px var(--lime), inset 0 0 40px rgba(198, 255, 46, 0.6);
  opacity: 0;
  pointer-events: none;
}

.ring-flash.go {
  animation: ringOut 0.55s ease-out;
}

@keyframes ringOut {
  0% {
    opacity: 0.85;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

.count {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  font-family: "Archivo Black", sans-serif;
  font-style: italic;
  font-size: clamp(90px, 22vw, 200px);
  color: #fff;
  text-shadow: 0 0 40px rgba(198, 255, 46, 0.6), 0 10px 40px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
}

.count.go {
  animation: countIn 0.8s var(--ease) forwards;
}

@keyframes countIn {
  0% {
    opacity: 0;
    transform: scale(1.6);
  }
  25% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
  }
}

body.low::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle, transparent 45%, rgba(255, 50, 30, 0.45));
  animation: lowPulse 0.85s ease-in-out infinite;
}

@keyframes lowPulse {
  50% {
    opacity: 0.25;
  }
}

body.embed .pop,
body.embed .ring-flash,
body.embed .count {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .ring-flash.go,
  body.low::after {
    animation: none;
  }
}
