.adventureOverlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: auto;
  padding: 16px;
  color: #65356c;
  background:
    radial-gradient(ellipse at 25% 5%, #fff8d3aa, transparent 50%),
    linear-gradient(140deg, #a5ccd3, #f8e1b9 55%, #c994a7);
  font-family: inherit;
}
.adventureHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  max-width: 1250px;
  margin: auto;
}
.adventureHeader h2 {
  font-size: clamp(18px, 3vw, 32px);
  margin: 5px;
}
.storyWelcome {
  text-align: center;
  padding: 5vh 5vw;
}
.storyWelcome h1 {
  font-size: clamp(30px, 5vw, 64px);
  margin: 16px;
}
.storybookCities {
  display: flex;
  gap: 8vw;
  justify-content: center;
  align-items: end;
  height: 28vh;
  margin: 16px;
}
.storybookTown {
  width: 30%;
  height: 85%;
  border-radius: 45% 45% 14px 14px;
  background: repeating-linear-gradient(
    0deg,
    #ffeac4 0 25px,
    #b97b5255 26px 29px
  );
  border: 8px ridge #d59a5f;
  box-shadow: 0 12px 0 #875836;
  font-size: clamp(24px, 4vw, 48px);
  align-content: center;
  animation: cityBreathe 5s ease-in-out infinite;
}
.storybookTown:last-child {
  background-color: #d9c7e9;
  animation-delay: -2s;
}
@keyframes cityBreathe {
  50% {
    transform: translateY(-6px);
  }
}
.cityMapGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 12px auto;
  max-width: 1250px;
}
.musicCity {
  position: relative;
  height: min(60vh, 450px);
  min-height: 245px;
  border: 8px ridge #b88658;
  border-radius: 24px;
  background: linear-gradient(#e8f4ea, #ffedca);
  box-shadow: 0 8px #8d5a3c;
  overflow: hidden;
}
.musicCity h3 {
  position: absolute;
  top: 0;
  right: 16px;
  margin: 6px;
  font-size: 18px;
}
.staffStreets {
  position: absolute;
  inset: 27% 3% 21%;
  background: repeating-linear-gradient(
    to bottom,
    #98736788 0 3px,
    transparent 3px calc(25% - 1px)
  );
  border-bottom: 3px solid #98736788;
  pointer-events: none;
}
.cityLandmark {
  position: absolute;
  left: 10px;
  font-size: 11px;
}
.rooftop {
  top: 12%;
}
.parking {
  bottom: 10%;
}
.mapCharacter {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 56px;
  min-height: 56px;
  border: 2px solid #dfbb7a;
  border-radius: 20px;
  background: #fff9eb;
  box-shadow: 0 3px #b78a5e;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  z-index: 1;
}
.mapCharacter img {
  width: 34px;
  height: 40px;
  object-fit: contain;
}
.mapCharacter span {
  font-size: 11px;
  max-width: 55px;
}
.mapCharacter.learned {
  border-color: #70a164;
  background: #f0f5ce;
}
.adventureFooter {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.characterStoryLayout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  max-width: 1000px;
  margin: 12px auto;
  background: #fff5e3;
  border: 7px ridge #c79660;
  border-radius: 25px;
  padding: 20px;
}
.storyPortrait img {
  width: 100%;
  height: 180px;
  object-fit: contain;
}
.storyCopy {
  line-height: 1.9;
  font-size: clamp(15px, 2vw, 22px);
}
.storyCopy p {
  margin-top: 0;
}
.characterQuiz {
  grid-column: 1/-1;
  text-align: center;
}
.characterChoices {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.characterAnswer {
  width: 130px;
  height: 130px;
  border: 3px solid #d3a55d;
  border-radius: 22px;
  background: #fffdf4;
}
.characterAnswer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.friendlyFeedback {
  min-height: 1.7em;
  margin: 8px;
  font-weight: bold;
}
.gameCard {
  border: 4px ridge #d7a46b;
  border-radius: 23px;
  background: linear-gradient(#fffaf0, #ffe4b3);
  color: #65356c;
  padding: 18px;
  min-height: 105px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 5px #9e6c4c;
}
.gameCard strong {
  font-size: 20px;
}
.gameCard span {
  font-size: 14px;
}
.gameCard:disabled {
  opacity: 0.65;
  cursor: default;
}
.gameGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 20px auto;
}
.rewardBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.gameStage {
  max-width: 1150px;
  margin: auto;
}
.gameStage h2 {
  margin: 0;
}
.gameInstructions {
  min-height: 1.6em;
  text-align: center;
  margin: 7px;
  font-size: 14px;
}
.playSurface {
  position: relative;
  height: min(54vh, 470px);
  border: 8px ridge #c2935e;
  background: #fff2da;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 7px #91613e;
}
.playSurface canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  outline-offset: -4px;
}
.gameControls {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.gameControls .choice {
  min-width: 48px;
  min-height: 44px;
  padding: 6px 15px;
}
.gameControls .selected {
  outline: 3px solid #7e568d;
}
.gameProgress {
  width: 100%;
  height: 8px;
  accent-color: #8a65a0;
}
.coinLabel {
  border-radius: 20px;
  background: #fff3c5;
  border: 2px solid #d4aa5e;
  padding: 6px 12px;
  font-weight: bold;
}
.cityDecorator {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 12px;
  background: linear-gradient(#cce8da, #f6dcad);
}
.decorCity {
  min-height: 0;
}
.decorCity h3 {
  margin: 0 0 8px;
  text-align: center;
}
.decorGrid {
  display: grid;
  height: calc(100% - 35px);
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
}
.decorTile {
  border: 2px dashed #c19769;
  background: #f6f5d1;
  border-radius: 15px;
  min-width: 44px;
  min-height: 44px;
  font: inherit;
  font-size: 13px;
  color: #76506d;
}
.decorTile.flower {
  background:
    radial-gradient(circle at 50% 35%, #e384a5 0 15%, transparent 16%),
    linear-gradient(#f6efd1, #b1ce7a);
}
.decorTile.lantern {
  background: radial-gradient(ellipse, #fff7b2, #e7b85d 65%, #efd8b0);
}
.decorTile.house {
  background: linear-gradient(155deg, #d19b9d 30%, #f2ddb0 31%);
}
.decorTile.tree {
  background: radial-gradient(
    ellipse at top,
    #86af6b,
    #4e8c66 65%,
    #d0ba8c 66%
  );
}
.bowlTarget {
  position: absolute;
  left: 42%;
  bottom: 15%;
  min-width: 200px;
  min-height: 60px;
  border: 3px dashed #b08a55;
  border-radius: 40%;
  background: #fff4dbed;
  color: #684f76;
  font: inherit;
  padding: 12px;
}
.ingredientTray {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 9px;
}
.ingredient {
  touch-action: none;
  min-width: 70px;
  min-height: 44px;
}
.stickerBook {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stickerBook img,
#collectedSticker img {
  width: 65px;
  height: 80px;
  object-fit: contain;
}
.collectionCard {
  max-width: 650px;
  margin: 8vh auto;
  background: #fff6df;
  border: 8px ridge #c3915b;
  border-radius: 30px;
  padding: 30px;
  text-align: center;
}
.saveNotice {
  font-size: 13px;
  color: #743c55;
  text-align: center;
}
.rewardIntro {
  text-align: center;
}
.rewardLobbyTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pendingRewards {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  max-height: 100px;
  overflow: auto;
}
.rewardLink {
  padding: 3px 8px;
  font-size: 11px;
  box-shadow: none;
}
.mapBridge {
  text-align: center;
  font-weight: bold;
}
.rewardChoiceNotice {
  text-align: center;
  font-size: 13px;
}
.storyMusicHint {
  background: #f5e9c9;
  border-radius: 14px;
  padding: 6px;
}
.gameStatus {
  text-align: center;
  min-height: 1.3em;
  font-size: 13px;
  font-weight: bold;
}
button:focus-visible,
canvas:focus-visible {
  outline: 3px solid #775095;
  outline-offset: 3px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .adventureOverlay {
    padding: 8px;
  }
  .adventureHeader h2 {
    font-size: 19px;
  }
  .adventureHeader .choice,
  .rewardBar .choice {
    font-size: 12px;
    padding: 5px 9px;
  }
  .musicCity {
    height: 63vh;
    min-height: 220px;
    border-width: 5px;
  }
  .cityMapGrid {
    gap: 12px;
    margin: 8px;
  }
  .characterStoryLayout {
    grid-template-columns: 120px 1fr;
    padding: 10px;
    gap: 8px;
    margin: 5px auto;
  }
  .storyPortrait img {
    height: 90px;
  }
  .storyCopy {
    font-size: 13px;
    line-height: 1.6;
  }
  .characterAnswer {
    width: 75px;
    height: 75px;
  }
  .friendlyFeedback {
    margin: 4px;
    font-size: 12px;
  }
  .characterQuiz h3 {
    margin: 3px;
  }
  .playSurface {
    height: 49vh;
    border-width: 5px;
  }
  .gameStage h2 {
    font-size: 18px;
  }
  .gameInstructions {
    font-size: 12px;
    margin: 4px;
  }
  .gameControls {
    margin: 6px 0;
    gap: 5px;
  }
  .gameControls .choice {
    min-height: 35px;
    font-size: 12px;
    padding: 3px 10px;
  }
  .gameGrid {
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    margin: 10px auto;
  }
  .gameCard {
    padding: 10px;
    min-height: 90px;
  }
  .gameCard strong {
    font-size: 15px;
  }
  .gameCard span {
    font-size: 11px;
  }
  .decorTile {
    min-height: 38px;
    font-size: 11px;
  }
  .decorGrid {
    gap: 4px;
    height: calc(100% - 22px);
  }
  .cityDecorator {
    padding: 7px;
    gap: 8px;
  }
  .decorCity h3 {
    font-size: 14px;
    margin: 0;
  }
  .gameStatus {
    font-size: 11px;
    margin: 4px;
  }
  .bowlTarget {
    bottom: 10%;
    min-width: 160px;
    min-height: 44px;
    padding: 4px;
    font-size: 12px;
  }
  .ingredientTray {
    margin: 4px;
  }
  .ingredient {
    min-height: 35px;
  }
  .storyWelcome {
    padding: 0;
  }
  .storybookCities {
    height: 30vh;
    margin: 10px;
  }
  .storyWelcome h1 {
    font-size: 30px;
    margin: 10px;
  }
  .collectionCard {
    margin: 4vh auto;
    padding: 15px;
  }
  .mapCharacter {
    min-width: 46px;
    min-height: 46px;
  }
  .mapCharacter img {
    height: 32px;
    width: 28px;
  }
  .mapCharacter span {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .storybookTown {
    animation: none;
  }
}

.adventureHeader {
  height: auto;
  min-height: 44px;
  padding: 2px;
  position: sticky;
  top: 0;
  z-index: 4;
}
.decorTile {
  position: relative;
}
.decorTile svg {
  display: block;
  width: 100%;
  height: calc(100% - 15px);
  max-height: 90px;
}
.decorTile span {
  display: block;
  font-size: 11px;
}
.mapGarden {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.mapGarden svg {
  width: 32px;
  height: 35px;
}
.playSurface {
  height: min(46vh, 410px);
}
@media (orientation: landscape) and (max-height: 500px) {
  .adventureHeader {
    min-height: 34px;
  }
  .playSurface {
    height: 47vh;
  }
  .decorTile svg {
    max-height: 27px;
    height: calc(100% - 10px);
  }
  .decorTile span {
    font-size: 9px;
  }
}
.staffStreets {
  top: 40%;
  bottom: 30%;
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.staffStreets i {
  display: block;
  height: 2px;
  background: #98736788;
}
.mapLedger {
  position: absolute;
  width: 40px;
  height: 2px;
  background: #987367;
  transform: translateX(-50%);
  pointer-events: none;
}
/* The arcade is a fitted play area: actions and exits stay beside the game. */
#rewardPanel {
  background:
    radial-gradient(ellipse at 15% 0%, #f9eed1 0, transparent 55%),
    linear-gradient(135deg, #e3f1eb, #f5e9d6 60%, #e8dbea);
}
#rewardPanel .saveNotice:empty {
  display: none;
}
#rewardPanel .choice,
.gameCard {
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
  touch-action: manipulation;
}
#rewardPanel .choice:active,
.gameCard:active:not(:disabled) {
  transform: translateY(2px) scale(0.97);
}
#rewardPanel button:focus-visible {
  outline: 3px solid #247c91;
  outline-offset: 3px;
}
#rewardPanel .choice {
  border: 1px solid #cfbfa6;
  border-radius: 14px;
  background: #fffaf0;
  box-shadow:
    0 3px 0 #c9b698,
    0 5px 12px #654c4c0c;
  color: #574866;
  min-height: 44px;
}
#rewardPanel .adventureHeader {
  position: static;
  background: transparent;
}
#rewardPanel.playing {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px;
}
#rewardPanel.playing[hidden] {
  display: none;
}
#rewardPanel.playing > .adventureHeader {
  width: 100%;
  min-height: 44px;
  flex-shrink: 0;
}
#rewardPanel.playing > .adventureHeader h2 {
  font-size: 18px;
}
#rewardPanel .gameStage {
  width: 100%;
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 5px minmax(0, 1fr) auto auto auto;
  grid-template-areas: "bar bar" "instructions hud" "progress progress" "surface surface" "controls footer" "status status" "promise promise";
  column-gap: 16px;
  row-gap: 8px;
}
#rewardPanel .gameStage[hidden] {
  display: none;
}
#rewardPanel .rewardBar {
  grid-area: bar;
  flex-wrap: nowrap;
  padding: 0 0 2px;
}
#rewardPanel .rewardBar h2 {
  flex: 1;
  font-size: clamp(18px, 2.5vw, 27px);
  text-wrap: balance;
}
#rewardPanel .rewardBar .choice {
  padding: 5px 13px;
  font-size: 13px;
}
#rewardPanel .gameInstructions {
  grid-area: instructions;
  margin: 0;
  align-self: center;
  text-align: right;
  min-height: 0;
  color: #646373;
  text-wrap: pretty;
}
.gameHud {
  grid-area: hud;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #577583;
  font-variant-numeric: tabular-nums;
}
#gameScore {
  border-radius: 20px;
  padding: 4px 14px;
  background: #fff1be;
  color: #865b25;
  font-weight: bold;
  min-width: 55px;
  text-align: center;
}
#rewardPanel .gameProgress {
  grid-area: progress;
  margin: 0;
  height: 5px;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  accent-color: #4eabac;
  direction: ltr;
}
.gameProgress::-webkit-progress-bar {
  background: #d4dfda;
}
.gameProgress::-webkit-progress-value {
  background: #4eabac;
  border-radius: 5px;
}
#rewardPanel .playSurface {
  grid-area: surface;
  height: auto;
  min-height: 0;
  border: 3px solid #fff9ec;
  border-radius: 24px;
  background: #d9f0ed;
  box-shadow:
    0 2px 0 #b7c9c2,
    0 9px 26px #315b6224;
}
#rewardPanel .gameControls {
  grid-area: controls;
  align-self: center;
  margin: 0;
  justify-content: center;
}
#rewardPanel .gameControls .choice {
  min-height: 48px;
  padding: 7px 22px;
  font-weight: bold;
  font-size: 15px;
}
#rewardPanel .gameStage[data-kind="dolphin"] .gameControls .choice,
#rewardPanel .gameStage[data-kind="turtle"] .gameControls .choice {
  background: #248ca4;
  border-color: #26758b;
  color: white;
  box-shadow: 0 4px 0 #236279;
  min-width: 200px;
}
#rewardPanel .gameStage[data-kind="taxi"] .gameControls,
#rewardPanel .gameStage[data-kind="carpet"] .gameControls {
  direction: ltr;
}
#rewardPanel .gameStage[data-kind="taxi"] .gameControls .choice {
  background: #ffdc85;
  color: #6d5027;
  border-color: #d2b061;
  min-width: 120px;
}
#rewardPanel .adventureFooter {
  grid-area: footer;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
}
#rewardPanel .adventureFooter .choice {
  min-height: 44px;
  font-size: 13px;
}
#rewardPanel #collectReward {
  background: #477f69;
  color: white;
  border-color: #3d705b;
}
#rewardPanel .gameStatus {
  grid-area: status;
  margin: 0;
  min-height: 1.5em;
  text-align: center;
  font-size: 14px;
  color: #4c7774;
}
#rewardPanel .rewardChoiceNotice {
  grid-area: promise;
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #776f7c;
}
#rewardPanel .ingredientTray {
  grid-area: controls;
  margin: 0;
}
#rewardPanel .gameStage[data-kind="faloudeh"] .gameControls {
  display: none;
}
#rewardPanel .paused .playSurface::after {
  content: "بازی مکث شده · برای ادامه دکمهٔ بالا را بزن";
  position: absolute;
  inset: 0;
  background: #eff8e9e0;
  display: grid;
  place-content: center;
  color: #436971;
  font-weight: bold;
  font-size: clamp(14px, 2vw, 25px);
  pointer-events: none;
}
#rewardPanel .cityDecorator {
  background: linear-gradient(#cef0ea, #f4e9c2 56%, #d2e5aa);
  padding: 16px;
  gap: 24px;
}
#rewardPanel .decorCity {
  border-radius: 18px;
  background: #fff9e57a;
  padding: 12px;
  border: 1px solid #ffffffb0;
}
#rewardPanel .decorCity h3 {
  margin: 0 0 8px;
  color: #627b66;
}
#rewardPanel .decorTile {
  border: 1px dashed #99b486;
  background: #fffdf078;
  border-radius: 13px;
  color: #83a47d;
  box-shadow: 0 2px 0 #9eae771c;
}
#rewardPanel .decorTile:not(:empty) {
  font-size: 24px;
}
#rewardPanel .gameGrid {
  gap: 20px;
  margin: 30px auto;
}
#rewardPanel .gameCard {
  position: relative;
  border: 1px solid #e0d3ba;
  border-radius: 24px;
  background: #fffaf0;
  min-height: 210px;
  padding: 22px;
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 5px 0 #d6c4aa,
    0 12px 22px #806e6b12;
  text-align: right;
}
#rewardPanel .gameCard img {
  width: 86px;
  height: 100px;
  object-fit: contain;
}
#rewardPanel .gameCard strong,
#rewardPanel .gameCard span {
  display: block;
}
#rewardPanel .gameCard strong {
  font-size: 20px;
  margin-bottom: 10px;
}
#rewardPanel .gameCard span {
  font-size: 13px;
  line-height: 1.8;
  color: #82758a;
}
#rewardPanel .gameCard small {
  grid-column: 1 / -1;
  color: #458c8d;
  font-weight: bold;
}
#rewardPanel .gameCard:disabled {
  opacity: 0.65;
  filter: saturate(0.55);
}
#rewardPanel .gameGrid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1050px) {
  #rewardPanel .gameGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel.playing {
    padding: 5px 12px;
    gap: 3px;
  }
  #rewardPanel.playing > .adventureHeader {
    min-height: 30px;
  }
  #rewardPanel.playing > .adventureHeader h2 {
    font-size: 13px;
  }
  #rewardPanel.playing > .adventureHeader .choice {
    min-height: 28px;
    padding: 2px 10px;
    font-size: 11px;
  }
  #rewardPanel.playing .coinLabel {
    padding: 2px 10px;
    font-size: 11px;
  }
  #rewardPanel .gameStage {
    row-gap: 3px;
    column-gap: 8px;
    grid-template-rows: 44px 23px 4px minmax(0, 1fr) auto 18px;
  }
  #rewardPanel .rewardBar h2 {
    font-size: 17px;
  }
  #rewardPanel .rewardBar .choice {
    min-height: 40px;
    font-size: 11px;
    padding: 3px 8px;
  }
  #rewardPanel .gameInstructions {
    font-size: 11px;
  }
  #rewardPanel .gameHud {
    font-size: 11px;
    gap: 8px;
  }
  #rewardPanel .gameControls .choice {
    min-height: 44px;
    font-size: 12px;
    padding: 3px 12px;
  }
  #rewardPanel .gameStatus {
    font-size: 11px;
    min-height: 0;
  }
  #rewardPanel .rewardChoiceNotice {
    display: none;
  }
  #rewardPanel .playSurface {
    border-radius: 17px;
  }
  #rewardPanel .cityDecorator {
    padding: 7px;
    gap: 10px;
  }
  #rewardPanel .decorCity {
    padding: 5px;
    border-radius: 10px;
  }
  #rewardPanel .decorCity h3 {
    margin: 0;
    font-size: 12px;
  }
  #rewardPanel .decorGrid {
    gap: 4px;
    height: calc(100% - 20px);
  }
  #rewardPanel .decorTile {
    min-height: 30px;
    border-radius: 7px;
  }
  #rewardPanel .gameCard {
    min-height: 155px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #rewardPanel .choice,
  #rewardPanel .gameCard {
    transition: none;
  }
}
.decorationPreview {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-end: 5px;
}
.decorationPreview svg {
  width: 27px;
  height: 27px;
}
#listenQuestion {
  min-height: 44px;
  font-size: 13px;
}
#narrationStatus {
  display: block;
  line-height: 1.6;
  margin-top: 6px;
}
@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel .gameStage[data-kind="city"] .gameControls .choice {
    padding: 2px 6px;
    font-size: 10px;
  }
  .decorationPreview svg {
    width: 22px;
    height: 22px;
  }
}
.gameInstructionsBlock {
  grid-area: instructions;
  display: flex;
  align-items: center;
  gap: 8px;
}
#gameVoiceStatus {
  color: #96533e;
  font-size: 11px;
}
#gameVoiceStatus:empty {
  display: none;
}
/* Colour choices name the colour and show it as a dot; the chosen one is ringed. */
#rewardPanel .gameControls .choice.swatch,
#rewardPanel .ingredientTray .ingredient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--swatch) 22%, #fffaf0);
  border-color: color-mix(in srgb, var(--swatch) 60%, #cfbfa6);
}
#rewardPanel .gameControls .choice.swatch::before,
#rewardPanel .ingredientTray .ingredient::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 2px #ffffffa0;
}
#rewardPanel .gameControls .choice.selected {
  outline: 3px solid #574866;
  outline-offset: 2px;
  background: color-mix(in srgb, var(--swatch, #fffaf0) 40%, #fffaf0);
}
/* Tablets have room for thumb-sized controls and readable guidance. */
@media (min-width: 900px) and (min-height: 600px) {
  #rewardPanel.playing {
    padding: 16px 24px;
  }
  #rewardPanel .rewardBar .choice {
    min-height: 52px;
    padding: 8px 18px;
    font-size: 15px;
  }
  #rewardPanel .gameInstructions {
    font-size: 17px;
  }
  #rewardPanel .gameHud {
    font-size: 16px;
  }
  #gameScore {
    padding: 6px 18px;
    font-size: 18px;
  }
  #rewardPanel .gameControls,
  #rewardPanel .ingredientTray {
    gap: 12px;
  }
  #rewardPanel .gameControls .choice,
  #rewardPanel .ingredientTray .ingredient {
    min-height: 64px;
    padding: 10px 26px;
    border-radius: 18px;
    font-size: 18px;
  }
  #rewardPanel .gameStage[data-kind="dolphin"] .gameControls .choice,
  #rewardPanel .gameStage[data-kind="turtle"] .gameControls .choice {
    min-width: 320px;
    font-size: 22px;
  }
  #rewardPanel .gameStage[data-kind="taxi"] .gameControls .choice,
  #rewardPanel .gameStage[data-kind="carpet"] .gameControls .choice {
    min-width: 180px;
    font-size: 20px;
  }
  #rewardPanel .gameStage[data-kind="dress"] .gameControls .choice,
  #rewardPanel .gameStage[data-kind="city"] .gameControls .choice {
    padding: 8px 14px;
    font-size: 16px;
  }
  #rewardPanel .adventureFooter .choice {
    min-height: 56px;
    font-size: 16px;
  }
  #rewardPanel .gameStatus {
    font-size: 18px;
    font-weight: bold;
  }
  #rewardPanel .rewardChoiceNotice {
    font-size: 14px;
  }
}
/* The frame hugs the 900×420 scene instead of showing empty side bars. */
#rewardPanel .gameStage:not([data-kind="city"]) .playSurface {
  justify-self: center;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 900 / 420;
}
/* Outfit colours are grouped under their part; each button is a large dot. */
#rewardPanel .gameControls .partLabel {
  align-self: center;
  margin-inline-start: 10px;
  font-weight: bold;
  color: #6a4f6f;
}
#rewardPanel .gameControls .choice.swatch.outfit {
  width: 52px;
  min-width: 52px;
  padding: 0;
  justify-content: center;
  font-size: 0;
}
#rewardPanel .gameControls .choice.swatch.outfit::before {
  width: 28px;
  height: 28px;
}
@media (min-width: 900px) and (min-height: 600px) {
  #rewardPanel .gameControls .choice.swatch.outfit {
    width: 64px;
    min-width: 64px;
  }
  #rewardPanel .gameControls .choice.swatch.outfit::before {
    width: 34px;
    height: 34px;
  }
  #rewardPanel .gameControls .partLabel {
    font-size: 18px;
  }
}
/* Young players: picture-first choices, big targets and visible feedback. */
#menu .heroChoices {
  gap: 16px;
}
.heroChoice {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 210px;
  min-height: 112px;
  padding: 12px 22px;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: bold;
  border-width: 4px;
  border-radius: 28px;
}
.heroChoice > span {
  font-size: clamp(34px, 4.5vw, 48px);
  line-height: 1;
}
#startAdventure.heroChoice {
  animation: heroInvite 2.4s ease-in-out infinite;
}
/* A glow, not a size change, so the target never moves under a finger. */
@keyframes heroInvite {
  50% {
    box-shadow: 0 0 0 7px #ffe08aaa;
  }
}
.storybookTown {
  cursor: pointer;
}
.adventureHeader .choice {
  min-height: 48px;
  padding: 6px 16px;
  font-size: 16px;
}
.mapLocked {
  position: absolute;
  inset: 38% 8% auto;
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: #fff8e8e6;
  text-align: center;
  font-size: clamp(14px, 1.8vw, 19px);
  font-weight: bold;
  color: #7b6380;
}
.mapCharacter {
  min-width: 74px;
  min-height: 74px;
  border-width: 3px;
  border-radius: 22px;
  flex-direction: column;
  justify-content: center;
  padding: 4px 6px;
}
.mapCharacter img {
  width: 52px;
  height: 52px;
}
.mapCharacter span {
  font-size: 13px;
  font-weight: bold;
  max-width: 86px;
}
#listenQuestion {
  min-height: 52px;
  padding: 6px 20px;
  font-size: 17px;
}
.characterAnswer {
  width: 150px;
  height: 150px;
  border-width: 4px;
  transition:
    transform 140ms ease,
    border-color 140ms ease;
}
.characterAnswer:active {
  transform: scale(0.95);
}
.characterAnswer.tryAgain,
.key.oops,
.black.oops {
  animation: gentleWiggle 420ms ease;
}
.characterAnswer.tryAgain {
  border-color: #e3a3a3;
}
.characterAnswer.isCorrect {
  border-color: #58a35c;
  background: #effae6;
  box-shadow: 0 0 0 6px #9ed69a80;
  animation: happyPop 500ms ease;
}
@keyframes gentleWiggle {
  20%,
  60% {
    translate: -6px 0;
  }
  40%,
  80% {
    translate: 6px 0;
  }
}
@keyframes happyPop {
  50% {
    transform: scale(1.12);
  }
}
.bigNext {
  min-height: 64px;
  padding: 10px 30px;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: bold;
  background: #4f9a63;
  border-color: #3d7d4f;
  color: white;
  animation: heroInvite 2s ease-in-out infinite;
}
#piano .glowKey {
  z-index: 3;
  animation: keyGlow 1.1s ease-in-out infinite;
}
#piano .key.glowKey {
  background: linear-gradient(#fff8d2, #ffd75e);
  border-bottom-color: #e9b93a;
}
#piano .black.glowKey {
  background: linear-gradient(#a37a1c, #ffcf4a);
}
@keyframes keyGlow {
  50% {
    box-shadow:
      0 0 0 4px #ffd34d,
      0 0 22px 8px #ffd34dcc;
  }
}
/* Phones in landscape: story, picture and answers side by side, no scrolling. */
@media (orientation: landscape) and (max-height: 500px) {
  .heroChoice {
    min-width: 170px;
    min-height: 74px;
    padding: 6px 16px;
    font-size: 16px;
    flex-direction: row;
    gap: 10px;
  }
  .heroChoice > span {
    font-size: 30px;
  }
  .adventureHeader .choice {
    min-height: 40px;
    padding: 4px 12px;
    font-size: 13px;
  }
  .mapCharacter {
    min-width: 56px;
    min-height: 56px;
    padding: 2px 4px;
  }
  .mapCharacter img {
    width: 34px;
    height: 34px;
  }
  .mapCharacter span {
    font-size: 11px;
  }
  .characterStoryLayout {
    grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
  }
  .characterQuiz {
    grid-column: auto;
  }
  .storyPortrait img {
    height: 80px;
  }
  .storyCopy {
    font-size: 12px;
  }
  .storyCopy .choice,
  #listenQuestion {
    min-height: 40px;
    font-size: 12px;
    padding: 3px 10px;
  }
  .characterQuiz h3 {
    font-size: 15px;
  }
  .characterChoices {
    gap: 8px;
  }
  .characterAnswer {
    width: 84px;
    height: 84px;
  }
  .bigNext {
    min-height: 48px;
    padding: 4px 16px;
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #startAdventure.heroChoice,
  .bigNext,
  #piano .glowKey,
  .characterAnswer.tryAgain,
  .characterAnswer.isCorrect,
  .key.oops,
  .black.oops {
    animation: none;
  }
}
/* Game menu: waiting rewards are a 🎁 badge on each game, not a list. */
#rewardPanel .gameCard.hasReward {
  border-color: #e7b54a;
  box-shadow:
    0 5px 0 #d6a647,
    0 0 0 4px #ffe08a99,
    0 12px 22px #806e6b12;
}
#rewardPanel .giftBadge {
  position: absolute;
  top: -12px;
  inset-inline-start: 14px;
  padding: 4px 12px;
  border-radius: 16px;
  background: #e8564f;
  color: white;
  font-size: 16px;
  box-shadow: 0 3px 0 #b8403a;
}
#rewardPanel .rewardIntro {
  font-size: clamp(15px, 2vw, 20px);
  font-weight: bold;
}
.installTip {
  margin: 4px auto;
  text-align: center;
  font-size: 13px;
  color: #7a5d7f;
}
.installTip[hidden],
#stickerTitle[hidden] {
  display: none;
}
#rewardPanel .rewardBar .choice .lbl {
  margin-inline-start: 5px;
}
/* Phones in landscape: the game fills the screen; controls float on top. */
@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel .gameCard {
    min-height: 110px;
    grid-template-columns: 56px 1fr;
    padding: 12px;
  }
  #rewardPanel .gameCard img {
    width: 56px;
    height: 64px;
  }
  #rewardPanel .gameCard span {
    display: none;
  }
  #rewardPanel .gameGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 14px auto;
    gap: 12px;
  }
  #rewardPanel .gameCard strong {
    font-size: 14px;
    margin: 0;
  }
  #rewardPanel .gameCard small {
    display: none;
  }
  #rewardPanel .giftBadge {
    font-size: 13px;
    padding: 2px 8px;
  }
  #rewardPanel .rewardIntro {
    font-size: 14px;
  }
  #rewardPanel .stickerBook img {
    width: 40px;
    height: 40px;
  }
  #rewardPanel.playing {
    padding: 0;
    background: #2f5b6b;
  }
  #rewardPanel.playing > .adventureHeader,
  #rewardPanel .rewardBar h2,
  #rewardPanel .gameInstructions,
  #rewardPanel #gameTime,
  #rewardPanel .rewardChoiceNotice {
    display: none;
  }
  #rewardPanel .gameStage {
    position: fixed;
    inset: 0;
    display: block;
  }
  #rewardPanel .gameStage .playSurface,
  #rewardPanel .gameStage:not([data-kind="city"]) .playSurface {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    max-width: none;
    aspect-ratio: auto;
    justify-self: stretch;
    align-self: stretch;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  /* Scene-coloured edges where a wide phone is wider than the scene. */
  #rewardPanel .gameStage[data-kind="dolphin"] .playSurface {
    background: linear-gradient(#8ad7ec 0 72%, #1f8db9 72%);
  }
  #rewardPanel .gameStage[data-kind="taxi"] .playSurface {
    background: linear-gradient(#a9d9f4 0 50%, #79ad84 50%);
  }
  #rewardPanel
    .gameStage:is([data-kind="carpet"], [data-kind="turtle"])
    .playSurface {
    background: linear-gradient(#a9d9f4, #fff0d2 70%, #e9c78f 70%);
  }
  #rewardPanel
    .gameStage:is(
      [data-kind="painting"],
      [data-kind="dress"],
      [data-kind="faloudeh"]
    )
    .playSurface {
    background: linear-gradient(#efe3dc 0 77%, #d5b78f 77%);
  }
  #rewardPanel .rewardBar,
  #rewardPanel .gameHud,
  #rewardPanel .gameInstructionsBlock,
  #rewardPanel .gameStatus,
  #rewardPanel .gameControls,
  #rewardPanel .ingredientTray,
  #rewardPanel .adventureFooter {
    position: absolute;
    z-index: 5;
    margin: 0;
  }
  #rewardPanel .rewardBar {
    top: max(6px, env(safe-area-inset-top));
    right: max(28px, calc(env(safe-area-inset-right) + 12px));
    display: flex;
    gap: 6px;
    padding: 0;
  }
  #rewardPanel .rewardBar .choice {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    background: #fffaf0e6;
  }
  #rewardPanel .rewardBar .choice .lbl {
    display: none;
  }
  #rewardPanel .gameProgress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 6;
    border-radius: 0;
  }
  #rewardPanel .gameHud {
    top: max(10px, env(safe-area-inset-top));
    left: max(28px, calc(env(safe-area-inset-left) + 12px));
  }
  #gameScore {
    font-size: 16px;
    box-shadow: 0 2px 6px #0002;
  }
  #rewardPanel .gameInstructionsBlock {
    top: 56px;
    right: max(28px, calc(env(safe-area-inset-right) + 12px));
  }
  #gameVoiceStatus {
    padding: 3px 8px;
    border-radius: 10px;
    background: #fffaf0e6;
  }
  #rewardPanel .gameStatus {
    top: 56px;
    left: 50%;
    max-width: 55%;
    translate: -50% 0;
    padding: 4px 14px;
    border-radius: 14px;
    background: #fffaf0e6;
    font-size: 13px;
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
  }
  #rewardPanel .gameStatus.fresh {
    opacity: 1;
  }
  #rewardPanel .adventureFooter {
    top: 50px;
    left: max(28px, calc(env(safe-area-inset-left) + 12px));
  }
  #rewardPanel #finishGame:disabled {
    display: none;
  }
  #rewardPanel #finishGame {
    min-height: 40px;
    background: #fffaf0e6;
  }
  /* The reward is the big moment: one large button in the middle. */
  #rewardPanel #collectReward:not([hidden]) {
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    min-height: 72px;
    padding: 10px 34px;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 0 0 8px #ffffff66;
  }
  #rewardPanel .gameControls {
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
    left: max(28px, calc(env(safe-area-inset-left) + 12px));
    right: max(28px, calc(env(safe-area-inset-right) + 12px));
    pointer-events: none;
  }
  #rewardPanel .gameControls > * {
    pointer-events: auto;
  }
  #rewardPanel .gameControls .choice {
    opacity: 0.94;
  }
  /* Jump: one big thumb button in the bottom-right corner. */
  #rewardPanel
    .gameStage:is([data-kind="dolphin"], [data-kind="turtle"])
    .gameControls {
    justify-content: flex-start;
  }
  #rewardPanel
    .gameStage:is([data-kind="dolphin"], [data-kind="turtle"])
    .gameControls
    .choice {
    min-width: 150px;
    min-height: 70px;
    border-radius: 35px;
    font-size: 17px;
  }
  /* Taxi: one button under each thumb. */
  #rewardPanel .gameStage[data-kind="taxi"] .gameControls {
    justify-content: space-between;
  }
  #rewardPanel
    .gameStage:is([data-kind="taxi"], [data-kind="carpet"])
    .gameControls
    .choice {
    min-width: 96px;
    min-height: 70px;
    border-radius: 22px;
    font-size: 17px;
  }
  /* Carpet: up and down stacked under the right thumb. */
  #rewardPanel .gameStage[data-kind="carpet"] .gameControls {
    left: auto;
    flex-direction: column;
    gap: 10px;
  }
  /* Making games: one floating strip of choices along the bottom. */
  #rewardPanel
    .gameStage:is(
      [data-kind="painting"],
      [data-kind="dress"],
      [data-kind="city"]
    )
    .gameControls,
  #rewardPanel .ingredientTray {
    left: 50%;
    right: auto;
    max-width: calc(100% - 20px);
    translate: -50% 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 20px;
    background: #fff8ecd9;
    box-shadow: 0 3px 12px #0003;
  }
  #rewardPanel .ingredientTray {
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
    display: flex;
  }
  #rewardPanel .ingredientTray[hidden] {
    display: none;
  }
  #rewardPanel .gameStage[data-kind="city"] .gameControls .choice {
    flex-shrink: 0;
    padding: 2px 10px;
    font-size: 13px;
  }
  #rewardPanel .gameStage[data-kind="city"] .gameControls .choice .lbl {
    display: none;
  }
  #rewardPanel .bowlTarget {
    bottom: 26%;
  }
  /* City: the two towns fill the screen between the buttons. */
  #rewardPanel .cityDecorator {
    position: absolute;
    inset: 0;
    padding: 56px max(28px, calc(env(safe-area-inset-right) + 12px)) 70px
      max(28px, calc(env(safe-area-inset-left) + 12px));
    gap: 10px;
  }
  #rewardPanel .decorGrid {
    height: calc(100% - 20px);
  }
  #rewardPanel .decorTile {
    min-height: 0;
  }
}

