/* In-phone Memory Match — the Whot! felt table, cards tilted 0° or ±18°, a holding tray and two vaults */

.wondalife-phone-screen.is-app:has(.mm-app) {
  background: #06140c;
}
.wondalife-phone-screen.is-app:has(.mm-app) .wondalife-phone-status {
  color: #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.mm-app) .wondalife-phone-signal::before {
  background: #f5f7f4;
  box-shadow: 4px 0 0 #f5f7f4, 8px -2px 0 #f5f7f4, 12px -4px 0 #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.mm-app) .wondalife-phone-battery {
  border-color: #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.mm-app) .wondalife-phone-battery::before,
.wondalife-phone-screen.is-app:has(.mm-app) .wondalife-phone-battery::after {
  background: #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.mm-app) .wondalife-phone-homebar {
  background: rgba(245, 247, 244, 0.35);
}
.wondalife-phone-screen.is-app .wondalife-phone-body:has(.mm-app) {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 0 0 22px;
  min-height: 0;
  height: 100%;
}

.mm-app {
  --mm-felt: #0d2a18;
  --mm-felt-hi: #143822;
  --mm-rim: #6b4a2a;
  --mm-gold: #f5c518;
  --mm-ivory-1: #fffdf6;
  --mm-ivory-2: #ece2cc;
  --mm-ivory-edge: #b8a682;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 22px;
  background: radial-gradient(120% 80% at 50% 0%, #0f2418 0%, #06140c 55%);
  color: #f5f7f4;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  z-index: 4;
  border-radius: inherit;
  -webkit-user-select: none;
  user-select: none;
}

.mm-empty {
  margin: auto;
  color: rgba(245, 247, 244, 0.6);
}

/* ---------- Header ---------- */

.mm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 2px;
  flex: none;
}
.mm-head__title {
  min-width: 0;
}
.mm-head h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.mm-head h1 span {
  font-weight: 500;
  font-size: 12px;
  color: rgba(245, 247, 244, 0.55);
}
.mm-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(245, 247, 244, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-head__icon {
  flex: none;
  width: 1.75em;
  height: 1.75em;
  margin: -0.4em -0.1em -0.4em -0.15em;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45));
}
.mm-head__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mm-x {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.mm-hold {
  position: relative;
  flex: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #e8f0e9;
  background: rgba(20, 56, 34, 0.85);
  cursor: pointer;
  touch-action: none;
}
.mm-hold span {
  position: relative;
}
.mm-hold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #c62f3d, #e5484d);
  transform: scaleX(0);
  transform-origin: left center;
}
.mm-hold.is-holding::before {
  animation: mm-hold 1.2s linear both;
  animation-delay: var(--hold-delay, 0ms);
}
@keyframes mm-hold {
  to { transform: scaleX(1); }
}
.mm-live {
  font-size: 10px;
  font-weight: 700;
  color: #fda4af;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

/* ---------- Seats: rival on top, you at the bottom ---------- */

.mm-seat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 10px;
  padding: 5px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid transparent;
  flex: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.mm-seat.is-turn {
  border-color: color-mix(in srgb, var(--seat) 70%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--seat) 28%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--seat) 16%, rgba(0, 0, 0, 0.28)), rgba(0, 0, 0, 0.28) 70%);
}
.mm-seat.is-champ {
  border-color: var(--mm-gold);
}
.mm-av {
  --pct: 0;
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}
.mm-av.is-turn {
  background: conic-gradient(var(--seat) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.14) 0);
}
.mm-av img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
  background: linear-gradient(180deg, #dbe7f3, #9fb6cc);
  border: 2px solid #06140c;
  box-sizing: border-box;
}
.mm-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 14px;
}
.mm-seat__txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mm-seat__txt strong {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-secs {
  color: var(--seat);
  font-weight: 800;
}
.mm-secs.is-low {
  color: #f87171;
  animation: mm-low 0.5s ease-in-out infinite alternate;
}
@keyframes mm-low {
  to { opacity: 0.45; }
}
.mm-seat__note {
  font-size: 10px;
  color: rgba(245, 247, 244, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-seat__cue {
  flex: none;
  font-size: 11px;
}
.mm-score {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.mm-score b {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mm-score i {
  font-style: normal;
  font-size: 9px;
  color: rgba(245, 247, 244, 0.55);
}
.mm-vault {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px 3px 5px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid color-mix(in srgb, var(--seat) 45%, transparent);
}
.mm-vault.is-bump {
  animation: mm-bump 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes mm-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); box-shadow: 0 0 16px var(--seat); }
  100% { transform: scale(1); }
}
.mm-vault__pile {
  position: relative;
  width: 30px;
  height: 26px;
}
.mm-vault em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--seat);
  min-width: 18px;
}
.mm-vault__empty {
  position: absolute;
  left: 6px;
  top: 1px;
  width: 18px;
  height: 24px;
  border-radius: 3px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  box-sizing: border-box;
}
.mm-mini {
  position: absolute;
  top: 1px;
  left: calc(var(--k) * 5px + (3 - var(--n)) * 2.5px);
  width: 18px;
  height: 24px;
  font-size: 18px;
  border-radius: 3px;
  overflow: hidden;
  transform: rotate(calc((var(--k) - (var(--n) - 1) / 2) * 9deg));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* ---------- Table ---------- */

.mm-table {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 3px 10px;
  border-radius: 18px;
  border: 2px solid var(--mm-rim);
  background: radial-gradient(ellipse at 50% 40%, var(--mm-felt-hi), var(--mm-felt) 70%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}
.mm-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px 0;
  flex: none;
}
.mm-strip__gap {
  flex: 1;
}
.mm-chip {
  font-size: 9.5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(245, 247, 244, 0.8);
  white-space: nowrap;
}
.mm-chip b {
  color: #fff;
}
.mm-next b {
  color: var(--mm-gold);
}
.mm-next.is-cheaper {
  background: rgba(251, 113, 133, 0.2);
  color: #fecdd3;
}
.mm-pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

/* The field sizes itself: --u is 1px at full size and shrinks when the table is short. */
.mm-field {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}
.mm-grid {
  --u: min(1px, calc(96cqw / (var(--cols) * var(--cell-w))), calc(96cqh / (var(--rows) * var(--cell-h))));
  position: relative;
  width: calc(var(--cols) * var(--cell-w) * var(--u));
  height: calc(var(--rows) * var(--cell-h) * var(--u));
}
.mm-slot {
  position: absolute;
  left: calc(((var(--c) + 0.5) * var(--cell-w) + var(--jx)) * var(--u));
  top: calc(((var(--r) + 0.5) * var(--cell-h) + var(--jy)) * var(--u));
  width: calc(var(--card-w) * var(--u));
  height: calc(var(--card-h) * var(--u));
  margin: calc(var(--card-h) * var(--u) / -2) 0 0 calc(var(--card-w) * var(--u) / -2);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: calc(var(--card-w) * var(--u));
  transform: rotate(var(--t));
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.mm-slot.is-live {
  cursor: pointer;
}

/* ---------- A card: back (greyed logo) and face ---------- */

.mm-card {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 0.14em;
  perspective: 6em;
  transition: transform 0.18s ease;
}
.mm-slot .mm-card {
  box-shadow: 0 0.05em 0.14em rgba(0, 0, 0, 0.45);
}
.mm-slot.is-live:hover .mm-card {
  transform: translateY(-2px) scale(1.07);
}
.mm-slot.is-live:hover .mm-logo {
  opacity: 0.72;
}
.mm-slot.is-live:active .mm-card {
  transform: scale(0.95);
}
.mm-side {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 0.14em;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-sizing: border-box;
}
.mm-side--back {
  background: linear-gradient(155deg, var(--mm-ivory-1) 0%, var(--mm-ivory-2) 100%);
  border: 1px solid var(--mm-ivory-edge);
  box-shadow: inset 0 0 0 0.06em var(--mm-ivory-1), inset 0 0 0 0.08em rgba(184, 166, 130, 0.55);
}
.mm-app.is-night .mm-side--back {
  background: linear-gradient(155deg, #2b3747 0%, #121a24 100%);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 0.06em #1b2531, inset 0 0 0 0.08em rgba(255, 255, 255, 0.12);
}
.mm-side--face {
  transform: rotateY(180deg);
  border: 1px solid var(--mm-ivory-edge);
}
.mm-logo {
  display: block;
  width: 86%;
  height: auto;
  filter: grayscale(1) contrast(0.9);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}
.mm-app.is-night .mm-logo {
  opacity: 0.42;
}
.mm-flip {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.mm-flip.is-up {
  transform: rotateY(180deg);
}
.mm-flip.is-lifting {
  animation: mm-turn-up 0.42s cubic-bezier(0.3, 0.7, 0.3, 1) both;
}
.mm-flip.is-opening {
  animation: mm-open 0.8s ease both;
}
.mm-flip.is-closing {
  animation: mm-turn-down 0.46s ease-in both;
}
@keyframes mm-turn-up {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}
@keyframes mm-open {
  0% { transform: rotateY(0deg); }
  45% { transform: rotateY(180deg) scale(1.3); }
  100% { transform: rotateY(180deg) scale(1.18); }
}
@keyframes mm-turn-down {
  0%, 35% { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}

/* Your rival lifts a card: its logo lights up in their colour, the card never turns over. */
.mm-slot.is-glow {
  z-index: 3;
}
.mm-slot.is-glow .mm-card {
  animation: mm-glow 1.6s ease both;
  animation-delay: var(--glow-delay, 0ms);
}
.mm-slot.is-glow .mm-logo {
  animation: mm-lit 1.6s ease both;
  animation-delay: var(--glow-delay, 0ms);
}
@keyframes mm-glow {
  0% { transform: none; box-shadow: 0 0.05em 0.14em rgba(0, 0, 0, 0.45); }
  14%, 78% { transform: translateY(-3px) scale(1.14); box-shadow: 0 0 0 2px var(--gc), 0 0 14px var(--gc), 0 6px 10px rgba(0, 0, 0, 0.4); }
  100% { transform: none; box-shadow: 0 0.05em 0.14em rgba(0, 0, 0, 0.45); }
}
@keyframes mm-lit {
  0% { filter: grayscale(1) contrast(0.9); opacity: 0.5; }
  12%, 80% { filter: none; opacity: 1; }
  100% { filter: grayscale(1) contrast(0.9); opacity: 0.5; }
}

/* Your card is up in the tray: its place waits as an outline. */
.mm-slot.is-out .mm-card {
  opacity: 0;
}
.mm-slot.is-out::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.14em;
  border: 1px dashed rgba(245, 197, 24, 0.55);
  background: rgba(245, 197, 24, 0.06);
}

/* A matched pair leaves a faint print on the felt in the winner's colour. */
.mm-slot.is-gone .mm-card {
  display: none;
}
.mm-slot.is-gone::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 0.12em;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--by) 35%, transparent);
}

/* Your rival's pair turns over where it lies, for both players. */
.mm-slot.is-open {
  z-index: 4;
}
.mm-slot.is-open .mm-side--face {
  box-shadow: 0 0 0 2px var(--mm-gold), 0 0 12px rgba(245, 197, 24, 0.6);
}

.mm-slot.is-nope .mm-card {
  animation: mm-nope 0.42s ease both;
}
@keyframes mm-nope {
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

.mm-grid.is-deal .mm-card {
  animation: mm-deal 0.42s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  animation-delay: calc(var(--i) * 18ms - var(--deal-e));
}
@keyframes mm-deal {
  0% { transform: translateY(-26px) scale(0.6); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* ---------- Faces ---------- */

.mm-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--mm-ivory-1), #efe6d2);
  color: #1f2937;
}
.mm-face--glyph b {
  font-family: Fredoka, Poppins, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.66em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 0.02em 0 rgba(0, 0, 0, 0.18);
}
.mm-face--glyph.is-two b {
  font-size: 0.5em;
  letter-spacing: -0.03em;
}
.mm-face--glyph i {
  position: absolute;
  top: 0.07em;
  left: 0.09em;
  font-style: normal;
  font-weight: 800;
  font-size: 0.15em;
  line-height: 1;
  color: var(--ink);
}
.mm-face--glyph i:last-child {
  top: auto;
  left: auto;
  bottom: 0.07em;
  right: 0.09em;
  transform: rotate(180deg);
}
.mm-face--img img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.mm-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 0.84em;
  height: 0.54em;
  padding: 0 0.04em;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--fg);
  text-align: center;
  line-height: 1.02;
  border-radius: 0.05em;
  box-shadow: 0 0.02em 0.05em rgba(0, 0, 0, 0.28), inset 0 0 0 0.012em rgba(0, 0, 0, 0.14);
}
.mm-brand b {
  font-family: Poppins, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 0.14em;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mm-brand.is-short b {
  font-size: 0.24em;
}
.mm-brand.is-mid b {
  font-size: 0.18em;
}
.mm-brand.is-long b {
  font-size: 0.15em;
  white-space: normal;
}
.mm-brand small {
  font-size: 0.085em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-top: 0.03em;
  white-space: nowrap;
}
.mm-brand--oval {
  width: 0.88em;
  height: 0.5em;
  border-radius: 50%;
}
.mm-brand--circle,
.mm-brand--coin,
.mm-brand--seal {
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
}
.mm-brand--coin {
  background: radial-gradient(circle at 35% 30%, #fff2b3, var(--bg) 55%, #9a6b06);
  box-shadow: 0 0.02em 0.05em rgba(0, 0, 0, 0.3), inset 0 0 0 0.03em #b8860b;
}
.mm-brand--seal {
  box-shadow: 0 0.02em 0.05em rgba(0, 0, 0, 0.3), inset 0 0 0 0.03em var(--bg), inset 0 0 0 0.042em var(--fg);
}
.mm-brand--shield {
  width: 0.72em;
  height: 0.64em;
  border-radius: 0.08em 0.08em 0.34em 0.34em;
}
.mm-brand--pill {
  width: 0.88em;
  height: 0.38em;
  border-radius: 999px;
}
.mm-brand--leaf {
  width: 0.8em;
  height: 0.52em;
  border-radius: 0.3em 0.03em 0.3em 0.03em;
}
.mm-brand--ribbon {
  width: 0.92em;
  height: 0.42em;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 91% 50%, 100% 100%, 0 100%, 9% 50%);
}

/* ---------- The holding tray ---------- */

.mm-tray {
  position: relative;
  flex: none;
  height: 126px;
  margin: 2px 8px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.4);
}
.mm-tray__slot {
  position: absolute;
  left: calc(50% - 37px + (var(--slot) - 0.5) * 92px);
  top: 7px;
  width: 74px;
  height: 102px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1.5px dashed rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
}
.mm-tray__slot i {
  font-style: normal;
  font-size: 28px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.1);
}
.mm-tray.is-yours .mm-tray__slot {
  border-color: rgba(245, 197, 24, 0.38);
}
.mm-tray__hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  text-align: center;
  font-size: 9.5px;
  color: rgba(245, 247, 244, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-big {
  position: absolute;
  z-index: 8;
  left: calc(50% - 37px + (var(--slot) - 0.5) * 92px);
  top: 7px;
  width: 74px;
  height: 102px;
  font-size: 74px;
  perspective: 600px;
  pointer-events: none;
  will-change: transform;
}
.mm-big .mm-side {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}
.mm-big.is-miss {
  animation: mm-miss 0.38s ease both;
}
@keyframes mm-miss {
  20%, 60% { transform: translateX(-6px) rotate(-3deg); }
  40%, 80% { transform: translateX(6px) rotate(3deg); }
}
.mm-big.is-cheer {
  --dir: calc(var(--slot) * 2 - 1);
  animation: mm-cheer 0.72s ease both;
}
.mm-big.is-cheer .mm-side--face,
.mm-big.is-merge .mm-side--face {
  box-shadow: 0 0 0 3px var(--mm-gold), 0 0 26px rgba(245, 197, 24, 0.7);
}
@keyframes mm-cheer {
  0% { transform: none; }
  22% { transform: translateY(-6px) rotate(calc(var(--dir) * 6deg)) scale(1.1); }
  48% { transform: translateY(-2px) rotate(calc(var(--dir) * -3deg)) scale(1.04); }
  74% { transform: translateY(-5px) rotate(calc(var(--dir) * 4deg)) scale(1.1); }
  100% { transform: none; }
}
.mm-big.is-merge {
  animation: mm-merge 0.26s ease-in both;
}
@keyframes mm-merge {
  to { transform: translateX(calc((0.5 - var(--slot)) * 92px)) scale(0.62); }
}
.mm-sparks {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 58px;
  width: 0;
  height: 0;
  pointer-events: none;
}
.mm-sparks i {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: hsl(calc(var(--k) * 36 + 40) 95% 62%);
  animation: mm-spark 0.72s ease-out both;
  animation-delay: inherit;
}
.mm-sparks i:nth-child(odd) {
  background: var(--tone);
  border-radius: 50%;
}
@keyframes mm-spark {
  0% { transform: rotate(calc(var(--k) * 36deg)) translateY(0) scale(1); opacity: 1; }
  100% { transform: rotate(calc(var(--k) * 36deg)) translateY(-78px) scale(0.3); opacity: 0; }
}
.mm-pop {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  white-space: nowrap;
  animation: mm-pop 0.72s ease both;
}
.mm-pop b {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: var(--mm-gold);
  text-shadow: 0 2px 0 #3a2a00, 0 4px 10px rgba(0, 0, 0, 0.6);
}
.mm-pop small {
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #06140c;
  background: var(--tone);
}
.mm-pop em {
  margin-top: 2px;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
@keyframes mm-pop {
  0% { transform: translateX(-50%) scale(0.4); opacity: 0; }
  25% { transform: translateX(-50%) scale(1.15); opacity: 1; }
  80% { transform: translateX(-50%) translateY(-6px) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-12px) scale(0.95); opacity: 0; }
}

.mm-flash {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  animation: mm-flash 1.7s ease both;
}
.mm-flash strong {
  font-size: clamp(20px, 7vw, 28px);
  font-weight: 900;
  color: var(--mm-gold);
  text-shadow: 0 2px 0 #3a2a00, 0 4px 0 #2a1e00, 0 8px 18px rgba(0, 0, 0, 0.6);
}
.mm-flash span {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fecdd3;
}
@keyframes mm-flash {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  14% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  24%, 82% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(1); opacity: 0; }
}

