/* Yeti Drop "ice-blue glass" interface: every piece is image art (assets/ui); CSS only positions. Live text on top, in 14 languages. */
@font-face {
  font-family: 'Fredoka';
  src: url(assets/fonts/fredoka-latin-600.woff2) format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  src: url(assets/fonts/fredoka-latin-700.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  src: url(assets/fonts/fredoka-latin-ext-600.woff2) format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fredoka';
  src: url(assets/fonts/fredoka-latin-ext-700.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'NunitoC';
  src: url(assets/fonts/nunito-cyrillic-900.woff2) format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --u: calc(min(4.4vmin, 30px) * var(--fit, 1));
  --ink: #fff;
  --orb: 64px;
  --bh: clamp(50px, calc(var(--u) * 3.9), 82px);
  /* theme colors (eyedropped): ice-blue glass, dark blue outline, lime green and orange action */
  --stroke: rgba(30, 58, 148, 0.92);
  --stroke-solid: #1e3a94;
  --glass: rgba(46, 98, 214, 0.5);
  --glass-glow: rgba(156, 206, 255, 0.5);
  --shade: rgba(16, 34, 104, 0.7);
  --lime: #8fdc16;
  --txt: 0 2px 3px rgba(18, 40, 120, 0.55), 0 0 10px rgba(30, 70, 170, 0.3);
  --font:
    'Fredoka', 'NunitoC', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', 'Apple SD Gothic Neo', 'Malgun Gothic',
    'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #17266a;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
canvas#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.hidden {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
}

/* frame stretched in 9 pieces (assembled on a canvas by src/lib/nine.js, no thread at the joint) */
.fr {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-style: solid;
  border-color: transparent;
}
.nine {
  border-image: none !important;
  background-size: 100% 100% !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
  background-repeat: no-repeat !important;
}
.card,
.pop {
  filter: drop-shadow(0 0 9px var(--glass-glow));
}
.card > .fr,
.pop > .fr {
  border-width: 46px;
  border-image: url(assets/ui/panel.webp) 150 fill;
}
.btn > .fr {
  border-width: calc(var(--bh) / 2);
  border-image: url(assets/ui/cap-clear.webp) 65 fill;
}
.btn.aqua > .fr,
#toast > .fr {
  border-image-source: url(assets/ui/cap-aqua.webp);
  border-image-slice: 70;
}
/* green button drawn in CSS: sharp on any screen (the image art had a blurry, stained halo) */
.btn.green > .fr {
  border: 0;
  border-image: none;
  border-radius: 999px;
  filter: none;
  background: linear-gradient(180deg, #f2ff9e 0%, #c3f53a 30%, #8fdc16 64%, #5fae0c 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.5),
    inset 0 -0.16em 0.3em rgba(36, 96, 0, 0.45),
    0 0.12em 0.32em rgba(24, 40, 70, 0.45),
    0 0 0.7em rgba(190, 255, 90, 0.38);
}
.btn.green > .fr::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 9%;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.08));
}
.btn.aqua > .fr {
  filter: brightness(1.08);
}
/* orange buttons and pills in CSS: sharp on any screen, like the green */
.btn.aqua > .fr {
  border: 0;
  border-image: none;
  border-radius: 999px;
  filter: none;
  background: linear-gradient(180deg, #ffd27a 0%, #ffa53a 32%, #f57a14 66%, #c9520a 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 240, 210, 0.55),
    inset 0 -0.16em 0.3em rgba(120, 40, 0, 0.42),
    0 0.12em 0.32em rgba(24, 40, 70, 0.45),
    0 0 0.7em rgba(255, 170, 70, 0.35);
}
.btn.aqua > .fr::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 9%;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.06));
}
#hud-level::before,
#intro b::before {
  border: 0 !important;
  border-image: none !important;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd27a 0%, #ffa53a 32%, #f57a14 66%, #c9520a 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 240, 210, 0.55),
    inset 0 -0.12em 0.22em rgba(120, 40, 0, 0.4),
    0 0.08em 0.22em rgba(24, 40, 70, 0.4);
}
#hud-level::after,
#intro b::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 10%;
  height: 34%;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.04));
  pointer-events: none;
}
#toast > .fr {
  border-width: 22px;
  border-image-repeat: stretch;
}
.row > .fr,
.slide > .fr,
.steps li > .fr {
  border-width: 21px;
  border-image: url(assets/ui/row.webp) 37 fill;
}
.pill > .fr {
  border-width: calc(var(--ph) / 2);
  border-image: url(assets/ui/cap-sm.webp) 29 fill;
}
#intro > .fr {
  border-width: 23px;
  border-image: url(assets/ui/tip.webp) 61 fill;
}

/* round glass buttons */
.orb {
  width: var(--orb);
  height: var(--orb);
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: var(--a) center / 100% 100% no-repeat;
}
.orb.on#btn-sound {
  --a: url(assets/ui/sound-on.webp);
  filter: drop-shadow(0 0 9px rgba(160, 240, 90, 0.8));
}
.o-back {
  --a: url(assets/ui/back.webp);
}
.o-sound {
  --a: url(assets/ui/sound.webp);
}
.o-gear {
  --a: url(assets/ui/gear.webp);
}
.o-pause {
  --a: url(assets/ui/pause.webp);
}
.o-restart {
  --a: url(assets/ui/restart.webp);
}
.o-grid {
  --a: url(assets/ui/grid.webp);
}
.orb.muted {
  --a: url(assets/ui/mute.webp);
}
.orb.hot {
  --a: url(assets/ui/a-restart.webp);
  --orb: 74px;
  filter: drop-shadow(0 0 10px rgba(255, 150, 60, 0.6));
}

/* loose icons and stars */
.ic {
  flex: 0 0 auto;
  width: calc(var(--u) * 1.6);
  height: calc(var(--u) * 1.6);
  background: var(--a) center / contain no-repeat;
  filter: drop-shadow(0 1px 2px var(--shade));
}
.ic-vib {
  --a: url(assets/ui/i-vib.webp);
}
.ic-motion {
  --a: url(assets/ui/i-motion.webp);
}
.ic-full {
  --a: url(assets/ui/i-full.webp);
}
.ic-globe {
  --a: url(assets/ui/i-globe.webp);
}
.ic-help {
  --a: url(assets/ui/i-help.webp);
}
.ic-sound {
  --a: url(assets/ui/i-sound.webp);
}
.ic-music {
  --a: url(assets/ui/i-music.webp);
}
.ic-next {
  --a: url(assets/ui/i-next.webp);
  width: 34px;
  height: 30px;
}
.star {
  display: inline-block;
  flex: 0 0 auto;
  aspect-ratio: 1;
  background: url(assets/ui/star-empty.webp) center / contain no-repeat;
}
.star.got {
  background-image: url(assets/ui/star.webp);
}

