@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap");

.wmfg {
  --bg:
    radial-gradient(110% 130% at 0% 0%, rgba(126, 151, 196, 0.2) 0%, rgba(126, 151, 196, 0) 38%),
    radial-gradient(120% 120% at 100% 0%, rgba(96, 107, 133, 0.18) 0%, rgba(96, 107, 133, 0) 42%),
    linear-gradient(180deg, #07080a 0%, #0b0d10 48%, #050608 100%);
  --surface:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.008) 100%),
    rgba(12, 14, 17, 0.88);
  --surface-strong:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.012) 100%),
    rgba(13, 15, 18, 0.96);
  --surface-soft: rgba(15, 17, 20, 0.74);
  --surface-ghost: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f5f6f8;
  --muted: #9097a2;
  --muted-strong: #c2c8d0;
  --accent: #dde5f2;
  --accent-soft: rgba(221, 229, 242, 0.12);
  --accent-glow: rgba(221, 229, 242, 0.16);
  --success: #b9efd2;
  --pending: #d7e4ff;
  --danger: #ffb8b2;
  --warning: #ffd9b2;
  --wmfg-leader-w: 336px;
  --wmfg-gap: 14px;
  --wmfg-vert-hdr: 248px;
  --wmfg-cols: 6;
  --wmfg-rows: 3;
  --wmfg-card-radius: 26px;
  --wmfg-logo-w: 180px;
  --wmfg-logo-x: 0px;
  --wmfg-logo-y: 0px;
  --wmfg-card-h: calc(
    (100vh - var(--wmfg-vert-hdr) - (var(--wmfg-gap) * (var(--wmfg-rows) - 1)))
      / var(--wmfg-rows)
  );
  --wmfg-card-w: clamp(
    74px,
    min(
      calc((100vw - var(--wmfg-leader-w) - 138px) / var(--wmfg-cols)),
      calc(var(--wmfg-card-h) * 0.75)
    ),
    184px
  );
  position: relative;
  width: min(1560px, calc(100vw - 40px));
  margin: clamp(16px, 3vw, 40px) auto 24px;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wmfg::before {
  content: "";
  position: absolute;
  inset: 8% 12% auto;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(221, 229, 242, 0.14) 0%, rgba(221, 229, 242, 0) 70%);
  filter: blur(54px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.82;
}

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

.wmfg__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--wmfg-leader-w);
  gap: 20px;
  align-items: stretch;
}

.wmfg__game-column {
  min-width: 0;
}

.wmfg__game-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 22px 22px 32px;
  border: 1px solid var(--line);
  border-radius: 22px 0 0 22px;
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wmfg__game-shell::before,
.wmfg__game-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.wmfg__game-shell::before {
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 26%);
  opacity: 0.8;
}

.wmfg__game-shell::after {
  inset: auto 28px -42px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(26px);
  opacity: 0.9;
  z-index: -1;
}

.wmfg__bg,
.wmfg__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wmfg__bg {
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  opacity: 0.02;
  filter: saturate(0.55) contrast(1.02) brightness(0.8);
  transform: scale(1.02);
}

.wmfg__overlay {
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(221, 229, 242, 0.08) 0%, rgba(221, 229, 242, 0) 48%),
    linear-gradient(180deg, rgba(6, 7, 9, 0.2) 0%, rgba(6, 7, 9, 0.74) 62%, rgba(6, 7, 9, 0.94) 100%);
}

.wmfg__header,
.wmfg__stats,
.wmfg__board,
.wmfg__lock,
.wmfg__leaderboard,
.wmfg__modal,
.wmfg__credit {
  position: relative;
  z-index: 1;
}

.wmfg__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 4px 4px 0;
}

