/* =========================================================================
   Банка пуговиц — contest page for the «Пуговки» loyalty programme.
   Warm cream background, Onest, glass jar and glossy sewing buttons.
   Self-contained: local fonts only, no external requests, no payments, no ads.
   ========================================================================= */

@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.66);
  --navy-faint: rgba(31, 39, 66, 0.12);
  --violet: #6260C6;
  --lavender: #D2D0FF;
  --lavender-bg: #E9E8FF;
  --coral: #E8623E;
  --coral-dark: #C94B2E;
  --sand: #FFF4DF;
  --cream: #FFFDF7;
  --yellow: #FED78C;
  --yellow-deep: #E7B45D;
  --mint: #7FC8A9;
  --white: #FFFFFF;
  --shadow: 0 16px 36px rgba(31, 39, 66, 0.12);
  --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,
body {
  height: 100%;
}

body {
  margin: 0;
  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;
  overscroll-behavior: none;
}

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

[hidden] {
  display: none !important;
}

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

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

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

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

.mg-app {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(31, 39, 66, 0.04);
}

@media (min-width: 560px) {
  .mg-app {
    height: min(940px, 100dvh);
    margin-top: max(0px, calc((100dvh - 940px) / 2));
    border-radius: 34px;
    box-shadow: 0 30px 80px rgba(31, 39, 66, 0.16);
  }
}

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

.mg-aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}

.mg-aurora i:nth-child(1) {
  width: 320px;
  height: 320px;
  left: -110px;
  top: -60px;
  background: rgba(254, 215, 140, 0.55);
}

.mg-aurora i:nth-child(2) {
  width: 280px;
  height: 280px;
  right: -110px;
  top: 120px;
  background: rgba(210, 208, 255, 0.6);
}

.mg-aurora i:nth-child(3) {
  width: 260px;
  height: 260px;
  left: 40%;
  bottom: -140px;
  background: rgba(232, 98, 62, 0.16);
}

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

.mg-screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  padding: calc(var(--safe-top) + 10px) 18px calc(var(--safe-bottom) + 10px);
}

.mg-screen.is-active {
  display: flex;
  animation: mg-fade 0.28s ease both;
}

@keyframes mg-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.mg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 4px 2px 10px;
}

.mg-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.mg-brand__word {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.mg-brand__o {
  width: 0.92em;
  height: 0.92em;
  margin: 0 0.02em;
}

.mg-brand__tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--violet);
  background: var(--lavender-bg);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

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

.mg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--sand);
  border: 1px solid rgba(231, 180, 93, 0.4);
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

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

.mg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--navy-faint);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  font-size: 18px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.mg-icon-btn:active {
  transform: scale(0.94);
}

.mg-icon-btn.is-off {
  color: rgba(31, 39, 66, 0.4);
}

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

.mg-menu {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 6px;
}

.mg-hero {
  position: relative;
  padding: 6px 2px 2px;
}

.mg-kicker {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
}

.mg-hero__title {
  margin: 0;
  font-size: clamp(38px, 12vw, 52px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.035em;
}

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

.mg-hero__lead {
  margin: 10px 0 0;
  max-width: 30ch;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--navy-soft);
}

.mg-deco {
  position: absolute;
  width: var(--s);
  height: var(--s);
  left: var(--x);
  top: var(--y);
  border-radius: 50%;
  transform: rotate(var(--r));
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 50% 60%, var(--c) 0%, var(--c) 62%, rgba(0, 0, 0, 0.16) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 10px 20px rgba(31, 39, 66, 0.12);
  pointer-events: none;
  opacity: 0.92;
}

.mg-deco::before,
.mg-deco::after {
  content: '';
  position: absolute;
  width: 22%;
  height: 22%;
  top: 39%;
  border-radius: 50%;
  background: rgba(31, 39, 66, 0.55);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.mg-deco::before {
  left: 28%;
}

.mg-deco::after {
  right: 28%;
}

.mg-deco--a {
  filter: drop-shadow(0 6px 10px rgba(232, 98, 62, 0.24));
}

.mg-deco--b,
.mg-deco--c,
.mg-deco--d {
  opacity: 0.8;
}

/* ------------------------------------------------------------- play card */

.mg-play-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 39, 66, 0.06);
}

.mg-play-card__math {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--navy-soft);
}

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