/* HUD */
#corner {
  position: fixed;
  z-index: 30;
  top: calc(env(safe-area-inset-top) + 14px);
  right: calc(env(safe-area-inset-right) + 12px + var(--sx, 0px));
  display: flex;
  gap: 10px;
}
body.panel #hud,
body.panel #hud-level,
body.panel #intro,
body.panel #start .logo-box,
body.panel #start .tap {
  visibility: hidden;
}
#hud {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top) + 14px);
  left: calc(env(safe-area-inset-left) + 12px + var(--sx, 0px));
  right: calc(env(safe-area-inset-right) + var(--orb) * 2 + 34px + var(--sx, 0px));
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
#hud .orb {
  pointer-events: auto;
}
.pill {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  --ph: 42px;
  height: var(--ph);
  font-weight: 700;
  text-shadow: var(--txt);
}
#hud-stars {
  flex: 0 1 168px;
  min-width: 0;
  margin: 0 auto;
  --ph: calc(var(--orb) * 0.77);
  padding: 0 4px;
}
#hud-st {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
#hud-st .star:not(.got) {
  background-image: url(assets/ui/star-line.webp);
  filter: drop-shadow(0 1px 1px var(--shade));
}
#hud-st .star {
  width: min(calc(var(--orb) * 0.6), 7vw);
  transition: transform 0.25s cubic-bezier(0.3, 1.8, 0.5, 1);
}
#hud-st .star.got {
  transform: scale(1.14);
}
#hud-st .star.bump {
  animation: starBump 0.5s cubic-bezier(0.3, 2, 0.5, 1);
}
@keyframes starBump {
  0% {
    transform: scale(1.8);
  }
  100% {
    transform: scale(1.14);
  }
}
#hud-level {
  position: fixed;
  z-index: 19;
  top: calc(env(safe-area-inset-top) + var(--orb) + 20px);
  left: 50%;
  transform: translateX(-50%);
  --lw: min(38.5vw, 200px);
  width: var(--lw);
  height: calc(var(--lw) * 0.29);
  padding: 0 14px;
  display: grid;
  place-items: center;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  font-weight: 700;
  font-size: calc(var(--lw) * 0.14);
  text-shadow: var(--txt);
  pointer-events: none;
}

/* screens */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 0.8);
  padding: calc(env(safe-area-inset-top) + var(--orb) + 18px) 14px calc(env(safe-area-inset-bottom) + 14px);
  text-align: center;
}
#start {
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + 11vh);
}
#start {
  pointer-events: none;
} /* the title screen is a level: the finger goes straight through to the rope */
.logo-box {
  position: relative;
  width: min(84vw, 540px);
  pointer-events: none;
  animation: logoFloat 4s ease-in-out infinite;
}
.logo {
  display: block;
  width: 100%;
  filter: drop-shadow(0 3px 8px rgba(20, 40, 130, 0.4));
  pointer-events: none;
}
/* a faint glow that sometimes passes over the logo, clipped by the logo drawing itself */
.logo-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 44%, rgba(255, 255, 240, 0.7) 50%, transparent 56%) 160% 0 / 250% 100%
    no-repeat;
  -webkit-mask: url(assets/img/logo.webp) center / 100% 100% no-repeat;
  mask: url(assets/img/logo.webp) center / 100% 100% no-repeat;
  animation: logoShine 7s ease-in-out 2s infinite;
}
@keyframes logoShine {
  0%,
  78% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}
/* a real, translated subtitle over the little plaque engraved in the logo (which vanishes, being so small, on a phone) */
.logo-sub {
  position: absolute;
  left: 50%;
  top: 84%;
  transform: translate(-50%, -50%);
  isolation: isolate;
  min-width: 62%;
  padding: 0.42em 1.5em;
  white-space: nowrap;
  text-align: center;
  font-weight: 700;
  font-size: max(12px, calc(min(76vw, 500px) * 0.05));
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: #fff;
  -webkit-text-stroke: 0.06em var(--stroke-solid);
  paint-order: stroke fill;
}
.logo-sub::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: brightness(0.5) saturate(2.6) hue-rotate(6deg);
  border: solid transparent;
  border-width: 1.05em;
  border-image: url(assets/ui/cap-level.webp) 61 fill;
}
@keyframes logoFloat {
  50% {
    transform: translateY(-6px) rotate(-0.6deg);
  }
}
.pill.total {
  font-size: calc(var(--u) * 1.85);
  min-width: 150px;
  --ph: calc(var(--u) * 3.6);
}
.pill.total .star {
  width: 1.35em;
}
.tap:not([style*='top']) {
  visibility: hidden;
} /* with no computed position (the art is still loading), the text never appears on top of the logo */
.tap {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: calc(var(--u) * 1.5);
  color: #fff;
  -webkit-text-stroke: 0.13em var(--stroke);
  paint-order: stroke fill;
  text-shadow: 0 2px 3px rgba(18, 36, 110, 0.6);
  animation: tapPulse 1.6s ease-in-out infinite;
}
@keyframes tapPulse {
  50% {
    opacity: 0.82;
    transform: scale(0.98);
  }
}

/* glass capsule buttons */
.btn {
  position: relative;
  isolation: isolate;
  height: var(--bh);
  min-width: 0;
  border: 0;
  padding: 0 calc(var(--bh) * 0.42);
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: calc(var(--bh) * 0.5);
  text-shadow: var(--txt);
  white-space: nowrap;
}
.btn > span {
  display: block;
  min-width: 0;
  max-width: 100%;
}
.btn.green > span {
  -webkit-text-stroke: 0.11em #2c6400;
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0.05em rgba(30, 70, 0, 0.55);
}
.btn.aqua > span {
  -webkit-text-stroke: 0.11em #9a3f00;
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0.05em rgba(120, 40, 0, 0.55);
}
.ribbon,
.pop h3,
.pill,
.sub {
  -webkit-text-stroke: 0.05em var(--stroke);
  paint-order: stroke fill;
}
.btn.big {
  --bh: clamp(68px, calc(var(--u) * 5), 104px);
  width: min(76vw, 420px);
  margin-top: 2vh;
  margin-bottom: 0;
  font-size: calc(var(--bh) * 0.5);
}
.btn.wide {
  width: 100%;
}