.wmfg__hero {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.wmfg__title {
  margin: 0;
  max-width: 10ch;
  font-family: "Outfit", sans-serif;
  font-size: clamp(38px, 5vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.06em;
  font-weight: 700;
  color: var(--text);
}

.wmfg__title--logo {
  max-width: none;
}

.wmfg__logo {
  display: block;
  width: 179px;
  max-width: 100%;
  height: auto;
  transform: translate(var(--wmfg-logo-x), var(--wmfg-logo-y));
}

.wmfg__subtitle {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(13px, 1.1vw, 17px);
  line-height: 1.6;
  color: rgba(245, 246, 248, 0.72);
}

.wmfg__event {
  align-self: start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}

.wmfg__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(190px, 0.9fr) repeat(2, minmax(0, 1fr));
  grid-template-areas: "clicks moves timer bonus score";
  gap: 0;
  align-items: stretch;
  width: calc(var(--wmfg-card-w) * var(--wmfg-cols) + var(--wmfg-gap) * (var(--wmfg-cols) - 1));
  max-width: 100%;
  margin: 0 auto 34px;
  padding: 10px 12px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid rgba(38, 38, 38, 0.08);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.wmfg__stats-left,
.wmfg__stats-right {
  display: contents;
}

.wmfg__clicks,
.wmfg__moves,
.wmfg__score,
.wmfg__time-bonus {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 88px;
  margin: 0;
  padding: 14px 18px;
}

.wmfg__clicks {
  grid-area: clicks;
}

.wmfg__moves {
  grid-area: moves;
}

.wmfg__score {
  grid-area: score;
}

.wmfg__time-bonus {
  grid-area: bonus;
}

.wmfg__score,
.wmfg__time-bonus {
  justify-items: end;
  text-align: right;
}

.wmfg__clicks::after,
.wmfg__moves::after,
.wmfg__stats-mid::after,
.wmfg__time-bonus::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 0;
  bottom: 16px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--line-soft) 14%, var(--line-soft) 86%, rgba(255, 255, 255, 0) 100%);
}

.wmfg__clicks span,
.wmfg__score span,
.wmfg__moves span,
.wmfg__time-bonus span,
.wmfg__stats-mid span {
  display: inline;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.wmfg__clicks strong,
.wmfg__score strong,
.wmfg__moves strong,
.wmfg__time-bonus strong {
  display: inline;
  font-family: "Outfit", sans-serif;
  font-size: clamp(22px, 1.65vw, 28px);
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wmfg__score strong,
.wmfg__time-bonus strong {
  color: var(--accent);
}

.wmfg__stats-mid {
  position: relative;
  isolation: isolate;
  grid-area: timer;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-height: 88px;
  width: min(100%, 206px);
  min-width: 0;
  margin: 0 auto;
  padding: 14px 28px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.012) 100%),
    rgba(18, 20, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
}

.wmfg__stats-mid::before {
  content: "";
  position: absolute;
  inset: 12% 18%;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(221, 229, 242, 0.18) 0%, rgba(221, 229, 242, 0) 72%);
  filter: blur(20px);
  opacity: 0.86;
}

