/* Shared styles for all games4kids games */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden;
  font-family: "Comic Sans MS", "Chalkboard SE", "Baloo 2", system-ui, sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: none;
  overscroll-behavior: none; -webkit-touch-callout: none; }  /* no pull-to-refresh, pinch, long-press menus */
#game { position: fixed; inset: 0; }

#muteBtn { position: absolute; z-index: 20; top: 1.2vh; width: 7vh; height: 7vh; font-size: 4vh; border: none;
  border-radius: 50%; background: #fffc; display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
#muteBtn { right: 1.5vw; }

/* ---- overlays ---- */
.overlay { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4vh; background: #0b3d8fcc; text-align: center; }
.overlay.hidden { display: none; }
.overlay h1 { margin: 0; font-size: 9vh; color: #fff; text-shadow: 0 .6vh 0 #0d47a1; padding: 0 4vw; }
button.big { width: 22vh; height: 22vh; border-radius: 50%; border: none; font-size: 11vh; line-height: 1;
  color: #fff; background: #43a047; box-shadow: 0 1.2vh 0 #2e7d32, 0 2vh 2vh #0005; cursor: pointer;
  animation: throb 1.2s ease-in-out infinite; padding: 0 0 0 1.5vh; }
button.big:active { transform: translateY(1vh); box-shadow: 0 .2vh 0 #2e7d32; }
@keyframes throb { 50% { scale: 1.08; } }

.confetti { position: absolute; top: -3vh; width: 1.6vh; height: 2.4vh; z-index: 40; pointer-events: none;
  animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(112vh) rotate(720deg); } }

/* ---- parent exit: drag the handle all the way across ---- */
#exit { position: absolute; z-index: 50; left: 2vw; bottom: 1.2vh; width: min(60vw, 75vh); height: 7vh; border-radius: 3.5vh;
  background: linear-gradient(90deg, #43a047 var(--p, 0%), #00000088 var(--p, 0%)); touch-action: none; pointer-events: none; }  /* only the handle takes touches, so the bar never blocks taps on the game under it */
#exit span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 7vh;
  color: #fff; font-size: 2.4vh; font-family: system-ui, sans-serif; pointer-events: none; }
#exitHandle { position: absolute; left: 0; top: 0; width: 7vh; height: 7vh; border-radius: 50%; background: #fff; font-size: 4vh;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 .4vh .8vh #0006; touch-action: none; cursor: grab; pointer-events: auto; }
#exitHandle.back { transition: transform .25s; }
@media (max-aspect-ratio: 1/1) {
  #exit { left: 3vw; bottom: 2vw; width: 64vw; height: 11vw; border-radius: 5.5vw; }
  #exit span { padding-left: 11vw; font-size: 3.6vw; }
  #exitHandle { width: 11vw; height: 11vw; font-size: 6vw; }
}

@media (max-aspect-ratio: 1/1) {
  #muteBtn { top: 2vw; right: 2vw; width: 13vw; height: 13vw; font-size: 7vw; }
  .overlay h1 { font-size: 11vw; }
  button.big { width: 38vw; height: 38vw; font-size: 19vw; }
}

/* ---- settings dialog (for adults: ordinary readable UI; open by holding .gearbtn) ---- */
.gearbtn { position: absolute; right: 2vw; bottom: 2vh; width: 8vh; height: 8vh; border-radius: 50%; border: none; background: #ffffff33;
  color: #fff; font-size: 4.5vh; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gearbtn small { font: 1.6vh system-ui, sans-serif; opacity: .8; }
.gearbtn.holding { animation: spin 1.2s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.card { background: #fff; color: #263238; border-radius: 3vh; padding: 3vh 4vw; max-width: min(92vw, 640px); max-height: 92vh; overflow: auto;
  font-family: system-ui, sans-serif; text-align: left; font-size: max(2.2vh, 15px); }
.card h2 { margin: 0 0 1vh; } .card h2 small { font-weight: 400; color: #78909c; }

.opts { display: flex; flex-wrap: wrap; gap: 1.5vh; margin: 1vh 0 2vh; }

.opts label { display: flex; align-items: center; gap: .8em; padding: 1vh 1.2vw 1vh 1vh; border: 2px solid #cfd8dc; border-radius: 2vh; cursor: pointer; }

.opts label.shake { animation: optshake .4s; border-color: #e53935; }
@keyframes optshake { 20%,60% { transform: translateX(-1.2vh); } 40%,80% { transform: translateX(1.2vh); } }

.opts svg { width: 5vh; height: 5vh; overflow: visible; }
.card input[type=checkbox] { width: 3vh; height: 3vh; min-width: 20px; min-height: 20px; }
.card .opt { display: flex; align-items: center; gap: .8em; cursor: pointer; }
.card .note { color: #78909c; margin: .5vh 0 2vh; font-size: .9em; }
.btn { font: inherit; font-weight: 700; background: #43a047; color: #fff; border: none; border-radius: 2vh; padding: 1.4vh 5vw; cursor: pointer; }
@media (max-aspect-ratio: 1/1) {
  .gearbtn { width: 14vw; height: 14vw; font-size: 8vw; bottom: 2vw; } .gearbtn small { font-size: 2.8vw; }
  .card { font-size: 16px; padding: 4vw; }
  .opts svg { width: 10vw; height: 10vw; }
}
.card select { font: inherit; padding: .8vh 1vw; border-radius: 1vh; border: 2px solid #cfd8dc; background: #fff; }
.card .opt select { margin-left: auto; }

/* Non-English pages stay hidden (just the background colour) until the translated text is in — no flash of English. See shared/i18n-early.js. */
html.i18n-wait body { visibility: hidden; }

/* ---- form fields in the grown-ups' dialogs (the account section): typing must work even though the page disables text selection ---- */
.card input[type=email], .card input[type=text] { font: inherit; padding: .9vh 1.2vw; border: 2px solid #b0bec5; border-radius: 1vh; width: 100%; max-width: 24em;
  background: #fff; color: inherit; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.card input:focus { outline: 3px solid #4fc3f7; border-color: #0288d1; }
.card .field { display: flex; flex-direction: column; gap: .6vh; margin: 1vh 0 1.4vh; }
.card h3 { margin: 1vh 0 .4vh; }
.card .sep { border: 0; border-top: 2px solid #eceff1; margin: 2vh 0; }
.card [hidden] { display: none !important; }
.btn.secondary { background: #eceff1; color: #37474f; }
.btn.danger { background: #c62828; }
.card .btn { margin: .4vh .6vw .4vh 0; }
.msg { min-height: 1.5em; margin: 1vh 0; font-weight: 600; }
.msg.err { color: #c62828; } .msg.ok { color: #2e7d32; }
