:root {
  font-family:
    ui-rounded,
    'Trebuchet MS',
    system-ui,
    -apple-system,
    sans-serif;
  color: #304b3e;
  background: #213f39;
  font-synthesis: none;
  --cream: #fff8e8;
  --ink: #304b3e;
  --pink: #f785aa;
  --gold: #f6c65c;
  --green: #3c7659;
}

/* Pig Run: the game view stays dominant; phone steering has its own touch area. */
.steering-options {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 9px 0 8px;
}
.steering-options button {
  border: 1px solid #c6ccb0;
  border-radius: 12px;
  background: #fff9e8;
  color: #435d49;
  padding: 9px 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
.steering-options button[aria-pressed='true'] {
  background: #3d624d;
  border-color: #3d624d;
  color: #fff7dd;
}
.steering-options span {
  grid-column: 1/-1;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  color: #536b54;
  min-height: 13px;
}
.sound-button {
  width: auto !important;
  padding: 0 11px;
  font-size: 12px !important;
}
.tilt-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 22px;
  margin: 0 24px 5px;
  color: #57715b;
  font-size: 8px;
  font-weight: 800;
}
.tilt-preview > div {
  position: relative;
  flex: 1;
  height: 5px;
  border-radius: 10px;
  background: #8db49255;
}
.tilt-preview i {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-style: normal;
}
.tilt-preview[data-status='waiting'] {
  opacity: 0.5;
}

