.mmg-game,
.mmg-game * {
  box-sizing: border-box;
}
.mmg-game {
  --mmg-ink: #eef5ff;
  --mmg-muted: #a5b7d5;
  --mmg-accent: #4c91ff;
  --mmg-bg: #101b36;
  width: 100%;
  max-width: 1080px;
  margin: 20px auto 28px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #2b3d68;
  border-radius: 19px;
  background: #111b32;
  color: var(--mmg-ink);
  box-shadow: 0 18px 45px rgba(11, 22, 49, 0.18);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
.mmg-game button,
.mmg-game input,
.mmg-game select {
  font: inherit;
}
.mmg-game .mmg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.mmg-game .mmg-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 175px;
}
.mmg-game .mmg-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #427afa, #6b4eff);
  font-size: 24px;
}
.mmg-game .mmg-brand strong {
  color: #f3f7ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.8px;
  display: block;
}
.mmg-game .mmg-brand small {
  color: var(--mmg-muted);
  font-size: 11px;
  display: block;
  margin-top: 2px;
}
.mmg-game .mmg-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mmg-game .mmg-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 8px;
  background: #202d4b;
  color: #adc3e4;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.45px;
}
.mmg-game .mmg-stat strong {
  color: #f7f9ff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}
.mmg-game .mmg-lives strong { color: #ff889a; }
.mmg-game .mmg-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #314673;
  border-radius: 14px;
  background: #081429;
}
.mmg-game .mmg-canvas {
  display: block;
  width: 100%;
  height: clamp(365px, 51vw, 540px);
  touch-action: manipulation;
}
.mmg-game .mmg-stage-hint {
  position: absolute;
  left: 11px;
  bottom: 68px;
  pointer-events: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 141, 153, 0.78);
  text-shadow: 0 1px 3px #17233e;
}
.mmg-game .mmg-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(7, 15, 33, 0.74);
  backdrop-filter: blur(4px);
}
.mmg-game .mmg-overlay[hidden] { display: none; }
.mmg-game .mmg-overlay-panel {
  padding: 25px 25px 27px;
  width: min(440px, 100%);
  border: 1px solid #456092;
  border-radius: 17px;
  background: linear-gradient(145deg, #1b2e54, #17213e);
  text-align: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}
.mmg-game .mmg-overlay-icon {
  margin-bottom: 4px;
  font-size: 44px;
}
.mmg-game .mmg-overlay h3 {
  margin: 4px 0 10px;
  color: #fff;
  font-size: clamp(21px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.25;
}
.mmg-game .mmg-overlay p {
  margin: 0 auto 20px;
  max-width: 340px;
  color: #c8d7ef;
  font-size: 14px;
  line-height: 1.7;
}
.mmg-game .mmg-button {
  border: 1px solid transparent;
  border-radius: 9px;
  min-height: 45px;
  padding: 10px 19px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: filter 150ms ease, transform 150ms ease;
  text-decoration: none;
  text-align: center;
}
.mmg-game .mmg-button:hover:not(:disabled) { filter: brightness(1.13); }
.mmg-game .mmg-button:active:not(:disabled) { transform: translateY(1px); }
.mmg-game .mmg-button:focus-visible,
.mmg-game .mmg-answer:focus-visible,
.mmg-game select:focus-visible {
  outline: 3px solid #89c4ff;
  outline-offset: 2px;
}
.mmg-game .mmg-button:disabled { opacity: 0.45; cursor: not-allowed; }
.mmg-game .mmg-primary {
  background: linear-gradient(100deg, #3687ff, #5857f9);
  color: #fff;
  box-shadow: 0 4px 13px rgba(36, 96, 214, 0.2);
}
.mmg-game .mmg-secondary {
  background: #283957;
  color: #f0f5ff;
  border-color: #3a527c;
}
.mmg-game .mmg-controls {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 18px;
}
.mmg-game .mmg-answer-wrap {
  flex: 1 1 280px;
  max-width: 510px;
}
.mmg-game .mmg-answer-wrap label,
.mmg-game .mmg-options label {
  display: block;
  margin: 0 0 7px;
  color: #aec5e6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
}
.mmg-game .mmg-answer-row { display: flex; gap: 8px; }
.mmg-game .mmg-answer {
  min-width: 0;
  width: 100%;
  height: 49px;
  padding: 10px 15px;
  border: 1px solid #466292;
  border-radius: 10px;
  background: #202e50;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  appearance: none;
}
.mmg-game .mmg-answer::placeholder { color: #8fa8ca; font-size: 15px; font-weight: 400; }
.mmg-game .mmg-fire { min-width: 105px; }
.mmg-game .mmg-options {
  display: flex;
  align-items: end;
  gap: 8px;
  flex: 0 1 auto;
  flex-wrap: wrap;
}
.mmg-game .mmg-options select {
  display: block;
  min-height: 45px;
  min-width: 85px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid #425c8a;
  background: #263856;
  color: #fff;
  font-size: 13px;
}
.mmg-game .mmg-feedback {
  min-height: 24px;
  margin: 13px 0 5px;
  font-size: 13px;
  color: #9ac5ff;
  font-weight: 650;
}
.mmg-game .mmg-feedback[data-status="error"] { color: #ffa6b6; }
.mmg-game .mmg-feedback[data-status="success"] { color: #7fe6c3; }
.mmg-game .mmg-instructions {
  color: #a1b3d2;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.65;
}
@media (max-width: 760px) {
  .mmg-game { padding: 12px; margin: 10px auto 20px; border-radius: 13px; }
  .mmg-game .mmg-header { align-items: start; flex-direction: column; gap: 11px; }
  .mmg-game .mmg-stats { justify-content: flex-start; width: 100%; gap: 6px; }
  .mmg-game .mmg-stat { padding: 6px 8px; }
  .mmg-game .mmg-controls { gap: 12px; }
  .mmg-game .mmg-answer-wrap { max-width: none; flex-basis: 100%; }
  .mmg-game .mmg-options { width: 100%; }
  .mmg-game .mmg-stage-hint { font-size: 8px; }
}
@media (max-width: 410px) {
  .mmg-game .mmg-canvas { height: 400px; }
  .mmg-game .mmg-button { font-size: 12px; padding-inline: 12px; }
  .mmg-game .mmg-fire { min-width: 84px; }
  .mmg-game .mmg-options select { min-width: 75px; }
}
@media (prefers-reduced-motion: reduce) {
  .mmg-game .mmg-button { transition: none; }
}
