/* Listen-scoped visual layer for the approved Lyt & find Option B package.
   The DOM artwork and audio still come from the live CMS/game data. */
body.listen-game-route {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  background: #69c8ee;
}

body.listen-game-route #app,
body.listen-game-route .main-shell,
body.listen-game-route #main {
  background: transparent;
}

/* The shared focus-route toast spacer must not move the Listen scene. */
body.game-focus-route.listen-game-route:has(#toast.visible) #main {
  margin-top: 0;
}

body.game-focus-route.listen-game-route #toast {
  top: calc(env(safe-area-inset-top) + 62px);
  right: auto;
  bottom: auto;
  left: 8px;
  width: min(100px, calc(100vw - 16px));
  max-width: min(100px, calc(100vw - 16px));
  padding: 6px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
  line-height: 1.2;
  text-align: center;
  transform: translateY(15px);
}

body.game-focus-route.listen-game-route #toast.visible {
  transform: translateY(0);
}

body.listen-game-route::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  display: block;
  content: "";
  opacity: 1;
  pointer-events: none;
  background: url("/assets/listen-option-b/master-tropical-portrait.png") 12% center / cover no-repeat;
}

body.listen-game-route::after {
  display: none;
}

@media (min-width: 780px) {
  body.listen-game-route {
    background-image: none;
  }

  body.listen-game-route::before {
    background-image: url("/assets/listen-option-b/master-tropical-landscape.png");
    background-position: center;
  }
}

body.listen-game-route .game-focus-top {
  position: relative;
  z-index: 2;
  min-height: 54px;
  background: transparent;
}

body.listen-game-route .game-overview-exit,
body.listen-game-route .game-focus-top .language-picker,
body.listen-game-route .game-focus-top .sound-toggle {
  width: clamp(48px, 11vw, 64px);
  min-width: clamp(48px, 11vw, 64px);
  height: clamp(48px, 11vw, 64px);
  min-height: clamp(48px, 11vw, 64px);
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 3px 2px #3e371d4d);
}

body.listen-game-route .game-overview-exit {
  background-image: url("/assets/listen-option-b/control-back.png");
  color: transparent;
}

body.listen-game-route .game-focus-top .language-picker {
  border: 0;
  background: transparent url("/assets/listen-option-b/control-language.png") center / contain no-repeat;
}

body.listen-game-route .game-focus-top .language-picker::after {
  content: "";
  background: none;
}

body.listen-game-route .game-focus-top .sound-toggle {
  padding: 0;
  background-image: url("/assets/listen-option-b/control-music.png");
  color: transparent;
  font-size: 0;
}

body.listen-game-route .game-focus-top .language-picker select {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 50%;
}

body.listen-game-route #main .playground.listen-game {
  display: grid;
  width: min(100%, 1160px);
  max-width: 1160px;
  min-height: 0 !important;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  justify-items: center;
  gap: clamp(2px, .7vh, 7px);
  margin: 0 auto;
  padding: 0 clamp(4px, 1.2vw, 14px) 8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Keep the same layout on non-Animal topics while their Admin background is
   absent or still loading. All overrides remain scoped to the Listen route. */
body.listen-game-route.listen-topic-scene:not(.listen-animal-scene) #main .playground.listen-game {
  display: flex;
  min-height: max(410px, calc(100dvh - 58px - clamp(56px, 12dvh, 104px) - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  flex-direction: column;
  gap: clamp(5px, 1.1vh, 10px);
  padding: clamp(10px, 2vh, 18px) clamp(8px, 2vw, 22px) clamp(10px, 1.8vh, 16px);
}

body.listen-game-route.listen-topic-scene:not(.listen-animal-scene) #main .listen-game .listen-game-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  gap: clamp(5px, 1vh, 12px);
  padding: 0;
}

body.listen-game-route.listen-topic-scene:not(.listen-animal-scene) #main .listen-game .listen-answer-card > span:first-child {
  height: clamp(220px, 30dvh, 300px);
  min-height: clamp(220px, 30dvh, 300px);
  max-height: 300px;
}