/* glass windows */
.card {
  position: relative;
  isolation: isolate;
  width: min(90vw, calc(var(--u) * 21));
  max-height: calc(100dvh - 12px);
  padding: calc(var(--u) * 1.5) calc(var(--u) * 1.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 0.85);
}
.card::before,
.pop::before {
  content: '';
  position: absolute;
  inset: 6px;
  z-index: -2;
  border-radius: 40px;
  background: var(--glass);
}
#pause .ribbon {
  font-size: calc(var(--u) * 2.75);
}
/* portrait victory: "Level N complete" on the glass band; in landscape the title is loose */
@media (orientation: portrait) {
  #end.won .ribbon {
    position: relative;
    isolation: isolate;
    padding: 0.38em 1.1em;
    margin: calc(var(--u) * -0.3) auto 0;
    font-size: calc(var(--u) * 1.95);
    line-height: 1.1;
    min-width: 70%;
  }
  #end.won .ribbon::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border: solid transparent;
    border-width: 0.93em;
    border-image: url(assets/ui/cap-level.webp) 61 fill;
  }
}
#end .ribbon {
  font-size: calc(var(--u) * 2.25);
}
.card.narrow {
  gap: calc(var(--u) * 1.05);
  width: min(72vw, calc(var(--u) * 18.5));
  padding-top: calc(var(--u) * 1.9);
  padding-bottom: calc(var(--u) * 1.9);
}
.ribbon {
  max-width: 100%;
  font-weight: 700;
  font-size: calc(var(--u) * 2.75);
  line-height: 1.12;
  color: #fff;
  text-shadow: var(--txt);
  white-space: nowrap;
}
.card .ribbon {
  font-size: calc(var(--u) * 2.35);
}
#pause {
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + 21vh);
}
.sub {
  margin: 0;
  max-width: 100%;
  font-weight: 700;
  font-size: calc(var(--u) * 1.85);
  min-height: 1.2em;
  text-shadow: var(--txt);
}
#end {
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + var(--orb) + 54px);
}
#end-stars {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 0.2);
  margin: 2px 0 0;
}
#end-stars .star {
  width: calc(var(--u) * 6);
} /* the 3 stars have the same size and the same line */
#end-stars .star.got.land {
  animation: starLand 0.38s both cubic-bezier(0.3, 1.9, 0.5, 1);
}
@keyframes starLand {
  from {
    transform: translateY(var(--y, 0)) scale(1.3);
  }
  to {
    transform: translateY(var(--y, 0));
  }
}
.row-btn > * {
  animation: btnIn 0.4s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}
body:has(#end-stars.lost) .row-btn > * {
  animation-delay: 0.1s !important;
} /* defeat: the buttons enter at once (retry is the main action); victory waits for the stars to stamp in */
.row-btn > *:nth-child(1) {
  animation-delay: 0.62s;
}
.row-btn > *:nth-child(2) {
  animation-delay: 0.7s;
}
.row-btn > *:nth-child(3) {
  animation-delay: 0.78s;
}
@keyframes btnIn {
  from {
    transform: translateY(14px) scale(0.7);
    opacity: 0;
  }
}
#end-stars.lost .star {
  width: calc(var(--u) * 3.9);
}
.confetti {
  position: fixed;
  z-index: 46;
  height: auto;
  pointer-events: none;
}
#end-stars.lost ~ .sub {
  font-size: calc(var(--u) * 1.2);
}
@media (orientation: portrait) {
  #end.won .sub {
    font-size: calc(var(--u) * 2.9);
    -webkit-text-stroke: 0.03em var(--stroke);
  }
}
@keyframes starIn {
  from {
    transform: translateY(var(--y, 0)) scale(0.2) rotate(-30deg);
    opacity: 0;
  }
  to {
    transform: translateY(var(--y, 0));
    opacity: 1;
  }
}
.row-btn {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  align-items: center;
}
.row-btn .orb {
  --orb: clamp(52px, calc(var(--u) * 4.9), 96px);
}
.row-btn .orb.hot {
  --orb: clamp(78px, calc(var(--u) * 5.6), 118px);
}
.row-btn .btn {
  --bh: clamp(56px, calc(var(--u) * 3.9), 84px);
  flex: 0 1 calc(var(--bh) * 1.7);
}
.row-btn .ic-next {
  width: calc(var(--bh) * 0.64);
  height: calc(var(--bh) * 0.54);
  filter: brightness(2.2) drop-shadow(0 2px 0 rgba(0, 90, 0, 0.35));
}
@media (orientation: portrait) {
  .row-btn .btn.green {
    --bh: clamp(60px, calc(var(--u) * 6.1), 118px);
    flex: 0 0 var(--bh);
    width: var(--bh);
    padding: 0;
  }
}

