/* Word games: Memory, Word bingo, Hear & find and Listen & spell, made from the Words topics. */
.wg-dialog {
  width: min(900px, calc(100vw - 16px));
  max-height: calc(100svh - 16px);
  padding: 0;
  border: 2px solid #b9d3ea;
  border-radius: 26px;
  background: var(--ad-surface);
  color: var(--ad-ink-deep);
  box-shadow: 0 10px 0 var(--ad-edge);
  overflow: auto;
}
.wg-dialog::backdrop {
  background:
    radial-gradient(120% 80% at 50% 15%, rgb(140 195 250 / 0.42), transparent 70%),
    linear-gradient(rgb(60 100 160 / 0.5), rgb(28 50 90 / 0.78));
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
}
.wg-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.wg-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wg-close,
.wg-hear,
.wg-next,
.wg-undo {
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid #9cc3ea;
  border-radius: 14px;
  background: #fff;
  color: #2b5f8c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wg-next {
  border-color: #28664f;
  background: var(--color-action-confirm);
  color: var(--ad-on-accent);
  box-shadow: 0 3px 0 #20553f;
}
.wg-title {
  flex: 1;
  margin: 0;
  font-size: calc(20px * var(--text-scale, 1));
}
.wg-title-icon {
  font-size: 1.25em;
}
.wg-topic {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ad-soft);
  font-weight: 700;
  font-size: calc(14px * var(--text-scale, 1));
}
.wg-bi small {
  font-weight: 500;
  font-size: 0.72em;
  color: var(--ad-ink-muted);
}
.wg-next .wg-bi small {
  color: #e6f4ee;
}
.wg-help {
  margin: 0;
  color: #527594;
  font-size: calc(15px * var(--text-scale, 1));
}
.wg-dots {
  display: flex;
  gap: 6px;
}
.wg-dot {
  width: 14px;
  height: 14px;
  border: 2px solid #b9d3ea;
  border-radius: 50%;
  background: #fff;
}
.wg-dot[data-state="now"] {
  border-color: #7a6ad6;
}
.wg-dot[data-state="good"] {
  border-color: #3a9a6d;
  background: #3a9a6d;
}
.wg-feedback {
  min-height: 2.8em;
  margin: 0;
  font-weight: 700;
}
.wg-feedback[data-tone="good"] {
  color: var(--ad-ink-leaf);
}
.wg-feedback[data-tone="wrong"] {
  color: #9a5b00;
}
.wg-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.wg-foot [hidden] {
  display: none;
}
.wg-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wg-call {
  margin: 0;
  text-align: center;
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 800;
}
.wg-memory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.wg-card,
.wg-cell,
.wg-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 108px;
  padding: 10px 6px;
  border: 3px solid #b9d3ea;
  border-radius: 20px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wg-card-front {
  display: none;
  font-size: 48px;
  line-height: 1.1;
}
.wg-card-word {
  font-size: calc(20px * var(--text-scale, 1));
}
.wg-card-back {
  font-size: 40px;
  color: #7a6ad6;
}
.wg-card[data-state="up"] .wg-card-back,
.wg-card[data-state="match"] .wg-card-back {
  display: none;
}
.wg-card[data-state="up"] .wg-card-front,
.wg-card[data-state="match"] .wg-card-front {
  display: block;
}
.wg-card[data-state="match"],
.wg-cell[data-state="match"],
.wg-pick[data-state="right"] {
  border-color: #3a9a6d;
  background: #eaf7ef;
}
.wg-cell[data-state="wrong"],
.wg-pick[data-state="wrong"] {
  border-color: #d9674d;
  opacity: 0.55;
}
.wg-bingo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.wg-cell-pic,
.wg-pick-pic {
  font-size: 48px;
  line-height: 1.1;
}
.wg-cell-name,
.wg-pick-name {
  font-size: calc(15px * var(--text-scale, 1));
}
/* Rhyme time and Same sound play on a sky-and-meadow scene: a purple ribbon asks, big picture cards with
   their letter and a name chip answer. In dark mode the night sky keeps the dark buttons of control-theme.css. */
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) {
  --wg-sky-top: var(--refresh-bfe3ff);
  --wg-sky-low: var(--refresh-e9f6ff);
  --wg-hill-near: var(--refresh-a8dc8a);
  --wg-hill-far: var(--refresh-93cf74);
  --wg-bush: var(--refresh-green-rim);
  --wg-bush-light: var(--refresh-green-high);
  --wg-cloud: rgb(255 255 255 / 0.9);
  --wg-glass: rgb(255 255 255 / 0.8);
  --wg-ink: var(--refresh-ink);
  --wg-ribbon-top: var(--ad-purple-edge);
  --wg-ribbon: var(--ad-purple-base);
  --wg-ribbon-tail: var(--ad-ink-purple);
  /* Yellow sparkle rays: three short strokes fanning up and out from one corner. */
  --wg-rays: conic-gradient(
    from 270deg,
    transparent 0 6deg,
    var(--refresh-gold) 6deg 20deg,
    transparent 20deg 36deg,
    var(--refresh-gold) 36deg 50deg,
    transparent 50deg 66deg,
    var(--refresh-gold) 66deg 80deg,
    transparent 80deg
  );
  --wg-rays-mask: radial-gradient(circle, transparent 40%, black 41% 72%, transparent 73%);
}
html[data-appearance="dark"] .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) {
  --wg-sky-top: var(--ad-page);
  --wg-sky-low: var(--ad-surface);
  --wg-hill-near: var(--refresh-green-low);
  --wg-hill-far: var(--refresh-green-base);
  --wg-cloud: rgb(255 255 255 / 0.12);
  --wg-glass: rgb(255 255 255 / 0.1);
  --wg-ink: var(--ad-ink-deep);
  --wg-ribbon-top: var(--ad-purple-top);
  --wg-ribbon: var(--ad-purple-face);
  --wg-ribbon-tail: var(--ad-purple-base);
}
/* The meadow sits behind the bottom buttons and does not scroll with the cards. */
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]):not([data-result]) {
  border-color: var(--refresh-b9d9f2);
  background:
    radial-gradient(44px 18px at 6% 58%, var(--wg-cloud) 98%, transparent 100%),
    radial-gradient(28px 22px at 8% 55%, var(--wg-cloud) 98%, transparent 100%),
    radial-gradient(50px 20px at 94% 52%, var(--wg-cloud) 98%, transparent 100%),
    radial-gradient(30px 24px at 92% 49%, var(--wg-cloud) 98%, transparent 100%),
    radial-gradient(46px 40px at 2% 100%, var(--wg-bush) 98%, transparent 100%),
    radial-gradient(32px 30px at 6% 100%, var(--wg-bush-light) 98%, transparent 100%),
    radial-gradient(46px 40px at 98% 100%, var(--wg-bush) 98%, transparent 100%),
    radial-gradient(32px 30px at 94% 100%, var(--wg-bush-light) 98%, transparent 100%),
    radial-gradient(70% 70px at 10% 100%, var(--wg-hill-near) 99%, transparent 100%),
    radial-gradient(70% 56px at 85% 100%, var(--wg-hill-far) 99%, transparent 100%),
    linear-gradient(var(--wg-sky-top), var(--wg-sky-low) 70%);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-content {
  gap: 14px;
  padding: 16px 20px 22px;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-title {
  color: var(--wg-ink);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) :is(.wg-close, .wg-hear) {
  border: 3px solid var(--refresh-line-strong);
  border-radius: 999px;
  background: var(--refresh-white);
  color: var(--refresh-ink);
  box-shadow: 0 4px 0 var(--ad-base);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-help {
  padding: 8px 18px;
  border: 2px solid var(--refresh-line);
  border-radius: 999px;
  background: var(--wg-glass);
  color: var(--wg-ink);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-bar .wg-dots {
  margin-left: auto;
  gap: 8px;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-dot {
  width: 22px;
  height: 22px;
  border: 3px solid var(--refresh-line-strong);
  background: var(--refresh-white);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-dot[data-state="now"] {
  border-color: var(--ad-purple-edge);
  background: var(--ad-purple-edge);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-dot[data-state="good"] {
  border-color: var(--ad-ink-leaf);
  background: var(--ad-ink-leaf);
}
/* The question rides a purple ribbon whose folded tails sit behind its ends. */
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call {
  position: relative;
  align-self: center;
  max-width: calc(100% - 64px);
  padding: 8px 30px;
  border-radius: 18px;
  background: linear-gradient(var(--wg-ribbon-top), var(--wg-ribbon));
  box-shadow: 0 5px 0 var(--wg-ribbon-tail);
  color: var(--ad-on-accent);
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.18);
  font-size: calc(26px * var(--text-scale, 1));
  font-weight: 900;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::before,
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 16px;
  bottom: -12px;
  width: 44px;
  background: var(--wg-ribbon-tail);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::before {
  left: -28px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::after {
  right: -28px;
  clip-path: polygon(0 0, 100% 0, 66% 50%, 100% 100%, 0 100%);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-picks {
  gap: 14px;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick {
  gap: 8px;
  min-height: 170px;
  padding: 14px 8px 12px;
  border: 4px solid var(--refresh-line-strong);
  border-radius: 28px;
  background: linear-gradient(var(--refresh-white) 55%, var(--refresh-eef6ff));
  box-shadow: 0 6px 0 var(--ad-base);
  color: var(--refresh-ink);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick[data-state="right"] {
  border-color: var(--color-action-confirm);
  background: var(--ad-paper);
  box-shadow: 0 6px 0 var(--color-action-confirm);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick[data-state="wrong"] {
  border-color: var(--ad-coral-edge);
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-letter {
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ad-blue-top);
  color: var(--ad-blue-ink);
  font-size: calc(20px * var(--text-scale, 1));
  font-weight: 900;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-pic {
  font-size: 72px;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-name {
  padding: 3px 20px;
  border-radius: 999px;
  background: var(--ad-blue-top);
  box-shadow: 0 3px 0 var(--ad-line);
  color: var(--ad-blue-ink);
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 800;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-next {
  border: 3px solid var(--refresh-white);
  border-radius: 999px;
  background: linear-gradient(var(--refresh-green-low), var(--refresh-green-base));
  box-shadow: 0 5px 0 var(--ad-ink-green-2);
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.2);
}
/* The worked example: a banner with the rule, the two example cards with a note between, a big start button. */
.wg-intro-banner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  align-self: center;
}
.wg-intro-banner::before,
.wg-intro-banner::after,
.wg-intro-pair .wg-pick::before {
  content: "";
  position: absolute;
  top: -22px;
  left: -40px;
  width: 52px;
  height: 52px;
  background: var(--wg-rays);
  -webkit-mask: var(--wg-rays-mask);
  mask: var(--wg-rays-mask);
  pointer-events: none;
}
.wg-intro-banner::after,
.wg-intro-pair .wg-pick:last-child::before {
  right: -40px;
  left: auto;
  transform: scaleX(-1);
}
.wg-intro-pair .wg-pick::before {
  top: -34px;
  left: -34px;
}
.wg-intro-pair .wg-pick:last-child::before {
  right: -34px;
}
.wg-intro-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 8px 26px;
  border-radius: 999px;
  background: var(--wg-glass);
  color: var(--wg-ink);
  font-size: calc(24px * var(--text-scale, 1));
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
.wg-intro-note:first-child {
  font-size: 1.35em;
}
/* A text note (♫) takes the ribbon purple; an emoji symbol keeps its own colours. */
:is(.wg-intro-note, .wg-intro-symbol) {
  color: var(--ad-purple-edge);
  text-align: center;
  line-height: 1;
}
.wg-intro-es {
  margin: 0;
  padding: 4px 22px;
  border-radius: 999px;
  background: var(--ad-purple-top);
  color: var(--ad-purple-ink);
  font-size: calc(17px * var(--text-scale, 1));
  font-weight: 700;
  text-align: center;
}
.wg-intro-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-intro-pair .wg-pick {
  width: 200px;
  min-height: 200px;
}
.wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-intro-pair .wg-pick-pic {
  font-size: 96px;
}
.wg-intro-symbol {
  width: 1.1em;
  height: 1.1em;
  font-size: 52px;
  animation: wg-bob 1.6s ease-in-out infinite alternate;
}
@keyframes wg-bob {
  to {
    transform: translateY(-8px) rotate(-6deg);
  }
}
.wg-intro-start {
  display: flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: min(100%, 420px);
  min-height: 60px;
  padding: 10px 32px;
  font-size: calc(24px * var(--text-scale, 1));
  font-weight: 900;
}
.wg-intro-play {
  width: 0.8em;
  height: 0.9em;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
html[data-calm="true"] .wg-intro-symbol {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .wg-intro-symbol {
    animation: none;
  }
}
/* Tablets in landscape: the cards and the start button take the room the screen has. */
@media (orientation: landscape) and (min-width: 768px) and (min-height: 640px) {
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-content {
    gap: 18px;
    padding: 20px 28px 28px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-title {
    font-size: calc(28px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) :is(.wg-close, .wg-hear, .wg-next:not(.wg-intro-start)) {
    min-height: 60px;
    padding-inline: 26px;
    font-size: calc(21px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-help {
    font-size: calc(18px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call {
    padding: 10px 44px;
    font-size: calc(36px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick {
    min-height: 250px;
    border-radius: 32px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-letter {
    width: 46px;
    height: 46px;
    font-size: calc(26px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-pic {
    font-size: 116px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-name {
    padding: 4px 28px;
    font-size: calc(30px * var(--text-scale, 1));
  }
  .wg-intro-title {
    padding: 10px 36px;
    font-size: calc(36px * var(--text-scale, 1));
  }
  .wg-intro-es {
    font-size: calc(22px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-intro-pair .wg-pick {
    width: 270px;
    min-height: 270px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-intro-pair .wg-pick-pic {
    font-size: 140px;
  }
  .wg-intro-symbol {
    font-size: 76px;
  }
  .wg-intro-start {
    min-width: 560px;
    min-height: 84px;
    font-size: calc(34px * var(--text-scale, 1));
  }
}
/* Phones: two by two cards, the progress dots on their own row and a full-width start button. */
@media (max-width: 600px) {
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-content {
    gap: 10px;
    padding: 12px 12px 18px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-bar .wg-dots {
    grid-column: 1 / -1;
    justify-self: center;
    margin: 0;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call {
    max-width: calc(100% - 44px);
    padding: 6px 18px;
    font-size: calc(21px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::before,
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::after {
    top: 12px;
    bottom: -8px;
    width: 30px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::before {
    left: -18px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-call::after {
    right: -18px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-picks {
    gap: 10px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick {
    min-height: 150px;
    border-width: 3px;
    border-radius: 24px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-letter {
    width: 30px;
    height: 30px;
    font-size: calc(17px * var(--text-scale, 1));
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-pic {
    font-size: 60px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-pick-name {
    padding: 2px 14px;
    font-size: calc(19px * var(--text-scale, 1));
  }
  .wg-intro-title {
    gap: 6px;
    padding: 6px 16px;
    font-size: calc(21px * var(--text-scale, 1));
  }
  .wg-intro-es {
    font-size: calc(15px * var(--text-scale, 1));
  }
  .wg-intro-banner::before,
  .wg-intro-banner::after {
    display: none;
  }
  .wg-intro-pair {
    gap: 6px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-intro-pair .wg-pick {
    flex: 1;
    width: auto;
    min-height: 170px;
  }
  .wg-dialog:is([data-game="rhyme"], [data-game="sound"]) .wg-intro-pair .wg-pick-pic {
    font-size: 72px;
  }
  .wg-intro-pair .wg-pick::before {
    display: none;
  }
  .wg-intro-symbol {
    font-size: 34px;
  }
  .wg-intro-start {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    font-size: calc(23px * var(--text-scale, 1));
  }
}
.wg-picks {
  /* Every challenge offers four answers: four across, or two by two on a phone. */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wg-pick {
  min-height: 150px;
}
.wg-pick-letter {
  position: absolute;
  top: 8px;
  left: 10px;
  color: var(--ad-ink-muted);
  font-weight: 800;
}
.wg-letters {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.wg-slot {
  display: grid;
  place-items: center;
  width: 52px;
  height: 60px;
  border-bottom: 5px solid #b9d3ea;
  font-size: calc(36px * var(--text-scale, 1));
  font-weight: 800;
  text-transform: lowercase;
}
.wg-slot[data-state="right"] {
  border-color: #3a9a6d;
  color: var(--ad-ink-leaf);
}
.wg-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.wg-tile {
  width: 64px;
  height: 64px;
  border: 3px solid #9cc3ea;
  border-radius: 16px;
  background: #fff;
  color: #2b5f8c;
  font: inherit;
  font-size: calc(30px * var(--text-scale, 1));
  font-weight: 800;
  text-transform: lowercase;
  cursor: pointer;
}
.wg-tile:disabled {
  opacity: 0.3;
}
.wg-tile[data-state="wrong"] {
  border-color: #d9674d;
}
.wg-undo {
  align-self: center;
  min-width: 64px;
}
/* The finished game is the shared results card (css/practice-results.css): same width as the Play games'. */
.wg-dialog[data-result="complete"] {
  width: min(520px, calc(100vw - 24px));
}
@media (orientation: landscape) and (min-width: 768px) and (min-height: 500px) {
  .wg-dialog[data-result="complete"] {
    width: min(880px, calc(100vw - 48px));
  }
}
@media (max-width: 600px) {
  .wg-memory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .wg-card,
  .wg-cell {
    min-height: 92px;
  }
  .wg-card-front,
  .wg-cell-pic,
  .wg-pick-pic {
    font-size: 40px;
  }
  .wg-card-front.wg-card-word {
    font-size: calc(17px * var(--text-scale, 1));
    overflow-wrap: anywhere;
  }
  .wg-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .wg-pick {
    min-height: 130px;
  }
  .wg-slot {
    width: 40px;
    height: 50px;
  }
  .wg-tile {
    width: 56px;
    height: 56px;
  }
  .wg-topic {
    display: none;
  }
}
html[data-appearance="dark"] .wg-dialog {
  border-color: #47637b;
  background: var(--ad-surface);
  color: var(--ad-ink-deep);
  box-shadow: 0 10px 0 var(--ad-edge);
}
html[data-appearance="dark"]
  :is(.wg-close, .wg-hear, .wg-undo, .wg-card, .wg-cell, .wg-pick, .wg-tile) {
  border-color: #47637b;
  background: #2b455c;
  color: #d8e8f5;
}
html[data-appearance="dark"] :is(.wg-help, .wg-bi small) {
  color: #9db8cc;
}
html[data-appearance="dark"] .wg-topic {
  background: var(--ad-soft);
}
.wg-bigpic {
  margin: 0;
  text-align: center;
  font-size: 84px;
  line-height: 1.1;
}
@media (max-width: 600px) {
  .wg-bigpic {
    font-size: 64px;
  }
}
.wg-sentence {
  min-height: 64px;
  padding: 12px 14px;
  border-bottom: 5px solid #b9d3ea;
  text-align: center;
  font-size: calc(26px * var(--text-scale, 1));
  font-weight: 800;
}
.wg-sentence[data-state="right"] {
  border-color: #3a9a6d;
  color: var(--ad-ink-leaf);
}
.wg-word {
  min-width: 56px;
  min-height: 56px;
  padding: 6px 14px;
  border: 3px solid #9cc3ea;
  border-radius: 16px;
  background: var(--ad-surface);
  color: var(--ad-ink-blue);
  font: inherit;
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 800;
  cursor: pointer;
}
.wg-word:disabled {
  opacity: 0.3;
}
.wg-word[data-state="wrong"] {
  border-color: #d9674d;
}
.wg-slot[data-state="gap"] {
  border-color: #7a6ad6;
  background: #efeafc;
}
html[data-appearance="dark"] .wg-word {
  border-color: #47637b;
  background: var(--ad-surface);
  color: var(--ad-ink-blue);
}
/* In the title the Spanish line drops under the English one on a phone, so the separator dot is not left hanging at the end of a line. */
@media (max-width: 599px) {
  .wg-title .wg-bi small {
    display: block;
  }
  .wg-title .wg-sep {
    display: none;
  }
}
/* A matched pair is a reward, not a disabled control: keep its picture and word at full strength. */
.wg-card[data-state="match"]:disabled {
  opacity: 1;
  color: #1f5f45;
}
/* The right answer stays at full strength too, while the other choices fade. */
.wg-pick[data-state="right"]:disabled {
  opacity: 1;
}
/* Right spelling: three words to choose from, one per row on a phone so each stays easy to read. */
.wg-spelling .wg-pick-name {
  font-size: calc(22px * var(--text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.04em;
}
/* Duck catch and Letter rain: a field where things move. */
.wg-field {
  position: relative;
  height: clamp(240px, 42vh, 340px);
  overflow: hidden;
  border: 3px solid #b9d3ea;
  border-radius: 22px;
  touch-action: manipulation;
  user-select: none;
}
.wg-sky {
  background: linear-gradient(#cdeefc, #eaf8ff 70%);
}
.wg-pond {
  position: absolute;
  inset: auto 0 0 0;
  height: 22%;
  background:
    radial-gradient(circle at 12px 0, #9fd6f2 8px, transparent 9px) 0 0 / 28px 14px repeat-x,
    linear-gradient(#7cc4ea, #4f9fd0);
}
.wg-cloudy {
  background: linear-gradient(#b8cfe6, #e4f1fb 60%, #f5fbff);
}
.wg-duck-wrap,
.wg-drop-wrap {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.wg-duck-wrap {
  --duck-width: 100px;
  --duck-bird: 48px;
  --duck-icon: 44px;
  width: var(--duck-width);
}
.wg-duck {
  display: grid;
  justify-items: center;
  width: var(--duck-width);
  padding: 2px;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.wg-duck-bird {
  display: block;
  width: var(--duck-bird);
  height: var(--duck-bird);
  font-size: var(--duck-bird);
}
.wg-duck-bird .choice-icon {
  display: block;
  width: var(--duck-bird);
  height: var(--duck-bird);
  font-size: var(--duck-bird);
  line-height: 1;
}
.wg-duck-sign {
  margin-top: -8px;
  padding: 2px 6px;
  border: 3px solid #e6cfae;
  border-radius: 12px;
  background: #fff;
  font-size: var(--duck-icon);
  line-height: 1.1;
}
.wg-duck-sign .choice-icon {
  display: block;
  width: var(--duck-icon);
  height: var(--duck-icon);
  font-size: var(--duck-icon);
  line-height: 1;
}
@media (orientation: landscape) and (min-width: 768px) and (min-height: 640px) {
  .wg-duck-wrap {
    --duck-width: 124px;
    --duck-bird: 60px;
    --duck-icon: 60px;
  }
  .wg-sky {
    height: clamp(320px, 48vh, 440px);
  }
}
.wg-duck-wrap[data-state="wobble"] .wg-duck {
  animation: wg-wobble 0.5s ease-in-out;
}
.wg-duck-wrap[data-state="caught"] .wg-duck {
  animation: wg-caught 1s ease-in forwards;
}
.wg-duck-wrap[data-state="caught"] .wg-duck-sign {
  border-color: #3a9a6d;
  background: #eaf7ef;
}
.wg-duck-wrap[data-state="calm"] {
  opacity: 0.55;
}
@keyframes wg-wobble {
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}
@keyframes wg-caught {
  35% {
    transform: scale(1.25) rotate(-12deg);
  }
  100% {
    transform: translateY(70px) scale(0.6) rotate(20deg);
    opacity: 0;
  }
}
.wg-drop-wrap {
  width: 44px;
}
.wg-drop {
  display: grid;
  place-items: center;
  width: 44px;
  height: 52px;
  padding: 0;
  border: 3px solid #6fb2de;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: #d6edfb;
  color: #1f5379;
  font: inherit;
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
}
.wg-drop-wrap[data-state="wobble"] .wg-drop {
  animation: wg-wobble 0.5s ease-in-out;
  border-color: #d9674d;
}
.wg-slot[data-state="now"] {
  border-color: #7a6ad6;
  background: #f1eefc;
}
html[data-calm="true"] .wg-duck-wrap[data-state="wobble"] .wg-duck,
html[data-calm="true"] .wg-drop-wrap[data-state="wobble"] .wg-drop {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .wg-duck-wrap[data-state="wobble"] .wg-duck,
  .wg-drop-wrap[data-state="wobble"] .wg-drop {
    animation: none;
  }
}
.wg-cloudy {
  height: clamp(190px, 32vh, 300px);
}
.wg-rain-pic {
  margin: 0;
  font-size: 48px;
}
/* Shadow match, What's missing? and Pattern time. */
.wg-shadow {
  filter: brightness(0) opacity(0.85);
}
.wg-pics-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.wg-shown {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 3px solid #b9d3ea;
  border-radius: 16px;
  background: #fff;
  font-size: 40px;
}
.wg-shown[data-state="gap"] {
  border-style: dashed;
  border-color: #7a6ad6;
  background: #f1eefc;
  font-size: 30px;
}
.wg-pick-only {
  min-height: 92px;
}
.wg-pick-only .wg-pick-pic {
  font-size: 52px;
}

/* Trace it: a big square to draw on with a finger; the page must not scroll under it. */
.wg-dialog .wg-trace {
  position: relative;
  inset: auto;
  display: block;
  width: min(100%, 300px, 46dvh);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 2px solid var(--ad-line-soft);
  border-radius: 20px;
  background: #fff;
  touch-action: none;
}
.wg-trace[data-state="right"] {
  border-color: var(--ad-mint-edge);
}
.wg-trace-skip {
  display: block;
  margin: 6px auto 0;
}
.wg-trace-skip[hidden] {
  display: none;
}

/* Where is it?: a small scene per choice, the cat placed around the box. */
.wg-where-scene {
  position: relative;
  display: block;
  width: 88px;
  height: 80px;
  margin: 0 auto;
}
.wg-where-box,
.wg-where-cat {
  position: absolute;
  line-height: 1;
}
.wg-where-box {
  left: 20px;
  top: 28px;
  z-index: 1;
  font-size: 44px;
}
.wg-where-cat {
  z-index: 2;
  font-size: 24px;
}
[data-place="in"] .wg-where-cat {
  left: 30px;
  top: 26px;
  z-index: 0;
}
[data-place="on"] .wg-where-cat {
  left: 30px;
  top: 2px;
}
[data-place="under"] .wg-where-box {
  top: 0;
}
[data-place="under"] .wg-where-cat {
  left: 30px;
  top: 48px;
}
[data-place="next"] .wg-where-box {
  left: 0;
}
[data-place="next"] .wg-where-cat {
  left: 58px;
  top: 46px;
}
[data-place="behind"] .wg-where-cat {
  left: 48px;
  top: 14px;
  z-index: 0;
  opacity: 0.9;
}
[data-place="front"] .wg-where-cat {
  left: 30px;
  top: 52px;
}
/* What day is next?: the names in order, the last one to find. */
.wg-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 12px;
}
.wg-calendar-card {
  display: grid;
  place-content: center;
  min-height: 62px;
  padding: 4px 2px;
  border: 2px solid var(--ad-line-soft);
  border-radius: 14px;
  background: #fff;
  font-size: calc(min(14px, 3.4vw) * var(--text-scale, 1));
  font-weight: 800;
  text-align: center;
}
.wg-calendar-card small {
  font-weight: 500;
  color: var(--ad-ink-muted);
}
.wg-calendar-gap {
  border-style: dashed;
  border-color: #7c6fcf;
}
html[data-appearance="dark"] :is(.wg-calendar-card, .wg-trace) {
  border-color: #3d5b73;
  background: #223a4f;
}
html[data-appearance="dark"] .wg-calendar-card small {
  color: var(--ad-ink-muted);
}
.wg-calendar ~ .wg-picks .wg-pick-name {
  font-size: calc(min(17px, 4.2vw) * var(--text-scale, 1));
}
.wg-calendar-gap {
  font-size: 22px;
  color: #7c6fcf;
}

/* Phone navigation leaves the header width to the exercise title. */
@media (max-width: 600px) {
  .wg-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 10px;
  }
  .wg-close,
  .wg-next {
    min-width: 44px;
    padding: 8px;
  }
  .wg-close {
    font-size: 24px;
  }
  :is(.wg-close, .wg-next:not(.wg-intro-start)) .wg-bi {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .wg-title {
    min-width: 0;
    font-size: calc(18px * var(--text-scale, 1));
    line-height: 1.2;
    text-wrap: balance;
  }
  :is(.wg-title, .wg-foot) .wg-bi small {
    display: none;
  }
  /* The instruction keeps its Spanish on phones, on a line of its own. */
  .wg-help .wg-bi small {
    display: block;
    font-size: 0.85em;
  }
  .wg-help .wg-sep {
    display: none;
  }
}

/* Keep long day and month names intact, including enlarged text. */
@media (max-width: 600px) {
  .wg-calendar,
  .wg-calendar ~ .wg-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wg-calendar ~ .wg-picks .wg-pick {
    min-height: 76px;
  }
}

/* Calendar audio stays beside the title even when the exercise needs scrolling. */
@media (max-width: 600px) {
  .wg-dialog[data-game="calendar"] .wg-bar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
  .wg-bar .wg-hear {
    width: 44px;
    min-height: 44px;
    padding: 6px;
    font-size: 20px;
  }
  .wg-bar .wg-hear .wg-bi {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Reserve the same picture box before and after the Fluent image loads. */
:is(.wg-cell-pic, .wg-pick-pic, .wg-card-front:not(.wg-card-word), .wg-bigpic) {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}
.wg-bigpic {
  align-self: center;
}
.wg-call-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
}
:is(.wg-where-box, .wg-where-cat) {
  width: 1em;
  height: 1em;
}

/* Short landscape screens keep the whole board beside the instructions. */
@media (orientation: landscape) and (max-height: 500px) {
  .wg-dialog:not([data-result]) .wg-content:has(.wg-memory, .wg-bingo, .wg-cloudy, .wg-where) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 6px 12px;
    min-height: calc(100svh - 20px);
    padding: 8px 12px;
  }
  .wg-content:has(.wg-memory, .wg-bingo, .wg-cloudy, .wg-where) > .wg-bar {
    grid-column: 1 / -1;
  }
  .wg-content:has(.wg-memory, .wg-bingo, .wg-cloudy, .wg-where) > .wg-stage {
    grid-column: 1;
    grid-row: 2 / 6;
    align-self: center;
    gap: 6px;
    min-width: 0;
  }
  .wg-content:has(.wg-memory, .wg-bingo, .wg-cloudy, .wg-where)
    > :is(.wg-help, .wg-dots, .wg-feedback, .wg-foot) {
    grid-column: 2;
  }
  .wg-content:has(.wg-memory, .wg-bingo, .wg-cloudy, .wg-where) > .wg-foot {
    grid-row: 5;
    flex-wrap: wrap;
    align-self: end;
  }
  .wg-content:has(.wg-memory, .wg-bingo, .wg-cloudy, .wg-where) > .wg-feedback {
    grid-row: 3 / 5;
    min-height: 0;
  }
  .wg-memory {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  :is(.wg-memory .wg-card, .wg-bingo .wg-cell) {
    min-height: 72px;
    padding: 4px;
    gap: 2px;
  }
  :is(.wg-card-front:not(.wg-card-word), .wg-cell-pic) {
    font-size: 32px;
  }
  .wg-card-word {
    font-size: calc(16px * var(--text-scale, 1));
    overflow-wrap: anywhere;
  }
  .wg-bingo {
    gap: 6px;
  }
  .wg-call {
    font-size: calc(18px * var(--text-scale, 1));
  }
  .wg-cloudy {
    height: 132px;
  }
  .wg-rain-pic {
    font-size: 40px;
  }
  .wg-dialog[data-game="rain"] .wg-slot {
    width: 36px;
    height: 40px;
    font-size: calc(26px * var(--text-scale, 1));
  }
}