.mg-play-card__math small {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(31, 39, 66, 0.45);
}

.mg-play-card__math b {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
}

.mg-play-card__math b span {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-soft);
}

.mg-play-card__win {
  color: var(--coral) !important;
}

.mg-arrow {
  width: 22px;
  height: 22px;
  color: rgba(31, 39, 66, 0.28);
  margin-top: 8px;
}

/* ---------------------------------------------------------------- buttons */

.mg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 16px;
  border: 0;
  border-radius: 18px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.mg-btn:active {
  transform: translateY(1px) scale(0.995);
}

.mg-btn--primary {
  background: linear-gradient(180deg, #FFE0A4 0%, var(--yellow) 46%, var(--yellow-deep) 100%);
  color: var(--navy);
  box-shadow: 0 10px 22px rgba(231, 180, 93, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.mg-btn--xl {
  min-height: 62px;
  font-size: 16.5px;
  justify-content: flex-start;
  text-align: left;
}

.mg-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(31, 39, 66, 0.1);
  font-size: 16px;
  flex: 0 0 auto;
}

.mg-btn__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}

.mg-btn__text b {
  font-size: 17px;
  font-weight: 800;
}

.mg-btn__text small {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(31, 39, 66, 0.6);
}

.mg-btn__chev {
  font-size: 22px;
  color: rgba(31, 39, 66, 0.35);
  line-height: 1;
}

.mg-btn--ghost {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--navy-faint);
  color: var(--navy);
  min-height: 46px;
  font-size: 14px;
}

.mg-btn--plain {
  background: transparent;
  color: var(--navy-soft);
  min-height: 44px;
  font-size: 14px;
}

.mg-btn--danger {
  background: linear-gradient(180deg, #F07A5A, var(--coral));
  color: #fff;
  box-shadow: 0 10px 20px rgba(232, 98, 62, 0.3);
}

.mg-btn--sm {
  min-height: 42px;
}

.mg-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: saturate(0.7);
}

/* --------------------------------------------------------------- rewards */

.mg-rewards {
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(31, 39, 66, 0.06);
}

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

.mg-rewards__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--navy);
}

.mg-rewards__head span {
  font-size: 11px;
  color: rgba(31, 39, 66, 0.42);
  font-weight: 600;
}

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

.mg-rewards__list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid rgba(31, 39, 66, 0.07);
  font-size: 13px;
}

.mg-rewards__list li b {
  font-weight: 700;
  color: var(--navy-soft);
}

.mg-rewards__list li i {
  font-style: normal;
  color: rgba(31, 39, 66, 0.3);
}

.mg-rewards__list li strong {
  font-weight: 800;
  color: var(--navy);
}

.mg-rewards__list li.is-best {
  background: var(--yellow);
  border-color: rgba(231, 180, 93, 0.55);
}

.mg-rewards__list li.is-best b {
  color: rgba(31, 39, 66, 0.62);
}

/* ---------------------------------------------------------------- note */

.mg-note-card {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--lavender-bg);
  border: 1px solid rgba(98, 96, 198, 0.16);
}

.mg-note-card__icon {
  color: var(--violet);
  font-size: 16px;
  line-height: 1.4;
}

.mg-note-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(31, 39, 66, 0.72);
}

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

.mg-menu-stats {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(31, 39, 66, 0.5);
  text-align: center;
}

.mg-best-line {
  margin: auto 0 0;
  padding-top: 6px;
  font-size: 12.5px;
  color: rgba(31, 39, 66, 0.55);
  text-align: center;
}

.mg-best-line b {
  color: var(--navy);
  font-weight: 800;
}

/* ------------------------------------------------------------------- foot */

.mg-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 2px;
  font-size: 11.5px;
  color: rgba(31, 39, 66, 0.45);
}

.mg-foot i {
  font-style: normal;
}

.mg-link {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--violet);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.mg-screen--game {
  padding: calc(var(--safe-top) + 6px) 10px calc(var(--safe-bottom) + 6px);
  gap: 6px;
}

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

.mg-hud__score,
.mg-hud__next {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.mg-hud__score small,
.mg-hud__next small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(31, 39, 66, 0.42);
}

.mg-hud__score b {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.mg-hud__next b {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--violet);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.mg-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px rgba(31, 39, 66, 0.05);
  touch-action: none;
}