#rewardPanel .gameStage[data-kind="city"] .gameControls small {
  display: inline-flex;
  gap: 6px;
  margin-inline-start: 6px;
}
/* Each game card has its own soft colour, so children find games by look. */
#rewardPanel .gameCard {
  background: linear-gradient(160deg, #fffaf0 30%, var(--tint, #ffe9c9));
}
#rewardPanel .gameCard[data-game="dolphin"] {
  --tint: #bfe9f6;
}
#rewardPanel .gameCard[data-game="taxi"] {
  --tint: #ffd9cc;
}
#rewardPanel .gameCard[data-game="city"] {
  --tint: #d9f2c9;
}
#rewardPanel .gameCard[data-game="carpet"] {
  --tint: #ead6f7;
}
#rewardPanel .gameCard[data-game="painting"] {
  --tint: #ffe3ec;
}
#rewardPanel .gameCard[data-game="dress"] {
  --tint: #e6dcff;
}
#rewardPanel .gameCard[data-game="turtle"] {
  --tint: #dff3c4;
}
#rewardPanel .gameCard[data-game="faloudeh"] {
  --tint: #ffdce6;
}
#rewardPanel .gameCard img {
  filter: drop-shadow(0 4px 4px #5a3b2b30);
}
/* Music city: two little garden towns instead of dashed boxes. */
#rewardPanel .cityDecorator {
  background:
    radial-gradient(circle at 85% 12%, #fff6c4 0 40px, transparent 41px),
    linear-gradient(#bfe6ff, #e9f7ff 40%, #c9eab0 40%, #9fd38a);
}
#rewardPanel .decorCity {
  background: #ffffff59;
  border: 2px solid #ffffffb3;
  box-shadow: 0 6px 18px #3b6b3a1f;
}
#rewardPanel .decorCity h3 {
  color: #5b4a6e;
}
#rewardPanel .decorTile {
  border: 2px solid #ffffffcc;
  background: linear-gradient(#bfe7a4, #93cf78);
  color: #ffffffd9;
  font-size: 22px;
  box-shadow:
    inset 0 -4px 0 #6faa5a,
    0 2px 4px #2f5a2a22;
}
#rewardPanel .decorTile:not(:empty) {
  background: linear-gradient(#d4f2bd, #a8dc8c);
}
#rewardPanel .decorTile:active {
  transform: scale(0.95);
}
#rewardPanel .decorTile span {
  color: #3f6b3b;
}
/* Moving games: two groups, one under each thumb. Left: travel or steering.
   Right: the main action (jump, gas/brake, up/down). */