/* world map: bubbles with the snow scene inside */
#worlds,
#levels {
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + var(--orb) + 14px);
}
.back {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 14px);
  left: calc(env(safe-area-inset-left) + 12px + var(--sx, 0px));
}
#worlds .pill.total {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  --ph: var(--orb);
  min-width: calc(var(--orb) * 3);
  font-size: calc(var(--orb) * 0.48);
  padding: 0 8px;
}
/* title of the map and of the level list in the same glass strip as "Level 6" */
#worlds > .ribbon,
#levels > .ribbon {
  position: relative;
  isolation: isolate;
  padding: 0.38em 1.1em;
  margin: 0 auto;
  font-size: calc(var(--u) * 2.3);
  line-height: 1.1;
  min-width: min(66vw, 380px);
}
#levels > .ribbon {
  min-width: min(52vw, 300px);
}
#worlds > .ribbon::before,
#levels > .ribbon::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: solid transparent;
  border-width: 0.93em;
  border-image: url(assets/ui/cap-level.webp) 61 fill;
}
/* path of petals between the worlds */
.ppath {
  display: none;
} /* the map has no path between the bubbles */
#world-list > .wcard {
  z-index: 1;
}
.pp {
  position: absolute;
  width: 15px;
  height: 7.5px;
  margin: -3.75px 0 0 -7.5px;
  border-radius: 50%;
  background: rgba(235, 245, 255, 0.5);
  transform: rotate(var(--a));
}
.pp.on {
  background: linear-gradient(90deg, #ffffff, #9fe8ff);
  box-shadow: 0 0 8px rgba(130, 225, 255, 0.95);
}
.pp.new {
  animation: ppOn 0.3s calc(0.55s + var(--k) * 0.06s) both;
}
@keyframes ppOn {
  from {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: none;
    transform: rotate(var(--a)) scale(0.4);
  }
  60% {
    transform: rotate(var(--a)) scale(1.6);
  }
}
#world-list {
  position: relative;
  --w: min(38vw, 290px, calc((100dvh - 140px - var(--u) * 6.6) / 2 - var(--u) * 2.5));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, calc(var(--w) + 18px)));
  gap: 4px 10px;
  justify-content: center;
  margin-top: calc(var(--u) * 1);
  margin-bottom: auto;
  padding-bottom: calc(var(--u) * 3);
}
.wcard {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
}
.wb {
  filter: drop-shadow(0 0 7px var(--glass-glow));
  position: relative;
  display: block;
  width: var(--w);
  height: var(--w);
  animation: bobW 4.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -1.1s);
}
@keyframes bobW {
  50% {
    translate: 0 calc(var(--w, 80px) * -0.03);
  }
}
.wring {
  -webkit-mask: radial-gradient(closest-side, transparent 90.5%, #000 91.5%);
  mask: radial-gradient(closest-side, transparent 90.5%, #000 91.5%);
}
.wring,
.wfill {
  position: absolute;
  inset: 0;
  background: url(assets/ui/ring-empty.webp) center / 100% 100% no-repeat;
}
.wfill {
  inset: 0;
  background-image: url(assets/ui/ring-full.webp);
  -webkit-mask: conic-gradient(#000 calc(var(--p) * 1turn), transparent 0);
  mask: conic-gradient(#000 calc(var(--p) * 1turn), transparent 0);
}
.wb img.lk.fall {
  animation: lockFall 0.85s 0.35s cubic-bezier(0.5, 0, 0.9, 0.5) both;
}
@keyframes lockFall {
  0%,
  20% {
    transform: rotate(0);
    opacity: 1;
  }
  8% {
    transform: rotate(-12deg);
  }
  16% {
    transform: rotate(11deg);
  }
  100% {
    transform: translateY(calc(var(--w, 80px) * 0.9)) rotate(38deg);
    opacity: 0;
  }
}
.wb img:first-child {
  filter: saturate(1.25) brightness(1.12);
}
.wb img {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  object-fit: contain;
}
.wcard.lock .wb img:first-child {
  filter: saturate(1.05) brightness(0.9);
}
.wb img.lk {
  inset: 40% 41.5%;
  width: 17%;
  height: 20%;
  filter: drop-shadow(0 2px 5px var(--shade));
}
/* world name and star counter in glass pills; the pill is the cap-sm art in 9 slices on ::before */
.wcard b,
.wcard .wst {
  position: relative;
  isolation: isolate;
  font-weight: 700;
  -webkit-text-stroke: 0.08em var(--stroke);
  paint-order: stroke fill;
  text-shadow: var(--txt);
  white-space: nowrap;
}
.wcard b,
.wcard .wst {
  height: 1.6em;
  padding: 0 0.9em;
}
.wcard b::before,
.wcard .wst::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: solid transparent;
  border-width: 0.8em;
  border-image: url(assets/ui/cap-sm.webp) 29 fill;
}
.wcard b {
  display: block;
  width: 94%;
  max-width: 100%;
  height: auto;
  min-height: 1.6em;
  margin-top: calc(var(--w) * -0.09);
  font-size: calc(var(--u) * 1.28);
  line-height: 1.6em;
} /* a long world name that wraps (French) grows the plaque instead of running under the star pill */
.wcard .wst {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: -0.18em;
  font-size: calc(var(--u) * 1.12);
  max-width: 100%;
}
.wcard.lock .wst {
  font-size: calc(var(--u) * 0.84);
  white-space: normal;
  line-height: 1.05;
  height: auto;
  min-height: 1.6em;
  padding: 0.15em 0.8em;
  justify-content: center;
}
.wcard .wst .star {
  width: 1.2em;
}
.wcard.lock {
  cursor: default;
}
.wcard.fresh {
  animation: unlockPop 0.9s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}
@keyframes unlockPop {
  0% {
    transform: scale(0.85);
  }
  100% {
    transform: none;
  }
}

/* level select: glass bubbles */
#grid {
  --c: min(25vw, 124px, 10.2dvh, calc((100dvh - 128px - var(--u) * 7) / 5 - 8px));
  display: grid;
  grid-template-columns: repeat(3, var(--c));
  gap: 8px clamp(8px, 3.2vw, 18px);
  margin-top: 2px;
}
#iris {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: none;
  display: none;
}
#iris.on {
  display: block;
  pointer-events: auto;
}
.cell {
  width: var(--c);
  height: var(--c);
  border: 0;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background:
    url(assets/ui/b-done.webp) center / contain no-repeat,
    radial-gradient(circle closest-side, rgba(70, 120, 225, 0.55) 0 90%, transparent 94%) center / 94% 94% no-repeat;
  font-weight: 700;
  font-size: calc(var(--c) * 0.38);
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--c) * 0.03);
  text-shadow: var(--txt);
  animation:
    cellIn 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both,
    bob 3.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 30ms), calc(var(--i, 0) * -0.37s);
}
.cell.next {
  animation:
    cellIn 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both,
    bob 3.6s ease-in-out infinite,
    nextGlow 1.9s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 30ms), calc(var(--i, 0) * -0.37s), 0s;
}
@keyframes bob {
  50% {
    translate: 0 calc(var(--c, 40px) * -0.05);
  }
}
@keyframes nextGlow {
  50% {
    filter: brightness(1.14) drop-shadow(0 0 9px rgba(110, 240, 255, 0.85));
  }
}
.cell.next {
  background: url(assets/ui/b-next.webp) center / contain no-repeat;
}
.cell.lock {
  background: url(assets/ui/b-lock-bare.webp) center / contain no-repeat;
  cursor: default;
}
.cell.lock::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 17%;
  width: 38%;
  height: 38%;
  transform: translateX(-50%);
  background: url(assets/ui/i-lock.webp) center / contain no-repeat;
  opacity: 1;
  filter: drop-shadow(0 2px 3px rgba(16, 34, 104, 0.65));
}
.cell .st {
  display: flex;
  gap: 0;
}
.cell .st .star {
  width: calc(var(--c) * 0.205);
}
.cell {
  position: relative;
  padding-bottom: calc(var(--c) * 0.05);
}
.cell.lock .st {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17%;
  justify-content: center;
  opacity: 0.9;
}
#levels-total > .fr {
  border-image-source: url(assets/ui/cap-level.webp);
  border-image-slice: 61;
}
@keyframes cellIn {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
#levels-total {
  flex: 0 0 auto;
  --ph: calc(var(--u) * 3.3);
  min-width: 170px;
  font-size: calc(var(--u) * 1.45);
  margin-top: auto;
  margin-bottom: 4px;
}
#levels-total .star {
  width: 1.3em;
}