/* ---------- After the game ---------- */

.mm-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}
.mm-btn--go {
  width: 100%;
  border: 0;
  padding: 11px;
  font-size: 14px;
  background: #1f9d55;
}
.mm-foot {
  position: absolute;
  z-index: 14;
  left: 10px;
  right: 10px;
  bottom: 28px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(8, 22, 14, 0.94);
  border: 1px solid rgba(180, 210, 160, 0.25);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.mm-foot p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.mm-foot__row {
  display: flex;
  gap: 8px;
}
.mm-foot__row .mm-btn--go {
  flex: 1;
}
.mm-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
}
.mm-modal__panel {
  width: min(100%, 300px);
  max-height: 88%;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
  border-radius: 20px;
  border: 1px solid rgba(180, 210, 160, 0.25);
  background: linear-gradient(180deg, #0f281a, #08160e);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: mm-pop-in 0.25s ease-out both;
}
.mm-modal__panel.is-win {
  border-color: rgba(245, 197, 24, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 197, 24, 0.18);
}
@keyframes mm-pop-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.mm-modal__icon {
  display: block;
  width: 60px;
  height: 60px;
  margin: -4px auto 4px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}
.mm-modal__panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}
.mm-modal__panel > p {
  margin: 0 0 10px;
  font-size: 12px;
  color: rgba(245, 247, 244, 0.75);
}
.mm-stats {
  width: 100%;
  margin: 0 0 10px;
  border-collapse: collapse;
  font-size: 11px;
}
.mm-stats th {
  font-weight: 600;
  font-size: 9.5px;
  color: rgba(245, 247, 244, 0.5);
  padding: 2px 4px;
}
.mm-stats td {
  padding: 5px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}