.steering-bar {
  position: absolute;
  z-index: 12;
  left: 16%;
  right: 16%;
  bottom: max(22px, env(safe-area-inset-bottom));
  padding: 9px 13px 8px;
  border-radius: 20px;
  background: rgba(255, 250, 229, 0.9);
  box-shadow: 0 4px 20px #34492222;
  color: #426249;
  touch-action: none;
}
.steering-bar label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.steering-bar label span {
  font-size: 7px;
  opacity: 0.75;
}
.steering-bar input {
  display: block;
  width: 100%;
  height: 25px;
  margin: 5px 0 0;
  accent-color: #e887a8;
  touch-action: none;
  cursor: ew-resize;
}
.chase-meter {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  text-align: center;
  color: #fff9e5;
  text-shadow: 0 1px 3px #355747;
}
.chase-meter span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.chase-meter > div {
  height: 4px;
  margin: 5px 20px;
  border-radius: 4px;
  background: #fff7de70;
  overflow: hidden;
}
.chase-meter i {
  display: block;
  height: 100%;
  background: #ffc776;
  transition: width 0.15s;
}
@media (pointer: coarse) {
  .steering-options {
    display: grid;
  }
  .home-bottom .goal-card {
    display: none;
  }
  .home-progress {
    margin-top: 10px;
  }
}
@media (pointer: fine) {
  .steering-bar {
    display: none;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  background: radial-gradient(ellipse at 30% 20%, #629685, #294c43 65%);
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #f0a650;
  outline-offset: 4px;
}
button {
  border: 0;
}
button:active:not(:disabled) {
  transform: translateY(2px);
}
[hidden] {
  display: none !important;
}
#game-shell {
  position: relative;
  width: min(100%, 780px);
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #85c7d8;
  box-shadow: 0 0 90px #072b3955;
}
#scene {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 -90px 100px #203d4520;
}
.screen {
  position: absolute;
  inset: 0;
}
.home-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  background: linear-gradient(#eff8ed88, transparent 36%, transparent 49%, #f5f3d0eb 79%, #fff8e8);
}
.home-screen button,
.home-screen a {
  pointer-events: auto;
}
.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(15px, env(safe-area-inset-top)) 22px 0;
}
.universe-link {
  color: #345b4c;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.015em;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: #fff9e4d9;
  color: #375a47;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 3px 0 #68857540;
}
.title-group {
  text-align: center;
  margin-top: 12px;
}
.chapter,
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 900;
}
.chapter {
  color: #557662;
}
.title-group h1 {
  font-size: clamp(64px, 14vw, 104px);
  font-weight: 1000;
  letter-spacing: -0.075em;
  line-height: 0.99;
  margin: 10px 0 10px;
  color: #ecb44c;
  text-shadow:
    0 4px 0 #b9843c,
    0 8px 0 #ffffff9c,
    0 12px 22px #726e5233;
  transform: rotate(-3deg);
}
.title-group h1 > span:first-child {
  color: #f98aac;
  text-shadow:
    0 4px 0 #cd597d,
    0 8px 0 #ffffff9c,
    0 12px 22px #726e5233;
}
.title-dot {
  color: #db8751;
}
.title-group p {
  font-size: 15px;
  letter-spacing: 0.025em;
  font-weight: 700;
  margin: 0;
  color: #163e30;
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: #fff8dfeb;
}
.home-bottom {
  padding: 0 26px max(10px, env(safe-area-inset-bottom));
  text-align: center;
  margin-top: auto;
}
.world-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 13px;
  color: #58765b;
}
.world-tabs i {
  font-style: normal;
  color: #99a782;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 35px;
  background: linear-gradient(#ffcf68, #f1b649);
  color: #624922;
  min-height: 59px;
  border-radius: 19px;
  box-shadow:
    0 5px 0 #cc953a,
    0 8px 20px #796a3320;
  font-size: 18px;
  letter-spacing: 0.06em;
  font-weight: 1000;
  width: 100%;
  padding: 14px 22px;
}
.primary-button span {
  font-size: 25px;
  line-height: 1;
}
.primary-button:hover {
  filter: brightness(1.04);
}
.control-summary {
  font-size: 11px;
  line-height: 1.5;
  margin: 13px 0 13px;
  color: #677659;
}
.keyboard-copy {
  display: inline;
}
.touch-copy {
  display: none;
}
.home-buttons {
  display: flex;
  gap: 7px;
  justify-content: center;
}
.secondary-button {
  border: 1px solid #64764e25;
  background: #fff9ebd9;
  border-radius: 12px;
  color: #506947;
  min-height: 41px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 0 #74835b13;
}
.secondary-button:hover {
  background: #fffdf4;
}
.home-progress {
  display: flex;
  justify-content: center;
  gap: 25px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
  margin: 15px 0 10px;
  color: #82916b;
}
.goal-card {
  border-top: 1px solid #75845725;
  padding-top: 10px;
}
.goal-card .eyebrow {
  font-size: 8px;
  color: #8b9675;
}
.goal-card p {
  font-size: 12px;
  font-weight: 700;
  margin: 5px 0 3px;
}
.goal-card > span:last-child {
  font-size: 10px;
  color: #8b9675;
}
.cookie-note {
  font-size: 8px;
  line-height: 1.5;
  color: #8b9983;
  margin: 11px 0 0;
}
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: max(18px, env(safe-area-inset-top)) 20px 0;
  color: white;
  text-shadow: 0 2px 5px #244b4750;
}
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.score-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.score-block .eyebrow {
  font-size: 8px;
  letter-spacing: 0.2em;
}
.score-block strong {
  font-size: 37px;
  font-weight: 1000;
  letter-spacing: -0.04em;
  line-height: 1;
}
.score-block > span:last-child {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.hud-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hud .icon-button {
  pointer-events: auto;
  background: #fff9e9da;
  font-size: 18px;
  text-shadow: none;
}
.coin-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 13px;
  border-radius: 17px;
  background: #35574482;
  font-size: 14px;
}
.coin-pill > span {
  color: #f8d573;
  font-size: 23px;
  text-shadow: 0 1px 0 #c69135;
}
.journey {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  font-size: 8px;
  letter-spacing: 0.1em;
  font-weight: 900;
}
.journey-line {
  height: 3px;
  background: #ffffff50;
  flex: 1;
  max-width: 210px;
  border-radius: 5px;
  overflow: hidden;
}
.journey-line i {
  display: block;
  height: 100%;
  background: #fff3b0;
  width: 0;
  border-radius: 5px;
}