.wmfg__stats-mid strong {
  display: inline;
  font-family: "Outfit", sans-serif;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wmfg__stats-mid.is-warning {
  background:
    linear-gradient(180deg, rgba(255, 217, 178, 0.12) 0%, rgba(255, 217, 178, 0.02) 100%),
    rgba(20, 16, 12, 0.94);
  border-color: rgba(255, 217, 178, 0.14);
}

.wmfg__stats-mid.is-warning::before {
  background: radial-gradient(circle, rgba(255, 217, 178, 0.22) 0%, rgba(255, 217, 178, 0) 72%);
}

.wmfg__stats-mid.is-warning strong {
  color: var(--warning);
}

.wmfg__stats-mid.is-finished {
  background:
    linear-gradient(180deg, rgba(255, 184, 178, 0.12) 0%, rgba(255, 184, 178, 0.02) 100%),
    rgba(22, 13, 14, 0.94);
  border-color: rgba(255, 184, 178, 0.14);
}

.wmfg__stats-mid.is-finished::before {
  background: radial-gradient(circle, rgba(255, 184, 178, 0.22) 0%, rgba(255, 184, 178, 0) 72%);
}

.wmfg__stats-mid.is-finished strong {
  color: var(--danger);
}

.wmfg__reset,
.wmfg__btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.wmfg__reset {
  flex: 0 0 auto;
  align-self: center;
  min-width: 154px;
  min-height: 36px;
  margin-left: auto;
  padding: 0 22px;
  border-radius: 11px;
  color: #0a0b0d;
  background: #FFCC00;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.wmfg__btn {
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  color: #0a0b0d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(220, 225, 234, 0.9) 100%),
    #eef2f8;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.wmfg__reset:hover,
.wmfg__btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.wmfg__reset:disabled,
.wmfg__btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.wmfg__btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wmfg__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

.wmfg__btn[hidden] {
  display: none;
}

.wmfg__lock {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 184, 178, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 184, 178, 0.08) 0%, rgba(255, 184, 178, 0.02) 100%),
    rgba(24, 14, 15, 0.9);
  color: #ffd4cf;
  font-size: 13px;
  line-height: 1.55;
}

.wmfg__board {
  position: relative;
  isolation: isolate;
  width: calc(var(--wmfg-card-w) * var(--wmfg-cols) + var(--wmfg-gap) * (var(--wmfg-cols) - 1));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--wmfg-cols), var(--wmfg-card-w));
  gap: var(--wmfg-gap);
  perspective: 1800px;
}

.wmfg__board::before,
.wmfg__board::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.wmfg__board::after {
  inset: auto 14% -28px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0) 72%);
  filter: blur(28px);
  opacity: 0.88;
}

.wmfg-card {
  position: relative;
  display: block;
  width: var(--wmfg-card-w);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  transform: translateY(0);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.3));
  transition: transform 0.26s ease, filter 0.26s ease;
}

.wmfg-card[disabled] {
  cursor: not-allowed;
}

.wmfg-card::before {
  content: "";
  display: block;
  padding-top: 133.3334%;
}

.wmfg-card__inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.wmfg-card:not([disabled]):not(.is-flipped):not(.is-matched):hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 24px 38px rgba(0, 0, 0, 0.34));
}

.wmfg-card.is-flipped .wmfg-card__inner,
.wmfg-card.is-matched .wmfg-card__inner {
  transform: rotateY(180deg);
}

.wmfg-card__face {
  position: absolute;
  inset: 0;
  padding: clamp(5px, 0.45vw, 8px);
  border-radius: 11px;
  overflow: hidden;
  backface-visibility: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%),
    rgba(12, 13, 16, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 30px rgba(0, 0, 0, 0.32);
}

.wmfg-card__face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 40%);
  opacity: 0.72;
  pointer-events: none;
}

.wmfg-card__face--back {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wmfg-card__face--back::before {
  display: none;
}

.wmfg-card__face--back::after {
  display: none;
}

.wmfg-card__face--front {
  transform: rotateY(180deg);
  background:
    linear-gradient(160deg, rgba(24, 27, 32, 0.98) 0%, rgba(8, 9, 12, 0.98) 100%);
}

.wmfg-card__img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 7px;
  background: #08090b;
}

.wmfg-card__face--back .wmfg-card__img {
  border-radius: 11px;
  filter: none;
}

.wmfg-card__face--front .wmfg-card__img {
  filter: saturate(1.04) contrast(1.02);
}

.wmfg-card.is-matched {
  filter:
    drop-shadow(0 24px 38px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 18px rgba(221, 229, 242, 0.14));
}

.wmfg-card.is-matched .wmfg-card__face--front {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 18px 30px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(221, 229, 242, 0.12);
}

