/* Practice Club exercises (draw lines, write, tick, Water, Math & sports) in one dialog. It is the whole
   window, not a card over the menu: a sky with clouds on top and meadow hills along the bottom, like the
   Learn sheet (css/layout.css). The background does not scroll with the content, so the hills stay put. */
.mv-dialog {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ad-ink-deep);
  box-shadow: none;
  overflow: auto;
}
.mv-dialog::backdrop {
  background: rgb(28 50 90 / 0.78);
}
/* The content keeps a readable width on a big screen; the sky still fills the window. */
.mv-content {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(1100px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top, 0px)) 18px max(16px, env(safe-area-inset-bottom, 0px));
}
.mv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mv-close,
.mv-hear,
.mv-next,
.mv-es-toggle {
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--ad-line-blue);
  border-radius: 16px;
  background: var(--ad-surface);
  box-shadow: 0 3px 0 var(--ad-edge);
  color: #2b5f8c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mv-hear,
.mv-es-toggle {
  border-radius: 999px;
}
/* Spanish stays out of sight until this button is pressed (data-es="on" on .mv-content). */
.mv-es-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
}
.mv-es-toggle[aria-pressed="true"] {
  border-color: var(--ad-purple-edge);
  background: var(--ad-purple-face);
  color: var(--ad-purple-ink);
}
.mv-content:not([data-es="on"]) .mv-es {
  display: none;
}
.mv-next {
  border-color: #28664f;
  background: var(--color-action-confirm);
  color: var(--ad-on-accent);
  box-shadow: 0 3px 0 #20553f;
}
/* The next question is on its way: the button glows, and a tap skips the wait. */
.mv-next[data-auto="true"] {
  animation: mv-next-glow 1.2s ease-in-out infinite;
}
@keyframes mv-next-glow {
  0%,
  100% {
    box-shadow:
      0 3px 0 rgb(32 85 63),
      0 0 0 0 rgb(60 160 110 / 0.55);
  }
  50% {
    box-shadow:
      0 3px 0 rgb(32 85 63),
      0 0 0 10px rgb(60 160 110 / 0);
  }
}
.mv-title {
  flex: 1;
  margin: 0;
  font-size: calc(20px * var(--text-scale, 1));
}
.mv-title-icon {
  font-size: 1.25em;
}
.mv-bi small {
  font-weight: 500;
  font-size: 0.72em;
  color: var(--ad-ink-muted);
}
.mv-next .mv-bi small {
  color: #e6f4ee;
}
.mv-dots {
  display: flex;
  gap: 6px;
}
.mv-dot {
  width: 14px;
  height: 14px;
  border: 2px solid #b9d3ea;
  border-radius: 50%;
  background: #fff;
}
.mv-dot[data-state="now"] {
  border-color: #7a6ad6;
  background: #7a6ad6;
}
.mv-dot[data-state="good"] {
  border-color: #3a9a6d;
  background: #3a9a6d;
}
.mv-dot[data-state="ok"] {
  border-color: #e0a21a;
  background: #f2c453;
}
/* What to do, in a pill with a megaphone. */
.mv-help {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 16px;
  border: 2px solid var(--ad-line-blue);
  border-radius: 24px;
  background: color-mix(in srgb, var(--ad-surface) 88%, transparent);
  box-shadow: 0 3px 0 var(--ad-edge);
  color: var(--ad-ink-deep);
  font-size: calc(16px * var(--text-scale, 1));
  font-weight: 700;
}
.mv-help::before {
  content: "📣";
  flex: none;
  font-size: 1.4em;
}
/* The answer's message is a banner on its own paper, so it reads over the meadow behind it. Its slot is
   always reserved (hidden while empty): the question does not jump when the message appears. */