.modal-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c42365c;
  backdrop-filter: blur(8px);
  padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.panel {
  position: relative;
  width: 100%;
  max-width: 390px;
  padding: 29px 25px;
  border-radius: 27px;
  background: #fff9eaf5;
  box-shadow: 0 20px 70px #183c3640;
  text-align: center;
  max-height: 100%;
  overflow: auto;
}
.panel > .eyebrow {
  color: #8b9671;
  font-size: 8px;
}
.panel h2 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin: 11px 0;
  color: #395b47;
}
.panel > p {
  font-size: 12px;
  line-height: 1.6;
  color: #718168;
}
.panel > .primary-button {
  margin-top: 20px;
}
.panel .secondary-button {
  font-size: 12px;
}
.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0 13px;
}
.setting-button {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #ced7bb;
  background: #f2f3e4;
  color: #698063;
  padding: 12px;
  border-radius: 12px;
  font-size: 11px;
}
.setting-button b {
  font-size: 13px;
  color: #355f45;
}
.wide {
  width: 100%;
}
.text-button {
  display: inline-block;
  color: #678164;
  padding: 13px 9px 0;
  background: none;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.close-button {
  position: absolute;
  top: 11px;
  right: 13px;
  background: #e5e9d9;
  color: #6e8261;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: 22px;
}
.result-score {
  display: block;
  font-size: 65px;
  letter-spacing: -0.065em;
  color: #3f6a4c;
  line-height: 1.05;
  margin-top: 10px;
}
.result-panel > p {
  margin: 7px 0;
}
.result-stats {
  display: flex;
  justify-content: space-around;
  gap: 5px;
  margin: 21px 0 14px;
  padding: 14px 0;
  border-top: 1px solid #d4ddc5;
  border-bottom: 1px solid #d4ddc5;
}
.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.result-stats b {
  font-size: 17px;
  color: #47694b;
}
.result-stats span {
  font-size: 9px;
  color: #8d977d;
}
.result-goal {
  font-weight: 800 !important;
  color: #8d814c !important;
  font-size: 11px !important;
}
.submit-form {
  margin-top: 23px;
}
.submit-form label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  color: #6e8061;
}
.submit-form label small {
  float: right;
  font-size: 9px;
  font-weight: 400;
}
.submit-form > div {
  display: flex;
  gap: 9px;
  margin-top: 8px;
}
.submit-form input {
  min-width: 0;
  width: 110px;
  flex: 1;
  background: #fffef8;
  border: 1px solid #c6d3b8;
  border-radius: 12px;
  padding: 9px 14px;
  letter-spacing: 0.15em;
  font-weight: 900;
  text-transform: uppercase;
  color: #3f6049;
}
.submit-form button {
  flex: 1.3;
}
.status {
  font-size: 10px !important;
  line-height: 1.5 !important;
  min-height: 15px;
  overflow-wrap: anywhere;
}
.result-links {
  display: flex;
  justify-content: center;
  gap: 15px;
}
.score-list {
  padding: 0;
  list-style: none;
  margin: 20px 0;
}
.score-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid #d8dfc8;
}
.score-list .rank {
  color: #9ca780;
  font-size: 13px;
  width: 24px;
}
.score-list .tag {
  font-size: 15px;
  letter-spacing: 0.1em;
  font-weight: 900;
  color: #59734e;
}
.score-list .board-score {
  margin-left: auto;
  font-size: 18px;
  font-weight: 1000;
  color: #446349;
}
.score-list li:first-child .rank {
  font-size: 20px;
}
.score-list .empty {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  color: #829073;
}
.skins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}
.skin-card {
  border: 2px solid transparent;
  background: #edf0dd;
  border-radius: 17px;
  padding: 15px 9px;
  color: #486746;
}
.skin-card.selected {
  border-color: #b6c68b;
  background: #e6eccf;
}
.skin-swatch {
  display: block;
  width: 48px;
  height: 42px;
  border-radius: 43% 43% 47% 47%;
  margin: 0 auto 10px;
  background: var(--skin);
  box-shadow: inset -5px -5px 0 #0000000d;
  position: relative;
}
.skin-swatch:before,
.skin-swatch:after {
  content: '';
  position: absolute;
  top: -4px;
  width: 19px;
  height: 23px;
  background: var(--skin);
  border-radius: 50% 50% 30% 30%;
  transform: rotate(-35deg);
  left: -4px;
  box-shadow: inset -3px -2px 0 #0000000b;
}
.skin-swatch:after {
  left: auto;
  right: -4px;
  transform: rotate(35deg);
}
.skin-card b,
.skin-card small {
  display: block;
}
.skin-card small {
  font-size: 10px;
  margin-top: 5px;
  color: #879171;
}
.fine-print {
  font-size: 10px !important;
  line-height: 1.65 !important;
}
.instructions > div {
  display: flex;
  gap: 17px;
  align-items: center;
  text-align: left;
}
.instructions > div > b {
  display: grid;
  place-items: center;
  min-width: 45px;
  height: 45px;
  border: 1px solid #d0d9bf;
  border-radius: 13px;
  font-size: 23px;
  color: #6a8656;
}
.instructions p {
  font-size: 11px;
  line-height: 1.5;
  color: #7b8a6b;
}
.instructions strong {
  display: block;
  color: #4d6f4e;
  font-size: 13px;
}
.help-powers {
  background: #eff0df;
  border-radius: 15px;
  padding: 8px 14px;
  text-align: left;
}
.help-powers p {
  font-size: 11px;
  color: #69805c;
  line-height: 1.5;
}
.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #24422e22;
  color: #fff2cb;
  font-size: 110px;
  font-weight: 1000;
  text-shadow: 0 5px 0 #59805a;
  pointer-events: none;
}
.toast {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 87%;
  background: #fff6dce8;
  color: #5b744b;
  font-size: 12px;
  font-weight: 900;
  padding: 13px 20px;
  border-radius: 15px;
  box-shadow: 0 6px 20px #223d3520;
  text-align: center;
  pointer-events: none;
}
.loading {
  position: absolute;
  inset: 0;
  background: #ebf2d8;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.loading-pig {
  font-size: 66px;
  animation: hop 1s ease-in-out infinite;
}
.loading p {
  font-size: 12px;
  color: #7e9069;
  font-weight: 700;
}
.noscript {
  position: absolute;
  inset: 20%;
  z-index: 10;
}
.home-screen ~ .hud {
  z-index: 1;
}
@keyframes hop {
  50% {
    transform: translateY(-10px) rotate(-5deg);
  }
}
@media (pointer: coarse) {
  .touch-copy {
    display: inline;
  }
  .keyboard-copy {
    display: none;
  }
}
@media (min-width: 700px) {
  .home-bottom {
    max-width: 420px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 18px;
  }
  .title-group {
    margin-top: 20px;
  }
  .title-group h1 {
    font-size: 108px;
  }
  .title-group p {
    font-size: 17px;
  }
  .home-top {
    padding: 22px 30px 0;
  }
  .hud {
    padding: 23px 29px 0;
  }
  .score-block strong {
    font-size: 45px;
  }
  .journey {
    font-size: 10px;
  }
  .world-tabs {
    font-size: 9px;
  }
  .home-buttons .secondary-button {
    font-size: 12px;
  }
  .cookie-note {
    font-size: 9px;
  }
  .goal-card p {
    font-size: 13px;
  }
}
@media (max-height: 720px) {
  .title-group {
    margin-top: 0;
  }
  .title-group h1 {
    font-size: 62px;
    margin: 6px 0;
  }
  .title-group p {
    font-size: 12px;
  }
  .home-top {
    padding-top: 9px;
  }
  .home-bottom {
    padding-inline: 22px;
  }
  .world-tabs {
    margin-bottom: 9px;
  }
  .primary-button {
    min-height: 49px;
    font-size: 16px;
    border-radius: 15px;
  }
  .control-summary {
    font-size: 10px;
    margin: 10px 0;
  }
  .home-progress {
    margin: 10px 0 6px;
  }
  .goal-card {
    padding-top: 6px;
  }
  .goal-card p {
    font-size: 11px;
  }
  .cookie-note {
    font-size: 7px;
    margin-top: 6px;
  }
  .panel {
    padding: 22px;
  }
  .result-score {
    font-size: 48px;
  }
  .result-stats {
    margin: 13px 0;
    padding: 11px 0;
  }
  .result-panel > .primary-button {
    margin-top: 12px;
  }
  .submit-form {
    margin-top: 17px;
  }
  .home-buttons .secondary-button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .loading-pig {
    animation: none;
  }
}