/* sound and gear panels */
.pop {
  position: fixed;
  z-index: 40;
  isolation: isolate;
  top: calc(env(safe-area-inset-top) + var(--orb) + 34px);
  right: calc(env(safe-area-inset-right) + 12px);
  width: min(calc(var(--u) * 21), 88vw);
  max-height: calc(100dvh - var(--orb) - 26px);
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pop h3 {
  margin: 0 auto 2px;
  width: fit-content;
  max-width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: calc(var(--u) * 2.5);
  color: #fff;
  text-shadow: var(--txt);
}
.row,
.slide {
  position: relative;
  isolation: isolate;
  min-height: calc(var(--u) * 3.3);
  padding: 0 calc(var(--u) * 0.95);
  font-weight: 700;
  -webkit-text-stroke: 0.05em var(--stroke);
  paint-order: stroke fill;
  font-size: calc(var(--u) * 1.3);
  text-shadow: var(--txt);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.row > span {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}
.row.link {
  border: 0;
  background: none;
  cursor: pointer;
}
.row .chev {
  flex: 0 0 auto;
  width: 13px;
  height: 20px;
  background: url(assets/ui/chevron.webp) center / contain no-repeat;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: calc(var(--u) * 3.7);
  height: calc(var(--u) * 1.9);
  margin: 0;
  cursor: pointer;
  background: url(assets/ui/toggle-off.webp) center / contain no-repeat;
  transition: transform 0.25s cubic-bezier(0.3, 1.9, 0.45, 1);
}
.switch:checked {
  background-image: url(assets/ui/toggle-on.webp);
}
.switch:active {
  transform: scale(0.92);
}
.slide {
  display: grid;
  grid-template-columns: calc(var(--u) * 1.6) minmax(0, 34%) minmax(104px, 1fr);
  gap: 10px;
  align-items: center;
}
.slide > span {
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}
.sl {
  position: relative;
  height: 40px;
  --f: 0.8;
  display: flex;
  align-items: center;
}
.sl::before,
.sl .fill {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 15px;
  transform: translateY(-50%);
  border: solid transparent;
  border-width: 0 7.5px;
  border-image: url(assets/ui/track.webp) 0 34 fill;
}
.sl .fill {
  border-image-source: url(assets/ui/track-full.webp);
  clip-path: inset(0 calc(100% - (19px + (100% - 38px) * var(--f))) 0 0);
}
.sl input {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 40px;
  margin: 0;
  background: none;
  cursor: pointer;
}
.sl input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 33px;
  height: 33px;
  border: 0;
  background: url(assets/ui/knob.webp) center / contain no-repeat;
}
.sl input::-moz-range-thumb {
  width: 33px;
  height: 33px;
  border: 0;
  background: url(assets/ui/knob.webp) center / contain no-repeat;
}
#gear-close {
  margin-top: 0;
  align-self: center;
  width: 76%;
  flex: 0 0 auto;
}
#panel-gear {
  left: 50%;
  right: auto;
  top: calc(env(safe-area-inset-top) + var(--orb) + 92px);
  transform: translateX(-50%);
  width: min(84vw, calc(var(--u) * 21));
  padding: calc(var(--u) * 0.7) calc(var(--u) * 0.65) calc(var(--u) * 0.6);
  gap: calc(var(--u) * 0.3);
}
#panel-gear .row {
  min-height: max(40px, calc(var(--u) * 3));
}
#panel-gear h3 {
  font-size: calc(var(--u) * 2.2);
}
#panel-gear #gear-close {
  --bh: 44px;
} /* lines: ~51 px at 844 height */
#panel-gear:not(.hidden) {
  animation-name: gearInL;
  transform-origin: center;
}
@media (orientation: landscape) and (min-height: 521px) {
  #panel-gear {
    top: calc(env(safe-area-inset-top) + var(--orb) + 22px);
  }
}
@keyframes gearIn {
  from {
    transform: translate(-50%, -50%) scale(0.88);
    opacity: 0;
  }
}

/* how to play */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.7);
  width: 100%;
}
#howto-ok {
  width: 84%;
}
#howto {
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top) + var(--orb) + 58px);
}
.steps li {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(var(--u) * 4.6);
  padding: calc(var(--u) * 0.45) calc(var(--u) * 0.95);
  text-align: left;
  text-wrap: balance;
  font-weight: 600;
  font-size: calc(var(--u) * 1.12);
  line-height: 1.12;
  text-shadow: var(--txt);
}
.steps li > span:last-child {
  min-width: 0;
}
.pic {
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--u) * 3.3);
  height: calc(var(--u) * 3.3);
  display: grid;
  place-items: center;
}
.pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pic.cut img {
  width: 84%;
  height: 88%;
}
.pic.cut .sc {
  display: none;
}
.pic canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.pic canvas + img,
.pic img + canvas {
  z-index: 1;
}
.pic.cut i {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #eafcff, transparent);
  box-shadow: 0 0 10px #8fe8ff;
  animation: swipeDemo 1.6s ease-in-out infinite;
}
@keyframes swipeDemo {
  0% {
    transform: translateX(-60%) scaleX(0.3);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  70% {
    transform: translateX(40%) scaleX(1);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* new element notice and toast */
#intro {
  position: fixed;
  z-index: 25;
  isolation: isolate;
  left: 50%;
  top: calc(env(safe-area-inset-top) + var(--orb) + 72px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 94vw;
  min-height: 48px;
  padding: 4px 18px 4px 10px;
  animation: introIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  pointer-events: none;
  text-shadow: var(--txt);
}
#intro b {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  padding: 5px 12px;
  line-height: 1;
  font-weight: 700;
  font-size: 13px;
}
#hud-level::before,
#intro b::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border: solid transparent;
  border-image: url(assets/ui/cap-aqua.webp) 70 fill;
}
#hud-level::before {
  border-width: 22px;
}
#intro b::before {
  border-width: 13px;
}
#intro img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
#intro span {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
}
@media (orientation: portrait) {
  #intro {
    width: 94vw;
    max-width: 94vw;
  }
}
@keyframes introIn {
  from {
    transform: translate(-50%, -20px) scale(0.8);
    opacity: 0;
  }
}
.pop-txt {
  position: fixed;
  z-index: 44;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-weight: 700;
  font-size: clamp(26px, calc(var(--u) * 2.4), 44px);
  white-space: nowrap;
  color: #ffe58a;
  -webkit-text-stroke: 5px #7a3a12;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #7a3a12,
    0 0 16px rgba(255, 210, 120, 0.8);
  animation: popTxt 1.05s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes popTxt {
  0% {
    transform: translate(-50%, -50%) scale(0.3) rotate(-8deg);
    opacity: 0;
  }
  22% {
    transform: translate(-50%, -50%) scale(1.15) rotate(-4deg);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -110%) scale(1) rotate(-4deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -150%) scale(0.95) rotate(-4deg);
    opacity: 0;
  }
}
html.calm .pop-txt {
  animation: popCalm 1.05s both !important;
}
@keyframes popCalm {
  0%,
  75% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}
