/* Talstien: soft, tactile number practice. Loaded only for the sequence game. */
.playground.sequence-game {
  --sequence-ink: #0c4c5d;
  --sequence-muted: #58757a;
  --sequence-teal: #4eaaa1;
  --sequence-teal-deep: #327f7b;
  --sequence-coral: #e88978;
  --sequence-yellow: #f3cf72;
  --sequence-lilac: #d9d2f1;
  --sequence-sky: #d7edf0;
  --sequence-paper: #f7f5e9;
  color: var(--sequence-ink);
}

.playground.sequence-game {
  --sequence-gutter: clamp(12px, 3.5vw, 24px);
  box-sizing: border-box;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(8px, 1.4vh, 14px) var(--sequence-gutter)
    calc(12px + env(safe-area-inset-bottom, 0px));
}

.playground.sequence-game *,
.playground.sequence-game *::before,
.playground.sequence-game *::after {
  box-sizing: border-box;
}

.playground.sequence-game .number-path {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(44px, 1fr);
  gap: clamp(6px, 1.5vw, 12px);
  align-content: start;
  width: min(100%, 620px);
  margin: 0 auto;
}

.playground.sequence-game .game-body {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, .9vh, 9px);
}

.playground.sequence-game .game-body > .number-path {
  flex: 0 0 auto;
  align-content: start;
}

.playground.sequence-game .sequence-replay-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto clamp(5px, .9vh, 9px);
}

.playground.sequence-game .sequence-replay {
  display: grid;
  width: clamp(64px, 15vw, 76px);
  height: clamp(64px, 15vw, 76px);
  min-width: 64px;
  min-height: 64px;
  place-items: center;
  border: 3px solid #a9d5ca;
  border-radius: 50%;
  background: #e1f2e8;
  color: var(--sequence-teal-deep);
  box-shadow: 0 4px 0 #c2dfd0, 0 0 0 5px #eaf3e8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.playground.sequence-game .sequence-replay:hover {
  background: #d6ede0;
  transform: translateY(-2px);
}

.playground.sequence-game .sequence-replay:active {
  box-shadow: 0 1px 0 #c2dfd0, 0 0 0 5px #eaf3e8;
  transform: translateY(2px);
}

.playground.sequence-game .sequence-replay:focus-visible {
  outline: 3px solid #dba854;
  outline-offset: 4px;
}