.mm-stats td:first-child {
  text-align: left;
  font-weight: 700;
}
.mm-stats tr.is-win td {
  color: var(--mm-gold);
}
.mm-modal__money {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.mm-modal__money.is-win {
  background: rgba(31, 157, 85, 0.45);
  color: #c8ffd8;
}
.mm-modal__money.is-loss {
  background: rgba(160, 30, 40, 0.55);
  color: #ffc9c9;
}
.mm-modal__row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.mm-modal__row .mm-btn {
  flex: 1;
}

/* ---------- Rules sheet ---------- */

.mm-sheet {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
}
.mm-sheet__panel {
  width: 100%;
  max-height: 86%;
  overflow: auto;
  padding: 12px 14px 30px;
  box-sizing: border-box;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg, #0f281a, #08160e);
  border-top: 1px solid rgba(180, 210, 160, 0.25);
  animation: mm-sheet-in 0.25s ease-out both;
}
@keyframes mm-sheet-in {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.mm-sheet__panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.mm-sheet__panel h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.mm-rules h3 {
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mm-gold);
}
.mm-rules ol {
  margin: 0;
  padding-left: 18px;
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(245, 247, 244, 0.88);
}
.mm-rules li + li {
  margin-top: 3px;
}
.mm-vals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 6px 18px;
}
.mm-val {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
}
.mm-val i {
  font-style: normal;
  font-weight: 600;
  font-size: 9px;
  color: rgba(245, 247, 244, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .mm-grid.is-deal .mm-card,
  .mm-big.is-cheer,
  .mm-big.is-miss,
  .mm-sparks i,
  .mm-vault.is-bump {
    animation: none !important;
  }
}