/* Short windows keep the farm menu reachable; wide landscapes give the
   controls their own column without shrinking the actual running viewport. */
@media (max-height: 450px) {
  .home-screen {
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
    touch-action: pan-y;
  }
  .home-top,
  .title-group,
  .home-bottom {
    flex-shrink: 0;
  }
}
@media (max-height: 450px) and (min-width: 600px) {
  .home-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
    grid-template-rows: 54px 1fr;
    column-gap: 12px;
    background: linear-gradient(90deg, #eff8ed35, #fff8e8e8 75%);
  }
  .home-top {
    grid-column: 1/-1;
    grid-row: 1;
    padding: 6px 20px 0;
  }
  .title-group {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 12px 0 0 16px;
  }
  .title-group h1 {
    font-size: clamp(45px, 9vw, 77px);
    margin: 7px 0;
  }
  .title-group p {
    font-size: 12px;
  }
  .chapter {
    font-size: 8px;
  }
  .home-bottom {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 4px 18px max(8px, env(safe-area-inset-bottom)) 0;
  }
  .world-tabs {
    font-size: 7px;
    gap: 5px;
    margin-bottom: 6px;
  }
  .home-bottom .primary-button {
    min-height: 44px;
    padding: 10px 16px;
  }
  .control-summary {
    margin: 8px 0;
    font-size: 9px;
  }
  .home-progress {
    margin: 8px 0 5px;
  }
  .goal-card {
    padding-top: 5px;
  }
  .goal-card p {
    font-size: 10px;
  }
  .goal-card > span:last-child {
    font-size: 9px;
  }
  .cookie-note {
    font-size: 7px;
    line-height: 1.3;
    margin-top: 6px;
  }
}