.playground.sequence-game .sequence-progress-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 4px 6px;
  width: min(100%, 360px);
  max-height: 42px;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.playground.sequence-game .sequence-progress-tokens > li {
  flex: 0 0 auto;
  display: grid;
  width: 27px;
  height: 19px;
  place-items: center;
  border: 1px solid #b5d9c9;
  border-radius: 999px;
  background: #e5f2e6;
  color: #397e70;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}

.playground.sequence-game .number-stone {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1px;
  min-width: 44px;
  min-height: 44px;
  height: clamp(58px, 8.4vh, 76px);
  padding: 4px 3px;
  overflow: visible;
  border: 2px solid #d8e5dc;
  border-radius: clamp(13px, 2vw, 19px);
  background: var(--sequence-paper);
  color: var(--sequence-ink);
  box-shadow: 0 4px 0 #c9d8cf;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.playground.sequence-game .number-stone:nth-child(6n + 1) {
  background: #bff4ce;
}

.playground.sequence-game .number-stone:nth-child(6n + 2) {
  background: #fff0a6;
}

.playground.sequence-game .number-stone:nth-child(6n + 3) {
  background: #beebff;
}

.playground.sequence-game .number-stone:nth-child(6n + 4) {
  background: #ffd5e5;
}

.playground.sequence-game .number-stone:nth-child(6n + 5) {
  background: #ded5ff;
}

.playground.sequence-game .number-stone:nth-child(6n) {
  background: #ffe1b8;
}

.playground.sequence-game .number-stone strong {
  color: inherit;
  font-size: clamp(1.55rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: .98;
  font-variant-numeric: tabular-nums;
}

.playground.sequence-game .number-stone small {
  color: #4c6c70;
  font-size: clamp(.66rem, 1.55vw, .82rem);
  font-weight: 600;
  line-height: 1.15;
}

.playground.sequence-game .number-stone:not(:disabled):hover {
  border-color: #9fc9c2;
  transform: translateY(-2px);
}

.playground.sequence-game .number-stone:not(:disabled):active {
  box-shadow: 0 1px 0 #c9d8cf;
  transform: translateY(3px) scale(.98);
}

.playground.sequence-game .number-stone:focus-visible {
  outline: 3px solid #dba854;
  outline-offset: 3px;
}

.playground.sequence-game .number-stone:disabled {
  border-color: #d3e3d8;
  background: #e1eee4;
  color: #4c7971;
  box-shadow: 0 3px 0 #bfd4c8;
  cursor: default;
}

.playground.sequence-game .number-stone.sequence-just-correct {
  z-index: 1;
  border-color: #70b8a4;
  background: #dff2e3;
  box-shadow: 0 4px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 14px 2px #f1ce6c70;
  animation: sequence-correct-bounce 520ms cubic-bezier(.2,.8,.25,1.15) both;
}

.playground.sequence-game .number-stone.sequence-just-correct::before,
.playground.sequence-game .number-stone.sequence-just-correct::after {
  position: absolute;
  z-index: 2;
  content: "";
  pointer-events: none;
  background: #e5b94f;
  clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 37%);
  animation: sequence-sparkle 500ms ease-out both;
}

.playground.sequence-game .number-stone.sequence-just-correct::before {
  top: 8px;
  right: 9px;
  width: 11px;
  height: 11px;
}

.playground.sequence-game .number-stone.sequence-just-correct::after {
  bottom: 15px;
  left: 8px;
  width: 7px;
  height: 7px;
  background: #71b9ad;
  animation-delay: 60ms;
}

.playground.sequence-game .number-stone.sequence-just-wrong {
  border-color: #e5aa99;
  background: #f9e8df;
  animation: sequence-gentle-wiggle 330ms ease-in-out both;
}

.playground.sequence-game .number-stone.sequence-just-correct.sequence-pulse-b {
  animation-name: sequence-correct-bounce-alt;
}

.playground.sequence-game .number-stone.sequence-just-wrong.sequence-pulse-b {
  animation-name: sequence-gentle-wiggle-alt;
}

@keyframes sequence-correct-bounce {
  0% { transform: scale(1); box-shadow: 0 4px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 4px 1px #f1ce6c30; }
  38% { transform: translateY(-5px) scale(1.055); box-shadow: 0 5px 0 #96c9b2, 0 0 0 5px #bce8ca90, 0 0 17px 4px #f1ce6c80; }
  70% { transform: translateY(1px) scale(.99); box-shadow: 0 3px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 11px 2px #f1ce6c55; }
  100% { transform: scale(1); box-shadow: 0 4px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 14px 2px #f1ce6c70; }
}

@keyframes sequence-correct-bounce-alt {
  0% { transform: scale(1); box-shadow: 0 4px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 4px 1px #f1ce6c30; }
  38% { transform: translateY(-4px) scale(1.045); box-shadow: 0 5px 0 #96c9b2, 0 0 0 5px #bce8ca90, 0 0 17px 4px #f1ce6c80; }
  70% { transform: translateY(1px) scale(.99); box-shadow: 0 3px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 11px 2px #f1ce6c55; }
  100% { transform: scale(1); box-shadow: 0 4px 0 #96c9b2, 0 0 0 4px #bce8ca80, 0 0 14px 2px #f1ce6c70; }
}

@keyframes sequence-sparkle {
  0% { opacity: 0; transform: scale(.35) rotate(-25deg); }
  35% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(.72) rotate(18deg); }
}

@keyframes sequence-gentle-wiggle {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-2px); }
  65% { transform: translateX(2px); }
}

@keyframes sequence-gentle-wiggle-alt {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(2px); }
  65% { transform: translateX(-2px); }
}

.playground.sequence-game .sequence-progress-tokens > li.sequence-token-pop {
  animation: sequence-token-pop 360ms cubic-bezier(.2,.8,.25,1.2) both;
}

@keyframes sequence-token-pop {
  0% { transform: scale(1); }
  42% { transform: scale(1.18); }
  72% { transform: scale(.96); }
  100% { transform: scale(1); }
}

body.sequence-development-route .celebration {
  animation: sequence-finish-arrive 380ms ease-out both;
}

body.sequence-development-route .celebration .reward {
  animation: sequence-finish-bounce 520ms cubic-bezier(.2,.8,.25,1.15) both;
}

@keyframes sequence-finish-arrive {
  from { opacity: .72; transform: translateY(7px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sequence-finish-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-6px) scale(1.05); }
  72% { transform: translateY(1px) scale(.99); }
}

@media (max-width: 390px) {
  .playground.sequence-game .number-path {
    gap: 6px;
  }

  .playground.sequence-game .number-stone {
    height: clamp(55px, 7.6vh, 62px);
    border-radius: 13px;
  }
}

@media (max-width: 340px) {
  .playground.sequence-game .number-path {
    gap: 7px;
  }

  .playground.sequence-game .number-stone {
    height: 55px;
    padding: 4px 2px;
  }

  .playground.sequence-game .number-stone strong {
    font-size: 1.8rem;
  }

}

@media (min-width: 700px) {
  .playground.sequence-game .number-path {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-height: 760px) and (max-width: 699px) {
  .playground.sequence-game {
    padding-top: 5px;
  }

  .playground.sequence-game .question > span {
    margin-bottom: 1px;
    font-size: .74rem;
  }

  .playground.sequence-game .question h2 {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
  }

  .playground.sequence-game .sequence-replay-row {
    margin-bottom: 4px;
  }

  .playground.sequence-game .sequence-replay {
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
  }

  .playground.sequence-game .number-path {
    gap: 5px;
  }

  .playground.sequence-game .number-stone {
    height: 54px;
  }
}

body.sequence-development-route .sequence-sr-only,
body.sequence-development-route #toast[data-notice="missing-audio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.sequence-development-route #toast[data-notice="missing-audio"] {
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

/* This clipped notice must not trigger the shared toast spacing on any Talstien host. */
body.game-focus-route.sequence-development-route:has(#toast.visible[data-notice="missing-audio"]) #main {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .playground.sequence-game .number-stone {
    transition: none;
  }

  .playground.sequence-game .sequence-replay {
    transition: none;
  }

  .playground.sequence-game .number-stone.sequence-just-correct,
  .playground.sequence-game .number-stone.sequence-just-wrong,
  .playground.sequence-game .number-stone.sequence-just-correct::before,
  .playground.sequence-game .number-stone.sequence-just-correct::after,
  .playground.sequence-game .sequence-progress-tokens > li.sequence-token-pop,
  body.sequence-development-route .celebration,
  body.sequence-development-route .celebration .reward {
    animation: none;
  }
}

/* Compact, screen-filling Development layout for the 20-number round. */
body.game-focus-route #main .playground.sequence-game {
  height: calc(100dvh - 100px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  min-height: 410px;
  padding-top: clamp(7px, 1vh, 12px);
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

body.game-focus-route #main .playground.sequence-game > .game-body {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: flex-start;
  gap: clamp(5px, .9vh, 9px);
}

body.game-focus-route #main .playground.sequence-game .sequence-replay-row {
  flex: 0 0 auto;
  margin: 0;
}

body.game-focus-route #main .playground.sequence-game .sequence-progress-tokens {
  flex: 0 0 auto;
  width: min(100%, 320px);
  max-height: 44px;
  gap: 4px 2px;
}

body.game-focus-route #main .playground.sequence-game .sequence-progress-tokens > li {
  width: 20px;
  height: 20px;
}

body.game-focus-route #main .playground.sequence-game > .game-body > .number-path {
  flex: 1 1 0;
  min-height: 0;
  max-height: 500px;
  grid-template-rows: repeat(5, minmax(44px, 1fr));
  align-content: stretch;
  gap: clamp(5px, 1vw, 9px);
}

body.game-focus-route #main .playground.sequence-game .number-stone {
  height: 100%;
  min-height: 44px;
  max-height: 104px;
}