body.listen-game-route.listen-topic-scene:not(.listen-animal-scene) #main .listen-game .listen-topic-pills {
  flex: 0 0 auto;
  padding: clamp(8px, 1.2vh, 14px) clamp(2px, 1vw, 10px) 0;
}

@media (max-width: 520px) and (max-height: 640px) {
  body.listen-game-route.listen-topic-scene:not(.listen-animal-scene) #main .playground.listen-game {
    --listen-topic-scenery-clearance: clamp(34px, 7dvh, 44px);
    min-height: max(360px, calc(100dvh - 58px - var(--listen-topic-scenery-clearance) - env(safe-area-inset-top) - env(safe-area-inset-bottom))) !important;
  }

  body.listen-game-route.listen-topic-scene:not(.listen-animal-scene) #main .listen-game .listen-answer-card > span:first-child {
    height: clamp(136px, 26dvh, 160px);
    min-height: clamp(136px, 26dvh, 160px);
    max-height: 160px;
  }
}

body.listen-game-route #main .listen-game .listen-game-body {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(2px, .5vh, 6px);
  padding: 0;
}

body.listen-game-route #main .listen-play-controls {
  display: flex;
  width: 100%;
  min-height: clamp(70px, 11svh, 104px);
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0;
}

body.listen-game-route #main .listen-game .listen-replay {
  position: relative;
  width: clamp(76px, 22vw, 112px);
  min-width: clamp(76px, 22vw, 112px);
  height: clamp(76px, 22vw, 112px);
  min-height: clamp(76px, 22vw, 112px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent url("/assets/listen-option-b/control-speaker.png") center / contain no-repeat;
  box-shadow: none;
  color: transparent;
  filter: drop-shadow(0 4px 2px #51472b55);
}

body.listen-game-route #main .listen-game .listen-replay span:first-child,
body.listen-game-route #main .listen-game .listen-replay span:last-child,
body.listen-game-route #main .listen-start::after {
  display: none;
}

body.listen-game-route #main .listen-game .listen-answer-stage {
  display: grid;
  width: min(100%, 900px, max(300px, calc((100svh - 500px) * 1.35)));
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  place-items: center;
  padding: 0;
  background: transparent;
}

body.listen-game-route #main .listen-game .listen-answer-grid {
  display: grid;
  width: 100%;
  max-width: none;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  gap: clamp(6px, 2.2vw, 20px);
  flex: 0 0 auto;
}

body.listen-game-route #main .listen-game .listen-answer-card {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 760 / 900;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}

body.listen-game-route #main .listen-game .listen-answer-card::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background: url("/assets/listen-option-b/answer-card-left.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 2px #32351a55);
}

body.listen-game-route #main .listen-game .listen-answer-card:nth-child(2)::before {
  background-image: url("/assets/listen-option-b/answer-card-right.png");
}

body.listen-game-route #main .listen-game .listen-answer-card > span:first-child {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 20%;
  background: transparent;
}

body.listen-game-route #main .listen-game .listen-answer-card > span:first-child > span,
body.listen-game-route #main .listen-game .listen-answer-card .listen-animal-art-stage,
body.listen-game-route #main .listen-game .listen-answer-card .listen-number-art-stage,
body.listen-game-route #main .listen-game .listen-answer-card .listen-number-art-motion,
body.listen-game-route #main .listen-game .listen-answer-card .listen-color-balloon-stage {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
  background: transparent;
}

body.listen-game-route #main .listen-game .listen-answer-card > span:first-child img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain !important;
  object-position: center !important;
}

body.listen-game-route #main .listen-game .listen-answer-card .listen-option-answer-state {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body.listen-game-route #main .listen-game .listen-answer-card.listen-answer-correct .listen-option-answer-state {
  background-image: url("/assets/listen-option-b/answer-correct.png");
}

body.listen-game-route #main .listen-game .listen-answer-card.listen-answer-wrong .listen-option-answer-state {
  background-image: url("/assets/listen-option-b/answer-wrong.png");
}

body.listen-game-route #main .listen-game .listen-answer-card > b {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

body.listen-game-route #main .listen-game .listen-answer-card:disabled:not(.listen-answer-correct) {
  filter: none;
  opacity: .72;
}