#toast {
  position: fixed;
  z-index: 45;
  isolation: isolate;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12vh);
  transform: translateX(-50%);
  padding: 12px 26px;
  max-width: 94vw;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: var(--txt);
  animation: introIn 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* screens come in: never flash, they only slide and grow slightly; buttons with a spring */
.screen:not(.hidden) {
  animation: screenIn 0.3s ease-out both;
}
.screen:not(.hidden) .card {
  animation: cardIn 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
.pop:not(.hidden) {
  animation: popIn 0.28s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  transform-origin: top right;
}
@keyframes screenIn {
  from {
    opacity: 0;
  }
}
@keyframes cardIn {
  from {
    transform: translateY(24px) scale(0.92);
    opacity: 0;
  }
}
@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}
.btn,
.orb,
.cell,
.wcard,
.row.link {
  transition:
    transform 0.38s cubic-bezier(0.3, 1.9, 0.45, 1),
    filter 0.15s;
}
.btn:active,
.orb:active,
.cell:active,
.wcard:active,
.row.link:active {
  transform: scale(0.92);
  filter: brightness(0.86);
  transition-duration: 0.06s;
}
.tap.gone {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
  animation: none;
}
.tap-ring {
  position: fixed;
  z-index: 70;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  pointer-events: none;
  background: url(assets/ui/ring-empty.webp) center / contain no-repeat;
  animation: tapRing 0.5s ease-out both;
}
@keyframes tapRing {
  from {
    transform: scale(0.25);
    opacity: 0.95;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}
.btn.sheen::after {
  content: '';
  position: absolute;
  inset: 7% 3.5%;
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.34) 50%, transparent 58%) no-repeat;
  background-size: 260% 100%;
  background-position: 130% 0;
  animation: sheen 8s ease-in-out infinite 2s;
}
@keyframes sheen {
  0%,
  88% {
    background-position: 130% 0;
  }
  100% {
    background-position: -40% 0;
  }
}
.bump {
  display: inline-block;
  animation: numBump 0.5s cubic-bezier(0.3, 1.9, 0.5, 1);
}
@keyframes numBump {
  30% {
    transform: scale(1.22);
  }
}
.fly-star {
  position: fixed;
  z-index: 50;
  width: 44px;
  height: 44px;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 210, 80, 0.9));
}
html.calm *,
html.calm *::before,
html.calm *::after {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 420px) {
  :root {
    --orb: 51px;
  }
}
@media (max-width: 340px) {
  :root {
    --orb: 46px;
  }
  #corner,
  #hud {
    gap: 4px;
  }
  #hud-st .star {
    width: 20px;
  }
  .row,
  .slide {
    padding: 0 12px;
    font-size: 15px;
  }
}