#rewardPanel
  .gameStage:is(
    [data-kind="dolphin"],
    [data-kind="turtle"],
    [data-kind="taxi"],
    [data-kind="carpet"],
    [data-kind="notes"]
  )
  .gameControls {
  direction: ltr;
  justify-content: space-between;
  gap: 16px;
}
#rewardPanel .controlGroup {
  display: flex;
  gap: 10px;
  align-items: center;
}
#rewardPanel .controlGroup.pedals {
  flex-direction: column;
  gap: 8px;
}
#rewardPanel .gameStage .gameControls .choice.holdControl {
  min-width: 96px;
  background: #fffaf0;
  color: #574866;
  border-color: #cfbfa6;
  box-shadow: 0 4px 0 #c9b698;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#rewardPanel .gameStage .gameControls .choice.holdControl.held {
  translate: 0 3px;
  box-shadow: 0 1px 0 #c9b698;
  filter: brightness(0.94);
}
#rewardPanel .gameStage .gameControls .choice.gas {
  background: #5fbf6e;
  border-color: #3f9a50;
  color: white;
  box-shadow: 0 4px 0 #3a8a48;
}
#rewardPanel .gameStage .gameControls .choice.brake {
  background: #e8675f;
  border-color: #c4483f;
  color: white;
  box-shadow: 0 4px 0 #b13f37;
}
#rewardPanel .gameStage .gameControls .choice.jump {
  background: #248ca4;
  border-color: #26758b;
  color: white;
  box-shadow: 0 4px 0 #236279;
}
#rewardPanel
  .gameStage:is([data-kind="dolphin"], [data-kind="turtle"])
  .gameControls
  .choice:not(.jump) {
  min-width: 96px;
}
@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel
    .gameStage:is(
      [data-kind="dolphin"],
      [data-kind="turtle"],
      [data-kind="taxi"],
      [data-kind="carpet"],
      [data-kind="notes"]
    )
    .gameControls {
    left: max(28px, calc(env(safe-area-inset-left) + 12px));
    right: max(28px, calc(env(safe-area-inset-right) + 12px));
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
  #rewardPanel .gameStage .gameControls .choice.holdControl,
  #rewardPanel .gameStage[data-kind="taxi"] .gameControls .choice,
  #rewardPanel .gameStage[data-kind="carpet"] .gameControls .choice {
    min-width: 84px;
    min-height: 62px;
    font-size: 16px;
    border-radius: 20px;
  }
  #rewardPanel .controlGroup.pedals .choice {
    min-height: 54px !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel .gameStage[data-kind="notes"] .playSurface {
    background: linear-gradient(#fff8ea, #ffe6c4);
  }
  #rewardPanel .gameStage[data-kind="notes"] .gameControls .choice {
    min-width: 96px;
    min-height: 54px;
    font-size: 16px;
    border-radius: 20px;
  }
  #rewardPanel .gameStage[data-kind="notes"] .gameControls .choice.jump {
    min-width: 130px;
    min-height: 70px;
    font-size: 19px;
  }
}
#rewardPanel .gameCard[data-game="notes"] {
  --tint: #fff0b8;
}
/* Story stage: the friend walks into town and hops onto their staff line. */
.storyStage {
  position: relative;
  height: 250px;
  overflow: hidden;
  border-radius: 20px;
  border: 3px solid #f3d9a8;
  background: linear-gradient(#fff6dd, #ffe2b5);
  box-shadow: inset 0 -30px 40px #ffffff55;
}
.storyStage.bass {
  border-color: #d9c8f0;
  background: linear-gradient(#f5efff, #e4d6fb);
}
.stageSkyline {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  opacity: 0.35;
  background: bottom / 100% 100% no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100' preserveAspectRatio='none'%3E%3Cg fill='%23b07fb8'%3E%3Crect x='10' y='60' width='50' height='40'/%3E%3Cellipse cx='35' cy='60' rx='24' ry='22'/%3E%3Crect x='70' y='30' width='8' height='70'/%3E%3Cpath d='M66 30 L74 14 L82 30Z'/%3E%3Crect x='100' y='70' width='70' height='30'/%3E%3Cellipse cx='135' cy='70' rx='20' ry='17'/%3E%3Crect x='190' y='55' width='45' height='45'/%3E%3Cellipse cx='212' cy='55' rx='21' ry='19'/%3E%3Crect x='250' y='40' width='7' height='60'/%3E%3Ccircle cx='253' cy='38' r='6'/%3E%3Crect x='265' y='72' width='35' height='28'/%3E%3C/g%3E%3C/svg%3E");
}
.storyStage.treble .stageSkyline {
  filter: hue-rotate(-50deg) saturate(1.3);
}
.stageTown {
  position: absolute;
  top: 8px;
  left: 10px;
  padding: 2px 10px;
  border-radius: 12px;
  background: #ffffffcc;
  font-size: 13px;
  font-weight: bold;
  color: #6a4f6f;
}
.stageLine,
.stageLedger,
.stageBand {
  position: absolute;
  translate: 0 -50%;
}
.stageLine {
  left: 6%;
  right: 4%;
  height: 2px;
  background: #7a5a4a;
}
.stageLedger {
  left: calc(50% - 11%);
  width: 22%;
  height: 2px;
  background: #7a5a4a;
}
.stageBand {
  left: 6%;
  right: 4%;
  height: 12px;
  background: #ffe36e;
  opacity: 0;
  transition: opacity 400ms ease;
}
.stageNote {
  position: absolute;
  width: 24px;
  height: 17px;
  border-radius: 50%;
  background: #5b3f8f;
  translate: -50% -50%;
  rotate: -20deg;
  scale: 0;
  transition: scale 300ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
/* The friend stands beside their note, centred on its line or space. */
.stageFriend {
  position: absolute;
  left: 64%;
  top: 86%;
  width: 72px;
  height: 72px;
  translate: -50% -50%;
  z-index: 2;
}
.stageFriend img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px #5a3b2b40);
}
.storyStage.walking .stageFriend img {
  animation: stageWalk 380ms ease-in-out infinite;
}
@keyframes stageWalk {
  50% {
    translate: 0 -7px;
    rotate: 4deg;
  }
}
.storyStage.landed .stageBand {
  opacity: 0.85;
}
.storyStage.landed .stageNote {
  scale: 1;
  animation: noteGlow 1.2s ease-in-out 3;
}
@keyframes noteGlow {
  50% {
    box-shadow: 0 0 0 7px #ffd34d88;
  }
}
.stageReplay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 2px solid #e6c98f;
  border-radius: 50%;
  background: #fffaf0e6;
  color: #6a4f6f;
  font-size: 20px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .characterStoryLayout {
    grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.2fr);
  }
  .storyStage {
    height: 150px;
    border-radius: 14px;
  }
  .stageFriend {
    width: 44px;
    height: 44px;
  }
  .stageNote {
    width: 15px;
    height: 11px;
  }
  .stageTown {
    font-size: 10px;
    padding: 1px 6px;
  }
  .stageReplay {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .storyStage.walking .stageFriend img,
  .storyStage.landed .stageNote {
    animation: none;
  }
}
/* Map friends: small round pictures in note order, name shown underneath. */
.mapCharacter {
  min-width: 0;
  min-height: 0;
  width: 46px;
  height: 46px;
  padding: 3px;
  border-width: 2px;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 2px 0 #b78a5e;
  overflow: visible;
}
.mapCharacter img {
  width: 100%;
  height: 100%;
}
.mapCharacter span {
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% 2px;
  max-width: none;
  white-space: nowrap;
  font-size: 10px;
  font-weight: bold;
  color: #5b3f6b;
  opacity: 0;
  pointer-events: none;
}
.mapCharacter:focus-visible span,
.mapCharacter:hover span {
  opacity: 1;
}
.mapLedger {
  width: 30px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .mapCharacter {
    width: 34px;
    height: 34px;
    min-width: 0;
    min-height: 0;
    padding: 2px;
  }
  .mapCharacter img {
    width: 100%;
    height: 100%;
  }
  .mapLedger {
    width: 22px;
  }
}
/* Keep every screen's buttons away from rounded corners and the notch. */
.adventureOverlay:not(.playing),
#menu {
  padding-left: max(28px, calc(env(safe-area-inset-left) + 12px));
  padding-right: max(28px, calc(env(safe-area-inset-right) + 12px));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
/* One joystick (plus one action button) in a single corner. */
#rewardPanel .gameControls:has(.joystickPad) {
  justify-content: flex-end;
}
#rewardPanel .controlGroup.joystickPad {
  flex-direction: row;
  align-items: center;
  gap: 18px;
}
#rewardPanel .joystick {
  position: relative;
  width: 132px;
  height: 132px;
  padding: 0;
  border: 3px solid #ffffffcc;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff66 0 35%, #4e3a6a55 36% 100%);
  box-shadow:
    inset 0 4px 10px #0003,
    0 4px 12px #0002;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#rewardPanel .joystick .knob {
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #f2c45a 60%, #d39a2c);
  box-shadow: 0 4px 8px #0004;
  transition: translate 90ms ease-out;
}
#rewardPanel .joystick.held .knob {
  transition: none;
}
#rewardPanel .joystickPad .choice.jump {
  min-width: 112px;
  min-height: 72px;
  border-radius: 36px;
  font-size: 18px;
}
@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel .joystick {
    width: 112px;
    height: 112px;
  }
  #rewardPanel .joystickPad .choice.jump {
    min-width: 96px;
    min-height: 62px;
    font-size: 16px;
  }
}
#rewardPanel .gameStage .gameControls:has(.joystickPad) {
  justify-content: flex-end;
}
/* Home: big pictures for the child; grown-up choices folded away. */
#menu .kidChoices .choice {
  min-height: 56px;
  padding: 8px 20px;
  font-size: clamp(15px, 2vw, 19px);
}
#menu .grownUps {
  margin-top: 6px;
  max-width: 760px;
  color: #fff8e9;
}
#menu .grownUps summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  background: #ffffff26;
  font-size: 14px;
  opacity: 0.85;
}
#menu .grownUps summary::-webkit-details-marker {
  display: none;
}
#menu .grownUps[open] summary {
  margin-bottom: 8px;
}
#menu .grownUps .choice {
  font-size: 14px;
  padding: 5px 12px;
}
#menu .grownUps .choices + .choices {
  margin-top: 8px;
}
/* Fifteen places per street: each picture fits its own place. */
.mapCharacter,
.mapCharacter.learned {
  width: clamp(26px, 2.8vw, 44px);
  height: clamp(26px, 2.8vw, 44px);
  min-width: 0;
  min-height: 0;
  padding: 1px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .mapCharacter,
  .mapCharacter.learned {
    width: clamp(24px, 2.8vw, 34px);
    height: clamp(24px, 2.8vw, 34px);
  }
}
/* Illustrated scene behind the story stage; a soft veil keeps the staff clear. */
.storyStage.hasScene {
  background-size: cover;
  background-position: center;
}
.storyStage.hasScene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#ffffff00 0%, #fffaf08c 30%, #fffaf08c 92%);
}
.storyStage.hasScene .stageSkyline {
  display: none;
}
.storyStage.hasScene .stageLine,
.storyStage.hasScene .stageLedger {
  background: #4a3328;
}
/* Replay sits in the top corner, away from where friends land. */
.stageReplay {
  top: 8px;
  bottom: auto;
}
/* Phones: the story screen fits exactly between header and footer. The
   picture column never grows past its row, so nothing spills out. */