body.listen-game-route #main .listen-game .listen-answer-card:focus-visible,
body.listen-game-route .listen-topic-pills button:focus-visible,
body.listen-game-route .game-overview-exit:focus-visible,
body.listen-game-route .game-focus-top .language-picker:focus-within,
body.listen-game-route .listen-replay:focus-visible {
  outline: 4px solid #126d68;
  outline-offset: 3px;
}

body.listen-game-route #main .listen-game-feedback {
  display: flex;
  width: min(100%, 900px);
  height: clamp(48px, 7svh, 70px);
  min-height: clamp(48px, 7svh, 70px);
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow: visible;
}

body.listen-game-route #main .listen-game-feedback .listen-feedback-face {
  width: clamp(42px, 7vh, 60px);
  height: clamp(42px, 7vh, 60px);
  object-fit: contain;
}

body.listen-game-route #main .listen-game-feedback .listen-food-character {
  width: clamp(48px, 7vh, 62px);
  height: clamp(48px, 7vh, 62px);
  object-fit: contain;
}

body.listen-game-route #main .listen-game .listen-food-reaction {
  height: 100%;
  min-height: 0;
}

body.listen-game-route #main .listen-game .listen-food-character-wrap {
  width: clamp(48px, 7vh, 62px);
  height: clamp(48px, 7vh, 62px);
}

body.listen-game-route #main .listen-topic-pills {
  display: grid;
  width: 100%;
  max-width: 960px;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(66px, min(20.5vw, 15svh), 92px);
  gap: clamp(4px, 1vw, 10px);
  align-self: center;
  padding: 0 clamp(3px, 1vw, 10px);
}

body.listen-game-route #main .listen-topic-pills button {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 25%;
  align-items: center;
  justify-items: center;
  padding: 3px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none;
  filter: drop-shadow(0 2px 2px #38452455);
  transition: transform .15s ease, filter .15s ease;
}

/* The legacy CMS-backed scene styles use a more specific background shorthand.
   Keep the supplied Option B tile artwork and frameless state in those scenes. */
body.listen-game-route #main .listen-topic-pills button[data-game-topic] {
  border: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="animals"] {
  background-image: url("/assets/listen-option-b/category-animals.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="food"] {
  background-image: url("/assets/listen-option-b/category-food.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="colors"] {
  background-image: url("/assets/listen-option-b/category-colors.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="numbers"] {
  background-image: url("/assets/listen-option-b/category-numbers.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="family"] {
  background-image: url("/assets/listen-option-b/category-family.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="body"] {
  background-image: url("/assets/listen-option-b/category-body.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="home"] {
  background-image: url("/assets/listen-option-b/category-home.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="nature"] {
  background-image: url("/assets/listen-option-b/category-nature.png") !important;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-label {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 1px 2px 2px;
  overflow: hidden;
  clip: auto;
  clip-path: none;
  border: 0;
  color: #234d56;
  font-size: clamp(.58rem, 2.2vw, .88rem);
  font-weight: 750;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.listen-game-route #main .listen-topic-pills button[aria-pressed="true"] {
  transform: translateY(-2px) scale(1.035);
  filter: drop-shadow(0 4px 3px #26472e55);
  box-shadow: none;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-art {
  width: min(84%, 104px);
  height: min(100%, 70px);
  align-self: center;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-art img {
  object-fit: contain;
}

body.listen-game-route #main .listen-session-progress {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

body.listen-game-route #main .listen-completion {
  width: min(92vw, 700px);
  min-height: min(76svh, 680px);
  align-content: center;
  padding: clamp(28px, 6vw, 58px);
  border: 12px solid #e8bb52;
  border-radius: clamp(30px, 6vw, 62px);
  background: #fff6da;
  box-shadow: 0 7px 0 #78522b66, 0 17px 35px #342c1e55;
}

body.listen-game-route #main .listen-completion-art {
  border: 0;
  background: transparent;
}

body.listen-game-route #main .listen-completion-art::after {
  position: absolute;
  inset: 4%;
  content: "";
  pointer-events: none;
  background: url("/assets/listen-option-b/feedback-star.png") center / 24% no-repeat;
  transform: translate(40%, -34%);
}

body.listen-game-route #main .listen-completion-action {
  border: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 3px 2px #51472b55);
  font-size: 0;
  box-shadow: none;
}

body.listen-game-route #main .listen-completion-replay {
  background-color: transparent;
  background-image: url("/assets/listen-option-b/control-speaker.png");
}

body.listen-game-route #main .listen-completion-games {
  background-color: transparent;
  background-image: url("/assets/listen-option-b/control-back.png");
}

@media (max-width: 520px) {
  body.listen-game-route .game-focus-top {
    min-height: 52px;
  }

  body.listen-game-route .game-focus-top .top-actions {
    gap: clamp(7px, 2vw, 12px);
  }

  body.listen-game-route #main .listen-game .listen-answer-stage {
    width: min(100%, 900px, max(290px, calc((100svh - 500px) * 1.35)));
  }

  body.listen-game-route #main .listen-game .listen-answer-grid {
    gap: clamp(4px, 1.7vw, 8px);
  }

  body.listen-game-route #main .listen-topic-pills {
    gap: 3px;
  }

  body.listen-game-route #main .listen-topic-pills button {
    min-height: 56px;
    grid-auto-rows: minmax(0, 1fr);
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-art {
    width: min(84%, 74px);
    height: min(100%, 56px);
  }
}

@media (max-width: 359px) {
  body.listen-game-route #main .listen-topic-pills .listen-topic-art {
    width: min(84%, 66px);
    height: min(100%, 48px);
  }

  body.listen-game-route #main .listen-game .listen-replay {
    width: 70px;
    min-width: 70px;
    height: 70px;
    min-height: 70px;
  }
}