/* landscape: title between the buttons, worlds in a row and levels in 5 x 3 */
@media (orientation: landscape) and (min-height: 521px) {
  :root {
    --u: calc(min(3vmin, 30px) * var(--fit, 1));
  }
}
@media (orientation: landscape) {
  #worlds,
  #levels {
    padding-top: calc(env(safe-area-inset-top) + 12px);
    gap: 8px;
  }
  #worlds .ribbon,
  #levels .ribbon {
    max-width: calc(100vw - 2 * (var(--orb) * 3.7 + 26px) - 12px);
    padding-inline: 0.7em;
  }
  #world-list {
    --w: min(19vw, 300px, calc(100dvh - 250px));
    grid-template-columns: repeat(4, minmax(0, calc(var(--w) + 16px)));
    gap: 12px;
    margin-block: auto;
    padding-bottom: 0;
    top: -5.5vh;
  }
  #grid {
    --c: min(12vw, 136px, calc((100dvh - 104px) / 3 - 8px));
    grid-template-columns: repeat(5, var(--c));
    gap: 6px clamp(10px, 2.6vw, 34px);
    margin-block: auto;
  }
  #worlds .ribbon,
  #levels .ribbon {
    font-size: calc(var(--u) * 1.9);
    min-width: 0;
  }
  #levels-total {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 14px);
    left: calc(env(safe-area-inset-left) + var(--orb) + 26px + var(--sx, 0px));
    margin: 0;
    --ph: var(--orb);
    min-width: calc(var(--orb) * 2.7);
    font-size: calc(var(--orb) * 0.42);
    padding: 0 20px;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .screen:not(#worlds):not(#levels) {
    padding-top: calc(env(safe-area-inset-top) + 8px);
    padding-bottom: 6px;
    gap: 6px;
  }
  #start {
    padding-top: calc(env(safe-area-inset-top) + 12px) !important;
  }
  .logo-box {
    width: min(38vw, 300px);
  }
  .logo-sub {
    font-size: max(11px, calc(min(38vw, 300px) * 0.05));
    top: 90%;
  }
  .btn.big {
    --bh: 56px;
    margin-top: 2px;
    width: min(36vw, 270px);
  }
  .pic {
    width: 58px;
    height: 58px;
  }
  .pic.cut .slash,
  .pic.cut i {
    display: none;
  }
  .pic.cut .sc {
    display: block;
    width: 112%;
    height: 112%;
    max-width: none;
  }
  #end {
    justify-content: flex-start;
    padding-top: calc(env(safe-area-inset-top) + 8px);
  }
  #pause,
  #howto {
    justify-content: flex-start;
    padding-top: calc(env(safe-area-inset-top) + 6px);
  }
  #pause {
    justify-content: center;
    padding-top: 6px;
  }
  .card {
    width: min(66vw, calc(var(--u) * 25));
    padding: 12px 18px 12px;
    gap: 4px;
  }
  .card .ribbon {
    font-size: calc(var(--u) * 1.85);
  }
  .sub {
    font-size: calc(var(--u) * 1.5);
    min-height: 0;
  }
  #end-stars.lost ~ .sub {
    font-size: calc(var(--u) * 1.05);
  }
  #end-stars .star {
    width: calc(var(--u) * 4.4);
  }
  #end-stars.lost .star {
    width: calc(var(--u) * 3.6);
  }
  #end .card {
    padding: 8px 18px 10px;
  }
  .row-btn .orb {
    --orb: max(52px, calc(var(--u) * 3.6));
  }
  .row-btn .orb.hot {
    --orb: max(60px, calc(var(--u) * 4.2));
  }
  .row-btn .btn {
    --bh: max(52px, calc(var(--u) * 3.6));
  }
  .card.narrow {
    width: min(41vw, 360px);
    gap: 6px;
    padding-bottom: 14px;
  } /* landscape pause: the 3 buttons in a column */
  .card.narrow .btn {
    --bh: 54px;
  }
  .steps {
    flex-direction: row;
    gap: 6px;
  }
  .steps li {
    flex: 1 1 0;
    flex-direction: column;
    text-align: center;
    padding: 8px 4px 8px;
    gap: 7px;
    min-height: 0;
    font-size: 13px;
  }
  #howto .btn {
    --bh: 46px;
  }
  .pop {
    overflow: auto;
    padding: 10px 14px 12px;
    gap: 5px;
  }
  .pop h3 {
    font-size: 24px;
  }
  #panel-gear {
    top: calc(env(safe-area-inset-top) + 6px);
    transform: translateX(-50%);
    width: min(560px, 66vw);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 10px 14px 12px;
  }
  #panel-gear:not(.hidden) {
    animation-name: gearInL;
  }
  #panel-gear h3 {
    grid-column: 1 / -1;
  }
  #panel-gear .row {
    min-height: 42px;
    font-size: 14.5px;
    padding: 0 12px;
  }
  .row-btn .btn {
    flex-basis: calc(var(--bh) * 2.3);
  }
  #panel-gear .ic {
    width: 20px;
    height: 20px;
  }
  #gear-close {
    width: 100%;
    align-self: center;
    margin: 0;
    --bh: 46px;
  }
}
@media (orientation: landscape) and (max-width: 720px) {
  #worlds .ribbon,
  #levels .ribbon {
    font-size: calc(var(--u) * 1.15);
    padding-inline: 0.5em;
  }
}
/* landscape with a free side column: stars, level number and the "New!" notice leave the top of the field */
@media (min-aspect-ratio: 115/100) {
  #hud {
    right: auto;
    width: calc(var(--orb) * 2 + 8px);
    flex-wrap: wrap;
  }
  #hud-stars {
    margin: 0;
    flex: 1 0 100%;
  }
  #hud-level {
    /* ~7 px of breathing room between stars, level and notice */
    left: calc(env(safe-area-inset-left) + 12px + var(--sx, 0px));
    width: calc(var(--orb) * 2 + 8px);
    height: 44px;
    font-size: 21px;
    transform: none;
    top: calc(env(safe-area-inset-top) + 22px + var(--orb) * 1.9 + max(7px, calc(var(--orb) * 0.12)));
  }
  #intro {
    top: calc(env(safe-area-inset-top) + 22px + var(--orb) * 1.9 + 44px + max(7px, calc(var(--orb) * 0.12)) * 2);
    left: calc(env(safe-area-inset-left) + 12px + var(--sx, 0px));
    transform: none;
    width: auto;
    max-width: min(28vw, 300px);
    flex-wrap: wrap;
    padding: 10px 14px;
    animation-name: introInSide;
  }
}
@keyframes gearInL {
  from {
    transform: translateX(-50%) scale(0.88);
    opacity: 0;
  }
}
@keyframes introInSide {
  from {
    transform: translateX(-20px) scale(0.85);
    opacity: 0;
  }
}