body.game-focus-route #main .playground.sequence-game .sequence-selected-check {
  position: absolute;
  top: 3px;
  right: 6px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: #f6fcf6;
  color: #327f67;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1;
}

@media (min-width: 700px) {
  body.game-focus-route #main .playground.sequence-game > .game-body > .number-path {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(44px, 1fr));
  }
}

@media (max-height: 760px) and (max-width: 390px) {
  body.game-focus-route #main .playground.sequence-game .number-stone {
    max-height: 82px;
  }
}

/* Development Talstien design package: keep all scenery and layout game-scoped. */
body.sequence-development-route {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  background-color: #b9eaf2;
  background-image: none;
  overflow-anchor: none;
}

html.sequence-development-route {
  overflow-anchor: none;
  scroll-behavior: auto;
}

body.sequence-development-route #app,
body.sequence-development-route .main-shell {
  overflow-anchor: none;
}

body.sequence-development-route::before,
body.sequence-development-route::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

body.sequence-development-route::before {
  z-index: -1;
  inset: -16px;
  background-image: url("/assets/talstien-background-gameplay.webp");
  background-position: center;
  background-size: cover;
  filter: blur(14px) saturate(.92);
  opacity: .48;
}

body.sequence-development-route::after {
  z-index: 0;
  background-image: url("/assets/talstien-background-gameplay.webp");
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: auto 140vh;
}