.mg-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.mg-tier-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid rgba(31, 39, 66, 0.08);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(31, 39, 66, 0.55);
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.mg-game-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 6px 0;
}

.mg-hint {
  margin: 0;
  font-size: 11.5px;
  color: rgba(31, 39, 66, 0.5);
  line-height: 1.3;
}

.mg-best-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 39, 66, 0.07);
  font-size: 12px;
  color: var(--navy);
  font-weight: 700;
}

.mg-best-chip .mg-ico {
  color: var(--yellow-deep);
}

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

.mg-result {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 4px 2px;
  overflow-y: auto;
}

.mg-result__title {
  margin: 0;
  font-size: clamp(28px, 8.5vw, 36px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.mg-result__sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--navy-soft);
  max-width: 32ch;
}

.mg-reward-big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #FFE9BC 0%, var(--yellow) 100%);
  border: 1px solid rgba(231, 180, 93, 0.5);
  box-shadow: 0 12px 26px rgba(231, 180, 93, 0.32);
  color: var(--navy);
}

.mg-reward-big__ico {
  width: 26px;
  height: 26px;
  align-self: center;
}

.mg-reward-big b {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mg-reward-big span {
  font-size: 14px;
  font-weight: 600;
  color: rgba(31, 39, 66, 0.6);
}

.mg-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mg-result-grid div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 39, 66, 0.06);
}

.mg-result-grid small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(31, 39, 66, 0.42);
}

.mg-result-grid b {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
}

.mg-result-grid i {
  font-style: normal;
  font-size: 10.5px;
  color: rgba(31, 39, 66, 0.42);
}

.mg-demo-note {
  margin: 0;
  font-size: 12px;
  color: var(--navy-soft);
  text-align: center;
}

.mg-result__fine {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(31, 39, 66, 0.42);
  text-align: center;
}

/* ----------------------------------------------------------------- modals */

.mg-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(31, 39, 66, 0.42);
  backdrop-filter: blur(3px);
  animation: mg-fade 0.2s ease both;
}

.mg-modal__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 92%;
  overflow-y: auto;
  padding: 22px 20px 18px;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: 0 24px 60px rgba(31, 39, 66, 0.3);
  animation: mg-rise 0.24s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes mg-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mg-modal__card--compact {
  text-align: center;
}

.mg-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.mg-modal__card h2 {
  margin: 0 0 12px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mg-modal__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--navy-soft);
}

.mg-modal__fine {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(31, 39, 66, 0.42);
}

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

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

.mg-steps li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lavender-bg);
  color: var(--violet);
  font-size: 12.5px;
  font-weight: 800;
}

.mg-steps b {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.mg-steps small {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--navy-soft);
}

/* ------------------------------------------------------------------ toast */

.mg-toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 76px);
  z-index: 30;
  transform: translate(-50%, 12px);
  max-width: 84%;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.mg-toast--warn {
  background: var(--coral);
}

.mg-toast--ok {
  background: #2F7D57;
}

/* --------------------------------------------------------------- confetti */

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

.mg-confetti i {
  position: absolute;
  top: 38%;
  width: 9px;
  height: 13px;
  border-radius: 3px;
  opacity: 0;
  animation: mg-confetti 1.9s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes mg-confetti {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 0), 62vh) rotate(var(--spin, 180deg));
  }
}

.mg-noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font);
  font-size: 16px;
}

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

@media (max-height: 640px) {
  .mg-hero__title {
    font-size: clamp(32px, 10vw, 40px);
  }

  .mg-hero__lead {
    font-size: 13px;
    margin-top: 6px;
  }

  .mg-play-card {
    padding: 12px;
    gap: 8px;
  }

  .mg-menu {
    gap: 10px;
  }

  .mg-rewards {
    padding: 10px 12px;
  }

  .mg-foot {
    padding-top: 6px;
  }

  .mg-btn--xl {
    min-height: 54px;
  }

  .mg-hud__score b {
    font-size: 18px;
  }
}

/* Landscape phones: keep the field usable instead of cropping it. */
@media (orientation: landscape) and (max-height: 560px) {
  .mg-screen {
    padding: 6px 12px;
  }

  .mg-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }

  .mg-hero__title {
    font-size: 30px;
  }

  .mg-deco {
    display: none;
  }
}