.mv-feedback {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 6px;
  min-height: 58px;
  margin: 0;
  padding: 8px 16px;
  border: 3px solid transparent;
  border-radius: 24px;
  font-size: calc(19px * var(--text-scale, 1));
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.mv-feedback:empty {
  visibility: hidden;
}
.mv-feedback:not(:empty) {
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  background: var(--ad-surface);
  box-shadow: 0 3px 0 var(--ad-edge);
  animation: mv-feedback-in 0.28s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.mv-feedback[data-tone="good"] {
  background: var(--ad-tint-mint);
  color: var(--ad-ink-green);
  font-size: calc(23px * var(--text-scale, 1));
}
.mv-feedback[data-tone="wrong"] {
  background: var(--ad-tint-gold);
  color: var(--ad-gold-ink);
}
.mv-feedback[data-tone="hint"] {
  background: var(--ad-purple-top);
  color: var(--ad-purple-ink);
}
@keyframes mv-feedback-in {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mv-feedback:not(:empty),
  .mv-next[data-auto="true"] {
    animation: none;
  }
}
.mv-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.mv-foot {
  align-items: center;
}
.mv-foot > .mv-feedback {
  flex: 1;
  min-width: 0;
}
.mv-foot > .mv-next {
  margin-left: auto;
}
/* The exercise fills the window: the question sits between the header and the buttons. */
.mv-stage {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.mv-foot [hidden] {
  display: none;
}
/* Part 1: names around a park scene; lines are drawn on top of the board. */
.mv-board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mv-names {
  display: flex;
  justify-content: space-around;
  gap: 8px;
}
.mv-chip {
  min-width: 96px;
  min-height: 44px;
  padding: 6px 16px;
  border: 2px solid #9fc79f;
  border-radius: 999px;
  background: #e8f6e4;
  color: #2f5d3a;
  font: inherit;
  font-weight: 800;
  cursor: grab;
  touch-action: none;
}
.mv-chip[aria-pressed="true"] {
  border-color: #7a6ad6;
  background: #e9e4fb;
  box-shadow: 0 0 0 3px #b9aff0;
}
/* The wrap is as wide as the scene at its height cap (48svh × 720/440, plus the border), so a short
   screen never letterboxes the park between two empty bands. */
.mv-scene-wrap {
  align-self: center;
  width: min(100%, calc(48svh * 720 / 440 + 4px));
  box-sizing: border-box;
  border: 2px solid #b9d3ea;
  border-radius: 18px;
  background: var(--ad-soft-keep);
  overflow: hidden;
}
.mv-scene {
  display: block;
  width: 100%;
  max-height: 48svh;
  margin: 0 auto;
}
.mv-egg {
  cursor: pointer;
  outline: none;
}
.mv-egg:hover .mv-egg-hit,
.mv-egg:focus-visible .mv-egg-hit {
  fill: #7a6ad622;
  stroke: #7a6ad6;
  stroke-width: 3;
}
.mv-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.mv-line {
  stroke: #3f5f7a;
  stroke-width: 4;
  stroke-linecap: round;
}
.mv-line.is-ok {
  stroke: #2e9e6b;
}
.mv-line.is-example {
  stroke: #e0a21a;
  stroke-dasharray: 2 9;
}
.mv-line.is-drag {
  stroke: #7a6ad6;
  stroke-dasharray: 8 7;
}
/* Part 2: a question, the typed answer and an on-screen keyboard. */
.mv-question {
  text-align: center;
}
/* The card is a button: tapping the question says it again. The speaker marks it for a child who cannot
   read the words yet. */
.mv-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border: 2px solid var(--ad-line-blue);
  border-radius: 28px;
  background: color-mix(in srgb, var(--ad-surface) 88%, transparent);
  box-shadow: 0 3px 0 var(--ad-edge);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.mv-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ad-edge);
}
.mv-card:focus-visible {
  outline: 3px solid var(--ad-purple-edge);
  outline-offset: 3px;
}
.mv-card-text {
  flex: 1;
  min-width: 0;
}
.mv-card-hear {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ad-line-blue);
  border-radius: 50%;
  background: var(--ad-soft);
  font-size: 22px;
}
/* Words for a screen reader only. */
.mv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mv-label {
  display: block;
  margin: 0;
  font-size: calc(23px * var(--text-scale, 1));
  font-weight: 800;
  line-height: 1.25;
}
.mv-label-es {
  display: block;
  margin-top: 6px;
  color: var(--ad-blue-ink);
  font-size: calc(16px * var(--text-scale, 1));
  text-align: center;
}
.mv-answer {
  min-width: 220px;
  margin: 0 auto 14px;
  padding: 10px 22px;
  border: 3px dashed #b9d3ea;
  border-radius: 18px;
  background: #fff;
  font-size: calc(32px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}
.mv-hint {
  min-height: calc(28px * var(--text-scale, 1));
  margin: -6px 0 10px;
  color: var(--ad-ink-muted);
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
}
.mv-answer[data-tone="good"] {
  border: 3px solid #3a9a6d;
  color: var(--ad-ink-leaf);
}
.mv-answer[data-tone="wrong"] {
  border-color: #d9674d;
}
.mv-pad {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.mv-pad-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
/* Keys share the row instead of keeping a fixed width: eight letters no longer run off a phone. */
.mv-key {
  flex: 0 1 56px;
  min-width: 0;
  min-height: 44px;
  padding: 4px 2px;
  border: 2px solid #9cc3ea;
  border-radius: 12px;
  background: #fff;
  color: #2b5f8c;
  font: inherit;
  font-size: 1.05em;
  font-weight: 800;
  cursor: pointer;
}
.mv-key-go {
  flex: 1 1 88px;
  max-width: 120px;
  border-color: #28664f;
  background: var(--color-action-confirm);
  color: var(--ad-on-accent);
}
/* Part 4: four pictures to tick (two by two on a phone). */
.mv-picks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mv-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 14px 8px 10px;
  border: 3px solid var(--ad-line-blue);
  border-radius: 26px;
  background: var(--ad-surface);
  box-shadow: 0 3px 0 var(--ad-edge);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mv-pic {
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  width: 100%;
  min-height: 1.1em;
  font-size: 56px;
  line-height: 1.1;
}
.mv-pic[data-illustration-scene] {
  width: min(100%, 160px);
}
.mv-letter {
  position: absolute;
  top: 8px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ad-soft);
  color: var(--ad-ink-muted);
  font-weight: 800;
}
.mv-pick[data-state="right"] {
  border-color: #3a9a6d;
  background: var(--ad-tint-mint);
  color: var(--ad-ink-green);
  opacity: 1;
}
.mv-pick[data-state="wrong"] {
  border-color: #d9674d;
  opacity: 0.45;
}
.mv-tick {
  position: absolute;
  top: 6px;
  right: 10px;
  color: #2e9e6b;
  font-size: 30px;
  font-weight: 900;
}
/* Sun rays around the medal, fading out with the distance. */
/* The ribbon: a rounded band with a tail folded behind each end. */
/* Close on the left, Play again on the right, both big enough for a child's thumb. */
.mv-result-actions > :is(.mv-hear, .mv-next) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 26px;
  border-radius: 999px;
  font-size: calc(20px * var(--text-scale, 1));
}
.mv-result-actions > .mv-next {
  border: 3px solid var(--ad-surface);
  box-shadow:
    0 0 0 2px var(--ad-mint-edge),
    0 4px 0 rgb(32 85 63);
}
.mv-btn-icon {
  font-size: 1.3em;
  font-weight: 900;
  line-height: 1;
}
/* On a phone the Next label hides, but "Play again" keeps its words. */
.mv-foot.mv-result-actions .mv-next .mv-bi {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}
@media (max-width: 520px) {
  .mv-content {
    padding-right: 12px;
    padding-left: 12px;
  }
  .mv-help {
    padding: 8px 12px;
    font-size: calc(15px * var(--text-scale, 1));
  }
  .mv-card {
    gap: 8px;
    padding: 10px 12px 10px 10px;
  }
  .mv-card-hear {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .mv-result-actions > :is(.mv-hear, .mv-next) {
    padding: 10px 18px;
  }
  .mv-label {
    font-size: calc(21px * var(--text-scale, 1));
  }
  .mv-chip {
    min-width: 0;
    padding: 6px 10px;
  }
  .mv-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mv-pic {
    font-size: 44px;
  }
  .mv-title {
    font-size: calc(17px * var(--text-scale, 1));
  }
  .mv-dot {
    width: 10px;
    height: 10px;
  }
}
html[data-appearance="dark"] .mv-dialog {
  color: var(--ad-ink-deep);
}
html[data-appearance="dark"]
  :is(.mv-close, .mv-hear, .mv-key, .mv-pick, .mv-answer, .mv-es-toggle) {
  border-color: #47637b;
  background: #2b455c;
  color: #d8e8f5;
}
html[data-appearance="dark"] .mv-es-toggle[aria-pressed="true"] {
  border-color: var(--ad-purple-edge);
  background: var(--ad-purple-base);
  color: var(--ad-purple-ink);
}
html[data-appearance="dark"] .mv-bi small {
  color: #9db8cc;
}
/* Phone navigation leaves the header width to the exercise title. */
@media (max-width: 600px) {
  .mv-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px 10px;
  }
  .mv-es-toggle {
    grid-column: 3;
    grid-row: 1;
  }
  .mv-close,
  .mv-next {
    min-width: 44px;
    padding: 8px;
  }
  .mv-close {
    font-size: 24px;
  }
  :is(.mv-close, .mv-next) .mv-bi {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .mv-title {
    min-width: 0;
    font-size: calc(18px * var(--text-scale, 1));
    line-height: 1.2;
    text-wrap: balance;
  }
  :is(.mv-title, .mv-foot) .mv-bi small {
    display: none;
  }
  .mv-dots {
    grid-column: 2 / -1;
    justify-self: start;
  }
}
/* Tablet landscape (docs/css-components.md): the window is all screen, so the question, the clue and the
   buttons are bigger for a child at arm's length. */
@media (orientation: landscape) and (min-width: 768px) and (min-height: 640px) {
  .mv-content {
    gap: 14px;
    padding-top: max(18px, env(safe-area-inset-top, 0px));
  }
  .mv-close,
  .mv-hear,
  .mv-next,
  .mv-es-toggle {
    min-height: 54px;
    font-size: calc(18px * var(--text-scale, 1));
  }
  .mv-title {
    font-size: calc(26px * var(--text-scale, 1));
  }
  .mv-dot {
    width: 18px;
    height: 18px;
  }
  .mv-help {
    padding: 10px 20px;
    font-size: calc(19px * var(--text-scale, 1));
  }
  .mv-label {
    font-size: calc(30px * var(--text-scale, 1));
  }
  .mv-label-es {
    font-size: calc(20px * var(--text-scale, 1));
  }
  .mv-feedback {
    min-height: 70px;
    font-size: calc(26px * var(--text-scale, 1));
  }
  .mv-feedback[data-tone="good"] {
    font-size: calc(32px * var(--text-scale, 1));
  }
  .mv-card {
    gap: 18px;
    padding: 14px 24px 14px 16px;
  }
  .mv-card-hear {
    width: 64px;
    height: 64px;
    font-size: 32px;
  }
  .mv-result-actions > :is(.mv-hear, .mv-next) {
    min-height: 72px;
    font-size: calc(24px * var(--text-scale, 1));
  }
}
/* Put names beside the park and instructions beside the board on short screens. */
@media (orientation: landscape) and (max-height: 500px) {
  .mv-content:has(.mv-board) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    grid-template-rows: auto auto 1fr auto;
    gap: 6px 12px;
    padding: 8px 12px;
  }
  .mv-content:has(.mv-board) > .mv-bar {
    grid-column: 1 / -1;
  }
  .mv-content:has(.mv-board) > .mv-stage {
    grid-column: 1;
    grid-row: 2 / 5;
    align-self: center;
    min-width: 0;
  }
  .mv-content:has(.mv-board) > :is(.mv-help, .mv-feedback, .mv-foot) {
    grid-column: 2;
  }
  .mv-board {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    gap: 6px;
  }
  .mv-names {
    flex-direction: column;
    gap: 14px;
  }
  .mv-chip {
    min-width: 0;
    padding: 6px 4px;
  }
  .mv-scene-wrap {
    width: 100%;
  }
  .mv-scene {
    max-height: none;
  }
  .mv-foot {
    flex-direction: column;
  }
  /* A short screen keeps the message slim so the board and the buttons stay in view. */
  .mv-feedback {
    min-height: 34px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: calc(15px * var(--text-scale, 1));
  }
  .mv-feedback[data-tone="good"] {
    font-size: calc(17px * var(--text-scale, 1));
  }
  .mv-result-actions > :is(.mv-hear, .mv-next) {
    min-height: 46px;
  }
  .mv-result-actions {
    flex-direction: row;
  }
}
/* What to do with the sentence, above it: a small blue pill. */
.mv-task {
  justify-self: start;
  width: fit-content;
  margin: 0;
  padding: 3px 12px;
  border: 2px solid var(--refresh-line-strong);
  border-radius: 999px;
  background: var(--refresh-sky-soft);
  color: var(--refresh-blue-deep);
  font-size: calc(15px * var(--text-scale, 1));
  font-weight: 800;
}