@media (orientation: landscape) and (max-height: 500px) {
  #characterScene .characterStoryLayout {
    height: calc(100dvh - 112px - env(safe-area-inset-bottom));
    min-height: 180px;
    width: 100%;
    max-width: none;
    margin: 4px 0;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }
  #characterScene .storyPortrait {
    height: 100%;
    min-height: 0;
  }
  #characterScene .storyStage {
    height: 100%;
  }
  #characterScene .stageFriend {
    width: 52px;
    height: 52px;
  }
  /* ↻ on the picture replays the story, so this button is not needed here. */
  #characterScene #replayStory {
    display: none;
  }
  #characterScene .storyCopy {
    max-height: 100%;
    overflow: auto;
    font-size: 13px;
    line-height: 1.7;
  }
  #characterScene .storyCopy h2 {
    margin: 0 0 4px;
    font-size: 19px;
  }
  #characterScene .characterQuiz {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  #characterScene .characterQuiz h3 {
    margin: 0;
    font-size: 14px;
  }
  #characterScene #listenQuestion {
    min-height: 38px;
    padding: 2px 12px;
    font-size: 12px;
  }
  #characterScene .characterChoices {
    gap: 6px;
  }
  #characterScene .characterAnswer {
    width: clamp(80px, 9.5vw, 100px);
    height: clamp(80px, 9.5vw, 100px);
    border-width: 3px;
    border-radius: 16px;
  }
  #characterScene .bigNext {
    min-height: 44px;
    padding: 4px 14px;
    font-size: 14px;
  }
  #characterScene .adventureFooter {
    margin: 0;
  }
  #characterScene .adventureFooter .choice {
    min-height: 40px;
    padding: 2px 16px;
    font-size: 14px;
  }
  /* Welcome: smaller towns, so the start button is always on screen. */
  #adventureWelcome {
    padding: 0;
  }
  #adventureWelcome h1 {
    margin: 4px;
    font-size: 22px;
  }
  #adventureWelcome p {
    margin: 0 0 4px;
    font-size: 13px;
  }
  #adventureWelcome .storybookCities {
    height: 26vh;
    margin: 6px auto;
    gap: 6vw;
  }
  #adventureWelcome .storybookTown {
    width: 26%;
    font-size: 20px;
    border-width: 5px;
  }
  #adventureWelcome #startAdventure {
    min-height: 60px;
  }
}
/* Short phone screens: one compact note row, so the piano keys get the rest. */
@media (orientation: landscape) and (max-height: 460px) {
  #app > header {
    height: 42px;
    min-height: 42px;
    padding-top: 2px;
  }
  #app > header .brand {
    display: none;
  }
  #board {
    height: auto;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "note staff footer";
    align-items: center;
    column-gap: 10px;
    padding: 2px 12px;
  }
  #board > #noteRow {
    grid-area: note;
    flex-direction: column;
    gap: 0;
    font-size: 14px;
    text-align: center;
  }
  #board > #noteRow #noteIcons {
    width: 46px;
  }
  #board > #staff {
    grid-area: staff;
    height: 78px;
    width: 100%;
  }
  #board > .boardFooter {
    grid-area: footer;
    flex-direction: column;
    gap: 4px;
    width: auto;
  }
  #board > .boardFooter #prompt {
    max-width: 150px;
    text-align: center;
  }
  #wood {
    flex: 1;
    margin-top: 6px;
  }
}
/* Song practice */
.songChoices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 150px));
  gap: 14px;
}
.songCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 130px;
  padding: 12px;
  font-size: 17px;
}
.songCard .songIcon {
  font-size: 44px;
  line-height: 1;
}
.songCard small {
  color: #3f8b5c;
  font-weight: bold;
}
.songDots {
  color: #7a4fa0;
  font-size: 16px;
  letter-spacing: 2px;
  direction: ltr;
}
.songDots:empty {
  display: none;
}
@media (orientation: landscape) and (max-height: 460px) {
  .songCard {
    min-height: 100px;
    font-size: 15px;
  }
  .songCard .songIcon {
    font-size: 34px;
  }
  #board > .boardFooter .songDots {
    font-size: 13px;
  }
}
/* Phones: question, pictures, then one row with «listen» and «next» side by
   side, so the next step is never pushed outside the card. */
