/* The age buttons retain the application's original listeners and translated labels. */
.modal-box:has(.agegrid) {
  --age-side: clamp(190px, 28%, 300px);
  --age-gap: clamp(18px, 3vw, 38px);
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  width: min(980px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 28px);
  min-height: min(400px, 70dvh);
  overflow: auto;
  color: #111c4f;
  background: #fff;
  background-image: url('./age-robo.webp');
  background-size: var(--age-side) auto;
  background-repeat: no-repeat;
  background-position: left center;
  border: 3px solid white;
  border-radius: 26px;
  box-shadow: 0 20px 65px rgb(27 53 100 / 30%);
  padding: clamp(36px, 5vw, 62px) var(--age-gap) 26px calc(var(--age-side) + var(--age-gap));
  text-align: start;
}
.modal-box:has(.agegrid) .agebox > img { display: none; }
.modal-box:has(.agegrid) .agebox > h2 {
  margin: 0 38px 8px 0;
  color: #0a1644;
  text-align: start;
  font-size: clamp(1.65rem, 3.1vw, 2.75rem);
  line-height: 1.12;
  text-wrap: balance;
}
.modal-box:has(.agegrid) .agebox > p:not(.micnote) {
  margin: 0 0 clamp(18px, 3vw, 32px);
  max-width: 56ch;
  color: #34466f;
  text-align: start;
  line-height: 1.5;
}
.modal-box:has(.agegrid) .agegrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, .85vw, 13px);
  width: 100%;
  margin: 0;
  padding: 0;
}
.modal-box:has(.agegrid) .agegrid > .btn {
  --age-fill: #fff0cb;
  --age-edge: #d98c0b;
  display: grid;
  align-content: center;
  justify-content: center;
  gap: .28rem;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: clamp(84px, 9vw, 112px);
  margin: 0;
  padding: .5em .12em;
  color: #0c1948;
  background: linear-gradient(135deg, #fff 0%, var(--age-fill) 64%);
  border: 2px solid var(--age-edge);
  border-radius: 16px;
  box-shadow: 0 3px var(--age-edge), 0 6px 12px rgb(19 40 78 / 10%);
  font-family: inherit;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-shadow: none;
  cursor: pointer;
}
.modal-box:has(.agegrid) .agegrid > .btn::before {
  display: block;
  justify-self: center;
  width: .86em;
  height: .86em;
  background: var(--age-edge);
  clip-path: polygon(50% 0%, 62% 34%, 99% 36%, 70% 60%, 80% 99%, 50% 78%, 20% 99%, 30% 60%, 1% 36%, 38% 34%);
  content: '';
}
.modal-box:has(.agegrid) .agegrid > .btn:nth-child(2) { --age-fill: #dff4d3; --age-edge: #248840; }
.modal-box:has(.agegrid) .agegrid > .btn:nth-child(3) { --age-fill: #d5edff; --age-edge: #1376b8; }
.modal-box:has(.agegrid) .agegrid > .btn:nth-child(4) { --age-fill: #e8dcff; --age-edge: #7952c3; }
.modal-box:has(.agegrid) .agegrid > .btn:nth-child(5) { --age-fill: #f1ddff; --age-edge: #9246bd; }
.modal-box:has(.agegrid) .agegrid > .btn:focus-visible {
  outline: 3px solid #172b69;
  outline-offset: 3px;
}
.modal-box:has(.agegrid) .agegrid > .btn:active { transform: translateY(2px); }
.modal-box:has(.agegrid) .agebox > .micnote {
  margin: 22px 0 0;
  padding: .65em 1em;
  color: #253d71;
  background: #eaf3ff;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.45;
  text-align: center;
}
@media (max-width: 720px), (max-height: 495px) {
  .modal-box:has(.agegrid) {
    --age-side: clamp(84px, 20vw, 128px);
    min-height: 0;
    padding: 20px clamp(16px, 4vw, 28px) 22px;
    background-size: var(--age-side) auto;
    background-position: 0 0;
  }
  .modal-box:has(.agegrid) .agebox > h2,
  .modal-box:has(.agegrid) .agebox > p:not(.micnote) { margin-left: calc(var(--age-side) + 4px); }
  .modal-box:has(.agegrid) .agebox > p:not(.micnote) { margin-bottom: 16px; }
  .modal-box:has(.agegrid) .agegrid { position: relative; padding-top: 14px; background: white; }
  .modal-box:has(.agegrid) .agegrid > .btn { min-height: 70px; }
}
@media (max-width: 460px) {
  .modal-box:has(.agegrid) { width: calc(100vw - 16px); max-width: calc(100vw - 16px); border-radius: 20px; }
  .modal-box:has(.agegrid) .agegrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
  .modal-box:has(.agegrid) .agegrid > .btn { grid-column: span 2; min-height: 60px; }
  .modal-box:has(.agegrid) .agegrid > .btn:nth-child(4) { grid-column: 2 / span 2; }
  .modal-box:has(.agegrid) .agebox > .micnote { margin-top: 16px; }
}

.modal-box:has(.agegrid) .agebox { text-align: start; }
.modal-box:has(.agegrid) .agegrid > .btn::after { content: "years"; color: #18274c; font-size: .66em; font-weight: 700; }
:lang(de) .modal-box:has(.agegrid) .agegrid > .btn::after { content: "Jahre"; }
:lang(fr) .modal-box:has(.agegrid) .agegrid > .btn::after { content: "ans"; }
.modal-box:has(.agegrid) .modal-x { width: 44px; height: 44px; background: #edf4ff; color: #102963; }
/* Question layouts follow content height, including translated feedback and up to five choices. */
.modal-box:has(.world-round) {
  width: min(1100px, 100%); padding: 0; max-height: calc(100dvh - 20px);
  overflow: auto; background: #b8e9fd; border-radius: 26px;
}
.modal-box:has(.world-round) .modal-x {
  inset: 13px 14px auto auto; z-index: 4; width: 46px; height: 46px;
  background: #fff; color: #112653; border: 1px solid #bbdbec; box-shadow: 0 3px 8px #12406742;
}
.world-round {
  --round-space: clamp(12px, 2vw, 22px);
  color: #14214b; padding: 14px 0 clamp(18px, 3.3vw, 40px);
  background: #b7eafa url('./world-landscape.webp') center center / cover no-repeat;
  font-family: 'Fredoka', var(--head);
}
.world-round .wr-banner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 0 72px 0 clamp(14px, 8vw, 100px); margin-bottom: clamp(16px, 3vw, 35px);
}
.world-round .wr-sign {
  display: grid; justify-items: center; padding: 8px clamp(13px, 2.5vw, 32px) 10px;
  color: #382009; text-align: center; background: linear-gradient(171deg, #ffd68e, #e9a34e 67%, #cb8038);
  border: 3px solid #98511f; border-radius: 24px 18px 22px 16px;
  box-shadow: inset 0 2px #fff0b1, inset 0 -3px #b86b29, 0 5px 9px #45280d3d;
}
.world-round .wr-sign h2 {
  margin: 0; font: 700 clamp(1.55rem, 4.1vw, 3.45rem)/1.04 'Fredoka',var(--head);
  color: #fff8d8; text-shadow: 0 2px #3d2918, 2px 0 #3d2918, -2px 0 #3d2918, 0 -2px #3d2918, 0 4px #76451e;
}
.world-round .wr-sign p { margin: 6px 0 0; font-weight: 650; line-height: 1.12; }
.world-round .wr-score {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 5px 15px;
  background: white; border-radius: 30px; box-shadow: 0 3px 7px #1a49764d; font-size: 1.3rem;
}
.world-round .wr-progress {
  display: flex; align-items: center; gap: 14px; width: min(88%, 920px); margin: 0 auto 12px;
  padding: 10px clamp(10px, 2vw, 24px); background: #fff; border-radius: 24px;
  box-shadow: 0 2px 7px #254b663d; font-weight: 600; line-height: 1.12;
}
.world-round .wr-progress > span { flex: none; }
.world-round .wr-segments { display: flex; gap: 4px; flex: 1; min-width: 0; }
.world-round .wr-segments i { display: block; flex: 1; height: 10px; border-radius: 8px; background: #badbf3; }
.world-round .wr-segments .complete, .world-round .wr-segments .answered { background: #087e54; }
.world-round .wr-segments .current:not(.answered) { background: white; box-shadow: inset 0 0 0 2px #1467d3; }
.world-round .wr-board {
  width: min(76%, 820px); margin: 0 auto; padding: clamp(14px, 2vw, 28px); text-align: center;
  background: linear-gradient(155deg,#fff6da,#fffaf0 55%,#ffe7bb);
  border: clamp(5px, .85vw, 10px) solid #c99053; border-radius: clamp(18px, 2vw, 29px);
  box-shadow: inset 0 0 0 2px #fff1d5, 0 0 0 2px #84572b, 0 9px 18px #1245603b;
}
.world-round .wr-question { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 10px; }
.world-round .wr-question h3 { margin: 0; font: 650 clamp(1.1rem, 2.4vw, 1.95rem)/1.16 'Fredoka', var(--head); color: #152455; }
.world-round .wspk { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #0a51bd; background: #dceeff; box-shadow: 0 1px 6px #20426938; }
.world-round .wspk svg { width: 23px; height: 23px; fill: currentColor; }
.world-round .wr-visual { display: grid; place-items: center; margin: 8px auto 16px; }
.world-round .wr-visual img.flag, .world-round .wr-visual .lmimg { width: auto; max-width: 95%; height: clamp(108px, 20dvh, 175px); object-fit: contain; }
.world-round .wr-visual .lmimg { aspect-ratio: auto; border-radius: 12px; }
.world-round .wr-options { display: grid; grid-template-columns: repeat(var(--option-count), minmax(0, 1fr)); gap: 9px; }
.world-round .wr-options:has(>:nth-child(4)) { grid-template-columns: repeat(2,minmax(0,1fr)); }
.world-round .wr-options:has(>:nth-child(5)) { grid-template-columns: repeat(6,minmax(0,1fr)); }
.world-round .wr-options:has(>:nth-child(5)) > button { grid-column: span 2; }
.world-round .wr-options:has(>:nth-child(5)) > button:nth-child(4) { grid-column: 2 / span 2; }
.world-round .wr-option, .world-round .wr-continue {
  --button-top: #ee3374; --button-bottom: #a40f49;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px;
  min-height: 54px; border: 2px solid #fff; border-radius: 22px; padding: 9px 7px;
  color: #fff; background: linear-gradient(var(--button-top),var(--button-bottom)); box-shadow: inset 0 -3px #18233b33, 0 3px 6px #61452042;
  font: 650 clamp(1rem, 1.9vw, 1.45rem)/1.12 'Fredoka',var(--head); overflow-wrap: anywhere;
}
.world-round .wr-option:nth-child(2), .world-round .wr-continue { --button-top: #277bde; --button-bottom: #124da5; }
.world-round .wr-option:nth-child(3) { --button-top: #ffd24a; --button-bottom: #efa214; color: #392100; }
.world-round .wr-option:nth-child(4) { --button-top: #198553; --button-bottom: #086639; }
.world-round .wr-option:nth-child(5) { --button-top: #8755c2; --button-bottom: #60318f; }
.world-round .wr-option:disabled { opacity: 1; cursor: default; }
.world-round .wr-option.correct::after { content: '✓'; }
.world-round .wr-option.incorrect::after { content: '✗'; }
.world-round .wr-option.correct { outline: 3px solid #167442; outline-offset: 1px; }
.world-round .wr-option.incorrect { outline: 3px dashed #9c2644; outline-offset: 1px; }
.world-round .wr-option .flag.sm { width: 28px; max-height: 22px; object-fit: contain; }
.world-round .wr-fact:not(:empty) { margin: 14px 0 0; padding: 8px; font-weight: 600; }
.world-round .wr-fact.correct { color: #125e3d; }.world-round .wr-fact.incorrect { color: #802541; }
.world-round .wr-continue { margin: 6px auto 0; padding-inline: 22px; }
.world-round .wr-continue[hidden] { display: none; }
.world-round button:focus-visible, .world-round .wr-question h3:focus-visible { outline: 3px solid #10285b; outline-offset: 3px; }
.world-round .wr-map { padding: 0; margin: 6px auto; overflow: hidden; }
.world-round .wr-map svg { max-height: min(48dvh, 380px); }
@media (max-width: 700px) {
  .modal-box:has(.world-round) { border-radius: 17px; }
  .world-round { background-image: url('./world-landscape-small.webp'); padding-bottom: 18px; }
  .world-round .wr-banner { padding-left: 9px; padding-right: 64px; margin-bottom: 24px; }
  .world-round .wr-sign { border-radius: 17px; }
  .world-round .wr-board { width: 94%; }
  .world-round .wr-progress { width: 94%; gap: 7px; font-size: .9rem; }
  .world-round .wr-visual img.flag, .world-round .wr-visual .lmimg { height: clamp(95px,17dvh,145px); }
}
@media (max-width: 470px) {
  .world-round .wr-sign { padding: 7px 8px; }
  .world-round .wr-sign h2 { font-size: 1.5rem; }
  .world-round .wr-score { padding-inline: 8px; font-size: 1rem; }
  .world-round .wr-options, .world-round .wr-options:has(>:nth-child(4)), .world-round .wr-options:has(>:nth-child(5)) { grid-template-columns: 1fr; gap: 6px; }
  .world-round .wr-options:has(>:nth-child(5)) > button, .world-round .wr-options:has(>:nth-child(5)) > button:nth-child(4) { grid-column: auto; }
  .world-round .wr-option { min-height: 46px; border-radius: 15px; }
  .world-round .wr-segments { gap: 2px; }
}