@media (min-width: 521px) {
  body.listen-game-route .game-overview-exit,
  body.listen-game-route .game-focus-top .sound-toggle {
    width: clamp(54px, 7vw, 84px);
    min-width: clamp(54px, 7vw, 84px);
    height: clamp(54px, 7vw, 84px);
    min-height: clamp(54px, 7vw, 84px);
  }

  body.listen-game-route .game-focus-top .language-picker {
    width: clamp(112px, 18vw, 170px);
    min-width: clamp(112px, 18vw, 170px);
    height: clamp(52px, 9vw, 82px);
    min-height: clamp(52px, 9vw, 82px);
  }

  body.listen-game-route .game-focus-top .language-picker select {
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
  }

  body.listen-game-route #main .listen-game .listen-answer-stage {
    width: min(100%, 900px, max(300px, calc((100svh - 500px) * 1.35)));
  }

  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(92px, 14svh, 150px);
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-art {
    width: min(84%, 140px);
    height: min(100%, 96px);
  }
}

body.listen-game-route .game-focus-top .language-picker {
  width: clamp(78px, 20vw, 108px);
  min-width: clamp(78px, 20vw, 108px);
  height: clamp(44px, 12vw, 60px);
  min-height: clamp(44px, 12vw, 60px);
  border: 0;
  border-radius: 0;
  background: transparent url("/assets/listen-option-b/control-language.png") center / contain no-repeat;
}

body.listen-game-route .game-focus-top .language-picker select {
  background: transparent;
  color: transparent;
  opacity: 0;
}

body.listen-game-route .game-overview-exit,
body.listen-game-route .game-focus-top .sound-toggle {
  width: clamp(48px, 14vw, 64px);
  min-width: clamp(48px, 14vw, 64px);
  height: clamp(48px, 14vw, 64px);
  min-height: clamp(48px, 14vw, 64px);
}

body.listen-game-route #main .listen-play-controls {
  min-height: clamp(118px, 15svh, 150px);
}

body.listen-game-route #main .listen-game .listen-replay {
  width: clamp(84px, 28vw, 128px);
  min-width: clamp(84px, 28vw, 128px);
  height: clamp(84px, 28vw, 128px);
  min-height: clamp(84px, 28vw, 128px);
}

body.listen-game-route #main .listen-game .listen-answer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(6px, 1.5vw, 18px);
}