body.sequence-development-route.sequence-completion-route::before,
body.sequence-development-route.sequence-completion-route::after {
  background-image: url("/assets/talstien-background-completion.webp");
}

body.sequence-development-route #app,
body.sequence-development-route .main-shell {
  min-height: 100dvh;
}

body.sequence-development-route .main-shell {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: none;
  flex-direction: column;
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 40px);
}

body.sequence-development-route .top.game-focus-top {
  width: 100%;
  max-width: 1040px;
  height: clamp(62px, 8vh, 78px);
  height: var(--sequence-layout-header-height, clamp(62px, 8vh, 78px));
  min-height: 62px;
  flex: 0 0 auto;
  gap: 12px;
  margin: 0 auto;
}

body.sequence-development-route .top.game-focus-top .top-actions {
  gap: clamp(6px, 1.4vw, 12px);
  margin-left: auto;
}

body.sequence-development-route .game-overview-exit {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid #a7ded5;
  border-radius: 17px;
  background: #e7fff1ee;
  box-shadow: 0 3px 0 #78c9b64d;
  color: #0c5963;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

body.sequence-development-route .language-picker {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #b7ddec;
  border-radius: 16px;
  background: #f5fcffed;
  box-shadow: 0 3px 0 #78b9d44a;
}

body.sequence-development-route .language-picker > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body.sequence-development-route .language-picker select {
  max-width: 112px;
  border: 0;
  background: transparent;
  color: #0c4c5d;
  font-weight: 700;
}

body.sequence-development-route .sound-toggle {
  width: 48px;
  height: 48px;
  border-color: #b7ddec;
  background: #f5fcffed;
  box-shadow: 0 3px 0 #78b9d44a;
  color: #0c4c5d;
}

body.sequence-development-route #main {
  display: flex;
  width: 100%;
  max-width: 1040px;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  margin: 0 auto;
  overflow-anchor: none;
}

body.sequence-development-route #main > .game-head,
body.sequence-development-route footer {
  display: none;
}

body.sequence-development-route #main .playground.sequence-game {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100dvh - var(--sequence-layout-header-height, clamp(62px, 8vh, 78px)) - env(safe-area-inset-top, 0px));
  min-height: 410px;
  max-width: 900px;
  flex: 1 1 auto;
  flex-direction: column;
  margin: 0 auto;
  padding: 0 0 calc(8px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  overflow-anchor: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.sequence-development-route #main .playground.sequence-game .sequence-turtle {
  position: absolute;
  z-index: 0;
  bottom: 0;
  left: 0;
  width: clamp(80px, 26vw, 155px);
  max-height: 23%;
  object-fit: contain;
  object-position: bottom left;
  pointer-events: none;
}

body.sequence-development-route #main .playground.sequence-game > .game-body {
  z-index: 1;
  justify-content: flex-start;
  gap: var(--sequence-layout-body-gap, clamp(4px, .8vh, 8px));
  overflow-anchor: none;
}

body.sequence-development-route #main .playground.sequence-game .sequence-replay-row,
body.sequence-development-route #main .playground.sequence-game .sequence-progress-tokens {
  position: relative;
  z-index: 1;
}

body.sequence-development-route #main .playground.sequence-game .sequence-progress-tokens {
  flex: 0 0 44px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  overflow-anchor: none;
}

body.sequence-development-route #main .playground.sequence-game .number-path {
  overflow-anchor: none;
}

body.sequence-development-route #main .playground.sequence-game .sequence-replay {
  border: 3px solid #f5fdff;
  background: #f8fdffff;
  box-shadow: 0 4px 0 #86c9dc80, 0 0 0 5px #ffffff60;
  color: #08a873;
}

