/* =========================================================================
   Лопай пуговки — contest page for the «Пуговки» loyalty programme.
   Warm brand background, Onest, flat friendly cards, glossy sewing buttons.
   The page is intentionally self-contained: only local fonts, no external
   requests, no payments and no ad SDKs.
   ========================================================================= */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #1F2742;
  --navy-soft: rgba(31, 39, 66, 0.68);
  --navy-faint: rgba(31, 39, 66, 0.14);
  --violet: #6260C6;
  --lavender: #D2D0FF;
  --lavender-bg: #E9E8FF;
  --coral: #E8623E;
  --coral-dark: #C94B2E;
  --sand: #FFF4DF;
  --cream: #FFFDF7;
  --yellow: #FED78C;
  --yellow-deep: #E7B45D;
  --white: #FFFFFF;
  --shadow: 0 14px 34px rgba(31, 39, 66, 0.10);
  --shadow-soft: 0 6px 18px rgba(31, 39, 66, 0.08);
  --radius: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: 'Onest', 'Segoe UI', 'Arial', sans-serif;
}

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

html {
  height: 100%;
  background: var(--lavender-bg);
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(120% 80% at 50% 0%, #F4EFFF 0%, #E9E8FF 55%, #E2E0FA 100%);
  color: var(--navy);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.gj-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.gj-ico {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.16em;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------ shell */

.gj-app {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  isolation: isolate;
}

@media (min-width: 560px) {
  body {
    padding: 16px;
    display: grid;
    place-items: center;
  }

  .gj-app {
    height: min(920px, calc(100dvh - 32px));
    min-height: 620px;
    border-radius: 34px;
    box-shadow: 0 30px 80px rgba(31, 39, 66, 0.22), 0 0 0 1px rgba(31, 39, 66, 0.06);
  }
}

.gj-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.gj-aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.65;
}

.gj-aurora i:nth-child(1) {
  width: 280px;
  height: 280px;
  top: -100px;
  left: -90px;
  background: rgba(210, 208, 255, 0.9);
}

.gj-aurora i:nth-child(2) {
  width: 220px;
  height: 220px;
  top: 26%;
  right: -120px;
  background: rgba(254, 215, 140, 0.42);
}

.gj-aurora i:nth-child(3) {
  width: 260px;
  height: 260px;
  bottom: -150px;
  left: 10%;
  background: rgba(232, 98, 62, 0.13);
}

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

.gj-screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}

.gj-screen.is-active {
  display: flex;
  animation: gj-screen-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gj-screen--menu {
  overflow: hidden;
}

.gj-screen--game {
  padding: calc(8px + var(--safe-top)) 12px calc(8px + var(--safe-bottom));
  gap: 8px;
  overflow: hidden;
}

.gj-screen--result {
  overflow-y: auto;
  overscroll-behavior: contain;
}

@keyframes gj-screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.gj-top {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: calc(16px + var(--safe-top)) 18px 8px;
}

.gj-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  user-select: none;
}

.gj-brand__word {
  display: flex;
  align-items: center;
  color: var(--navy);
  font-size: clamp(28px, 8.6vw, 38px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.gj-brand__o {
  width: 0.95em;
  height: 0.95em;
  margin: 0 0.01em;
  flex: 0 0 auto;
  transform: translateY(-0.02em);
}

.gj-brand__tag {
  padding-left: 0.18em;
  color: var(--violet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gj-top__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gj-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px 0 10px;
  border: 1.5px solid rgba(31, 39, 66, 0.08);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.gj-chip .gj-ico {
  width: 24px;
  height: 24px;
}

.gj-chip--wallet b {
  font-variant-numeric: tabular-nums;
}

.gj-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid rgba(31, 39, 66, 0.08);
  border-radius: 15px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  color: var(--navy);
  transition: transform 0.12s ease, background 0.12s ease;
}

.gj-icon-btn:active {
  transform: scale(0.94);
  background: var(--sand);
}

.gj-icon-btn .gj-ico {
  width: 21px;
  height: 21px;
}

/* ------------------------------------------------------------------- menu */

.gj-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(98, 96, 198, 0.25) transparent;
}

.gj-hero {
  position: relative;
  padding: 20px 2px 14px;
  text-align: center;
}

.gj-kicker {
  position: relative;
  z-index: 3;
  margin: 0 0 8px;
  padding: 0 8px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gj-hero__title {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--navy);
  font-size: clamp(42px, 13.4vw, 66px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.86;
}

.gj-hero__title em {
  color: var(--coral);
  font-style: normal;
}

.gj-hero__lead {
  position: relative;
  z-index: 2;
  max-width: 310px;
  margin: 14px auto 0;
  color: var(--navy-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

/* Floating buttons, pure CSS: a glossy disc with two holes. */
.gj-bubble {
  position: absolute;
  width: var(--s);
  height: var(--s);
  left: var(--x);
  top: var(--y);
  border-radius: 50%;
  background: var(--c);
  box-shadow:
    inset -5px -7px 12px rgba(31, 39, 66, 0.24),
    inset 4px 5px 10px rgba(255, 255, 255, 0.45),
    0 8px 16px rgba(31, 39, 66, 0.13);
  transform: rotate(var(--r));
  animation: gj-float 5.5s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.gj-bubble::before {
  content: '';
  position: absolute;
  left: 22%;
  top: 13%;
  width: 34%;
  height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(1px);
  transform: rotate(-24deg);
}

.gj-bubble i {
  position: absolute;
  top: 44%;
  width: 14%;
  height: 14%;
  border-radius: 50%;
  background: rgba(31, 39, 66, 0.53);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.gj-bubble i:first-child {
  left: 28%;
}

.gj-bubble i:last-child {
  right: 28%;
}

.gj-bubble--b { animation-delay: -1.2s; }
.gj-bubble--c { animation-delay: -2.4s; }
.gj-bubble--d { animation-delay: -3.1s; }
.gj-bubble--e { animation-delay: -4.2s; }

@keyframes gj-float {
  0%, 100% { transform: translateY(0) rotate(var(--r)); }
  50% { transform: translateY(-9px) rotate(calc(var(--r) + 4deg)); }
}

.gj-play-card {
  position: relative;
  z-index: 2;
  padding: 14px;
  border: 1.5px solid rgba(31, 39, 66, 0.07);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.gj-play-card__math {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 12px;
}

.gj-play-card__math > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gj-play-card__math > div:last-child {
  text-align: right;
}

.gj-play-card__math small {
  color: var(--navy-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gj-play-card__math b {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.gj-play-card__math b span {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.62;
}

.gj-play-card__math .gj-play-card__win {
  color: var(--coral);
}

.gj-arrow {
  width: 26px;
  height: 26px;
  color: var(--violet);
  opacity: 0.65;
}

.gj-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border: 1.5px solid transparent;
  border-radius: 17px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.gj-btn:active {
  transform: translateY(2px);
}

.gj-btn--primary {
  border-color: rgba(31, 39, 66, 0.12);
  background: var(--yellow);
  color: var(--navy);
  box-shadow: 0 5px 0 var(--yellow-deep), 0 12px 22px rgba(231, 180, 93, 0.25);
}

.gj-btn--primary:active {
  box-shadow: 0 2px 0 var(--yellow-deep), 0 6px 12px rgba(231, 180, 93, 0.22);
}

.gj-btn:disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.gj-btn--primary:disabled {
  background: #F1E7D8;
  color: rgba(31, 39, 66, 0.55);
  border-color: rgba(31, 39, 66, 0.06);
}

.gj-btn--primary.is-warn {
  background: #FFE0D4;
  box-shadow: 0 5px 0 #E8A58B, 0 12px 22px rgba(232, 98, 62, 0.16);
}

.gj-btn--ghost {
  border-color: rgba(98, 96, 198, 0.16);
  background: var(--lavender-bg);
  color: var(--navy);
}

.gj-btn--plain {
  background: transparent;
  color: var(--violet);
}

.gj-btn--danger {
  border-color: rgba(232, 98, 62, 0.25);
  background: #FBE1DA;
  color: #9D351C;
}

.gj-btn--sm {
  min-height: 42px;
  margin-top: 8px;
  font-size: 13px;
}

.gj-btn--xl {
  min-height: 68px;
  padding: 10px 15px;
  text-align: left;
  justify-content: flex-start;
}

.gj-btn--xl .gj-btn__chev {
  margin-left: auto;
  padding-right: 2px;
  font-size: 26px;
  font-weight: 500;
  opacity: 0.45;
}

.gj-btn__icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.gj-btn__icon .gj-ico {
  width: 22px;
  height: 22px;
  color: var(--navy);
}

.gj-btn__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gj-btn__text b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gj-btn__text small {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.58;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gj-rewards {
  margin-top: 12px;
  padding: 13px 14px 14px;
  border: 1.5px dashed rgba(98, 96, 198, 0.26);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.55);
}

.gj-rewards__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.gj-rewards__head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gj-rewards__head span {
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.gj-rewards__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gj-rewards__list li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 8px 9px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid rgba(31, 39, 66, 0.05);
}

.gj-rewards__list li.is-best {
  background: var(--lavender-bg);
  border-color: rgba(98, 96, 198, 0.18);
}

.gj-rewards__round {
  display: inline-grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
}

.gj-rewards__list li.is-best .gj-rewards__round {
  background: var(--coral);
  color: var(--white);
}

.gj-rewards__list b {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.gj-rewards__list small {
  color: var(--navy-soft);
  font-size: 9px;
  font-weight: 600;
}

.gj-menu-stats {
  margin: 12px 0 0;
  color: var(--navy-soft);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.gj-note-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1.5px solid rgba(98, 96, 198, 0.14);
  border-radius: 20px;
  background: rgba(233, 232, 255, 0.58);
}

.gj-note-card__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--white);
  color: var(--violet);
}

.gj-note-card__icon .gj-ico {
  width: 16px;
  height: 16px;
}

.gj-note-card p {
  margin: 0;
  color: var(--navy-soft);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
}

.gj-note-card b {
  color: var(--navy);
}

.gj-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 20px calc(12px + var(--safe-bottom));
  color: rgba(31, 39, 66, 0.5);
  font-size: 10px;
  font-weight: 600;
}

.gj-foot i {
  font-style: normal;
  opacity: 0.5;
}

.gj-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--violet);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.gj-link:active {
  opacity: 0.7;
}

/* ------------------------------------------------------------------- game */

.gj-hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 0;
}

.gj-hud__spacer {
  flex: 1 1 auto;
}

.gj-round-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 15px;
  background: var(--lavender-bg);
  border: 1.5px solid rgba(98, 96, 198, 0.12);
}

.gj-round-chip small {
  color: var(--violet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gj-round-chip b {
  display: flex;
  align-items: baseline;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.gj-round-chip b i {
  font-style: normal;
  font-size: 11px;
  opacity: 0.45;
}

.gj-hud .gj-chip {
  min-height: 40px;
  padding: 0 12px 0 8px;
  font-size: 15px;
}

.gj-hud .gj-chip .gj-ico {
  width: 21px;
  height: 21px;
}

.gj-hud .gj-icon-btn {
  width: 42px;
  height: 42px;
}

.gj-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(31, 39, 66, 0.09);
  border-radius: 28px;
  background: var(--cream);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 14px 30px rgba(31, 39, 66, 0.08);
}

#gjCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.gj-round-intro {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(255, 253, 247, 0.88);
  backdrop-filter: blur(5px);
  text-align: center;
  pointer-events: none;
  animation: gj-intro-in 0.22s ease both;
}

.gj-round-intro small {
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gj-round-intro b {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.gj-round-intro span {
  color: var(--navy-soft);
  font-size: 12px;
  font-weight: 600;
}

@keyframes gj-intro-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gj-game-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.gj-score {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 48px;
}

.gj-score--right {
  text-align: right;
}

.gj-score small {
  color: var(--violet);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gj-score b {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.gj-game-hint {
  margin: 0;
  color: var(--navy-soft);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* ----------------------------------------------------------------- result */

.gj-result {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: calc(28px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  text-align: center;
}

.gj-result__title {
  margin: 0;
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.gj-result__sub {
  max-width: 300px;
  margin: 10px auto 0;
  color: var(--navy-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.gj-reward-big {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 18px auto 16px;
  padding: 16px 18px 12px;
  border: 1.5px dashed rgba(232, 98, 62, 0.35);
  border-radius: 24px;
  background: var(--sand);
}

.gj-reward-big__ico {
  width: 34px;
  height: 34px;
  align-self: center;
  margin-right: 2px;
}

.gj-reward-big b {
  color: var(--coral);
  font-size: clamp(52px, 16vw, 72px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.gj-reward-big.is-zero b {
  color: var(--navy-soft);
}

.gj-reward-big span {
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 700;
}

.gj-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.gj-result-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid rgba(31, 39, 66, 0.06);
  border-radius: 15px;
  background: var(--white);
}

.gj-result-grid small {
  color: var(--navy-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gj-result-grid b {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.gj-result-grid i {
  color: var(--navy-soft);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 600;
}

.gj-result .gj-btn + .gj-btn {
  margin-top: 9px;
}

.gj-demo-note {
  margin: 12px 0 0;
  color: var(--navy-soft);
  font-size: 11px;
  font-weight: 600;
}

.gj-result__fine {
  margin: 14px 0 0;
  color: rgba(31, 39, 66, 0.42);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ modal */

.gj-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 39, 66, 0.36);
  backdrop-filter: blur(5px);
  animation: gj-fade-in 0.2s ease both;
}

.gj-modal__card {
  position: relative;
  width: 100%;
  max-width: 370px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 24px 20px 20px;
  border-radius: 28px;
  background: var(--cream);
  box-shadow: 0 26px 70px rgba(31, 39, 66, 0.3);
  text-align: left;
  animation: gj-card-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.gj-modal__card h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.gj-modal__card--compact {
  max-width: 330px;
  text-align: center;
}

.gj-modal__card--compact h2 {
  margin-bottom: 8px;
}

.gj-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--lavender-bg);
  box-shadow: none;
}

.gj-modal__text {
  margin: 0 0 14px;
  color: var(--navy-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.gj-modal__text b {
  color: var(--navy);
}

.gj-modal__fine {
  margin: 12px 0 0;
  color: rgba(31, 39, 66, 0.45);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.35;
}

.gj-modal .gj-btn + .gj-btn {
  margin-top: 8px;
}

.gj-steps {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.gj-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.gj-steps li > span {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lavender-bg);
  color: var(--violet);
  font-size: 11px;
  font-weight: 800;
}

.gj-steps div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gj-steps b {
  font-size: 13px;
  font-weight: 800;
}

.gj-steps small {
  color: var(--navy-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

@keyframes gj-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gj-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------- misc */

.gj-toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + var(--safe-bottom));
  z-index: 200;
  max-width: min(330px, calc(100vw - 40px));
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--cream);
  box-shadow: 0 12px 30px rgba(31, 39, 66, 0.25);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.gj-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.gj-confetti {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.gj-confetti i {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset -2px -2px 3px rgba(31, 39, 66, 0.2);
  animation: gj-confetti-fall var(--t) cubic-bezier(0.2, 0.6, 0.5, 1) var(--d) both;
}

@keyframes gj-confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate3d(var(--dx), 105dvh, 0) rotate(var(--rot)); opacity: 0.9; }
}

.gj-noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--cream);
  color: var(--navy);
  font: 600 16px/1.4 var(--font);
  text-align: center;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 365px) {
  .gj-top {
    padding-left: 14px;
    padding-right: 14px;
  }

  .gj-brand__word {
    font-size: 27px;
  }

  .gj-brand__tag {
    display: none;
  }

  .gj-menu {
    padding-left: 14px;
    padding-right: 14px;
  }

  .gj-hero {
    padding-top: 14px;
  }

  .gj-hero__title {
    font-size: 40px;
  }

  .gj-hero__lead {
    margin-top: 10px;
    font-size: 12.5px;
  }

  .gj-play-card {
    padding: 12px;
  }

  .gj-play-card__math b {
    font-size: 19px;
  }

  .gj-btn--xl {
    min-height: 62px;
  }

  .gj-btn__text b {
    font-size: 17px;
  }

  .gj-rewards {
    padding: 11px;
  }

  .gj-rewards__list li {
    padding: 6px 7px;
  }

  .gj-foot {
    padding-left: 14px;
    padding-right: 14px;
    font-size: 9px;
  }

  .gj-screen--game {
    padding-left: 9px;
    padding-right: 9px;
  }

  .gj-hud {
    gap: 6px;
  }

  .gj-hud .gj-chip {
    padding: 0 9px 0 7px;
    font-size: 13px;
  }

  .gj-round-chip {
    padding: 0 9px;
  }

  .gj-game-hint {
    font-size: 9px;
  }

  .gj-result {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-height: 640px) and (max-width: 559px) {
  .gj-hero {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .gj-hero__title {
    font-size: 38px;
  }

  .gj-hero__lead {
    margin-top: 8px;
    font-size: 12px;
  }

  .gj-kicker {
    margin-bottom: 5px;
  }

  .gj-play-card__math {
    padding-bottom: 9px;
  }

  .gj-rewards {
    margin-top: 9px;
  }

  .gj-note-card {
    display: none;
  }

  .gj-menu-stats {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