body.listen-game-route #main .listen-game .listen-answer-card {
  aspect-ratio: 760 / 900;
}

@media (min-width: 521px) {
  body.listen-game-route .game-focus-top .language-picker {
    width: clamp(112px, 18vw, 170px);
    min-width: clamp(112px, 18vw, 170px);
    height: clamp(52px, 9vw, 82px);
    min-height: clamp(52px, 9vw, 82px);
  }

  body.listen-game-route #main .listen-play-controls {
    min-height: clamp(118px, 15svh, 150px);
  }

  body.listen-game-route #main .listen-game .listen-replay {
    width: clamp(98px, 14vw, 128px);
    min-width: clamp(98px, 14vw, 128px);
    height: clamp(98px, 14vw, 128px);
    min-height: clamp(98px, 14vw, 128px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.listen-game-route #main .listen-topic-pills button,
  body.listen-game-route #main .listen-game .listen-answer-card {
    transition: none !important;
    animation-duration: .01ms !important;
  }

  body.listen-game-route #main .listen-topic-pills button[aria-pressed="true"] {
    transform: none;
  }
}

/* Match the master artwork closely without changing CMS data, labels or gameplay. */
body.listen-game-route #main .listen-game .listen-answer-stage {
  width: min(100%, 920px, max(288px, calc((100svh - 500px) * 1.65)));
}

body.listen-game-route #main .listen-game .listen-answer-card .listen-animal-art-motion {
  width: 96%;
  height: 96%;
}

body.listen-game-route #main .listen-game .listen-answer-card .emoji {
  font-size: clamp(7.5rem, 24vw, 12rem);
  line-height: 1;
}

body.listen-game-route #main .listen-game .listen-answer-card > span:first-child img {
  object-fit: contain !important;
  object-position: center !important;
}

body.listen-game-route #main .listen-game .listen-answer-card > span:first-child {
  position: relative;
  width: 89%;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none;
  flex: 1 1 auto;
  margin: auto;
  border-radius: 14%;
  background: transparent !important;
}

/* The approved Development scene takes precedence over optional CMS backdrops. */
body.listen-game-route::before {
  background-image: url("/assets/listen-option-b/master-tropical-portrait.png") !important;
  background-position: 12% center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

/* Remove the legacy translucent CMS-backdrop outline outside the supplied frames. */
body.listen-game-route.listen-animal-scene.listen-animal-image-active #main .playground.listen-game .listen-answer-card,
body.listen-game-route.listen-topic-scene.listen-topic-image-active #main .playground.listen-game .listen-answer-card {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.listen-game-route #main .listen-game .listen-answer-card::before {
  background-size: 100% 100%;
}

body.listen-game-route #main .listen-game-feedback {
  height: clamp(24px, 3vh, 34px);
  min-height: clamp(24px, 3vh, 34px);
}

body.listen-game-route #main .listen-topic-pills {
  max-width: 880px;
  grid-auto-rows: clamp(116px, 16.2svh, 148px);
  align-items: stretch;
}

body.listen-game-route #main .listen-topic-pills button {
  position: relative;
  grid-template-rows: minmax(0, 1fr) 30%;
  padding: 5px;
  border-radius: clamp(16px, 2.2vw, 28px);
  background-size: 100% 100%;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic]::after {
  position: absolute;
  z-index: 1;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(145deg, #ffffff50 0%, #ffffff0c 38%, transparent 70%);
  content: "";
  pointer-events: none;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-art,
body.listen-game-route #main .listen-topic-pills .listen-topic-label {
  position: relative;
  z-index: 2;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-art {
  width: min(92%, 142px);
  height: min(100%, 102px);
}

body.listen-game-route #main .listen-topic-pills .listen-topic-label {
  align-self: end;
  padding: 2px 4px 4px;
  font-size: clamp(.72rem, 1.15vw, .96rem);
  line-height: 1.05;
}

@media (max-width: 520px) {
  body.listen-game-route::before {
    background-position: 12% center;
  }

  body.listen-game-route .game-focus-top .language-picker {
    width: clamp(78px, 21vw, 108px);
    min-width: clamp(78px, 21vw, 108px);
  }

  body.listen-game-route #main .listen-game .listen-play-controls {
    min-height: clamp(102px, 12.5svh, 118px);
  }

  body.listen-game-route #main .listen-game .listen-replay {
    width: clamp(92px, 28vw, 124px);
    min-width: clamp(92px, 28vw, 124px);
    height: clamp(92px, 28vw, 124px);
    min-height: clamp(92px, 28vw, 124px);
  }

  body.listen-game-route #main .listen-game-feedback {
    height: clamp(20px, 3vh, 26px);
    min-height: clamp(20px, 3vh, 26px);
  }

  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(82px, 11.3svh, 96px);
  }

  body.listen-game-route #main .listen-topic-pills button {
    grid-template-rows: minmax(0, 1fr) 30%;
    padding: 4px;
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-art {
    width: min(92%, 84px);
    height: min(100%, 66px);
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-label {
    font-size: clamp(.68rem, 2.8vw, .82rem);
  }
}