.wmfg-card.is-match-smoke::before,
.wmfg-card.is-match-smoke::after {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.wmfg-card.is-match-smoke .wmfg-card__face--front {
  animation: wmfg-match-pulse 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wmfg-card.is-match-smoke::before {
  background: radial-gradient(circle, rgba(221, 229, 242, 0.22) 0%, rgba(221, 229, 242, 0) 66%);
  animation: wmfg-halo-expand 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wmfg-card.is-match-smoke::after {
  inset: -4%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: wmfg-ring-fade 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes wmfg-match-pulse {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.12),
      0 18px 30px rgba(0, 0, 0, 0.32),
      0 0 0 1px rgba(221, 229, 242, 0.12);
  }

  24% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.18),
      0 0 0 4px rgba(221, 229, 242, 0.12),
      0 0 28px rgba(221, 229, 242, 0.18);
  }

  100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.12),
      0 18px 30px rgba(0, 0, 0, 0.32),
      0 0 0 1px rgba(221, 229, 242, 0.12);
  }
}

@keyframes wmfg-halo-expand {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  24% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes wmfg-ring-fade {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }

  20% {
    opacity: 0.54;
  }

  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

.wmfg__leaderboard {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0 22px 22px 0;
  padding: 22px 18px 18px;
  height: 100%;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wmfg__leaderboard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(221, 229, 242, 0.1) 0%, rgba(221, 229, 242, 0) 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0.92;
}

.wmfg__leaderboard h3,
.wmfg__leaderboard-sub,
.wmfg__leaderboard-list {
  position: relative;
  z-index: 1;
}

.wmfg__leaderboard h3 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 700;
  color: var(--text);
}

.wmfg__leaderboard-sub {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.wmfg__leaderboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.wmfg__leaderboard-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.wmfg__leaderboard-item:nth-child(1),
.wmfg__leaderboard-item:nth-child(2),
.wmfg__leaderboard-item:nth-child(3) {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.06);
}

.wmfg__leaderboard-item--placeholder {
  display: block;
  padding: 16px 14px;
  text-align: center;
  color: var(--muted-strong);
}

.wmfg__leaderboard-rank {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.wmfg__leaderboard-player {
  min-width: 0;
}

.wmfg__leaderboard-player > div:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.wmfg__leaderboard-meta {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.wmfg__leaderboard-score {
  font-family: "Outfit", sans-serif;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.wmfg__modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 999;
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.46) 0%, rgba(5, 6, 8, 0.82) 100%),
    rgba(5, 6, 8, 0.62);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.wmfg__modal[hidden] {
  display: none;
}

.wmfg__modal-box {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(520px, 100%);
  padding: 28px 26px 24px;
  border-radius: 30px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow:
    0 36px 96px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wmfg__modal-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(221, 229, 242, 0.12) 0%, rgba(221, 229, 242, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0.9;
}

.wmfg__modal-box > * {
  position: relative;
  z-index: 1;
}

.wmfg__modal-box h3 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 0.94;
  letter-spacing: -0.06em;
  font-weight: 700;
  color: var(--text);
}

.wmfg__modal-row {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted-strong);
}