@media (orientation: portrait) {
  .slide .ic {
    filter: sepia(1) saturate(5) hue-rotate(38deg) brightness(1.05) drop-shadow(0 1px 2px var(--shade));
  }
}
/* language list (from inside the gear): one column on tall portrait, two on a medium window, three on a short landscape window */
.row em {
  flex: 0 1 auto;
  max-width: 48%;
  font-style: normal;
  white-space: nowrap;
  text-align: right;
}
.row.link > em + .chev {
  margin-left: -2px;
}
#panel-lang {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(84vw, calc(var(--u) * 21));
  max-height: calc(100dvh - 12px);
  padding: calc(var(--u) * 1) calc(var(--u) * 1);
  gap: calc(var(--u) * 0.4);
  transform-origin: center;
}
#panel-lang:not(.hidden) {
  animation-name: gearIn;
}
#panel-lang h3 {
  margin: 0 auto;
}
#lang-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 8px;
  width: 100%;
}
#lang-list .row > .fr {
  border-width: 20px;
}
.row.lang {
  border: 0;
  background: none;
  cursor: pointer;
}
#lang-list .row {
  height: 44px;
  min-height: 0;
  padding: 0 calc(var(--u) * 0.9) 0 calc(var(--u) * 1.5);
  font-size: calc(var(--u) * 1.18);
}
#lang-list .row > span {
  text-align: left;
  font-weight: 700;
}
#lang-close {
  flex: 0 0 auto;
  --bh: clamp(46px, calc(var(--u) * 3.3), 62px);
  align-self: center;
  width: 46%;
  margin-top: 2px;
}
.dot {
  flex: 0 0 auto;
  width: calc(var(--u) * 1.3);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px rgba(232, 244, 255, 0.9),
    inset 0 2px 5px rgba(20, 46, 130, 0.5);
  background: radial-gradient(
    circle at 38% 30%,
    rgba(255, 255, 255, 0.5),
    rgba(160, 200, 255, 0.16) 55%,
    transparent 72%
  );
}
.lang.on .dot {
  background: radial-gradient(circle at 38% 30%, #f2ffc4, #9ae024 55%, #55a10c);
  box-shadow:
    inset 0 0 0 2px #eaffc4,
    0 0 9px rgba(160, 235, 50, 0.85);
}
@media (orientation: portrait) {
  #panel-lang {
    top: calc(env(safe-area-inset-top) + var(--orb) + 44px);
    transform: translateX(-50%);
  }
  #panel-lang:not(.hidden) {
    animation-name: gearInL;
  }
  #lang-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    overflow-y: auto;
    max-height: calc(min(100dvh, var(--yt, 100dvh)) - var(--orb) - 44px - 178px);
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: none;
  }
  #lang-list::-webkit-scrollbar {
    display: none;
  }
  #panel-lang h3 {
    font-size: calc(var(--u) * 2.4);
  }
  #lang-close {
    --bh: 46px;
  }
}
@media (max-height: 819px) {
  #lang-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #panel-lang {
    width: min(92vw, calc(var(--u) * 30));
  }
}
@media (orientation: landscape) and (min-height: 521px) {
  #panel-lang {
    top: calc(env(safe-area-inset-top) + var(--orb) + 24px);
    transform: translateX(-50%);
  }
  #panel-lang:not(.hidden) {
    animation-name: gearInL;
  }
  #lang-list .row {
    height: 40px;
    font-size: clamp(14px, calc(var(--u) * 0.85), 21px);
    padding-left: 24px;
  }
  #lang-close {
    --bh: 46px;
  }
  #panel-lang h3 {
    font-size: clamp(24px, calc(var(--u) * 1.6), 40px);
  }
  #lang-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
    max-height: calc(100dvh - 190px);
    scrollbar-width: none;
    touch-action: pan-y;
  }
  #lang-list::-webkit-scrollbar {
    display: none;
  }
  #panel-lang {
    width: min(70vw, 640px);
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  #lang-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
    overflow-y: auto;
    max-height: calc(100dvh - 118px);
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-right: 2px;
    scrollbar-width: none;
  }
  #lang-list::-webkit-scrollbar {
    display: none;
  }
  #panel-lang {
    display: flex;
    width: min(66vw, 560px);
    padding: 6px 14px 8px;
    overflow: visible;
    top: calc(env(safe-area-inset-top) + 8px);
    transform: translateX(-50%);
    gap: 3px;
  }
  #panel-lang:not(.hidden) {
    animation-name: gearInL;
  }
  #panel-lang h3 {
    font-size: 27px;
  }
  #lang-list .row {
    font-size: 14px;
    padding: 0 10px 0 22px;
  }
  #lang-close {
    display: grid;
    --bh: 46px;
    margin-top: 0;
    width: min(32%, 220px);
    font-size: 24px;
  }
  .dot {
    width: 18px;
  }
}
/* layout adjustments, part 1 */
/* portrait level grid: title on the same line as the buttons, smaller bubbles, total pill just below the grid */
@media (orientation: portrait) {
  #levels {
    padding-top: calc(env(safe-area-inset-top) + var(--orb) + 24px);
  }
  /* title on its own line, on the SAME axis as the grid and the pill (centered flex column): before it was fixed on the buttons' line, shifted left because of the two buttons on the right */
  #levels > .ribbon {
    margin: 0 auto;
    font-size: calc(var(--u) * 1.9);
    min-width: min(52vw, 300px);
    max-width: calc(100vw - 2 * var(--orb) - 24px);
  }
  #grid {
    --c: min(19.5vw, 100px, 10.2dvh, calc((100dvh - 128px - var(--u) * 7) / 5 - 8px));
  }
  @media (max-aspect-ratio: 1/2) {
    #grid {
      --c: min(19.5vw, 100px, 8dvh);
    }
  } /* tall screen: the title takes its own line and the yeti sits below the pill */
  #levels-total {
    margin-top: calc(var(--u) * 1.2);
  }
  #worlds .pill.total {
    font-size: calc(var(--orb) * 0.6);
    min-width: calc(var(--orb) * 3.3);
  }
}
/* glass-band titles on the panels that use them (pause, defeat, sound and landscape languages; portrait languages) */
#panel-lang h3,
#pause .ribbon,
#end:not(.won) .ribbon,
#panel-sound h3 {
  position: relative;
  isolation: isolate;
}
@media (orientation: landscape) {
  #pause .ribbon,
  #end:not(.won) .ribbon,
  #panel-sound h3,
  #panel-lang h3 {
    padding: 0.3em 1.1em;
  }
  #pause .ribbon::before,
  #end:not(.won) .ribbon::before,
  #panel-sound h3::before,
  #panel-lang h3::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border: solid transparent;
    border-width: 0.93em;
    border-image: url(assets/ui/cap-level.webp) 61 fill;
  }
}
@media (orientation: portrait) {
  #panel-lang h3 {
    padding: 0.3em 1.1em;
  }
  #panel-lang h3::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border: solid transparent;
    border-width: 0.93em;
    border-image: url(assets/ui/cap-level.webp) 61 fill;
  }
}
/* languages: selection dot to the left of the text, without a thick outline */
#lang-list .row {
  flex-direction: row;
  -webkit-text-stroke: 0.025em var(--stroke);
}
#lang-list .row .dot {
  order: -1;
}
#lang-list .row {
  padding: 0 calc(var(--u) * 0.9) 0 calc(var(--u) * 0.9);
  gap: 12px;
}
/* layout adjustments, part 2 */
.dot {
  background: transparent;
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, 0.92);
}
.lang.on .dot {
  background: radial-gradient(circle at 38% 30%, #f2ffc4, #9ae024 55%, #55a10c);
  box-shadow: 0 0 6px rgba(160, 235, 50, 0.7);
}
.wcard b {
  font-size: calc(var(--u) * 1.16);
  margin-top: calc(var(--w) * -0.14);
  padding: 0 0.6em;
}
@media (orientation: landscape) {
  .wcard b::before,
  .wcard .wst::before {
    display: none;
  }
  .wcard b,
  .wcard .wst {
    height: auto;
  }
  .wcard b {
    margin-top: 0;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .row-btn {
    gap: 18px;
  }
  #end .row-btn .orb {
    --orb: max(60px, calc(var(--u) * 4.4));
  }
  .steps li:nth-child(3) .pic img {
    width: 84%;
    height: 84%;
  }
}
/* layout adjustments, part 3: title in a band straddling the panel's top edge; languages in pale glass */
@media (orientation: landscape) {
  #pause .ribbon,
  #end:not(.won) .ribbon {
    margin-top: calc(-0.95em - 12px);
  }
  #panel-sound h3,
  #panel-lang h3 {
    margin-top: calc(-0.95em - 12px);
  }
  #panel-sound,
  #panel-lang {
    overflow: visible;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  body:has(#end-stars.lost) #end {
    padding-top: 52px;
  }
  #panel-lang {
    top: 36px;
  }
  #panel-sound {
    top: calc(env(safe-area-inset-top) + var(--orb) + 40px);
  }
}
@media (orientation: portrait) {
  #panel-lang h3 {
    margin-top: calc(-0.95em - 6px);
  }
}
#panel-lang > .fr {
  filter: brightness(1.18) saturate(0.75);
  opacity: 0.88;
}
#lang-list .row > .fr {
  filter: brightness(1.12) saturate(0.8);
}
/* End of style.css (complete file). */