@media (min-width: 521px) and (max-width: 779px) {
  body.listen-game-route::before {
    background-position: 8% center;
  }
}

@media (min-width: 521px) {
  body.listen-game-route .game-focus-top {
    min-height: clamp(62px, 7vw, 84px);
  }

  body.listen-game-route .game-overview-exit,
  body.listen-game-route .game-focus-top .sound-toggle {
    width: clamp(68px, 6.2vw, 90px);
    min-width: clamp(68px, 6.2vw, 90px);
    height: clamp(68px, 6.2vw, 90px);
    min-height: clamp(68px, 6.2vw, 90px);
  }

  body.listen-game-route .game-focus-top .language-picker {
    width: clamp(140px, 20vw, 190px);
    min-width: clamp(140px, 20vw, 190px);
    height: clamp(68px, 10vw, 98px);
    min-height: clamp(68px, 10vw, 98px);
  }

  body.listen-game-route #main .listen-play-controls {
    min-height: clamp(108px, 12svh, 126px);
  }

  body.listen-game-route #main .listen-game .listen-replay {
    width: clamp(108px, 9vw, 132px);
    min-width: clamp(108px, 9vw, 132px);
    height: clamp(108px, 9vw, 132px);
    min-height: clamp(108px, 9vw, 132px);
  }

  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(116px, 16.2svh, 148px);
  }
}

@media (min-width: 1200px) {
  body.listen-game-route #main .listen-game .listen-answer-stage {
    width: min(100%, 560px, max(480px, calc((100svh - 520px) * 1.35)));
  }

  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(118px, 13.4svh, 124px);
  }

  body.listen-game-route #main .listen-play-controls {
    min-height: 88px;
  }

  body.listen-game-route #main .listen-game .listen-replay {
    width: clamp(104px, 8vw, 116px);
    min-width: clamp(104px, 8vw, 116px);
    height: clamp(104px, 8vw, 116px);
    min-height: clamp(104px, 8vw, 116px);
  }
}

@media (min-width: 780px) {
  body.listen-game-route::before {
    background-image: url("/assets/listen-option-b/master-tropical-landscape.png") !important;
    background-position: center !important;
  }
}

@media (min-width: 521px) and (max-width: 779px) {
  body.listen-game-route::before {
    background-position: 8% center !important;
  }

  body.listen-game-route #main .listen-play-controls {
    min-height: clamp(100px, 11svh, 116px);
  }

  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(108px, 12.4svh, 128px);
  }
}

/* Master-reference refinements: use the package's illustrated scenes, answer
   frames, and blank pastel shells while leaving all runtime CMS art untouched. */
body.listen-game-route::before {
  background-image: url("/assets/listen-option-b/master-tropical-portrait.png") !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

@media (min-width: 780px) {
  body.listen-game-route::before {
    background-image: url("/assets/listen-option-b/master-tropical-landscape.png") !important;
    background-position: center !important;
  }
}

body.listen-game-route #main .listen-game .listen-answer-card::before {
  background-size: 100% 100%;
  filter: none;
}