.wmfg__modal-row strong {
  font-family: "Outfit", sans-serif;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.wmfg__modal-row:not(.wmfg__modal-row--summary) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wmfg__modal-row--summary {
  color: var(--muted-strong);
  font-size: 13px;
}

.wmfg__save-wrap {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wmfg__save-wrap[hidden] {
  display: none;
}

.wmfg__save-field + .wmfg__save-field {
  margin-top: 12px;
}

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

.wmfg__label {
  display: block;
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.wmfg__input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.2;
  padding: 14px 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wmfg__input::placeholder {
  color: rgba(194, 200, 208, 0.42);
}

.wmfg__input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    0 0 0 3px rgba(221, 229, 242, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wmfg__input[type="email"] {
  text-transform: none;
}

.wmfg__modal-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wmfg__save-status {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-strong);
}

.wmfg__save-status[data-state="success"] {
  color: var(--success);
}

.wmfg__save-status[data-state="pending"] {
  color: var(--pending);
}

.wmfg__save-status[data-state="error"] {
  color: var(--danger);
}

.wmfg__credit {
  margin: 14px 8px 0;
  text-align: right;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(194, 200, 208, 0.42);
}

@media (max-width: 1280px) {
  .wmfg {
    --wmfg-leader-w: 312px;
    --wmfg-vert-hdr: 234px;
    width: min(1500px, calc(100vw - 26px));
  }

  .wmfg__title {
    font-size: clamp(34px, 4.8vw, 66px);
  }

  .wmfg__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(190px, 0.9fr) repeat(2, minmax(0, 1fr));
    grid-template-areas: "clicks moves timer bonus score";
    gap: 10px;
  }

  .wmfg__clicks::after,
  .wmfg__moves::after,
  .wmfg__stats-mid::after,
  .wmfg__time-bonus::after {
    display: none;
  }

  .wmfg__clicks,
  .wmfg__moves,
  .wmfg__score,
  .wmfg__time-bonus {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
  }

  .wmfg__stats-mid {
    margin: 0 auto;
  }

  .wmfg__reset {
    margin-left: auto;
  }
}

@media (max-width: 1080px) {
  .wmfg {
    --wmfg-leader-w: 100%;
    --wmfg-cols: 5;
    --wmfg-rows: 4;
    --wmfg-vert-hdr: 210px;
    --wmfg-card-w: clamp(
      70px,
      min(
        calc((100vw - 56px) / var(--wmfg-cols)),
        calc(var(--wmfg-card-h) * 0.75)
      ),
      168px
    );
    width: min(1400px, calc(100vw - 18px));
  }

  .wmfg__layout {
    grid-template-columns: 1fr;
  }

  .wmfg__leaderboard {
    position: static;
    height: auto;
  }

  .wmfg__header {
    display: flex;
  }
}

@media (max-width: 760px) {
  .wmfg {
    --wmfg-gap: 8px;
    --wmfg-cols: 4;
    --wmfg-rows: 5;
    --wmfg-vert-hdr: 146px;
    --wmfg-card-radius: 20px;
    --wmfg-card-w: clamp(
      48px,
      min(
        calc((100vw - 26px - (var(--wmfg-gap) * (var(--wmfg-cols) - 1))) / var(--wmfg-cols)),
        calc(var(--wmfg-card-h) * 0.75)
      ),
      118px
    );
    width: min(calc(100vw - 10px), 760px);
    margin: 8px auto 12px;
  }

  .wmfg::before {
    inset: 5% 8% auto;
    height: 120px;
  }

  .wmfg__game-shell {
    padding: 12px 12px 24px;
    border-radius: 26px;
  }

  .wmfg__header {
    margin-bottom: 14px;
    padding: 2px 2px 0;
  }

  .wmfg__title {
    max-width: none;
    font-size: clamp(28px, 9vw, 42px);
  }

  .wmfg__logo {
    max-width: min(var(--wmfg-logo-w), 44vw);
  }

  .wmfg__subtitle {
    max-width: none;
    font-size: 12px;
    line-height: 1.55;
  }

  .wmfg__event {
    min-height: auto;
    padding: 10px 12px;
    font-size: 9px;
    letter-spacing: 0.16em;
    white-space: normal;
    text-align: left;
  }

  .wmfg__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "timer timer"
      "clicks moves"
      "bonus score";
    gap: 8px;
    width: 100%;
    padding: 0;
    margin-bottom: 34px;
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .wmfg__clicks,
  .wmfg__moves,
  .wmfg__score,
  .wmfg__time-bonus,
  .wmfg__stats-mid {
    min-height: 0;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .wmfg__clicks strong,
  .wmfg__moves strong,
  .wmfg__score strong,
  .wmfg__time-bonus strong {
    font-size: 20px;
  }

  .wmfg__stats-mid {
    gap: 8px;
    width: 100%;
  }

  .wmfg__stats-mid strong {
    font-size: clamp(24px, 7vw, 32px);
  }

  .wmfg__reset {
    min-width: 0;
    min-height: 52px;
    margin-left: 0;
    padding: 0 16px;
  }

  .wmfg__lock {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 12px;
  }

  .wmfg__board {
    width: min(
      100%,
      calc(var(--wmfg-card-w) * var(--wmfg-cols) + var(--wmfg-gap) * (var(--wmfg-cols) - 1))
    );
    grid-template-columns: repeat(var(--wmfg-cols), var(--wmfg-card-w));
  }

  .wmfg__board::before {
    inset: -12px -12px -14px;
    border-radius: 24px;
  }

  .wmfg__board::after {
    inset: auto 10% -20px;
    height: 88px;
  }

  .wmfg-card {
    width: var(--wmfg-card-w);
  }

  .wmfg__board .wmfg-card:nth-last-child(2):nth-child(4n + 1) {
    grid-column: 2;
  }

  .wmfg__board .wmfg-card:last-child:nth-child(4n + 2) {
    grid-column: 3;
  }

  .wmfg__leaderboard {
    margin-top: 12px;
    padding: 18px 14px 14px;
    border-radius: 24px;
  }

  .wmfg__leaderboard h3 {
    font-size: 24px;
  }

  .wmfg__leaderboard-sub {
    margin: 6px 0 14px;
    font-size: 9px;
  }

  .wmfg__leaderboard-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 10px 11px;
    border-radius: 18px;
  }

  .wmfg__leaderboard-rank {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .wmfg__modal {
    padding: 12px;
  }

  .wmfg__modal-box {
    padding: 22px 18px 18px;
    border-radius: 24px;
  }

  .wmfg__modal-box h3 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .wmfg__modal-row {
    font-size: 14px;
  }

  .wmfg__modal-row strong {
    font-size: 17px;
  }

  .wmfg__credit {
    margin-top: 10px;
    text-align: center;
    font-size: 8px;
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  .wmfg {
    --wmfg-cols: 6;
    --wmfg-rows: 3;
    --wmfg-vert-hdr: 108px;
    --wmfg-card-w: clamp(
      44px,
      min(
        calc((100vw - 24px - (var(--wmfg-gap) * (var(--wmfg-cols) - 1))) / var(--wmfg-cols)),
        calc(var(--wmfg-card-h) * 0.75)
      ),
      96px
    );
  }

  .wmfg__board .wmfg-card:nth-last-child(2):nth-child(4n + 1),
  .wmfg__board .wmfg-card:last-child:nth-child(4n + 2) {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .wmfg {
    --wmfg-gap: 5px;
    --wmfg-vert-hdr: 132px;
  }

  .wmfg__title {
    font-size: clamp(24px, 9vw, 34px);
  }

  .wmfg__subtitle {
    font-size: 11px;
  }

  .wmfg__clicks,
  .wmfg__moves,
  .wmfg__score,
  .wmfg__time-bonus,
  .wmfg__stats-mid {
    padding: 10px 12px;
  }

  .wmfg__clicks span,
  .wmfg__moves span,
  .wmfg__score span,
  .wmfg__time-bonus span,
  .wmfg__stats-mid span {
    font-size: 9px;
  }

  .wmfg__clicks strong,
  .wmfg__moves strong,
  .wmfg__score strong,
  .wmfg__time-bonus strong {
    font-size: 18px;
  }

  .wmfg__stats-mid strong {
    font-size: 22px;
  }

  .wmfg__reset,
  .wmfg__btn {
    min-height: 50px;
    padding: 0 16px;
    font-size: 13px;
  }

  .wmfg__board {
    gap: 5px;
  }

  .wmfg-card__face {
    border-radius: 11px;
    padding: 4px;
  }

  .wmfg-card__img {
    border-radius: 11px;
  }

  .wmfg__leaderboard-item {
    gap: 10px;
  }

  .wmfg__modal-actions {
    grid-template-columns: 1fr;
  }
}

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