@media (orientation: landscape) and (max-height: 500px) {
  #characterScene .characterQuiz {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
      "question question"
      "answers answers"
      "feedback feedback"
      "listen next";
    justify-content: center;
    justify-items: center;
    align-content: center;
    gap: 4px 8px;
  }
  #characterScene .characterQuiz #storyQuestion {
    grid-area: question;
  }
  #characterScene .characterQuiz #storyAnswers {
    grid-area: answers;
  }
  #characterScene .characterQuiz #storyFeedback {
    grid-area: feedback;
    margin: 0;
    min-height: 0;
    font-size: 12px;
  }
  #characterScene .characterQuiz #storyFeedback:empty {
    display: none;
  }
  #characterScene .characterQuiz #listenQuestion {
    grid-area: listen;
  }
  #characterScene .characterQuiz #quizNext,
  #characterScene .characterQuiz #storyPiano {
    grid-area: next;
    min-height: 44px;
    padding: 2px 12px;
    font-size: 13px;
  }
}
/* Parent page */
.stat.parentNotes {
  grid-column: 1 / -1;
  text-align: right;
}
.parentNotes strong {
  display: block;
  margin-bottom: 6px;
}
.parentNote {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 15px;
}
.parentNote img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.songCard .songTown {
  font-size: 12px;
  color: #7a6380;
}
.songCard.bass {
  background: #f3ecff;
}
@media (orientation: landscape) and (max-height: 500px) {
  #characterScene .characterQuiz #storyPiano {
    white-space: nowrap;
    font-size: 12px;
  }
  .songChoices {
    grid-template-columns: repeat(6, minmax(0, 120px));
    gap: 8px;
  }
  .songCard {
    min-height: 92px;
    padding: 6px;
    font-size: 13px;
  }
}
/* Phones: a round 🔊 button and no feedback line (the glow and the voice
   already say «آفرین»), so the quiz always fits inside the card. */