body.listen-game-route #main .listen-game .listen-answer-card > span:first-child {
  width: 86%;
  height: 88% !important;
  border-radius: 14%;
  background: transparent !important;
}

body.listen-game-route #main .listen-topic-pills {
  max-width: 960px;
  grid-auto-rows: clamp(80px, 10.8svh, 98px);
  gap: clamp(5px, 1.15vw, 12px);
  padding-inline: clamp(4px, 1vw, 10px);
}

body.listen-game-route #main .listen-topic-pills button,
body.listen-game-route #main .listen-topic-pills button[data-game-topic] {
  min-height: 56px;
  grid-template-rows: minmax(0, 1fr) 27%;
  padding: 4px;
  overflow: hidden;
  border: 0 !important;
  border-radius: clamp(15px, 2vw, 24px);
  background-color: transparent !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none !important;
  filter: none;
  text-shadow: none !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic]::after {
  display: none;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-art {
  width: min(84%, 148px);
  height: min(100%, 80px);
  align-self: center;
  overflow: hidden;
  border-radius: 50%;
}

body.listen-game-route #main .listen-topic-pills .listen-topic-art img {
  border-radius: inherit;
  object-fit: contain;
  object-position: center;
  clip-path: ellipse(50% 50% at center);
}

body.listen-game-route #main .listen-topic-pills .listen-topic-label {
  align-self: end;
  padding: 1px 3px 3px;
  color: #163f58;
  font-size: clamp(.68rem, 1.15vw, .94rem);
  font-weight: 800;
  line-height: 1.05;
  text-shadow: none;
}

body.listen-game-route #main .listen-topic-pills button[aria-pressed="true"] {
  transform: translateY(-2px);
  filter: none;
}

@media (max-width: 520px) {
  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(78px, 10.5svh, 90px);
    gap: 4px;
    transform: translateY(-6px);
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-art {
    width: min(84%, 86px);
    height: min(100%, 58px);
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-label {
    font-size: clamp(.64rem, 2.8vw, .78rem);
  }
}

@media (min-width: 521px) and (max-width: 779px) {
  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(100px, 11.5svh, 122px);
  }

  body.listen-game-route #main .listen-topic-pills .listen-topic-art {
    width: min(86%, 132px);
    height: min(100%, 82px);
  }
}

@media (min-width: 1200px) {
  body.listen-game-route #main .listen-topic-pills {
    grid-auto-rows: clamp(106px, 12.4svh, 124px);
  }
}

/* October 25 package refresh: new clean illustrated scenes and matching
   supplied category tiles. All layout and live game content remain untouched. */
body.listen-game-route::before {
  background-image: url("/assets/listen-option-b/option-b-bg-mobile.svg") !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

@media (min-width: 521px) and (max-width: 779px) {
  body.listen-game-route::before {
    background-image: url("/assets/listen-option-b/option-b-bg-tablet.svg") !important;
    background-position: center !important;
  }
}

@media (min-width: 780px) {
  body.listen-game-route::before {
    background-image: url("/assets/listen-option-b/option-b-bg-desktop.svg") !important;
    background-position: center !important;
  }
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="animals"] {
  background-image: url("/assets/listen-option-b/option-b-category-animals.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="food"] {
  background-image: url("/assets/listen-option-b/option-b-category-food.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="colors"] {
  background-image: url("/assets/listen-option-b/option-b-category-colors.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="numbers"] {
  background-image: url("/assets/listen-option-b/option-b-category-numbers.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="family"] {
  background-image: url("/assets/listen-option-b/option-b-category-family.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="body"] {
  background-image: url("/assets/listen-option-b/option-b-category-body.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="home"] {
  background-image: url("/assets/listen-option-b/option-b-category-home.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic="nature"] {
  background-image: url("/assets/listen-option-b/option-b-category-nature.png") !important;
}

body.listen-game-route #main .listen-topic-pills button[data-game-topic] {
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
}

/* The supplied tile assets carry the visible category illustration. Keep CMS
   media mounted and loaded, but do not stack it over the packaged icon artwork. */
body.listen-game-route #main .listen-topic-pills .listen-topic-art {
  opacity: 0 !important;
}