body.sequence-development-route #main .playground.sequence-game .sequence-replay svg {
  display: block;
  width: 36px;
  height: 36px;
}

body.sequence-development-route #main .playground.sequence-game .number-stone {
  border: 2px solid #9cd5e5;
  border-radius: clamp(14px, 2vw, 21px);
  color: #0c3f65;
  box-shadow: 0 4px 0 #5ca9c555, 0 5px 12px #174e631c;
  font-family: Fredoka, "Trebuchet MS", sans-serif;
}

body.sequence-development-route #main .playground.sequence-game .number-stone:nth-child(6n + 2) {
  border-color: #edcf67;
  box-shadow: 0 4px 0 #d7ad46a8, 0 5px 12px #795c2618;
}

body.sequence-development-route #main .playground.sequence-game .number-stone:nth-child(6n + 4) {
  border-color: #e3a4c2;
  box-shadow: 0 4px 0 #c985a6a8, 0 5px 12px #795c2618;
}

body.sequence-development-route #main .playground.sequence-game .number-stone:nth-child(6n + 6) {
  border-color: #e9b36d;
  box-shadow: 0 4px 0 #cf9655a8, 0 5px 12px #795c2618;
}

body.sequence-development-route #main .playground.sequence-game .number-stone:disabled {
  border-color: #7bc8a2;
  background: #bff4cee8;
  color: #0c624d;
  box-shadow: 0 4px 0 #56a98775, 0 5px 12px #174e6318;
}

body.sequence-development-route #main .playground.sequence-game .number-stone.sequence-just-correct {
  background: #bff4ce;
}

body.sequence-development-route.sequence-completion-route #main .sequence-completion {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100dvh - clamp(62px, 8vh, 78px) - env(safe-area-inset-top, 0px));
  min-height: 500px;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vh, 17px);
  margin: 0 auto;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

body.sequence-development-route .sequence-completion-hero {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(170px, 42vw, 270px);
  max-height: 30vh;
  flex: 0 0 auto;
  aspect-ratio: 1;
  place-items: center;
}