@media (orientation: landscape) and (max-height: 500px) {
  #characterScene .characterStoryLayout {
    padding: 6px 8px;
  }
  #characterScene .characterQuiz {
    gap: 6px 10px;
  }
  #characterScene .characterQuiz #storyFeedback {
    display: none;
  }
  #characterScene .characterQuiz #listenQuestion {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
  }
  #characterScene .characterQuiz #listenQuestion .lbl {
    display: none;
  }
  #characterScene .characterQuiz #storyQuestion {
    font-size: 14px;
    line-height: 1.3;
  }
}
/* Welcome: one illustrated scene — Sol town, the bridge, Fa town — with the
   start button in the middle, on every screen size. */
#adventureWelcome {
  position: relative;
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 0;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 90px);
  border: 4px solid #f3d9a8;
  border-radius: 26px;
  overflow: hidden;
  background: center / cover url("assets/story/scene-t0.jpg");
  box-shadow: 0 8px 24px #5a3b2b33;
}
#adventureWelcome h1,
#adventureWelcome p {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: fit-content;
  max-width: 90%;
  padding: 4px 18px;
  border-radius: 18px;
  background: #fffaf0d9;
}
#adventureWelcome h1 {
  margin-top: 4%;
  font-size: clamp(20px, 3.4vw, 42px);
}
#adventureWelcome p {
  margin-top: 6px;
  font-size: clamp(12px, 1.6vw, 18px);
}
/* The towns are labels on the picture itself (tappable, as before). */
#adventureWelcome .storybookCities {
  position: absolute;
  inset: auto 4% 30% 4%;
  height: auto;
  margin: 0;
  display: flex;
  justify-content: space-between;
}
#adventureWelcome .storybookTown {
  width: auto;
  height: auto;
  padding: 6px 18px;
  border: 3px solid #fff;
  border-radius: 18px;
  background: #fffaf0e6;
  box-shadow: 0 4px 10px #0002;
  font-size: clamp(15px, 2.2vw, 26px);
  animation: none;
}
#adventureWelcome .storybookTown:first-child {
  background: #fff1d6e6;
}
#adventureWelcome .storybookTown:last-child {
  background: #efe4ffe6;
}
#adventureWelcome #startAdventure {
  position: absolute;
  left: 50%;
  bottom: 7%;
  translate: -50% 0;
  margin: 0;
}
@media (orientation: landscape) and (max-height: 500px) {
  #adventureWelcome {
    margin-top: 4px;
    max-height: calc(100dvh - 64px);
    border-radius: 18px;
  }
  #adventureWelcome h1 {
    font-size: 20px;
    padding: 2px 14px;
  }
  #adventureWelcome p {
    font-size: 12px;
    padding: 2px 12px;
  }
  #adventureWelcome .storybookCities {
    inset: auto 4% 32% 4%;
    height: auto;
  }
  #adventureWelcome .storybookTown {
    width: auto;
    font-size: 15px;
    padding: 3px 12px;
    border-width: 2px;
  }
  #adventureWelcome #startAdventure {
    bottom: 6%;
    min-height: 56px;
  }
}
/* The picture has golden Sol town on the left and lavender Fa on the right. */
#adventureWelcome .storybookCities {
  direction: ltr;
}
/* Map: one land fills the screen when chosen from the welcome picture. */
#cityMap.focused .cityMapGrid {
  grid-template-columns: 1fr;
}
.musicCity[hidden] {
  display: none;
}
.musicCity {
  container-type: inline-size;
}
/* Friend pictures share the street: bigger when there are only a few. */
.mapCharacter,
.mapCharacter.learned {
  width: min(64px, calc(78cqw / var(--n, 15)));
  height: min(64px, calc(78cqw / var(--n, 15)));
}
.musicCity.roomy .mapCharacter span {
  opacity: 1;
  font-size: 12px;
  background: #fffaf0d9;
  padding: 0 5px;
  border-radius: 8px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .mapCharacter,
  .mapCharacter.learned {
    width: min(52px, calc(78cqw / var(--n, 15)));
    height: min(52px, calc(78cqw / var(--n, 15)));
  }
  /* No overlapping lines above the map; the lands fill the height. */
  #cityMap .mapBridge,
  #cityMap .rewardChoiceNotice {
    display: none;
  }
  #cityMap .cityMapGrid {
    margin: 4px 0 0;
  }
  #cityMap .musicCity {
    height: calc(100dvh - 72px - env(safe-area-inset-bottom));
    min-height: 200px;
  }
  .musicCity.roomy .mapCharacter span {
    font-size: 10px;
  }
}
.mapCharacter.labelAbove span {
  top: auto;
  bottom: 100%;
  translate: -50% -2px;
}
.cityLandmark {
  z-index: 0;
  opacity: 0.75;
}
/* Nine songs: wrap into rows that fit the screen. */
.songChoices {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  width: min(900px, 100%);
}
@media (orientation: landscape) and (max-height: 500px) {
  .songChoices {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
  .songCard {
    min-height: 76px;
    gap: 2px;
  }
  .songCard .songIcon {
    font-size: 26px;
  }
}
/* Dress-up on phones: colours in a side column, so Cinderella's shoes show. */
@media (orientation: landscape) and (max-height: 500px) {
  #rewardPanel .gameStage[data-kind="dress"] .gameControls {
    top: 58px;
    bottom: auto;
    left: auto;
    right: max(28px, calc(env(safe-area-inset-right) + 12px));
    translate: none;
    display: grid;
    grid-template-columns: repeat(3, 40px);
    gap: 4px 6px;
    max-width: none;
    padding: 6px 8px;
    overflow: visible;
  }
  #rewardPanel .gameStage[data-kind="dress"] .gameControls .partLabel {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    font-size: 13px;
    text-align: center;
  }
  #rewardPanel
    .gameStage[data-kind="dress"]
    .gameControls
    .choice.swatch.outfit {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 12px;
  }
  #rewardPanel
    .gameStage[data-kind="dress"]
    .gameControls
    .choice.swatch.outfit::before {
    width: 22px;
    height: 22px;
  }
}
/* Onboarding: language, then note names with a preview of the cast. */
#onboarding {
  z-index: 60;
}
.onboardChoices .choice {
  min-width: 130px;
  min-height: 56px;
  font-size: 20px;
}
.onboardNames {
  margin-top: 6px;
  font-weight: bold;
}
.onboardHint {
  opacity: 0.85;
  font-size: 14px;
}
.onboardSystems {
  gap: 14px;
}
.onboardSystem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  min-width: 240px;
}
.onboardSystem strong {
  font-size: 20px;
  direction: ltr;
}
.onboardCast {
  display: flex;
  gap: 2px;
}
.onboardCast img {
  width: 30px;
  height: 36px;
  object-fit: contain;
}
.onboardSystem small {
  font-size: 12px;
  opacity: 0.8;
}
#onboardStart {
  margin-top: 8px;
  min-height: 64px;
  min-width: 200px;
}
/* Cast pictures are sized by octave: giant low voices, tiny high ones. */
img[data-octave="2"] {
  scale: 1.12;
}
img[data-octave="3"] {
  scale: 1;
}
img[data-octave="4"] {
  scale: 0.9;
}
img[data-octave="5"] {
  scale: 0.78;
}
img[data-octave="6"] {
  scale: 0.66;
}
@media (orientation: landscape) and (max-height: 500px) {
  #onboarding {
    gap: 4px;
  }
  .onboardChoices .choice {
    min-height: 44px;
    font-size: 16px;
  }
  .onboardSystem {
    padding: 4px 10px;
    min-width: 200px;
  }
  .onboardCast img {
    width: 24px;
    height: 28px;
  }
  #onboardStart {
    min-height: 48px;
  }
}
/* Language switch: always visible in the home screen corner. */
#menu .langButton {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  inset-inline-end: max(28px, calc(env(safe-area-inset-right) + 12px));
  min-height: 40px;
  padding: 4px 14px;
  font-size: 14px;
  z-index: 1;
}
/* Phones: every button on the piano screen is at least 40px tall. */
@media (orientation: landscape) and (max-height: 460px) {
  #app > header .pill {
    min-height: 40px;
    padding: 4px 12px;
    font-size: 13px;
  }
  #app > header {
    height: 48px;
    min-height: 48px;
  }
  #board > .boardFooter .next {
    min-height: 40px;
    padding: 2px 12px;
    font-size: 13px;
  }
  /* «Games ready» is on the home screen too; the piano gets the space. */
  #board > .boardFooter .rewardLink {
    display: none;
  }
}
.stageReplay {
  width: 44px;
  height: 44px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .stageReplay {
    width: 40px;
    height: 40px;
  }
  #menu .grownUps .choice {
    min-height: 40px;
  }
}
