@import url("../../study-stat-game-med-match/assets/med-match.css?ver=20260922-whole-words");

/* Mom & Baby uses direct board selection on phones; no duplicate focus tray. */
[data-study-stat-game="mom-baby-match"] .mm-focus-tray { display:none!important; }

/* Own the one-second success treatment instead of relying on the imported
   Med Match release to provide this game-specific feedback. */
[data-study-stat-game="mom-baby-match"] .mm-tile.is-matched {
  z-index: 6;
  border-color: #ff3d81 !important;
  outline: 5px solid #ff3d81;
  outline-offset: -5px;
  box-shadow: 0 0 0 5px #42d6cc, 0 0 28px rgba(255, 61, 129, .9) !important;
  filter: brightness(1.12) saturate(1.16);
  transform: none !important;
}

.study-stat-med-match-shell {
  width: 100%;
  max-width: 1240px;
  margin: 28px auto;
  padding: 18px;
  box-sizing: border-box;
  background: #fff8ee;
  border: 2px solid #e6e0ff;
  border-radius: 18px;
  box-shadow: 10px 12px 0 #b388ff;
  font-family: Rubik, "Trebuchet MS", Inter, Arial, sans-serif;
}

[data-study-stat-game="mom-baby-match"] {
  width: 100%;
  aspect-ratio: 24 / 17;
  min-height: 320px;
  overflow: hidden;
  border-radius: 12px;
  background: #071331;
}

[data-study-stat-game="mom-baby-match"] canvas {
  display: block;
  touch-action: pan-y;
}

.mm-category-screen {
  min-height: 100%;
  box-sizing: border-box;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 5vw, 64px);
  color: #fffdf8;
  background:
    linear-gradient(rgba(32, 52, 95, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 52, 95, 0.35) 1px, transparent 1px),
    #071331;
  background-size: 32px 32px;
  font-family: Inter, Arial, sans-serif;
}

.mm-category-screen h2 {
  margin: 0;
  color: #ffc84d;
  font: 900 clamp(28px, 4vw, 42px)/1.05 "Arial Black", Arial, sans-serif;
  text-transform: uppercase;
}

.mm-category-screen > p {
  max-width: 720px;
  margin: 0;
  color: #dce3f6;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.55;
}

.mm-category-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mm-level-choices {
  grid-template-columns: repeat(2, minmax(0, 260px));
}

.mm-category-choice {
  min-height: 128px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 3px solid #b388ff;
  border-radius: 8px;
  color: #101a43;
  background: #fff8ee;
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.mm-category-choice strong {
  max-width: 100%;
  font: 900 13px/1.2 "Arial Black", Arial, sans-serif;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.mm-category-choice span,
.mm-category-choice small {
  font-size: 12px;
  line-height: 1.25;
}

.mm-category-choice[aria-checked="true"] {
  border-color: #ffc84d;
  box-shadow: 0 0 0 3px #ff3d81;
  background: #fffdf8;
}

.mm-category-choice:disabled {
  color: #aeb6cf;
  border-color: #526080;
  background: #152348;
  cursor: not-allowed;
}

.mm-category-choice:focus-visible,
.mm-start-button:focus-visible {
  outline: 4px solid #fffdf8;
  outline-offset: 4px;
}

.mm-start-button {
  justify-self: start;
  min-width: 220px;
  padding: 15px 24px;
  border: 2px solid #fffdf8;
  border-radius: 6px;
  color: #fffdf8;
  background: #ff3d81;
  cursor: pointer;
  font: 900 16px/1 "Arial Black", Arial, sans-serif;
}

.mm-load-error {
  margin: 0;
  padding: 28px;
  color: #1b1f3b;
  background: #fff8ee;
  font: 700 16px/1.5 Inter, Arial, sans-serif;
}

@media (max-width: 720px) {
  [data-study-stat-game="mom-baby-match"] {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }


  .study-stat-med-match-shell {
    margin: 14px auto;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 5px 7px 0 #b388ff;
  }

  .mm-category-screen {
    align-content: start;
    overflow: visible;
    padding: 24px 16px;
  }

  .mm-category-choices {
    grid-template-columns: 1fr;
  }

  .mm-category-choice {
    min-height: 112px;
  }

  .mm-start-button {
    width: 100%;
  }
}

[data-study-stat-game="mom-baby-match"].is-playing { aspect-ratio: auto; min-height: 0; }
[data-study-stat-game="mom-baby-match"] button:focus-visible { outline: 4px solid #ffc84d; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  [data-study-stat-game="mom-baby-match"] canvas {
    scroll-behavior: auto;
  }
}

/* Approved Mom & Baby start-screen identity. Scoped to prevent the other
   matching games mounted on the Arcade page from inheriting this palette. */
[data-study-stat-game="mom-baby-match"] .mm-category-screen h2 {
  color: #f4b6ca;
}

[data-study-stat-game="mom-baby-match"] .mm-category-choice {
  min-height: 112px;
  padding: 14px 12px;
  border-color: #aedcf3;
  background: #f8dbe5;
}

[data-study-stat-game="mom-baby-match"] .mm-category-choice strong {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

[data-study-stat-game="mom-baby-match"] .mm-category-choice span,
[data-study-stat-game="mom-baby-match"] .mm-category-choice small,
[data-study-stat-game="mom-baby-match"] .mm-category-screen > p {
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

[data-study-stat-game="mom-baby-match"] .mm-category-choice:nth-child(even) {
  border-color: #f4b6ca;
  background: #d9eef9;
}

[data-study-stat-game="mom-baby-match"] .mm-category-choice[aria-checked="true"] {
  border-color: #fffdf8;
  background: #d9eef9;
  box-shadow: 0 0 0 3px #f4b6ca;
}

[data-study-stat-game="mom-baby-match"] .mm-start-button {
  color: #101a43;
  background: #aedcf3;
  border-color: #fffdf8;
  box-shadow: 0 5px 0 #d982a4;
}

[data-study-stat-game="mom-baby-match"] .mm-start-button:hover {
  background: #f4b6ca;
}

@media (max-width: 720px) {
  [data-study-stat-game="mom-baby-match"] .mm-category-screen {
    gap: 12px;
    padding: 20px 14px;
  }

  [data-study-stat-game="mom-baby-match"] .mm-category-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  [data-study-stat-game="mom-baby-match"] .mm-category-choice {
    min-height: 104px;
    padding: 12px 10px;
  }
}

@media (max-width: 380px) {
  [data-study-stat-game="mom-baby-match"] .mm-category-choices {
    grid-template-columns: 1fr;
  }
}


[data-study-stat-game="mom-baby-match"] .mb-clinical-context { margin: 10px 16px; padding: 10px 14px; color: #fff; background: #183850; border-radius: 8px; font-size: 15px; line-height: 1.45; }
[data-study-stat-game="mom-baby-match"] .mb-clinical-context[hidden] { display: none; }