body.sequence-development-route .sequence-completion-star {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px #7c643433);
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .sequence-completion-star {
  animation: sequence-star-arrive 500ms cubic-bezier(.18,.8,.3,1.2) both;
}

body.sequence-development-route .sequence-celebration-star {
  position: absolute;
  z-index: 2;
  color: #ffd43b;
  font-size: clamp(15px, 4.8vw, 25px);
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 0 #ddaa25;
  transform: scale(.25) rotate(-18deg);
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .sequence-celebration-star {
  animation: sequence-star-pop 540ms cubic-bezier(.2,.8,.25,1.2) both;
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .star-two {
  animation-delay: 45ms;
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .star-three {
  animation-delay: 90ms;
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .star-four {
  animation-delay: 135ms;
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .star-five {
  animation-delay: 180ms;
}

body.sequence-development-route .sequence-completion.sequence-celebration-active .star-six {
  animation-delay: 225ms;
}

body.sequence-development-route .sequence-completion.sequence-celebration-static .sequence-celebration-star {
  opacity: 1;
  transform: scale(1) rotate(0);
}

body.sequence-development-route .sequence-celebration-star.star-one {
  top: 10%;
  left: 10%;
}

body.sequence-development-route .sequence-celebration-star.star-two {
  top: 1%;
  right: 14%;
}

body.sequence-development-route .sequence-celebration-star.star-three {
  top: 42%;
  right: 0;
}

body.sequence-development-route .sequence-celebration-star.star-four {
  right: 12%;
  bottom: 10%;
}

body.sequence-development-route .sequence-celebration-star.star-five {
  bottom: 0;
  left: 36%;
}

body.sequence-development-route .sequence-celebration-star.star-six {
  top: 44%;
  left: 0;
}

@keyframes sequence-star-pop {
  0% { opacity: 0; transform: scale(.25) rotate(-18deg); }
  52% { opacity: 1; transform: scale(1.18) rotate(8deg); }
  100% { opacity: 0; transform: scale(.82) rotate(0); }
}

body.sequence-development-route .sequence-completion-star {
  z-index: 1;
}

body.sequence-development-route .sequence-completion h1 {
  z-index: 1;
  padding: 5px 24px 9px;
  border: 2px solid #fff7da;
  border-radius: 999px;
  background: #fff9dff0;
  box-shadow: 0 4px 0 #e4c26470;
  color: #0c4c5d;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  line-height: 1.18;
}

body.sequence-development-route .sequence-completion-score {
  z-index: 1;
  display: flex;
  min-width: clamp(210px, 60vw, 310px);
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  border: 2px solid #fff9e8;
  border-radius: 999px;
  background: #fffdf2ef;
  box-shadow: 0 4px 0 #d7bd766e;
  color: #0c4c5d;
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: clamp(1.55rem, 5vw, 2rem);
  font-weight: 700;
}

body.sequence-development-route .sequence-completion-score > span {
  color: #f7b800;
  font-size: 1.35em;
  line-height: 1;
  text-shadow: 0 2px 0 #db8d00;
}

body.sequence-development-route .sequence-completion-actions {
  z-index: 1;
  display: flex;
  width: min(100%, 360px);
  flex-direction: column;
  gap: 12px;
}

body.sequence-development-route .sequence-completion-replay,
body.sequence-development-route .sequence-completion-games {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid #ffffffb8;
  border-radius: 999px;
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

body.sequence-development-route .sequence-completion-replay {
  background: #08af73;
  box-shadow: 0 5px 0 #087c60, 0 8px 13px #235f4a29;
  color: #fff;
}

body.sequence-development-route .sequence-completion-games {
  background: #e2f5ff;
  box-shadow: 0 4px 0 #9bcfe6, 0 7px 12px #235f4a1a;
  color: #0c4c5d;
}

body.sequence-development-route .sequence-completion-replay > span:first-child,
body.sequence-development-route .sequence-completion-games > span:first-child {
  font-family: system-ui, sans-serif;
  font-size: 1.2em;
}

body.sequence-development-route .sequence-completion-replay:active,
body.sequence-development-route .sequence-completion-games:active {
  transform: translateY(2px);
}

body.sequence-development-route .sequence-completion-chest {
  position: absolute;
  z-index: 0;
  right: clamp(4px, 6vw, 64px);
  bottom: 0;
  width: clamp(112px, 30vw, 190px);
  max-height: 22%;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  filter: drop-shadow(0 5px 7px #69401730);
}

@keyframes sequence-star-arrive {
  0% { opacity: 0; transform: translateY(12px) scale(.86) rotate(-5deg); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.035) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@media (min-width: 700px) {
  body.sequence-development-route::after {
    background-size: auto 100vh;
  }

  body.sequence-development-route #main .playground.sequence-game {
    padding-inline: clamp(10px, 3vw, 36px);
  }

  body.sequence-development-route #main .playground.sequence-game .sequence-turtle {
    left: clamp(8px, 3vw, 38px);
    width: clamp(95px, 15vw, 170px);
    max-height: 20%;
  }

  body.sequence-development-route .sequence-completion-chest {
    right: max(3%, calc((100% - 720px) / 2));
  }
}

@media (max-width: 390px) {
  body.sequence-development-route .main-shell {
    padding-inline: 10px;
  }

  body.sequence-development-route .game-overview-exit {
    min-height: 42px;
    gap: 5px;
    padding: 6px 10px;
    font-size: .9rem;
  }

  body.sequence-development-route .language-picker {
    min-height: 42px;
    padding-inline: 7px;
  }

  body.sequence-development-route .language-picker select {
    max-width: 84px;
    font-size: .9rem;
  }

  body.sequence-development-route .sound-toggle {
    width: 42px;
    height: 42px;
  }
}

@media (max-height: 760px) and (max-width: 390px) {
  body.sequence-development-route .sequence-completion-hero {
    width: clamp(145px, 40vw, 190px);
    max-height: 24vh;
  }

  body.sequence-development-route.sequence-completion-route #main .sequence-completion {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sequence-development-route .sequence-completion.sequence-celebration-active .sequence-completion-star,
  body.sequence-development-route .sequence-completion.sequence-celebration-active .sequence-celebration-star {
    animation: none;
  }

  body.sequence-development-route .sequence-completion.sequence-celebration-active .sequence-celebration-star,
  body.sequence-development-route .sequence-completion.sequence-celebration-static .sequence-celebration-star {
    opacity: 1;
    transform: none;
  }

  body.sequence-development-route .sequence-completion-replay,
  body.sequence-development-route .sequence-completion-games {
    transition: none;
  }
}