/* Journey information stays compact so the approaching trail remains readable. */
.next-milestone {
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: #fff0c3;
}

.result-worlds {
  font-size: 12px !important;
  color: #658073 !important;
  margin: 12px 0 0 !important;
  font-weight: 700;
}
@media (max-height: 550px) {
  .next-milestone {
    font-size: 9px;
  }
}

/* The top band has a fixed footprint, even with every power active. */
.hud {
  padding-top: max(12px, env(safe-area-inset-top));
}
.journey {
  margin-top: 9px;
}
.next-milestone {
  margin-top: 4px;
}
.powers {
  display: flex;
  gap: 5px;
  height: 27px;
  margin-top: 5px;
  overflow: hidden;
}
.power-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 8px;
  background: #fff6dfef;
  color: #435b45;
  font-size: 10px;
  font-weight: 900;
  text-shadow: none;
  white-space: nowrap;
}
.power-tag b {
  font-size: 15px;
}
.run-notice {
  height: 32px;
  margin-top: 4px;
  max-width: 390px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  background: #294b42da;
  color: #fff5cf;
  text-shadow: none;
  overflow: hidden;
}
.run-notice:empty {
  visibility: hidden;
}
.ending-controls {
  position: absolute;
  z-index: 5;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
}
.ending-controls button {
  white-space: nowrap;
  background: #fff5dbe8;
  font-size: 12px;
  padding: 10px 18px;
}
.ending-controls button:disabled {
  visibility: hidden;
}
@media (max-height: 550px) {
  .hud {
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .score-block strong {
    font-size: 25px;
  }
  .score-block .eyebrow,
  .score-block > span:last-child {
    display: none;
  }
  .journey {
    margin-top: 0;
  }
  .powers {
    height: 22px;
    position: absolute;
    top: 48px;
    right: 20px;
  }
  .run-notice {
    height: 24px;
    margin-top: 3px;
    max-width: 310px;
    font-size: 10px;
  }
  .next-milestone {
    font-size: 9px;
  }
}

.practice-controls {
  display: block;
  margin: 4px auto;
  padding: 6px 12px;
  min-height: 30px;
  font-size: 11px;
}
.tutorial-card {
  position: absolute;
  top: max(86px, calc(env(safe-area-inset-top) + 70px));
  left: 20px;
  right: 20px;
  max-width: 430px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #fff6deef;
  color: #355846;
  border-bottom: 4px solid #e9bc5f;
  text-shadow: none;
  box-shadow: 0 6px 18px #1f43371c;
}
#lesson-icon {
  font-size: 43px;
  line-height: 1;
  font-weight: 900;
  min-width: 38px;
  text-align: center;
  color: #56876d;
}
#lesson-step {
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 900;
}
#lesson-title {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.2;
}
#lesson-detail {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.35;
}
.hud[data-tutorial='true'] .journey,
.hud[data-tutorial='true'] .next-milestone,
.hud[data-tutorial='true'] .powers,
.hud[data-tutorial='true'] .run-notice,
.hud[data-tutorial='true'] .chase-meter {
  visibility: hidden;
}
.tutorial-card[data-waiting='true'] {
  border-bottom-color: #6bac85;
}
@media (max-height: 550px) {
  .tutorial-card {
    top: max(50px, env(safe-area-inset-top));
    padding: 9px 12px;
    gap: 10px;
    max-width: 380px;
  }
  #lesson-title {
    font-size: 15px;
  }
  #lesson-detail {
    font-size: 11px;
  }
  #lesson-icon {
    font-size: 34px;
  }
  .practice-controls {
    margin: 0 auto;
    padding: 3px 10px;
    min-height: 24px;
  }
}

.tutorial-card[data-ready='true'] {
  background: #fff1b8f5;
  border-bottom-color: #e5a83b;
}
.tutorial-card[data-ready='true'] #lesson-icon {
  color: #bf792a;
}

/* Readable labels over the moving countryside and a compact score action. */
.world-tabs { display: inline-flex; padding: 5px 9px; border-radius: 8px; background: #fff8dfeb; color: #244d38; }
.submit-form .primary-button { width: auto; min-width: 0; padding: 12px; font-size: 16px; letter-spacing: .02em; }
#result-rank { font-weight: 800; color: #315b3e; }
