:root {
  --navy: #17334f;
  --navy-deep: #10283f;
  --ink: #203d58;
  --muted: #5d7288;
  --sky: #64cdec;
  --mint: #4fcdb6;
  --lime: #a6e56d;
  --gold: #ffce62;
  --coral: #ff8e73;
  --violet: #8662d9;
  --paper: #fffdfa;
  --border: #d9e7eb;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flow-root;
  overflow-x: hidden;
  color: var(--navy);
  background: #bcebf2;
  font-family: 'Trebuchet MS', 'Arial Rounded MT Bold', Arial, sans-serif;
}
button, select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
:focus-visible {
  outline: 4px solid #ffad43;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.solution-steps { margin: 12px 0 0; padding-left: 1.5rem; line-height: 1.5; }
.solution-steps li + li { margin-top: 6px; }
.story-prompt {
  max-width: 32rem;
  margin: 8px auto 14px;
  padding: 8px 14px;
  border: 1px solid #ffffff55;
  border-radius: 10px;
  background: #09193ac7;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}
.detail-skills { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.detail-skills li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; background: #eef8fb; color: #17334f; }
.detail-skills li span { text-align: right; }
.mission-result { margin: 16px 0; padding: clamp(22px, 4vw, 36px); border: 3px solid #17486b; border-radius: 18px; background: linear-gradient(145deg, #fff6cc, #e2fff3); color: #17334f; text-align: center; box-shadow: 6px 7px 0 #94c8b6; }
.mission-result > span { display: block; color: #a26807; font-size: 2.5rem; }
.mission-result h2 { margin: 4px 0 8px; }
.mission-result p { margin: 0 0 20px; font-weight: 800; }
.detail-delete { display: block; margin: 14px auto 0; padding: 10px 12px; border: 0; background: transparent; color: #9f3030; font: inherit; font-size: .82rem; font-weight: 800; text-decoration: underline; cursor: pointer; }
.detail-delete:focus-visible { outline: 3px solid #9f3030; outline-offset: 3px; }
html[data-text-size="large"] { font-size: 112.5%; }
html[data-high-contrast="true"] { --navy: #08243d; --ink: #102e45; --muted: #33475a; --border: #557585; }
html[data-calm-motion="true"] *, html[data-calm-motion="true"] *::before, html[data-calm-motion="true"] *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
.options-field input[type="range"] { width: 100%; min-height: 28px; accent-color: #7255c2; }
.world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 78% 8%, #fff9c5 0 70px, transparent 71px), linear-gradient(165deg, #bdf2f2 0%, #ddf8f5 48%, #aee4d7 100%);
}
.world-orb {
  position: absolute;
  border: 2px solid #ffffff70;
  border-radius: 50%;
}
.orb-one {
  width: 520px;
  height: 520px;
  top: -270px;
  left: -180px;
}
.orb-two {
  width: 380px;
  height: 380px;
  right: -140px;
  top: 25%;
}
.world-cloud {
  position: absolute;
  width: 115px;
  height: 26px;
  background: #ffffffa8;
  border-radius: 20px;
  box-shadow: 23px -15px #ffffffa8, 58px -6px #ffffffa8;
}
.cloud-one {
  top: 13%;
  left: 9%;
}
.cloud-two {
  right: 14%;
  top: 31%;
  transform: scale(.65);
}
.world-hill {
  position: absolute;
  bottom: -110px;
  width: 60vw;
  height: 240px;
  background: #7dd0ad82;
  border-radius: 50% 50% 0 0;
}
.hill-one {
  left: -9%;
}
.hill-two {
  right: -16%;
  bottom: -145px;
  background: #7dcbb39c;
}
.app {
  width: min(1240px, calc(100% - clamp(72px, 11vw, 190px)));
  margin: 27px auto 36px;
}
.screen {
  box-shadow: 0 22px 55px #1c617e2b, 0 8px 0 #2e78955c;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.logo b {
  color: #aee77e;
  font-weight: 900;
}
.logo-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-size: 1.5rem;
  background: var(--gold);
  border: 3px solid var(--navy);
  border-radius: 10px;
  box-shadow: 3px 3px 0 #0d2539;
  transform: rotate(-7deg);
}
.overline {
  color: #427990;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .17em;
}
/* Home */
.home {
  background: #f7fcfb;
  border: 3px solid var(--navy);
  border-radius: 25px;
  overflow: hidden;
}
.home-header {
  height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 42px;
  background: var(--navy);
  color: white;
}
.header-slogan {
  color: #a7d5df;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .2em;
}
.home-header-right { display: flex; align-items: center; gap: 16px; }
.sound-control { min-width: 82px; }
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: clamp(25px, 3vw, 54px);
  padding: 44px clamp(30px, 4vw, 64px) 22px;
  background: radial-gradient(circle at 41% 50%, #d5f7f0 0, transparent 35%), linear-gradient(112deg, #f9fffd 55%, #e9f7f7 100%);
}
.intro {
  min-width: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #206678;
  font-weight: 900;
  font-size: .73rem;
  letter-spacing: .16em;
}
.eyebrow-star {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--navy);
  background: var(--lime);
  border: 2px solid var(--navy);
  border-radius: 7px;
  font-size: 1rem;
  letter-spacing: 0;
}
.intro h1 {
  max-width: 670px;
  margin: 19px 0 16px;
  font-size: clamp(3.4rem, 5.1vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.075em;
  font-weight: 900;
}
.intro h1 em {
  color: #7755c7;
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: #c5b0f4;
  text-decoration-thickness: .09em;
  text-underline-offset: .1em;
}
.subtitle {
  margin: 0 0 8px;
  color: #244a65;
  font-size: clamp(1.13rem, 1.8vw, 1.43rem);
  font-weight: 900;
}
.intro-copy {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}
.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.feature-list span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #c2e5e2;
  border-radius: 9px;
  background: #ffffffc9;
  color: #315b68;
  font-size: .76rem;
  font-weight: 900;
}
.feature-list b {
  color: #5b47b2;
  font-size: 1.1rem;
  line-height: 1;
}
.art-wrap {
  position: relative;
  width: 100%;
  max-width: 650px;
  height: 310px;
  margin-top: 3px;
}
.island-art {
  position: absolute;
  inset: -35px -25px auto -14px;
  width: calc(100% + 35px);
  height: 365px;
  overflow: visible;
  filter: drop-shadow(0 12px 16px #315e7726);
  animation: float-in 5s ease-in-out infinite;
}
.art-caption {
  position: absolute;
  z-index: 1;
  bottom: 5px;
  left: 10px;
  color: #508293;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .2em;
}
.select-panel {
  align-self: center;
  padding: 30px;
  background: #fff;
  border: 2px solid var(--navy);
  border-radius: 22px;
  box-shadow: 9px 10px 0 #4fb4b994, 0 18px 35px #245d7822;
}
.select-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.select-step {
  color: #72889a;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
}
.select-spark {
  color: var(--violet);
  font-size: 1.8rem;
}
.select-panel h2 {
  margin: 10px 0 6px;
  font-size: 2.15rem;
  line-height: 1.1;
  letter-spacing: -.055em;
}
.select-panel > p {
  margin: 0 0 23px;
  color: var(--muted);
  line-height: 1.45;
}
.age-list {
  display: grid;
  gap: 11px;
  margin-bottom: 24px;
}
@media (min-width: 901px) {
  .age-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .age-list .age-card:last-child { grid-column: 1 / -1; }
  .age-list .age-arrow { display: none; }
}
.age-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 11px 13px;
  border: 2px solid #d5e2e9;
  border-radius: 14px;
  background: #f8fbfc;
  transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
  cursor: pointer;
}
.age-card:hover {
  transform: translateY(-2px);
  border-color: #8ccbd3;
}
.age-card:has(input:checked) {
  border-color: #7856cd;
  background: #f5f0ff;
  box-shadow: 0 4px 0 #ddd0fa;
}
.age-card input:checked ~ .age-copy strong {
  color: #6340b0;
}
.age-card input:checked ~ .age-arrow {
  color: #6340b0;
}
.age-card:has(input:focus-visible) {
  outline: 4px solid #ffad43;
  outline-offset: 3px;
}
.age-card input {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 18px;
  height: 18px;
  accent-color: #7856cd;
}
.age-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--navy);
  border-radius: 11px;
  color: var(--navy);
  font-size: 1.9rem;
  font-weight: 900;
  box-shadow: inset -5px -5px #00000012, 3px 3px 0 #244561;
}
.age-one {
  background: #ffda7a;
}
.age-two {
  background: #8be4da;
}
.age-three {
  background: #c8adf4;
}
.age-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-right: 12px;
}
.age-copy strong {
  color: var(--navy);
  font-size: 1rem;
}
.age-copy small {
  color: #647a8c;
  font-size: .78rem;
}
.age-arrow {
  margin-left: auto;
  align-self: end;
  color: #9aa9b6;
  font-size: 1rem;
}
.primary-btn {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  color: var(--navy);
  background: var(--gold);
  box-shadow: 0 6px 0 #d59a39;
  font-weight: 900;
  font-size: 1.05rem;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.primary-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.04);
  box-shadow: 0 9px 0 #d59a39;
}
.primary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #d59a39;
}
.primary-btn span:last-child {
  font-size: 1.5rem;
  line-height: 1;
}
.reset-note {
  display: block;
  margin-top: 16px;
  color: #778b9c;
  text-align: center;
  font-size: .75rem;
}
.home-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 15px;
  min-height: 37px;
  padding: 6px 14px;
  color: #7894a4;
  background: #ebf7f5;
  border-top: 1px solid #d8eeea;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .18em;
}
.home-footer > span:nth-child(2) {
  color: #80b4aa;
  font-size: 1rem;
}
.footer-credits {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  letter-spacing: .06em;
  text-align: center;
}
.footer-dev {
  letter-spacing: .06em;
  opacity: .85;
}
/* Game */
.game {
  display: grid;
  gap: 18px;
  background: transparent;
  box-shadow: none;
}
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 81px;
  padding: 14px 22px;
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: var(--navy);
  box-shadow: 0 8px 0 #285d7182;
  color: #fff;
}
.header-middle, .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.age-control {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 12px;
  border: 1px solid #638196;
  border-radius: 10px;
  color: #b9d4df;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .1em;
}
.age-control select {
  min-height: 30px;
  max-width: 116px;
  padding: 3px 5px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 900;
}
.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 41px;
  padding: 5px 11px;
  border-radius: 10px;
  color: var(--navy);
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 900;
}
.hud-pill strong {
  font-size: 1.08rem;
}
.hud-pill.gold {
  background: var(--gold);
}
.hud-pill.coral {
  background: #ffc9b8;
}
.hud-pill > span {
  font-size: 1.1rem;
}
.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid #6c879a;
  border-radius: 9px;
  color: #fff;
  background: #294661;
  font-size: .74rem;
  font-weight: 800;
  text-decoration: none;
  transition: background .16s, transform .16s;
}
.control:hover {
  background: #3d6380;
  transform: translateY(-2px);
}
.control[aria-pressed="false"] {
  opacity: .7;
}
.control-icon {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}
.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.57fr) minmax(295px, .72fr);
  gap: 19px;
  align-items: start;
}
.panel {
  border: 2px solid var(--navy);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 0 #2c75859e, 0 20px 36px #23658224;
}
.play-panel {
  position: relative;
  overflow: hidden;
  padding: 25px 28px 28px;
}
.play-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg, #75d6a3 0 42px, #aee581 42px 84px);
}
.mission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 9px 0 17px;
}
.mission h1 {
  margin: 3px 0 0;
  font-size: 1.68rem;
  letter-spacing: -.055em;
  line-height: 1;
}
.mission-star {
  color: #f4b74f;
  font-size: 1.1rem;
}
.mission-badge {
  padding: 8px 12px;
  border: 1px solid #b2d8ce;
  border-radius: 9px;
  background: #e7f8ed;
  color: #246454;
  font-size: .76rem;
  font-weight: 900;
  white-space: nowrap;
}
.question-card {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px 15px;
  border: 2px solid #102c53;
  border-radius: 17px;
  background: radial-gradient(circle at 50% 32%, #547dc1 0, transparent 44%), linear-gradient(120deg, #234c83, #32386c 85%);
  color: #fff;
  text-align: center;
  box-shadow: inset 0 -8px #142f5a;
  animation: question-in .32s ease-out;
}
.question-card::before, .question-card::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border: 2px solid #d9e9ff29;
  transform: rotate(25deg);
}
.question-card::before {
  top: -58px;
  left: -30px;
}
.question-card::after {
  bottom: -69px;
  right: -24px;
}
.question-glow {
  position: absolute;
  width: 270px;
  height: 130px;
  top: 26px;
  left: calc(50% - 135px);
  border-radius: 50%;
  background: #84c9ff44;
  filter: blur(40px);
}
.question-content {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.question-kicker {
  display: inline-block;
  margin-bottom: 13px;
  color: #bfeee5;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .21em;
}
.expression {
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.07em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-shadow: 0 5px 0 #182c566b;
}
.question-mark {
  color: #ffe17d;
  white-space: nowrap;
}
.question-subtitle {
  display: block;
  margin-top: 14px;
  color: #c8dbee;
  font-size: .8rem;
  font-weight: 800;
}
.question-decoration {
  position: absolute;
  top: 20px;
  right: 22px;
  color: #fbd57f;
  font-size: 1.8rem;
}
.hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 13px;
}
.hint-button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #b6d8df;
  border-radius: 9px;
  background: #edfaf9;
  color: #275a67;
  font-size: .83rem;
  font-weight: 900;
  transition: background .15s, transform .15s;
}
.hint-button:hover:not(:disabled) {
  background: #d6f3ed;
  transform: translateY(-2px);
}
.hint-button:disabled {
  opacity: .7;
}
.hint-button span {
  color: #7955c5;
  font-size: 1.1rem;
}
.answer-instruction {
  color: #688397;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-align: right;
}
.hint-box {
  display: grid;
  gap: 5px;
  padding: 11px 14px;
  border-left: 4px solid var(--violet);
  border-radius: 8px;
  background: #f3edff;
  color: #4b3b79;
  line-height: 1.4;
  font-size: .86rem;
}
.hint-box strong {
  font-size: .64rem;
  letter-spacing: .14em;
}
.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}
.answer {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 10px 42px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  box-shadow: 0 5px 0 #b7cad7;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 900;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.answer:nth-child(1) {
  background: #fff8e8;
}
.answer:nth-child(2) {
  background: #effbf7;
}
.answer:nth-child(3) {
  background: #f2f4ff;
}
.answer:nth-child(4) {
  background: #fff1ee;
}
.answer:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 #9bb9ca;
}
.answer:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #9bb9ca;
}
.answer:disabled {
  opacity: .96;
}
.answer .key {
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #bfd0dc;
  border-radius: 6px;
  background: #ffffffaf;
  color: #71869a;
  font-size: .72rem;
}
.answer.correct {
  background: #c9f3d5;
  border-color: #2b8a62;
  box-shadow: 0 5px 0 #308359;
}
.answer.wrong {
  background: #ffe2dc;
  border-color: #c95e58;
  box-shadow: 0 5px 0 #ae5753;
}
.feedback {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 13px;
  border: 1px solid #d6e5ea;
  border-radius: 11px;
  background: #f5f9fa;
  color: #426076;
}
.feedback-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ddecf2;
  color: #2a7190;
  font-size: 1.25rem;
}
.feedback strong, .feedback small {
  display: block;
}
.feedback strong {
  font-size: .93rem;
}
.feedback small {
  margin-top: 2px;
  font-size: .79rem;
  line-height: 1.3;
}
.feedback.success {
  border-color: #a8e0b7;
  background: #e8fae8;
  color: #266247;
}
.feedback.success .feedback-icon {
  background: #c8edc8;
  color: #24764e;
}
.feedback.error {
  border-color: #f0c7b3;
  background: #fff1e7;
  color: #814a35;
}
.feedback.error .feedback-icon {
  background: #ffdcbd;
  color: #a15c3b;
}
.solution {
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid #d1c6ee;
  border-radius: 10px;
  background: #f5f0ff;
  color: #493b78;
}
.solution-label {
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .13em;
}
.solution p {
  margin: 5px 0 0;
  font-size: .86rem;
  line-height: 1.4;
}
.next-button {
  display: block;
  margin: 12px 0 0 auto;
  padding: 9px 13px;
  border: 2px solid var(--navy);
  border-radius: 9px;
  color: var(--navy);
  background: var(--gold);
  box-shadow: 0 4px 0 #d79f44;
  font-size: .82rem;
  font-weight: 900;
}
.next-button:hover {
  transform: translateY(-2px);
}
.next-button span {
  margin-left: 10px;
}
.mobile-next-button {
  display: none;
}
.game-page .play-panel > .next-button {
  width: 100%;
  min-height: 50px;
  margin: 15px 0 4px;
  padding: 8px 16px;
  border: 2px solid #51406c;
  border-radius: 13px;
  color: #30264b;
  background: linear-gradient(110deg, #ffe985, #ffc657 68%, #ffac68);
  box-shadow: 0 5px 0 #ba7b42, 0 9px 20px #50417024;
  font-size: .96rem;
  letter-spacing: .015em;
  text-align: center;
}
.game-page .play-panel > .next-button:hover {
  box-shadow: 0 6px 0 #ba7b42, 0 11px 22px #50417030;
}
.game-page .play-panel > .next-button span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 10px;
  border-radius: 50%;
  background: #fff9;
  font-size: 1.05rem;
}
.experience {
  margin-top: 20px;
}
.experience-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #476a7b;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.experience-head strong {
  color: var(--navy);
  letter-spacing: 0;
}
.xp-track {
  height: 16px;
  overflow: hidden;
  border: 2px solid #274a65;
  border-radius: 20px;
  background: #e2edf2;
}
.xp-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7b5bce, #ad8be9 55%, #d6b0fb);
  transition: width .35s;
}
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  top: 39%;
  left: 50%;
  width: 13px;
  height: 13px;
  background: var(--gold);
  animation: burst .7s ease-out forwards;
}
/* Stats */
.stats-panel {
  padding: 23px;
}
.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stats-head h2 {
  margin: 3px 0 0;
  font-size: 1.6rem;
  letter-spacing: -.055em;
}
.stats-emblem {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 2px solid var(--navy);
  border-radius: 11px;
  color: #5f47ab;
  background: #eadfff;
  font-size: 1.5rem;
  box-shadow: 3px 3px 0 #b5a1dd;
}
.stats-intro {
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: .85rem;
}
.level-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 94px;
  overflow: hidden;
  padding: 14px;
  border: 2px solid #233f6d;
  border-radius: 13px;
  background: linear-gradient(120deg, #264f86, #3e4c9c);
  color: #fff;
  box-shadow: 0 5px 0 #233f6d;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.level-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #233f6d; }
.level-card:active { transform: translateY(2px); box-shadow: 0 2px 0 #233f6d; }
.level-card:focus-visible { outline: 4px solid #ffda70; outline-offset: 3px; }
.level-card small {
  display: block;
  color: #c6ddf3;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.level-card strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
}
.level-spark {
  position: absolute;
  right: 18px;
  top: 17px;
  color: #ebdbff;
  font-size: 1.9rem;
}
.level-card .avatar-preview {
  width: 53px;
  height: 53px;
  border: 2px solid #f6db85;
  border-radius: 12px;
  box-shadow: inset -5px -5px #0000001c, 3px 3px 0 #1d2f55;
}
.level-card-info {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  padding-right: 26px;
}
.level-card-name {
  overflow: hidden;
  color: #ffe9ad;
  font-size: .82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.level-card-link { color: #b9fff1; font-size: .7rem; font-weight: 800; }
.stat-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 14px;
  padding: 13px;
  border: 1px solid #ecd396;
  border-radius: 11px;
  background: #fff7df;
}
.stat-hero > span {
  max-width: 110px;
  color: #826a32;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.35;
}
.stat-hero strong {
  color: #7b5623;
  font-size: 1.8rem;
  white-space: nowrap;
}
.stat-hero strong span:first-child {
  color: #f2b941;
}
.stats-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.stat {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid #dbe6ea;
  border-radius: 10px;
  background: #f8fbfb;
}
.stat span {
  color: #647d8b;
  font-size: .73rem;
  font-weight: 800;
}
.stat strong {
  color: #224861;
  font-size: 1.32rem;
  line-height: 1;
}
.tip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
  padding: 11px;
  border: 1px solid #bde1dc;
  border-radius: 10px;
  background: #eafaef;
  color: #3d695e;
  font-size: .75rem;
  line-height: 1.35;
}
.tip > span:first-child {
  font-size: 1.4rem;
}
.game-footer {
  padding: 5px 0;
  color: #336b77;
  text-align: center;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .18em;
}
.game-footer > span {
  color: #7956c9;
  margin: 0 7px;
}
/* Help dialog */
dialog {
  width: min(460px, calc(100% - 32px));
  padding: 28px;
  border: 2px solid var(--navy);
  border-radius: 20px;
  background: #fffefa;
  color: var(--navy);
  box-shadow: 8px 9px 0 #4db9bc;
}
dialog::backdrop {
  background: #112d4bbb;
  backdrop-filter: blur(4px);
}
.dialog-star {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 17px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: var(--gold);
  font-size: 1.8rem;
}
dialog h2 {
  margin: 5px 0 10px;
  font-size: 1.9rem;
  letter-spacing: -.05em;
}
dialog p, dialog li {
  color: #50687c;
  line-height: 1.5;
}
dialog ul {
  padding-left: 22px;
}
.dialog-close {
  margin-top: 18px;
}
@keyframes question-in {
  from {
    opacity: .3;
    transform: scale(.97) translateY(5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes float-in {
  50% {
    transform: translateY(-7px);
  }
}
@keyframes burst {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(140deg) scale(.3);
  }
}
@media (max-width: 1160px) {
  .game-header {
    flex-wrap: wrap;
  }
  .header-actions {
    margin-left: auto;
  }
  .home-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  }
  .intro h1 {
    font-size: clamp(3.2rem, 5vw, 4.5rem);
  }
}
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
    padding: 33px;
  }
  .intro h1 {
    max-width: 750px;
  }
  .art-wrap {
    height: 275px;
    max-width: 580px;
  }
  .island-art {
    height: 330px;
  }
  .select-panel {
    max-width: 620px;
    width: 100%;
    justify-self: center;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  .stats-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1199px), (max-width: 1400px) and (hover: none) and (pointer: coarse) {
  .game-page .game-header {
    flex-wrap: wrap;
  }
  .game-page .game-header .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
  }
  .game-page .mobile-next-button:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .game-page .play-panel > .mobile-next-button span {
    margin-left: 0;
  }
  .game-page .play-panel > .next-button:not(.mobile-next-button) {
    display: none;
  }
}
@media (max-width: 600px) {
  .app {
    width: calc(100% - 20px);
    margin: 10px auto 24px;
  }
  .home {
    border-radius: 17px;
  }
  .home-header {
    min-height: 66px;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .home-header-right { gap: 8px; }
  .home-header .sound-control { min-width: 39px; }
  .logo {
    font-size: 1.14rem;
    gap: 8px;
  }
  .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 1.25rem;
  }
  .header-slogan {
    display: none;
  }
  .home-grid {
    gap: 9px;
    padding: 24px 18px 28px;
  }
  .eyebrow {
    font-size: .62rem;
    letter-spacing: .09em;
  }
  .intro h1 {
    margin: 18px 0 13px;
    font-size: clamp(2.8rem, 10vw, 4rem);
  }
  .intro-copy {
    font-size: .92rem;
  }
  .feature-list {
    margin-top: 17px;
  }
  .feature-list span {
    font-size: .7rem;
  }
  .art-wrap {
    height: 210px;
  }
  .island-art {
    inset: -44px -15px auto -10px;
    height: 280px;
    width: calc(100% + 20px);
  }
  .art-caption {
    bottom: 0;
    font-size: .56rem;
  }
  .select-panel {
    padding: 20px;
    box-shadow: 5px 6px 0 #4fb4b994;
  }
  .select-panel h2 {
    font-size: 1.8rem;
  }
  .age-card {
    min-height: 72px;
  }
  .home-footer {
    font-size: .45rem;
    gap: 6px;
    letter-spacing: .1em;
  }
  .game-header {
    padding: 12px;
    gap: 11px;
  }
  .game-header .logo {
    width: 100%;
  }
  .header-middle {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .header-actions {
    margin-left: 0;
    flex: 1;
    justify-content: flex-end;
  }
  .control {
    min-width: 39px;
  }
  .control-text {
    display: none;
  }
  .age-control {
    gap: 4px;
    padding-left: 7px;
  }
  .age-control span {
    display: none;
  }
  .age-control select {
    max-width: 96px;
  }
  .hud-pill {
    padding: 5px 7px;
    font-size: .72rem;
  }
  .hud-pill strong {
    font-size: .89rem;
  }
  .panel {
    border-radius: 17px;
  }
  .play-panel {
    padding: 20px 15px 22px;
  }
  .question-card {
    min-height: 180px;
  }
  .expression {
    font-size: clamp(2.2rem, 8vw, 3.3rem);
  }
  .answers {
    gap: 10px;
  }
  .answer {
    min-height: 68px;
  }
  .answer-instruction {
    font-size: .57rem;
  }
  .mission h1 {
    font-size: 1.45rem;
  }
  .stats-panel {
    padding: 18px;
  }
  .stats-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-footer {
    font-size: .53rem;
  }
}
@media (max-width: 380px) {
  .feature-list {
    gap: 5px;
  }
  .feature-list span {
    padding: 6px;
  }
  .answer {
    min-height: 63px;
    padding: 8px 30px;
  }
  .answer .key {
    left: 7px;
    top: 8px;
  }
  .hint-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .answer-instruction {
    text-align: left;
  }
  .hud-pill.coral {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Table practice and online race */
.extra-modes {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}
.mode-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 61px;
  padding: 9px 11px;
  border: 2px solid #b5d3d6;
  border-radius: 11px;
  background: #effaf7;
  color: var(--navy);
  text-align: left;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.mode-button:hover {
  transform: translateY(-2px);
  border-color: #4aacae;
  box-shadow: 0 4px 0 #a0d4d0;
}
.mode-button > span:nth-child(2) {
  display: grid;
  gap: 2px;
  flex: 1;
}
.mode-button strong { font-size: .86rem; }
.mode-button small { color: #607c84; font-size: .7rem; }
.mode-button > span:last-child { font-weight: 900; }
.mode-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border: 2px solid var(--navy);
  border-radius: 9px;
  background: #92e0d0;
  font-size: 1.45rem;
  font-weight: 900;
}
.mixed-mode { background: #fff5dd; border-color: #e5bd70; }
.mixed-mode:hover { border-color: #bb8126; box-shadow: 0 4px 0 #e9d09a; }
.mixed-mode .mode-icon { background: #ffcf70; }
.online-mode { background: #f3eeff; border-color: #cec0ee; }
.online-mode:hover { border-color: #8766d0; box-shadow: 0 4px 0 #d0c0ee; }
.online-mode .mode-icon { background: #cfb9f8; font-size: 1.2rem; }
.table-mode-label { background: #d1f4e9; }
.settings-summary { margin: 0 0 12px !important; padding: 9px 11px; border-radius: 10px; font-size: .74rem !important; font-weight: 800; line-height: 1.35; }
.options-control { background: #385576; }
.options-dialog form { display: grid; }
.options-field { display: grid; gap: 6px; color: #294b5e; font-size: .85rem; }
.options-field select { width: 100%; min-height: 46px; padding: 9px 12px; border: 2px solid #a9c8d1; border-radius: 9px; background: #fff; color: var(--navy); font: inherit; font-weight: 800; }
.options-field select:focus-visible, .options-toggle input:focus-visible { outline: 3px solid #f3b748; outline-offset: 2px; }
.options-note { margin: -7px 0 0; padding: 9px 11px; border-radius: 8px; background: #eef8fa; color: #4b6877; font-size: .76rem; }
.options-toggle { display: flex; align-items: center; gap: 11px; padding: 12px; border: 2px solid #bfdadf; border-radius: 11px; background: #effaf8; cursor: pointer; }
.options-toggle input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: #7255c2; }
.options-toggle span:nth-child(2) { display: grid; gap: 3px; flex: 1; }
.options-toggle strong { color: #234b61; font-size: .88rem; }
.options-toggle small { color: #5f7885; font-size: .73rem; line-height: 1.3; }
.options-toggle span:last-child { color: #7653c6; font-size: 1.4rem; }
.options-reset-note { margin: 0; color: #775926; font-size: .75rem; }
.options-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; }
.options-actions .primary-btn { width: auto; min-height: 45px; }

/* A full-size, visual setup screen with the same form state as the game. */
.options-dialog {
  width: min(1240px, calc(100% - 24px));
  max-height: min(94vh, 940px);
  max-height: min(94dvh, 940px);
  padding: 0;
  overflow-y: auto;
  border-width: 3px;
  background: #f5fcfb;
  box-shadow: 12px 14px 0 #28838e80;
}
.options-dialog form { gap: 0; }
.options-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  background: linear-gradient(110deg, #17334f, #315c78 67%, #316a70);
  color: #fff;
}
.options-hero .overline { color: #a6e56d; }
.options-hero h2 { margin: 2px 0 4px; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.options-hero p { margin: 0; color: #e9f8f8; font-size: .95rem; }
.options-hero-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  border: 3px solid #10283f;
  border-radius: 15px;
  background: #a6e56d;
  color: #17334f;
  box-shadow: 0 5px 0 #163d46;
  font-size: 2rem;
}
.options-section { padding: 18px 28px 20px; border-bottom: 2px solid #d7e8e8; }
.options-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.options-section-heading h3 { margin: 0; color: #17334f; font-size: clamp(1.13rem, 1.7vw, 1.5rem); line-height: 1.15; }
.options-section-heading p { margin: 2px 0 0; font-size: .79rem; }
.options-step {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 2px solid #17334f;
  border-radius: 10px;
  background: #ffce62;
  color: #17334f;
  font-weight: 900;
  box-shadow: 0 3px 0 #d59b42;
}
.options-followup { background: #f7f0ff; }
.options-followup .options-step { background: #d9c6ff; box-shadow: 0 3px 0 #a68bde; }
.option-choices { display: grid; gap: 9px; }
.mode-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.three-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.age-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.age-choices .option-card:last-child { grid-column: 1 / -1; }
.two-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 74px;
  padding: 9px;
  border: 2px solid #bed7dd;
  border-radius: 13px;
  background: #fff;
  color: #17334f;
  box-shadow: 0 4px 0 #d3e7e8;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.option-card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #b8d7d9; border-color: #6caab3; }
.option-card:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.option-card:disabled:hover { transform: none; border-color: #bed7dd; }
.option-card:active { transform: translateY(2px); box-shadow: 0 2px 0 #b8d7d9; }
.option-card[aria-pressed="true"] { border-color: #286c54; background: #e4f9df; box-shadow: 0 4px 0 #87bf8c; }
.option-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border: 2px solid #17334f;
  border-radius: 10px;
  background: #e5d8ff;
  color: #4a2b8b;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}
.option-card[aria-pressed="true"] .option-card-icon { background: #a6e56d; color: #17334f; }
.option-card-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.option-card-copy strong { font-size: .85rem; line-height: 1.15; }
.option-card-copy small { color: #4c6470; font-size: .68rem; line-height: 1.25; }
.option-card-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 21px;
  height: 21px;
  border: 2px solid #a7c4c8;
  border-radius: 50%;
  color: transparent;
  font-size: .76rem;
  font-weight: 900;
}
.option-card[aria-pressed="true"] .option-card-check { border-color: #286c54; background: #286c54; color: #fff; }
.options-dialog .options-note { margin: 13px 0 0; padding: 8px 11px; font-size: .75rem; line-height: 1.4; }
.options-setting-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 15px; }
.options-setting { min-width: 0; }
.options-setting h4 { margin: 0 0 8px; color: #294b5e; font-size: .84rem; }
.options-setting .option-card { min-height: 68px; }
.options-setting .option-card-icon { width: 31px; height: 31px; font-size: .98rem; }
.options-setting .option-card-copy strong { font-size: .76rem; }
.options-setting .option-card-copy small { font-size: .61rem; }
.options-setting .option-card-check { width: 17px; height: 17px; font-size: .57rem; }
.options-extra { margin: 12px 28px 0; border: 2px solid #c7dfe5; border-radius: 13px; background: #fff; }
.options-extra summary { padding: 12px 16px; color: #234b61; font-weight: 900; cursor: pointer; }
.options-extra summary span { margin-left: 8px; color: #55717f; font-size: .76rem; font-weight: 500; }
.options-extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 12px; padding: 6px 16px 16px; }
.options-dialog .options-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  justify-content: flex-end;
  padding: 14px 28px;
  border-top: 2px solid #d1e5e5;
  background: #f5fcfb;
  box-shadow: 0 -6px 16px #17334f0c;
}
.options-dialog .options-reset-note { flex: 1; min-width: 220px; margin-right: auto; }

@media (max-width: 980px) {
  .mode-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options-setting-grid { grid-template-columns: 1fr; }
  .options-setting .option-card-copy strong { font-size: .82rem; }
  .options-setting .option-card-copy small { font-size: .7rem; }
}
@media (max-width: 600px) {
  .options-dialog { width: calc(100% - 12px); max-height: 96dvh; box-shadow: 4px 6px 0 #28838e80; }
  .options-hero { gap: 12px; padding: 13px 15px; }
  .options-hero-icon { width: 42px; height: 42px; font-size: 1.4rem; }
  .options-hero h2 { font-size: 1.6rem; }
  .options-hero p { font-size: .79rem; }
  .options-section { padding: 14px 13px; }
  .options-section-heading { gap: 8px; }
  .option-choices { gap: 7px; }
  .option-card { min-height: 92px; padding: 7px; align-items: flex-start; gap: 5px; flex-direction: column; position: relative; }
  .option-card-icon { width: 31px; height: 31px; font-size: 1rem; }
  .option-card-copy strong { font-size: .77rem; }
  .option-card-copy small { font-size: .63rem; }
  .option-card-check { position: absolute; top: 8px; right: 8px; }
  .compact-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-choice-group="optionsVariant"] { grid-template-columns: 1fr; }
  .options-setting .option-card { min-height: 78px; }
  .options-extra { margin: 10px 13px 0; }
  .options-extra summary span { display: block; margin: 2px 0 0; }
  .options-extra-grid { grid-template-columns: 1fr; }
  .options-dialog .options-actions { padding: 11px 13px; }
  .options-dialog .options-reset-note { flex-basis: 100%; }
  .options-dialog .options-actions .primary-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .option-card { transition: none; }
  .option-card:hover, .option-card:active { transform: none; }
}

.online-screen { display: grid; gap: 18px; box-shadow: none; }
.online-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 79px;
  padding: 14px 22px;
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 0 #285d7182;
}
.online-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .75fr);
  align-items: center;
  gap: clamp(25px, 4vw, 65px);
  min-height: 620px;
  padding: clamp(25px, 5vw, 65px);
  border: 2px solid var(--navy);
  border-radius: 22px;
  background: radial-gradient(circle at 20% 85%, #d7f7d5 0, transparent 42%), linear-gradient(120deg, #fafff9, #e6f5f7);
  box-shadow: 0 8px 0 #2c75859e;
}
.online-intro h1 {
  margin: 17px 0 14px;
  font-size: clamp(3.1rem, 5.2vw, 5.5rem);
  letter-spacing: -.075em;
  line-height: 1;
}
.online-intro h1 em { color: #7653c6; font-style: normal; }
.online-intro p { max-width: 510px; color: #516f7d; font-size: 1.1rem; line-height: 1.55; }
.online-steps { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.online-steps span { padding: 8px 10px; border: 1px solid #b5d9d9; border-radius: 9px; background: #fff; color: #356171; font-size: .76rem; font-weight: 900; }
.online-entry-card { display: grid; gap: 9px; padding: 26px; }
.online-entry-card label { font-size: .83rem; font-weight: 900; }
.online-entry-card input {
  width: 100%;
  min-height: 51px;
  padding: 10px 13px;
  border: 2px solid #9ab6c5;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 800;
}
.online-entry-card input::placeholder { color: #8da2ae; }
.online-entry-card small { color: #6b8491; font-size: .72rem; line-height: 1.35; }
.online-entry-card .primary-btn { margin-top: 7px; }
.entry-divider { display: block; margin: 12px 0 4px; color: #72909b; text-align: center; font-size: .65rem; font-weight: 900; letter-spacing: .14em; }
.join-button { justify-content: space-between; min-height: 49px; padding: 8px 15px; font-weight: 900; }
.online-note { margin: 8px 0 0; color: #66808f; font-size: .76rem; line-height: 1.4; }
.privacy-quick { margin: 4px 0; padding: 8px 10px; border-left: 3px solid #5bbfb3; border-radius: 6px; background: #eaf8f4; color: #315d67; font-size: .74rem; line-height: 1.4; }
.privacy-quick a { color: #2754a0; font-weight: 900; text-underline-offset: 2px; }
.online-message { min-height: 20px; margin: 0; color: #8e3e38; font-weight: 900; text-align: center; }

.online-room { display: grid; gap: 18px; }
.room-toolbar { display: flex; align-items: center; gap: 15px; min-height: 92px; padding: 17px 23px; }
.room-toolbar h1 { margin: 4px 0 0; font-size: 1.65rem; letter-spacing: -.05em; }
.room-toolbar h1 span { color: #7450c6; letter-spacing: .1em; }
.copy-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #b3d2d4;
  border-radius: 8px;
  background: #e6f7ef;
  color: #2c6166;
  font-size: .77rem;
  font-weight: 900;
}
.copy-button:hover { background: #d3efdf; }
.room-counter { display: grid; justify-items: end; gap: 3px; margin-left: auto; }
.room-counter span { color: #5f7889; font-size: .74rem; font-weight: 900; }
.room-counter strong { color: #334e81; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.online-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 18px; align-items: start; }
.race-panel { min-height: 470px; padding: 25px; }
.race-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.race-top h2 { margin: 5px 0 0; font-size: 1.6rem; letter-spacing: -.05em; }
.race-question { min-height: 170px; }
.race-answers { margin-top: 17px; }
.race-notice { min-height: 65px; display: flex; align-items: center; margin-top: 15px; padding: 12px 15px; border: 1px solid #c8dfe3; border-radius: 11px; background: #f0f9f8; color: #3e6673; font-weight: 900; line-height: 1.4; }
.race-result { margin-top: 15px; padding: 17px; border: 1px solid #d4c4ee; border-radius: 12px; background: #f6f0ff; }
.race-result h3 { margin: 6px 0; font-size: 1.2rem; }
.race-result p { margin: 0; color: #5e527f; line-height: 1.45; }
.start-race { max-width: 270px; margin-top: 18px; }
.leaderboard { padding: 23px; }
.leaderboard h2 { margin: 4px 0 17px; font-size: 1.5rem; letter-spacing: -.05em; }
.race-players { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; counter-reset: ranking; }
.race-players li { display: flex; align-items: center; gap: 10px; min-height: 57px; padding: 8px 10px; border: 1px solid #dae6e8; border-radius: 10px; background: #f8fbfb; }
.race-players li::before { counter-increment: ranking; content: counter(ranking); display: grid; place-items: center; flex: none; width: 27px; height: 27px; border-radius: 7px; background: #e1edf1; color: #4c6d7d; font-size: .76rem; font-weight: 900; }
.race-players li:first-child { border-color: #ebd68f; background: #fff9e6; }
.race-players li:first-child::before { background: #ffdf7c; color: #78561e; }
.race-players li.me { outline: 2px solid #8d71d5; }
.race-player-name { display: grid; min-width: 0; gap: 2px; flex: 1; }
.race-player-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.race-player-name small { color: #6d8692; font-size: .68rem; }
.race-player-points { font-size: 1rem; font-weight: 900; white-space: nowrap; }
.leaderboard-note { margin: 16px 0 0; color: #6b8290; font-size: .75rem; line-height: 1.45; }
.online-teams-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 0 0 17px; text-align: center; }
.online-teams-score strong { padding: 10px 7px; border-radius: 9px; background: #e8f0ff; color: #31558a; font-size: .85rem; }
.online-teams-score strong:last-child { background: #fff0df; color: #96553a; }
.online-teams-score span { color: #667e92; font-size: .7rem; font-weight: 900; }
@media (max-width: 900px) {
  .online-entry, .online-grid { grid-template-columns: 1fr; }
  .online-entry { min-height: 0; }
  .online-entry-card { max-width: 650px; width: 100%; }
  .race-players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .online-header { min-height: 66px; padding: 12px; }
  .online-header .control { min-height: 37px; }
  .online-header .control-text { display: none; }
  .online-header .sound-control { min-width: 40px; }
  .online-entry { gap: 20px; padding: 24px 17px; }
  .online-intro h1 { font-size: clamp(2.65rem, 10vw, 4rem); }
  .online-intro p { font-size: .95rem; }
  .online-entry-card { padding: 18px; }
  .room-toolbar { flex-wrap: wrap; padding: 15px; }
  .room-toolbar h1 { font-size: 1.4rem; }
  .room-counter { margin-left: auto; }
  .race-panel, .leaderboard { padding: 17px; }
  .race-players { grid-template-columns: 1fr; }
}

/* Hero card and local versus */
.home-sidebar { display: grid; gap: 18px; align-self: center; min-width: 0; }
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 98px;
  padding: 15px;
  overflow: hidden;
  border: 2px solid #243d72;
  border-radius: 17px;
  color: #fff;
  background: radial-gradient(circle at 82% 15%, #997cea80, transparent 30%), linear-gradient(115deg, #244b81, #423c85);
  box-shadow: 6px 7px 0 #8c77d28a;
}
.profile-avatar { display: grid; place-items: center; flex: none; width: 62px; height: 62px; border: 2px solid #f6db85; border-radius: 13px; background: #ffce62; color: var(--navy); box-shadow: inset -7px -7px #e5a945; font-size: 2rem; font-weight: 900; transform: rotate(-5deg); }
.profile-info { display: grid; gap: 3px; min-width: 0; flex: 1; }
.profile-info small { color: #c9e7ee; font-size: .6rem; font-weight: 900; letter-spacing: .14em; }
.profile-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.35rem; letter-spacing: -.04em; }
.profile-info span { color: #ffe9ad; font-size: .75rem; font-weight: 900; }
.profile-edit { flex: none; width: 34px; height: 34px; border: 1px solid #a9b8e6; border-radius: 8px; background: #ffffff1f; color: #fff; font-size: 1.15rem; }
.profile-edit:hover { background: #ffffff3f; }
.versus-mode { background: #fff7e8; border-color: #edcf9e; }.versus-mode .mode-icon { background: #ffd687; font-size: .8rem; }
.team-mode { background: #edf3ff; border-color: #b9c8e8; }.team-mode .mode-icon { background: #b5c9f5; font-size: 1.1rem; }
.profile-dialog, .local-setup { width: min(490px, calc(100% - 24px)); }
.profile-dialog .sound-control { position: absolute; top: 24px; right: 24px; min-width: 40px; }
.profile-dialog form, .local-setup form, #duelFields, #teamFields { display: grid; gap: 8px; }
.profile-dialog label, .local-setup label { margin-top: 5px; font-size: .8rem; font-weight: 900; }
.profile-dialog input, .local-setup input { width: 100%; min-height: 49px; padding: 9px 12px; border: 2px solid #a2b9c7; border-radius: 9px; color: var(--navy); background: #fff; font-weight: 800; }
.profile-dialog form small { color: #667f8b; line-height: 1.4; }
.form-error { min-height: 1.2em; margin: 3px 0; color: #a73e3a; font-size: .8rem; font-weight: 900; }
.text-button { padding: 7px; border: 0; background: transparent; color: #5f7184; text-decoration: underline; font-weight: 900; }
.local-screen { display: grid; gap: 18px; box-shadow: none; }
.local-toolbar { display: flex; align-items: center; gap: 17px; padding: 17px 23px; }
.local-toolbar h1 { margin: 3px 0 0; font-size: 1.6rem; letter-spacing: -.05em; }
.local-toolbar .mission-badge { margin-left: auto; }
.local-clock { min-width: 64px; color: #294d81; font-size: 1.3rem; text-align: right; font-variant-numeric: tabular-nums; }
.local-question { min-height: 174px; }
.local-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.local-side { padding: 20px; }
.blue-side { border-top: 9px solid #6a9ee6; }.orange-side { border-top: 9px solid #ffa66d; }
.local-side-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 75px; }
.local-side-head h2 { margin: 3px 0; font-size: 1.35rem; line-height: 1.1; overflow-wrap: anywhere; }
.local-side-head small { color: #6a8291; font-size: .71rem; }
.side-points { padding: 7px 9px; border-radius: 9px; background: #fff1cf; white-space: nowrap; font-size: 1rem; }
.local-answers { margin: 12px 0; }.local-answers .answer { min-height: 67px; }
.side-status { min-height: 39px; display: flex; align-items: center; margin: 0; padding: 8px 11px; border-radius: 9px; background: #eff7f8; color: #456b78; font-size: .8rem; font-weight: 900; }
.local-notice { min-height: 55px; display: flex; align-items: center; padding: 12px 18px; color: #376471; font-weight: 900; }
.local-screen > .race-result { margin: 0; padding: 20px; }
.local-screen > .next-button { margin-left: auto; }
@media (max-width: 900px) {
  .home-sidebar { width: 100%; max-width: 620px; justify-self: center; }
}
@media (max-width: 700px) {
  .local-sides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .local-answers { grid-template-columns: 1fr; gap: 7px; }
  .local-answers .answer { min-height: 55px; padding: 6px 25px; font-size: 1.35rem; }
  .local-answers .key { top: 5px; left: 5px; width: 20px; height: 20px; }
  .local-side { padding: 10px; }
  .local-side-head { display: grid; gap: 3px; min-height: 90px; }
  .local-side-head h2 { font-size: 1.05rem; }
  .side-points { justify-self: start; font-size: .85rem; }
  .local-toolbar { flex-wrap: wrap; padding: 15px; }
  .local-toolbar .mission-badge { margin-left: auto; }
}
@media (max-width: 600px) {
  .profile-card { min-height: 84px; padding: 11px; }
  .profile-avatar { width: 51px; height: 51px; font-size: 1.6rem; }
  .local-question { min-height: 155px; }
}

/* Keep the full desktop experience visible in shorter browser windows. */
@media (min-width: 901px) and (max-height: 1100px) {
  .app { margin-top: 14px; margin-bottom: 20px; }
  .home-header { height: 66px; }
  .home-grid { gap: 26px; padding: 22px 34px 17px; }
  .intro h1 { margin: 14px 0 11px; font-size: clamp(3.2rem, 4.4vw, 4.7rem); }
  .intro-copy { line-height: 1.35; }
  .feature-list { margin-top: 13px; }
  .art-wrap { height: 250px; }
  .island-art { height: 305px; }
  .select-panel { padding: 18px 20px; }
  .select-panel h2 { margin: 4px 0; font-size: 1.8rem; }
  .select-panel > p { margin-bottom: 12px; font-size: .88rem; }
  .age-list { gap: 7px; margin-bottom: 13px; }
  .age-card { min-height: 57px; padding: 5px 10px; }
  .age-icon { width: 39px; height: 39px; font-size: 1.5rem; }
  .select-panel > .primary-btn { min-height: 50px; padding: 8px 15px; }
  .extra-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
  .extra-modes .mode-button { min-height: 52px; gap: 7px; padding: 6px 8px; }
  .extra-modes .mode-button > span:last-child { display: none; }
  .extra-modes .mode-icon { width: 34px; height: 34px; font-size: 1.2rem; }
  .extra-modes .mode-button strong { font-size: .78rem; }
  .extra-modes .mode-button small { font-size: .64rem; line-height: 1.2; }
  .reset-note { margin-top: 10px; }
  .home-sidebar { gap: 11px; }
  .profile-card { min-height: 76px; padding: 9px 13px; }
  .profile-avatar { width: 48px; height: 48px; font-size: 1.6rem; }

  .game, .online-screen, .local-screen { gap: 12px; }
  .game-header, .online-header { min-height: 66px; padding-top: 10px; padding-bottom: 10px; }
  .play-panel { padding: 18px 22px 20px; }
  .mission { margin: 5px 0 11px; }
  .question-card { min-height: 172px; padding: 17px 12px; }
  .question-kicker { margin-bottom: 8px; }
  .question-subtitle { margin-top: 8px; }
  .hint-row { margin: 10px 0; }
  .answer { min-height: 60px; padding-top: 7px; padding-bottom: 7px; }
  .answers { gap: 9px; margin-bottom: 11px; }
  .experience { margin-top: 13px; }
  .stats-panel { padding: 17px; }
  .stats-intro { margin-bottom: 12px; }
  .level-card { min-height: 72px; padding: 9px; }
  .level-card .avatar-preview { width: 45px; height: 45px; }
  .stat-hero { margin: 11px 0; padding: 9px; }
  .stats-list { gap: 7px; }
  .stat { min-height: 61px; padding: 8px 10px; }
  .tip { margin-top: 11px; padding: 8px; }
}
@media (min-width: 901px) and (max-width: 1199px) and (max-height: 1100px) {
  .extra-modes { grid-template-columns: 1fr; }
}

/* Persistent hero profile */
.profile-card { padding: 0; }
.profile-open {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: 94px;
  gap: 14px;
  padding: 12px 6px 12px 14px;
  border: 0;
  border-radius: 15px;
  color: inherit;
  background: transparent;
  text-align: left;
}
.profile-open:hover { background: #ffffff17; }
.profile-open:focus-visible { outline-offset: -5px; }
.profile-info em { color: #9fe8d4; font-size: .7rem; font-style: normal; font-weight: 900; }
.profile-edit { margin-right: 13px; }
.profile-avatar, .avatar-preview {
  position: relative;
  display: block;
  flex: none;
  overflow: visible;
  background: var(--avatar-bg, #ffe9ad);
  transform: none;
}
.avatar-preview {
  width: 59px;
  height: 59px;
  border: 2px solid var(--navy);
  border-radius: 13px;
  box-shadow: inset -5px -5px #00000012, 3px 3px 0 #244561;
}
.avatar-explorer { --avatar-bg: #ffe9b1; --face: #f5bc8d; --hair: #5a3b67; --shirt: #57b9a8; }
.avatar-robot { --avatar-bg: #d5f3fc; --face: #b8dce7; --hair: #587fa2; --shirt: #9074d4; }
.avatar-dragon { --avatar-bg: #d4f5ce; --face: #74ce82; --hair: #327d67; --shirt: #4bb2a5; }
.avatar-astronaut { --avatar-bg: #dce8ff; --face: #e9c3a8; --hair: #e8f3ff; --shirt: #7598d3; }
.avatar-wizard { --avatar-bg: #ede0ff; --face: #c49a78; --hair: #604aa4; --shirt: #765bc4; }
.avatar-fox { --avatar-bg: #ffead5; --face: #f7ad60; --hair: #ba633e; --shirt: #72bdd2; }
.avatar-ninja { --avatar-bg: #e4d8ff; --face: #d9aa81; --hair: #344061; --shirt: #6855ad; }
.avatar-captain { --avatar-bg: #d8f4ff; --face: #bd795d; --hair: #263e6d; --shirt: #eb7469; }
.avatar-scientist { --avatar-bg: #e1fbf1; --face: #a86a4e; --hair: #3d3a51; --shirt: #f1f8ff; }
.avatar-inventor { --avatar-bg: #fff0d0; --face: #e3a47d; --hair: #a95853; --shirt: #57abb0; }
.avatar-knight { --avatar-bg: #dce9ff; --face: #e3bb99; --hair: #8095ad; --shirt: #5477a4; }
.avatar-artist { --avatar-bg: #ffe2f0; --face: #9e6048; --hair: #743d76; --shirt: #f1ac4c; }
.avatar-cat { --avatar-bg: #ffe6ed; --face: #f4b5bb; --hair: #cc798d; --shirt: #aa77c8; }
.avatar-owl { --avatar-bg: #f6e7cc; --face: #d4a56c; --hair: #8f634c; --shirt: #7db3aa; }
.avatar-panda { --avatar-bg: #e4f2f4; --face: #f8fbf6; --hair: #343d4f; --shirt: #91c3a5; }
.avatar-lion { --avatar-bg: #fff0bd; --face: #e9b568; --hair: #bd713a; --shirt: #6db4a2; }
.avatar-unicorn { --avatar-bg: #f3e4ff; --face: #faf3f2; --hair: #bd8ce2; --shirt: #72c7d3; }
.avatar-penguin { --avatar-bg: #dcefff; --face: #f7f9f2; --hair: #303c58; --shirt: #5d80b1; }
.avatar-piggy { --avatar-bg: #ffe4f0; --face: #ffb6d0; --hair: #f28cb3; --shirt: #ff7aa8; }
.avatar-sponge { --avatar-bg: #cfe9ff; --face: #ffe14d; --hair: #e6c02a; --shirt: #f4f1e4; }
.avatar-mouse { --avatar-bg: #e7e9f5; --face: #f7f4ee; --hair: #33333f; --shirt: #e04b4b; }
.avatar-blocky { --avatar-bg: #dfe4ea; --face: #f2c94c; --hair: #4a4f57; --shirt: #4a7dcf; }
.avatar-cubeminer { --avatar-bg: #cdb89a; --face: #e2a982; --hair: #3a2a1c; --shirt: #3a8cc0; }
.avatar-spiky { --avatar-bg: #ffdfc2; --face: #f0b98c; --hair: #25252b; --shirt: #f28a2e; }
.avatar-plumber { --avatar-bg: #ffe9d6; --face: #f3c39b; --hair: #4a2c1a; --shirt: #2f6fd0; }
.avatar-ghost { --avatar-bg: #1d2a6b; --face: #e2585d; --hair: #e2585d; --shirt: #e2585d; }
.avatar-creeper { --avatar-bg: #8fd47a; --face: #7ac665; --hair: #4f9a3f; --shirt: #5aa84a; }
.avatar-skydiver { --avatar-bg: #bfe3ff; --face: #e8b48c; --hair: #3a4a63; --shirt: #7b4bd6; }
.avatar-princess { --avatar-bg: #ffe6f4; --face: #f6cfb4; --hair: #f2c14e; --shirt: #f7a8d4; }
.avatar-pirate { --avatar-bg: #ffe8c8; --face: #e0a97e; --hair: #2b2b33; --shirt: #c0392b; }
.avatar-turtle { --avatar-bg: #d8f2c8; --face: #8fd06a; --hair: #4f9140; --shirt: #e07b3a; }
.avatar-racer { --avatar-bg: #ffe2c9; --face: #eab48c; --hair: #20304a; --shirt: #e8443a; }
.avatar-ranger { --avatar-bg: #dbe8ff; --face: #e9c3a8; --hair: #5a6b8c; --shirt: #eef3ff; }
.avatar-youngwizard { --avatar-bg: #e6ddf7; --face: #e8b994; --hair: #2c2c33; --shirt: #8b5e3c; }
.avatar-hero { --avatar-bg: #ffe0dd; --face: #f0b48c; --hair: #25314f; --shirt: #2f6fd0; }
.avatar-legend { --avatar-bg: #fff2c4; --face: #e8b994; --hair: #f4d35e; --shirt: #b8860b; }
.avatar-body, .avatar-hair, .avatar-face, .avatar-eyes, .avatar-mouth, .avatar-accessory { position: absolute; display: block; }
.avatar-body { z-index: 1; left: 15%; bottom: 3%; width: 70%; height: 28%; border: 2px solid var(--navy); border-radius: 7px 7px 3px 3px; background: var(--shirt); box-shadow: inset -5px -4px #0000001c; }
.avatar-face { z-index: 2; left: 23%; top: 24%; width: 54%; height: 47%; border: 2px solid var(--navy); border-radius: 6px; background: var(--face); box-shadow: inset -4px -3px #00000018; }
.avatar-hair { z-index: 3; left: 20%; top: 15%; width: 60%; height: 22%; border: 2px solid var(--navy); border-radius: 6px 6px 2px 2px; background: var(--hair); }
.avatar-eyes { z-index: 4; left: 33%; top: 43%; width: 34%; height: 8%; }
.avatar-eyes::before, .avatar-eyes::after { content: ''; position: absolute; top: 0; width: 20%; height: 100%; border-radius: 2px; background: var(--navy); }
.avatar-eyes::before { left: 0; }.avatar-eyes::after { right: 0; }
.avatar-mouth { z-index: 4; left: 45%; top: 59%; width: 10%; height: 3%; border-radius: 2px; background: #9d5d68; }
.avatar-robot .avatar-mouth { background: #466e88; width: 20%; left: 40%; }
.avatar-dragon .avatar-hair { clip-path: polygon(0 100%, 12% 0, 32% 55%, 50% 0, 69% 55%, 88% 0, 100% 100%); height: 30%; top: 7%; }
.avatar-astronaut .avatar-hair { top: 12%; left: 14%; width: 72%; height: 62%; border-radius: 15px; z-index: 1; }
.avatar-astronaut .avatar-face { z-index: 2; }.avatar-astronaut .avatar-eyes { z-index: 3; }
.avatar-wizard .avatar-hair { top: 5%; left: 15%; width: 70%; height: 30%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.avatar-fox .avatar-hair { top: 7%; height: 29%; clip-path: polygon(0 100%, 2% 0, 37% 50%, 63% 50%, 98% 0, 100% 100%); }
.avatar-accessory { z-index: 5; }
.avatar-ninja .avatar-hair, .avatar-knight .avatar-hair, .avatar-penguin .avatar-hair { z-index: 1; left: 13%; top: 9%; width: 74%; height: 67%; border-radius: 14px; }
.avatar-ninja .avatar-accessory { left: 23%; top: 55%; width: 54%; height: 17%; border: 2px solid var(--navy); border-radius: 2px 2px 6px 6px; background: #344061; }
.avatar-captain .avatar-hair { top: 10%; left: 14%; width: 72%; height: 26%; border-radius: 6px 6px 2px 2px; }
.avatar-captain .avatar-accessory { top: 29%; left: 9%; width: 82%; height: 8%; border: 2px solid var(--navy); border-radius: 3px; background: #f5c55a; }
.avatar-scientist .avatar-hair { clip-path: polygon(0 100%, 7% 30%, 24% 48%, 32% 0, 50% 38%, 70% 4%, 80% 45%, 100% 27%, 100% 100%); top: 7%; height: 30%; }
.avatar-scientist .avatar-accessory { top: 39%; left: 26%; width: 48%; height: 16%; border: 3px solid #3e5770; border-radius: 8px; background: linear-gradient(90deg, #ffffff40 46%, #3e5770 46%, #3e5770 54%, #ffffff40 54%); }
.avatar-inventor .avatar-hair { top: 8%; height: 30%; border-radius: 50% 45% 20% 20%; }
.avatar-inventor .avatar-accessory { top: 29%; left: 21%; width: 58%; height: 12%; border: 3px solid #745467; border-radius: 8px; background: linear-gradient(90deg, #aee9f4 46%, #745467 46%, #745467 54%, #aee9f4 54%); }
.avatar-knight .avatar-hair { background: #8095ad; }
.avatar-knight .avatar-accessory { top: 31%; left: 17%; width: 66%; height: 11%; border: 2px solid #344a61; border-radius: 3px; background: #b3c5d6; }
.avatar-artist .avatar-hair { top: 6%; left: 11%; width: 74%; height: 27%; border-radius: 50% 55% 18% 18%; transform: rotate(-9deg); }
.avatar-artist .avatar-accessory { top: 58%; left: 66%; width: 9%; height: 9%; border-radius: 50%; background: #ec7794; }
.avatar-cat .avatar-hair, .avatar-fox .avatar-hair, .avatar-unicorn .avatar-hair { top: 5%; height: 35%; clip-path: polygon(0 100%, 3% 0, 38% 45%, 62% 45%, 97% 0, 100% 100%); }
.avatar-cat .avatar-accessory { top: 55%; left: 46%; width: 8%; height: 7%; border-radius: 50%; background: #9d5366; }
.avatar-cat .avatar-accessory::before, .avatar-cat .avatar-accessory::after { content: ''; position: absolute; top: 30%; width: 150%; height: 2px; background: #9d5366; }
.avatar-cat .avatar-accessory::before { right: 125%; transform: rotate(13deg); }.avatar-cat .avatar-accessory::after { left: 125%; transform: rotate(-13deg); }
.avatar-owl .avatar-hair { top: 5%; height: 33%; clip-path: polygon(0 80%, 0 0, 28% 44%, 50% 15%, 72% 44%, 100% 0, 100% 80%); }
.avatar-owl .avatar-face { border-radius: 44% 44% 36% 36%; }
.avatar-owl .avatar-accessory, .avatar-penguin .avatar-accessory { top: 53%; left: 43%; width: 14%; height: 15%; clip-path: polygon(50% 100%, 0 0, 100% 0); background: #ef9b46; }
.avatar-panda .avatar-hair { z-index: 1; left: 13%; top: 8%; width: 74%; height: 65%; border-radius: 45% 45% 38% 38%; }
.avatar-panda .avatar-hair::before, .avatar-panda .avatar-hair::after, .avatar-lion .avatar-hair::before, .avatar-lion .avatar-hair::after { content: ''; position: absolute; top: -5%; width: 29%; height: 32%; border-radius: 50%; background: var(--hair); }
.avatar-panda .avatar-hair::before, .avatar-lion .avatar-hair::before { left: -5%; }.avatar-panda .avatar-hair::after, .avatar-lion .avatar-hair::after { right: -5%; }
.avatar-panda .avatar-eyes::before, .avatar-panda .avatar-eyes::after { top: -35%; width: 34%; height: 170%; border-radius: 45%; }
.avatar-panda .avatar-accessory { top: 57%; left: 44%; width: 12%; height: 8%; border-radius: 50%; background: #343d4f; }
.avatar-lion .avatar-hair { z-index: 1; left: 11%; top: 8%; width: 78%; height: 67%; border-radius: 44%; }
.avatar-lion .avatar-face { border-radius: 38% 38% 40% 40%; }
.avatar-lion .avatar-accessory { top: 56%; left: 45%; width: 10%; height: 8%; border-radius: 45%; background: #754a3e; }
.avatar-unicorn .avatar-hair { background: linear-gradient(90deg, #f0a4c9, #a6a0e5); }
.avatar-unicorn .avatar-accessory { top: 0; left: 42%; width: 16%; height: 27%; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: #f3c45c; }
.avatar-penguin .avatar-hair { border-radius: 48% 48% 20% 20%; }
.avatar-penguin .avatar-face { border-radius: 44% 44% 38% 38%; }
.avatar-piggy .avatar-face { border-radius: 50%; }
.avatar-piggy .avatar-hair { top: 6%; height: 24%; border-radius: 50% 50% 0 0; }
.avatar-piggy .avatar-hair::before, .avatar-piggy .avatar-hair::after { content: ''; position: absolute; top: -40%; width: 34%; height: 78%; border: 2px solid var(--navy); border-radius: 50% 50% 12% 12%; background: var(--hair); }
.avatar-piggy .avatar-hair::before { left: 1%; }.avatar-piggy .avatar-hair::after { right: 1%; }
.avatar-piggy .avatar-accessory { top: 51%; left: 41%; width: 18%; height: 13%; border: 2px solid var(--navy); border-radius: 50%; background: #ff9cc4; }
.avatar-piggy .avatar-accessory::before, .avatar-piggy .avatar-accessory::after { content: ''; position: absolute; top: 26%; width: 14%; height: 46%; border-radius: 50%; background: #c76b91; }
.avatar-piggy .avatar-accessory::before { left: 26%; }.avatar-piggy .avatar-accessory::after { right: 26%; }
.avatar-sponge .avatar-face { border-radius: 7px; background: radial-gradient(circle at 32% 42%, #d9b21e 10%, transparent 11%), radial-gradient(circle at 68% 30%, #d9b21e 8%, transparent 9%), radial-gradient(circle at 62% 74%, #d9b21e 9%, transparent 10%), radial-gradient(circle at 34% 72%, #d9b21e 7%, transparent 8%), var(--face); }
.avatar-sponge .avatar-hair { top: 6%; height: 16%; border-radius: 6px 6px 0 0; }
.avatar-mouse .avatar-hair { z-index: 1; left: 12%; top: 6%; width: 76%; height: 66%; border-radius: 48% 48% 40% 40%; }
.avatar-mouse .avatar-hair::before, .avatar-mouse .avatar-hair::after { content: ''; position: absolute; top: -32%; width: 46%; height: 50%; border: 2px solid var(--navy); border-radius: 50%; background: var(--face); }
.avatar-mouse .avatar-hair::before { left: -12%; }.avatar-mouse .avatar-hair::after { right: -12%; }
.avatar-mouse .avatar-accessory { top: 61%; left: 45%; width: 11%; height: 6%; border-radius: 0 0 50% 50%; background: #e04b4b; }
.avatar-blocky .avatar-face { border-radius: 3px; }
.avatar-blocky .avatar-hair { top: 7%; height: 16%; border-radius: 3px; }
.avatar-blocky .avatar-accessory { top: 55%; left: 37%; width: 26%; height: 5%; border-radius: 2px; background: var(--navy); }
.avatar-cubeminer .avatar-face { border-radius: 4px; }
.avatar-cubeminer .avatar-hair { top: 8%; height: 20%; border-radius: 3px; }
.avatar-cubeminer .avatar-accessory { top: 30%; left: 62%; width: 13%; height: 13%; border: 2px solid var(--navy); background: #7fe6df; transform: rotate(45deg); }
.avatar-spiky .avatar-hair { top: 2%; height: 40%; clip-path: polygon(0 100%, 5% 34%, 18% 62%, 28% 4%, 44% 55%, 56% 0, 72% 56%, 86% 12%, 100% 100%); }
.avatar-plumber .avatar-hair { top: 8%; height: 19%; border-radius: 6px 6px 2px 2px; background: #e5432f; }
.avatar-plumber .avatar-hair::after { content: ''; position: absolute; left: 40%; bottom: -6px; width: 58%; height: 34%; border: 2px solid var(--navy); border-radius: 3px 6px 6px 3px; background: #e5432f; }
.avatar-plumber .avatar-accessory { top: 60%; left: 31%; width: 38%; height: 9%; border-radius: 50%; background: #4a2c1a; }
.avatar-ghost .avatar-body, .avatar-ghost .avatar-face, .avatar-ghost .avatar-mouth, .avatar-ghost .avatar-accessory { display: none; }
.avatar-ghost .avatar-hair { z-index: 2; left: 15%; top: 9%; width: 70%; height: 66%; background: var(--hair); clip-path: polygon(0 60%, 0 32%, 12% 10%, 32% 0, 68% 0, 88% 10%, 100% 32%, 100% 100%, 84% 84%, 68% 100%, 50% 82%, 32% 100%, 16% 84%, 0 100%); }
.avatar-ghost .avatar-eyes { z-index: 4; left: 32%; top: 30%; width: 36%; height: 14%; }
.avatar-ghost .avatar-eyes::before, .avatar-ghost .avatar-eyes::after { width: 30%; height: 100%; border-radius: 3px; background: #ffffff; }
.avatar-creeper .avatar-face { border-radius: 3px; }
.avatar-creeper .avatar-hair { top: 6%; height: 20%; border-radius: 2px; }
.avatar-creeper .avatar-eyes { left: 31%; top: 38%; width: 38%; height: 12%; }
.avatar-creeper .avatar-eyes::before, .avatar-creeper .avatar-eyes::after { width: 32%; height: 150%; border-radius: 2px; background: #16240f; }
.avatar-creeper .avatar-mouth { left: 37%; top: 53%; width: 26%; height: 22%; border-radius: 2px; background: #16240f; }
.avatar-skydiver .avatar-hair { top: 6%; height: 24%; border-radius: 50% 50% 22% 22%; }
.avatar-skydiver .avatar-accessory { top: 8%; left: 9%; width: 82%; height: 13%; border: 2px solid var(--navy); border-radius: 8px; background: linear-gradient(90deg, #ff5d8f, #ffd23f, #4bd6c4); }
.avatar-princess .avatar-hair { top: 7%; left: 9%; width: 82%; height: 46%; border-radius: 42% 42% 30% 30%; }
.avatar-princess .avatar-accessory { top: 0; left: 39%; width: 22%; height: 16%; clip-path: polygon(0 100%, 10% 30%, 30% 70%, 50% 10%, 70% 70%, 90% 30%, 100% 100%); background: #ffd761; }
.avatar-pirate .avatar-hair { top: 4%; left: 7%; width: 86%; height: 20%; border-radius: 50% 50% 0 0; background: #2b2b33; }
.avatar-pirate .avatar-hair::after { content: ''; position: absolute; left: -7%; bottom: -5px; width: 114%; height: 9px; border: 2px solid var(--navy); border-radius: 6px; background: #2b2b33; }
.avatar-pirate .avatar-accessory { top: 39%; left: 26%; width: 20%; height: 16%; border-radius: 3px 3px 40% 40%; background: #2b2b33; }
.avatar-turtle .avatar-hair { top: 8%; height: 19%; border-radius: 6px 6px 3px 3px; background: #e0532f; }
.avatar-turtle .avatar-accessory { top: 60%; left: 44%; width: 12%; height: 7%; border-radius: 50%; background: #3f7233; }
.avatar-racer .avatar-hair { top: 6%; left: 14%; width: 72%; height: 56%; border-radius: 16px 16px 8px 8px; background: #e8443a; }
.avatar-racer .avatar-accessory { top: 40%; left: 22%; width: 56%; height: 13%; border: 3px solid #20304a; border-radius: 8px; background: linear-gradient(90deg, #ffffff55 46%, #20304a 46%, #20304a 54%, #ffffff55 54%); }
.avatar-ranger .avatar-hair { top: 6%; left: 15%; width: 70%; height: 52%; border-radius: 15px; background: #5a6b8c; }
.avatar-ranger .avatar-accessory { top: 8%; left: 30%; width: 40%; height: 9%; border: 2px solid var(--navy); border-radius: 6px; background: #4bd6c4; }
.avatar-youngwizard .avatar-hair { top: 5%; left: 14%; width: 72%; height: 26%; border-radius: 42% 42% 22% 22%; }
.avatar-youngwizard .avatar-accessory { top: 38%; left: 22%; width: 56%; height: 16%; border: 3px solid #3e5770; border-radius: 10px; background: linear-gradient(90deg, #ffffff40 46%, #3e5770 46%, #3e5770 54%, #ffffff40 54%); }
.avatar-hero .avatar-hair { top: 6%; height: 21%; border-radius: 6px 6px 2px 2px; background: #25314f; }
.avatar-hero .avatar-accessory { top: 37%; left: 20%; width: 60%; height: 13%; border: 2px solid var(--navy); border-radius: 5px; background: #e8443a; }
.avatar-legend .avatar-hair { top: 3%; height: 24%; background: linear-gradient(90deg, #f7e08a, #e0a83a, #f7e08a); clip-path: polygon(0 100%, 5% 36%, 20% 62%, 32% 6%, 50% 56%, 68% 6%, 80% 62%, 95% 36%, 100% 100%); }
.avatar-legend .avatar-accessory { top: 0; left: 38%; width: 24%; height: 18%; clip-path: polygon(0 100%, 12% 30%, 32% 70%, 50% 0, 68% 70%, 88% 30%, 100% 100%); background: #ffd761; }
.avatar-crown { position: absolute; z-index: 6; top: -22%; left: 22%; color: #ffd761; font-size: 2.05rem; line-height: 1; text-shadow: 0 2px 0 #764926, 0 0 8px #ffeaa0; }
.avatar-preview .avatar-crown { font-size: 1.7rem; }

.profile-dialog { width: min(570px, calc(100% - 24px)); max-height: min(90vh, 900px); max-height: min(90dvh, 900px); overflow-y: auto; }
.avatar-fieldset { margin: 9px 0 2px; padding: 0; border: 0; }
.avatar-fieldset legend { margin-bottom: 9px; font-size: .8rem; font-weight: 900; }
.avatar-choices { display: grid; gap: 15px; }
.avatar-group h3 { margin: 0 0 8px; color: #42677b; font-size: .78rem; }
.avatar-choices-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.avatar-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 112px; padding: 11px 6px 8px; border: 2px solid #d3e2e8; border-radius: 12px; background: #f7fbfc; color: #25445f; cursor: pointer; font-size: .75rem; font-weight: 900; text-align: center; }
.avatar-choice:hover { border-color: #9d84db; transform: translateY(-2px); }
.avatar-choice:has(input:checked) { border-color: #7753ca; background: #f1eaff; box-shadow: 0 3px 0 #cdbaf2; }
.avatar-choice input { position: absolute; top: 7px; right: 7px; width: 16px; height: 16px; margin: 0; accent-color: #7753ca; }
.avatar-choice input:checked + .avatar-preview { outline: 3px solid #7753ca; outline-offset: 2px; }
.avatar-choice input:focus-visible { outline: 3px solid #ffad43; outline-offset: 3px; }
.avatar-choice.exclusive { background: linear-gradient(#fffdf5, #fff6dd); }
.avatar-choice.locked { color: #93a4ad; cursor: not-allowed; background: #f1f3f4; filter: grayscale(.4); }
.avatar-choice.locked:hover { border-color: #d3e2e8; transform: none; }
.avatar-choice.locked .avatar-preview { opacity: .45; }
.avatar-choice input:disabled { display: none; }
.avatar-requirement { color: #6d7f89; font-size: .62rem; font-weight: 800; line-height: 1.2; }
.avatar-choice.locked .avatar-requirement { color: #b07a3a; }
.avatar-lock { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #2a3b4d; color: #fff; font-size: .78rem; box-shadow: 0 2px 0 #14202b; }

.profile-details { width: min(740px, calc(100% - 24px)); max-height: min(90vh, 930px); max-height: min(90dvh, 930px); overflow-y: auto; padding: 28px; background: #f8fffd; }
.detail-close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border: 1px solid #b7cbd1; border-radius: 10px; background: white; color: var(--navy); font-size: 1.6rem; font-weight: 900; }
.detail-hero { display: flex; align-items: center; gap: 22px; padding: 16px 50px 20px 0; }
.detail-avatar { width: 105px; height: 105px; border-radius: 19px; }
.detail-avatar .avatar-crown { font-size: 2.8rem; }
.detail-hero h2 { margin: 4px 0 6px; overflow-wrap: anywhere; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.detail-hero p { margin: 8px 0 0; font-size: .87rem; }
.detail-level { display: inline-block; padding: 5px 10px; border-radius: 8px; background: #e7dcff; color: #5d3caa; font-size: .78rem; }
.detail-section { margin-top: 16px; padding: 17px; border: 1px solid #d3e5e8; border-radius: 14px; background: white; }
.detail-section h3 { margin: 0 0 12px; font-size: 1.05rem; letter-spacing: -.02em; }
.detail-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.detail-section-head h3 { margin: 0 0 10px; }
.detail-section-head strong { color: #6d4cbd; font-size: .85rem; }
.detail-progress, .goal-track { display: block; overflow: hidden; border-radius: 30px; background: #e8e1f5; }
.detail-progress { height: 16px; border: 2px solid #5b458a; }
.detail-progress > span, .goal-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7961d3, #b189ef); transition: width .3s; }
.detail-next { margin: 9px 0 0; font-size: .8rem; }
.detail-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.detail-stats > div { display: grid; gap: 3px; padding: 12px 8px; border: 1px solid #e8dba9; border-radius: 11px; background: #fff9e7; text-align: center; }
.detail-stats strong { color: #6042a2; font-size: 1.45rem; }
.detail-stats span { color: #657a88; font-size: .68rem; font-weight: 900; }
.detail-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-badge { display: flex; align-items: center; gap: 9px; min-height: 61px; padding: 8px; border: 1px solid #d8e0e4; border-radius: 10px; background: #f5f7f8; color: #778a96; }
.detail-badge.unlocked { border-color: #bcdab9; background: #eefaeb; color: #284f4d; }
.badge-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: #e2e8eb; font-size: 1.25rem; }
.unlocked .badge-icon { background: #bce8b4; color: #376c46; }
.detail-badge strong, .detail-badge small { display: block; }
.detail-badge strong { font-size: .77rem; }.detail-badge small { margin-top: 2px; font-size: .65rem; line-height: 1.25; }
.crown-section { border-color: #edd8a2; background: #fffaf0; }
.crown-section h3 { color: #8f6122; }
.crown-section > p { margin: 0 0 14px; font-size: .8rem; }
.crown-goals { display: grid; gap: 9px; }
.crown-goal > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: #485d68; font-size: .73rem; font-weight: 800; }
.crown-goal strong { color: #765092; }
.goal-track { height: 7px; background: #e9dfca; }.goal-track > span { background: linear-gradient(90deg, #f0aa50, #ffd766); }
.detail-edit { width: 100%; min-height: 44px; margin-top: 16px; border: 1px solid #ae9ad8; border-radius: 9px; background: #eee7ff; color: #593a9b; font-weight: 900; }
.detail-edit:hover { background: #e4d8ff; }

@media (max-width: 600px) {
  .profile-open { min-height: 84px; gap: 10px; padding: 9px; }
  .profile-edit { margin-right: 8px; }
  .profile-info em { font-size: .62rem; }
  .profile-dialog, .profile-details { padding: 18px; }
  .avatar-choice { min-height: 96px; padding: 8px 3px; font-size: .67rem; }
  .avatar-preview { width: 47px; height: 47px; }
  .detail-hero { gap: 15px; padding-right: 25px; }
  .detail-avatar { width: 76px; height: 76px; }
  .detail-hero p { font-size: .74rem; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-badges { grid-template-columns: 1fr; }
}

/* Optional question clock */
.timer-choice { display: flex; align-items: center; gap: 10px; min-height: 55px; margin: -4px 0 14px; padding: 8px 12px; border: 1px solid #bfdadf; border-radius: 11px; background: #effaf8; cursor: pointer; }
.timer-choice input { flex: none; width: 19px; height: 19px; margin: 0; accent-color: #7255c2; }
.timer-choice > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.timer-choice strong { color: #234b61; font-size: .84rem; }
.timer-choice small { color: #5f7885; font-size: .69rem; line-height: 1.25; }
.timer-choice-icon { color: #7653c6; font-size: 1.35rem; }
.time-control { white-space: nowrap; }
.time-control[aria-pressed="false"] { opacity: 1; background: #365267; }
.mission-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 8px; }
.game-clock { min-width: 57px; padding: 7px 9px; border: 1px solid #d4b486; border-radius: 9px; background: #fff2d9; color: #714716; font-size: .83rem; font-weight: 900; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.game-clock.urgent {
  border-color: #e2a5a1;
  background: #fff0ef;
  color: #aa3b37;
  transform-origin: center;
  animation: clock-heartbeat 1.2s ease-in-out infinite;
}
@keyframes clock-heartbeat {
  0%, 36%, 70%, 100% {
    transform: scale(1);
    border-color: #e2a5a1;
    background: #fff0ef;
    color: #aa3b37;
    box-shadow: 0 0 0 0 rgb(198 40 54 / 0%);
  }
  18%, 53% {
    transform: scale(1.12);
    border-color: #8d1e2b;
    background: #c62836;
    color: #fff;
    box-shadow: 0 0 0 5px rgb(198 40 54 / 18%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-clock.urgent {
    animation: none;
    border-color: #8d1e2b;
    background: #c62836;
    color: #fff;
  }
}
@media (max-width: 600px) {
  .time-control { min-height: 36px; padding: 5px 8px; font-size: .7rem; }
  .header-middle { flex-wrap: wrap; justify-content: center; }
  .mission-meta { max-width: 57%; }
  .game-clock, .mission-badge { font-size: .7rem; }
}
@media (min-width: 1200px) and (max-height: 1000px) {
  .app { margin-top: 4px; margin-bottom: 4px; }
  .home-grid { padding-top: 6px; padding-bottom: 4px; }
  .home-sidebar { gap: 7px; }
  .select-panel { padding-top: 8px; padding-bottom: 8px; }
  .select-heading, .reset-note { display: none; }
  .select-panel > p { margin-bottom: 4px; }
  .age-list { gap: 5px; margin-bottom: 5px; }
  .age-card { min-height: 52px; }
  .timer-choice { min-height: 48px; margin-bottom: 10px; }
  .extra-modes .mode-button { min-height: 46px; }
  .profile-open { min-height: 77px; padding-top: 8px; padding-bottom: 8px; }
  .home-footer { gap: 3px 10px; padding-top: 3px; padding-bottom: 3px; }
}
/* Aviso flotante si el navegador bloquea el inicio automático del audio. */
.sound-notice {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 470px);
  padding: 11px 18px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--paper);
  color: var(--navy);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 10px 26px rgb(16 40 63 / 22%);
  transform: translateX(-50%);
  animation: sound-notice-in .35s ease both;
}
.sound-notice[hidden] { display: none; }
.sound-notice:hover { transform: translateX(-50%) translateY(-2px); }
.sound-notice b { font-weight: 900; }
.sound-notice-icon { font-size: 1.15rem; }
@keyframes sound-notice-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 520px) {
  .sound-notice { bottom: 12px; padding: 9px 14px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sound-notice, .sound-notice:hover { animation: none; transform: translateX(-50%); }
}
