/* Mahjong Garden styles, part 1 of 4: base styles: fonts, canvas, top bar, helpers, first screens. The four files are loaded in order (see index.html) and each one can override the one before it: to change a rule, edit the LAST file that sets it. */

:root {
  --wf: url(../assets/fundo.webp);
  --wfl: url(../assets/fundo-largo.webp);
  --wflu: url(../assets/fundo-largo-ultra.webp);
  --wm: url(../assets/mapa.webp);
  --wmd: url(../assets/mapa-deitado.webp);
  --wmu: url(../assets/mapa-ultra.webp);
  --wma: url(../assets/mapa-alto.webp);
  --wmpu: url(../assets/mapa-pe-ultra.webp);
  --wmpa: url(../assets/mapa-pe-alto.webp);
} /* scenery of world 1 (garden); the other worlds switch it via body[data-world] */
@font-face {
  font-family: 'Fredoka';
  font-weight: 400 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Fredoka';
  font-weight: 400 700;
  font-display: swap;
  src: url(../assets/fonts/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
:root {
  --ink: #3a2416;
  --line: #6b4529; /* thin, medium-brown borders, as in the design */
  --cream: #fff6e2;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --u: 4px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
body {
  background: #8fd36a var(--wf) center / cover no-repeat;
}
body.land {
  background-image: var(--wfl);
}
#back {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#ui > * {
  pointer-events: auto;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* thick-bordered plaques with volume (never a black box with text) */
.round {
  width: clamp(60px, 8.5vmin, 88px);
  height: clamp(60px, 8.5vmin, 88px);
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--cream);
  box-shadow: 0 5px 0 rgba(107, 69, 41, 0.6);
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
  transition: transform 0.08s;
}
.round:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(107, 69, 41, 0.6);
}
.round svg {
  width: 58%;
  height: 58%;
  fill: var(--ink);
  stroke: var(--ink);
}
.round.small {
  width: clamp(48px, 13vw, 66px);
  height: clamp(48px, 13vw, 66px);
}
.round.small {
  background: linear-gradient(#ffd84a, #f5b417);
}
.round.small svg {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 1;
}
.pill {
  height: clamp(44px, 6vmin, 58px);
  padding: 0 18px;
  border-radius: 30px;
  border: 2.5px solid var(--line);
  background: var(--cream);
  box-shadow: 0 3px 0 rgba(58, 36, 22, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
}
.pill b {
  font-size: 24px;
}
.pill.level {
  min-width: 24vw;
  max-width: 190px;
  justify-content: center;
}
.pill.level b {
  font-size: clamp(28px, 7.5vw, 40px);
}
.pill.coins b {
  font-size: clamp(24px, 6.5vw, 34px);
}
.topbar .coins {
  max-width: 220px;
}
.pill {
  border-width: 3.5px !important;
}
.rem {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 3px solid rgba(58, 36, 22, 0.25);
  font-size: 18px;
  font-weight: 700;
}
.rem i {
  width: 14px;
  height: 16px;
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  background: #fffbf2;
  display: block;
}
.rem em {
  font-style: normal;
}
.rem small {
  font-size: 15px;
  font-weight: 600;
}
@media (max-width: 349px) {
  .rem small {
    display: none;
  }
}
@media (max-width: 400px) {
  .pill {
    padding: 0 10px;
    font-size: 15px;
    gap: 4px;
  }
  .rem small {
    font-size: 13px;
  }
  .tagline {
    font-size: 15px;
  }
  .pill b {
    font-size: 20px;
  }
  .rem {
    font-size: 15px;
    padding-left: 7px;
    margin-left: 3px;
  }
  .coins i {
    width: 24px;
    height: 24px;
  }
}

.topbar {
  position: absolute;
  top: calc(var(--sat) + 10px);
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.topbar .level {
  position: absolute;
  left: 36%;
  width: 19%;
  padding: 0;
}
.topbar .coins {
  position: relative;
  width: 31%;
  margin-right: 3%;
  justify-content: flex-end;
  padding-right: 16px;
}
.topbar .coins i {
  position: absolute;
  left: -6px;
  width: 46px;
  height: 46px;
  margin: 0;
}
.topbar .coins b {
  flex: 1;
  text-align: center;
  padding-left: 26px;
}
.round .spark,
.spark {
  position: absolute;
  width: 28px;
  height: 22px;
  left: -12px;
  top: -14px;
  stroke: #ffc531 !important;
  fill: none !important;
  pointer-events: none;
}
.coins .spark {
  left: -6px;
  top: -16px;
}
.coins i {
  width: 38px;
  height: 38px;
  margin-left: -12px;
  background: url(../assets/ui/coin.webp) center / contain no-repeat;
  display: block;
}
.coins.bump {
  animation: bump 0.2s ease-out;
}
@keyframes bump {
  40% {
    transform: scale(1.08);
  }
}
.helper.used {
  animation: used 0.35s ease-out;
}
@keyframes used {
  30% {
    transform: scale(0.9);
  }
  70% {
    transform: scale(1.08);
  }
}

.mascot {
  position: absolute;
  right: var(--mascot-right, 8px);
  bottom: var(--mascot-bottom, 70%);
  height: var(--mascot-h, 110px);
  transition: opacity 0.2s;
  transform-origin: 50% 100%;
  animation: breathe 3.2s ease-in-out infinite;
  pointer-events: none;
  filter: drop-shadow(0 4px 0 rgba(58, 36, 22, 0.25));
}
.mascot.boing {
  animation:
    boing 0.42s cubic-bezier(0.3, 1.6, 0.5, 1),
    breathe 3.2s 0.42s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    transform: scale(1.012, 0.99);
  }
}
@keyframes boing {
  0% {
    transform: scale(0.94, 1.05);
  }
  60% {
    transform: scale(1.04, 0.97);
  }
  100% {
    transform: scale(1);
  }
}

.helpers {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--sab) + 2.5vh);
  display: flex;
  justify-content: center;
  gap: min(6vw, 40px);
  pointer-events: none;
}
.helper {
  width: min(20vw, 110px) !important;
  height: min(20vw, 110px) !important;
  box-shadow:
    0 6px 0 rgba(107, 69, 41, 0.6),
    0 10px 14px rgba(58, 36, 22, 0.25) !important;
}
.helper img {
  width: 66%;
  height: 66%;
  object-fit: contain;
  pointer-events: none;
}
.hwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: auto;
}
.hlabel {
  font-size: clamp(14px, 2.1vmin, 19px);
  font-weight: 700;
  color: var(--ink);
}
.helpers > * {
  pointer-events: auto;
}
.helper .badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 36px;
  height: 36px;
  border-radius: 18px;
  font-size: 20px !important;
  background: #4cbb4a;
  color: #fff;
  border: 2.5px solid var(--line);
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
}
.helper.off {
  opacity: 0.55;
}
.helper.off .badge {
  background: #a99;
}
.shake {
  animation: shake 0.3s;
}
@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}
.helper svg {
  stroke: var(--ink);
  fill: none;
}
.helper[data-h='hint'] svg circle {
  fill: #ffe066;
}

/* landscape: mascot on the left, helpers in a column on the right */
body.land .mascot {
  left: calc(var(--sx) + 2 * var(--sw) / 100);
  right: auto;
  top: auto;
  bottom: calc(var(--sab) + 18px);
}
body.modal-open .mascot {
  opacity: 0;
}
body.land .helpers {
  left: auto;
  right: calc(var(--sx) + 3 * var(--sw) / 100);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  flex-direction: column;
}
body.land .helper {
  width: clamp(72px, calc(11 * var(--uh)), 104px) !important;
  height: clamp(72px, calc(11 * var(--uh)), 104px) !important;
}

.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--sat) + 76px);
  transform: translate(-50%, -10px);
  opacity: 0;
  max-width: min(86vw, 520px);
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 10px 18px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 0 var(--ink);
  transition:
    opacity 0.25s,
    transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(58, 36, 22, 0.48);
  animation: fade 0.35s ease-out;
}
.modal {
  width: min(88cqw, 85.11cqw);
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: 5.96cqw;
  box-shadow: 0 1.7cqw 0 rgba(107, 69, 41, 0.6);
  padding: 3.83cqw 4.68cqw 4.68cqw;
  text-align: center;
  position: relative;
  animation: pop 0.28s ease-out;
}
.modal h2 {
  margin: 1.28cqw 0;
  font-size: 7.23cqw;
}
.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 4px;
}
.star {
  width: 52px;
  height: 52px;
  fill: #e6d8bf;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
  animation: starIn 0.42s backwards ease-out;
}
.star:nth-child(2) {
  margin-top: -10px;
  width: 62px;
  height: 62px;
}
.star.on {
  fill: #ffd23a;
}
@keyframes starIn {
  0% {
    transform: scale(0.5) rotate(-30deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.earn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.28cqw;
  font-size: 5.53cqw !important;
  font-weight: 700;
}
.earn i {
  width: 6.38cqw;
  height: 6.38cqw;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  display: block;
  background: radial-gradient(circle at 35% 35%, #fff6a8, #ffd23a 45%, #f0a91c);
}
.modal p {
  margin: 1.28cqw 0 2.98cqw;
  font-size: 3.83cqw;
  text-wrap: balance;
}
.m-face.late {
  animation: pop 0.3s 0.22s backwards ease-out;
}
.m-face {
  height: 25.53cqw;
  margin-top: -17.02cqw;
}
.row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  border: 3px solid var(--line);
  border-radius: 20px;
  padding: 12px 26px;
  font-size: 23px;
  font-weight: 700;
  background: var(--cream);
  box-shadow: 0 5px 0 rgba(107, 69, 41, 0.6);
  transition: transform 0.08s;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(107, 69, 41, 0.6);
}
.btn.go {
  background: linear-gradient(#8ee36f, #4cbb4a);
  color: #fff;
  text-shadow: 0 2px 0 var(--ink);
}
@keyframes pop {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  65% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

.home {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 12px;
  padding: calc(var(--sat) + 20px) 16px calc(var(--sab) + 20px);
  overflow-y: auto;
}
.home-mascot {
  height: min(24vh, 300px);
  animation: breathe 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.title {
  margin: 0;
  font-size: clamp(34px, min(9vw, 7.5vh), 84px);
  color: #fff;
  letter-spacing: 1px;
  text-align: center;
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
}
.tagline {
  margin: 0 0 10px;
  font-size: clamp(17px, 2.6vmin, 24px);
  max-width: calc(100vw - 32px);
  font-weight: 600;
  background: var(--cream);
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 6px 14px;
  text-align: center;
}
.home h3 {
  margin: 14px 0 4px;
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  font-size: 24px;
}
.levels {
  --lv: clamp(46px, min(9vmin, 7.2vh), 84px);
  display: grid;
  grid-template-columns: repeat(5, var(--lv));
  gap: 10px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 246, 226, 0.92);
  border: 2.5px solid var(--line);
  max-width: calc(100vw - 24px);
}
.lv {
  width: var(--lv);
  height: var(--lv);
  border-radius: 16px;
  border: 3px solid var(--line);
  background: #ffe28a;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 22px;
  font-weight: 700;
}
.lv.locked {
  background: #e3d6bf;
  color: #7d6a52;
  box-shadow: 0 4px 0 #9c8a70;
  border-color: #9c8a70;
}
.sound {
  position: absolute;
  top: calc(var(--sat) + 10px);
  right: 12px;
}
.sound.muted {
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .mascot,
  .home-mascot,
  .mascot.boing {
    animation: none;
  }
  .modal,
  .toast {
    animation: none;
    transition: none;
  }
}

.home {
  justify-content: safe center;
  gap: 1.6vh;
  padding-top: calc(var(--sat) + 9vh);
}
.home-coins {
  position: absolute;
  top: calc(var(--sat) + 10px);
  right: 3%;
  width: min(36%, 220px);
  height: clamp(44px, 6vmin, 58px);
}
.home-coins i {
  position: absolute;
  left: -6px;
  width: 46px;
  height: 46px;
}
.home-coins b {
  flex: 1;
  text-align: center;
  padding-left: 26px;
  font-size: clamp(24px, 6.5vw, 34px);
}
.home-mascot {
  height: min(22vh, 230px);
  margin-bottom: -5vh;
  position: relative;
  z-index: 0;
}
.logo {
  width: min(86vw, 520px);
  max-height: 34vh;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 0 rgba(107, 69, 41, 0.35));
  animation: logoIn 0.6s ease-out;
}
@keyframes logoIn {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  70% {
    transform: scale(1.03);
    opacity: 1;
  }
}
.btn .bi {
  width: 0.9em;
  height: 0.9em;
  fill: currentColor;
  vertical-align: -0.08em;
  filter: drop-shadow(0 2px 0 rgba(58, 36, 22, 0.6));
}
.home-row {
  display: flex;
  gap: 8vw;
  margin-top: 2vh;
}
.small-btn {
  width: clamp(64px, 17vw, 96px) !important;
  height: clamp(64px, 17vw, 96px) !important;
}
.small-btn svg {
  fill: #ffc531 !important;
  stroke: var(--line) !important;
  width: 56% !important;
  height: 56% !important;
}
.small-btn.muted {
  opacity: 0.55;
}

.map {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.map-art {
  position: absolute;
  background: var(--wm) center / 100% 100% no-repeat;
}
.topbar .round.small svg {
  fill: var(--ink);
}

.ribbon {
  position: relative;
  margin: -1.28cqw auto 2.13cqw;
  width: 108%;
  margin-left: -4%;
  aspect-ratio: 900 / 219;
  background: url(../assets/ui/ribbon.webp) center / contain no-repeat;
  display: grid;
  place-items: center;
}
.ribbon.green {
  background-image: url(../assets/ui/ribbon-green.webp);
}
.ribbon span {
  font-size: clamp(5.11cqw, 6.6cqw, 7.23cqw);
  font-weight: 700;
  color: var(--ink);
  margin-top: -0.85cqw;
}
.ribbon.green span {
  color: #fff;
  -webkit-text-stroke: 1.06cqw #5b7a2a;
  paint-order: stroke fill;
}
.modal {
  padding-top: 1.28cqw;
}
.m-face {
  height: 27.66cqw;
  margin: -21.28cqw auto -3.83cqw;
  display: block;
  position: relative;
  z-index: 1;
}
.m-body p {
  margin: 0.85cqw 0 2.98cqw;
}
.btn.yellow {
  background: linear-gradient(#ffe27a, #ffc531);
}
.btn.wide {
  width: 100%;
  font-size: clamp(22px, 6vw, 28px);
  padding: 12px 0;
  margin: 5px 0;
}
.btn .bbadge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  margin-left: 6px;
  background: #4cbb4a;
  color: #fff;
  border: 2px solid var(--line);
  font-size: 16px;
  text-shadow: none;
  vertical-align: 2px;
}
.col {
  display: flex;
  flex-direction: column;
}
.switches {
  display: flex;
  gap: 2.13cqw;
  margin: 2.13cqw 0 0;
}
.switch {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.28cqw;
  border: 2.5px solid var(--line);
  border-radius: 3.4cqw;
  background: #fff8e8;
  padding: 1.7cqw 2.13cqw;
  font-weight: 700;
  font-size: 3.4cqw;
}
.switch b {
  width: 9.36cqw;
  height: 5.11cqw;
  border-radius: 2.55cqw;
  background: #cbbfae;
  position: relative;
  border: 2px solid var(--line);
}
.switch b::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 3.83cqw;
  height: 3.83cqw;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
.switch.on b {
  background: #4cbb4a;
}
.switch.on b::after {
  left: 4.47cqw;
}
.mini-tray {
  display: flex;
  justify-content: center;
  gap: 0.85cqw;
  padding: 1.7cqw;
  border-radius: 3.4cqw;
  border: 2.5px solid var(--line);
  background: linear-gradient(#f4b465, #cf843d);
  margin: 2px 0 1.7cqw;
}
.mini-tray i {
  width: 11%;
  aspect-ratio: 1;
  border-radius: 1.7cqw;
  border: 2px solid var(--line);
  background: #fff6dc center / 78% no-repeat;
}
.modal.win .stars {
  margin-top: 0.85cqw;
}
.modal.win .star {
  width: 13.62cqw;
  height: 13.62cqw;
}
.modal.win .star:nth-child(2) {
  width: 16.6cqw;
  height: 16.6cqw;
  margin-top: -3.4cqw;
}
.earn {
  background: #fff8e8;
  border: 2.5px solid var(--line);
  border-radius: 212.55cqw;
  width: max-content;
  margin: 1.28cqw auto 2.98cqw !important;
  padding: 2px 3.4cqw 2px 1.28cqw;
}
.earn i {
  width: 7.23cqw;
  height: 7.23cqw;
  border: none;
  background: url(../assets/ui/coin.webp) center / contain no-repeat;
}

.bubble {
  position: absolute;
  right: calc(var(--mascot-right, 8px) + 30vw);
  top: calc(var(--sat) + 9vh);
  max-width: 46vw;
  background: #fff;
  border: 2.5px solid var(--line);
  border-radius: 18px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: clamp(14px, 3.8vw, 18px);
  text-align: center;
  animation: pop 0.4s ease-out;
  pointer-events: none;
}
.bubble::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 40%;
  border: 8px solid transparent;
  border-left-color: var(--line);
}
.hand {
  position: absolute;
  width: clamp(64px, 17vw, 96px);
  transform: translate(-20%, -10%);
  pointer-events: none;
  animation: tap 1.1s ease-in-out infinite;
  filter: drop-shadow(0 4px 2px rgba(58, 36, 22, 0.3));
}
@keyframes tap {
  0%,
  100% {
    translate: 10px 14px;
  }
  50% {
    translate: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hand,
  .stop.cur,
  .logo {
    animation: none;
  }
}
.btn {
  font-size: clamp(20px, 5.4vw, 26px);
  border-width: 3.5px !important;
}
.btn.go {
  background: linear-gradient(#86e35e, #3fae37);
  color: #fff;
  -webkit-text-stroke: 4px #2e6b1f;
  paint-order: stroke fill;
  text-shadow: none;
  box-shadow: 0 5px 0 #2e6b1f;
}
.btn.yellow {
  -webkit-text-stroke: 0;
  color: var(--ink);
  box-shadow: 0 5px 0 #a8741c;
}
.btn.ghost {
  background: linear-gradient(#fffaf0, #f3e2c2);
}
.row {
  flex-wrap: nowrap;
}
.row .btn {
  flex: 1;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}
.modal.win,
.modal.lose {
  width: min(92cqw, 91.49cqw);
}
.home-mascot {
  height: min(30vh, 300px);
  margin-bottom: -9vh;
}

.hlabel {
  display: none;
}
body.land .hlabel {
  display: block;
  background: var(--cream);
  border: 2.5px solid var(--line);
  border-radius: 12px;
  padding: 1px 10px;
  margin-top: -10px;
  position: relative;
  z-index: 1;
}
body.land .hwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo {
  width: min(92vw, 560px);
  max-height: 40vh;
}
body.land .home {
  flex-direction: column;
  padding-top: calc(var(--sat) + 4vh);
}
body.land .home-mascot {
  position: absolute;
  left: calc(var(--sx) + 4 * var(--sw) / 100);
  bottom: 4vh;
  height: min(calc(62 * var(--uh)), 460px);
  margin: 0;
}
body.land .logo {
  width: min(calc(46 * var(--su) / 100), 620px);
  max-height: calc(52 * var(--uh));
}
.modal.lose .scene {
  height: 18cqh;
  border-radius: 3.4cqw;
  border: 2.5px solid var(--line);
  margin: 0 0 2.13cqw;
  position: relative;
  overflow: hidden;
  background: var(--wf) center 35% / 160% auto no-repeat;
}
.modal.lose .scene img {
  position: absolute;
  left: 50%;
  bottom: -8%;
  height: 100%;
  transform: translateX(-50%);
}
.modal.lose .m-face {
  display: none;
}
.modal.win .m-face {
  filter: drop-shadow(0 0 3.83cqw rgba(255, 225, 110, 0.95));
}
.modal.win::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -23.4cqw;
  width: 46.81cqw;
  height: 46.81cqw;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 238, 150, 0.9), rgba(255, 238, 150, 0) 65%);
  pointer-events: none;
}

.bi {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  vertical-align: -0.22em;
  filter: none !important;
}
.small-btn img {
  width: 60%;
  height: 60%;
  object-fit: contain;
}
.yellow-btn {
  background: linear-gradient(#ffe27a, #ffc531) !important;
}
.yellow-btn img {
  width: 62%;
  height: 62%;
  object-fit: contain;
  filter: brightness(0.35) sepia(1) hue-rotate(-20deg);
}
img.star {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: grayscale(1) brightness(1.35) opacity(0.75);
  animation: starIn 0.42s backwards ease-out;
}
img.star.on {
  filter: drop-shadow(0 0 10px rgba(255, 220, 90, 0.9));
}
.modal.win img.star {
  width: 18.3cqw;
  height: 18.3cqw;
}
.modal.win img.star:nth-child(2) {
  width: 22.55cqw;
  height: 22.55cqw;
  margin-top: -4.68cqw;
}
.ribbon.gold {
  background-image: url(../assets/ui/ribbon-gold.webp);
  aspect-ratio: 900 / 245;
}
.ribbon.gold span {
  color: #fff;
  -webkit-text-stroke: 1.06cqw #8a5a14;
  paint-order: stroke fill;
}
.modal {
  background: url(../assets/ui/panel.webp) center / 100% 100% no-repeat;
  border: none !important;
  box-shadow: none !important;
  padding: 2.13cqw 5.53cqw 6.38cqw;
  filter: drop-shadow(0 1.7cqw 0 rgba(107, 69, 41, 0.45));
}
.m-foot {
  display: block;
  width: 46%;
  margin: 2.55cqw auto -8.51cqw;
}
.home-mascot {
  height: min(32vh, 320px);
}
body.land .helper {
  width: clamp(80px, calc(14 * var(--uh)), 120px) !important;
  height: clamp(80px, calc(14 * var(--uh)), 120px) !important;
}
body.land .hlabel {
  font-size: clamp(15px, calc(2.4 * var(--uh)), 20px);
}

.btn {
  border: 4px solid var(--ink) !important;
  position: relative;
  line-height: 1.15;
  font-size: clamp(24px, 6.6vw, 32px);
  padding: 12px 22px;
}
.btn::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 6%;
  height: 32%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  pointer-events: none;
}
.btn.wide {
  font-size: clamp(26px, 7vw, 34px);
  padding: 14px 0;
}
.modal .row .btn {
  font-size: clamp(4.26cqw, 5.4cqw, 5.53cqw);
}
.lvw {
  display: none;
}
body.land .lvw {
  display: inline;
  font-size: 22px;
  font-weight: 700;
}
body.land .pill.level {
  max-width: 220px;
  min-width: 170px;
}
.modal.lose .row {
  padding: 0 2px;
}
.modal.lose .row .btn {
  flex: 1 1 0;
  min-width: 0;
  font-size: clamp(3.62cqw, 4.6cqw, 4.68cqw);
  padding: 2.55cqw 1.28cqw;
}
.modal.lose .scene {
  background-position: center 22%;
  background-size: 220% auto;
}
.mini-tray i {
  width: 13.5%;
}
.bubble {
  font-size: clamp(17px, 4.6vw, 22px);
  padding: 12px 16px;
  max-width: 54vw;
  border-width: 3px;
}
.bubble::after {
  right: -18px;
  border-width: 12px;
}
.hand {
  width: clamp(76px, 20vw, 110px);
}
.modal.pause .m-face,
.modal.win .m-face {
  margin-bottom: -9.79cqw;
  z-index: 0;
}
.ribbon {
  z-index: 1;
}
.earn {
  font-size: clamp(6.38cqw, 8cqw, 8.51cqw) !important;
}
.earn i {
  width: 8.94cqw;
  height: 8.94cqw;
}
.modal.win::before {
  top: -27.66cqw;
  width: 63.83cqw;
  height: 63.83cqw;
}
body.land .home-coins {
  right: 2%;
  width: min(22%, 240px);
}
body.land .small-btn {
  width: clamp(70px, calc(11 * var(--uh)), 100px) !important;
  height: clamp(70px, calc(11 * var(--uh)), 100px) !important;
}
.home-next {
  display: none;
}
body.land .home-next {
  display: flex;
  position: absolute;
  right: calc(var(--sx) + 4 * var(--sw) / 100);
  top: 22vh;
  flex-direction: column;
  gap: calc(4 * var(--uh));
  align-items: center;
}
body.land .home-next .stop {
  position: relative;
  transform: none;
}
body.land .home-next .stop.cur {
  animation: none;
}
.title-sparks {
  position: relative;
}
.modal.lose .row .btn {
  white-space: nowrap;
  font-size: 4.26cqw !important;
  padding: 2.55cqw 0.85cqw !important;
}
.modal.lose .row .btn .bi {
  width: 1em;
  height: 1em;
}
.modal.lose .row .btn .bbadge {
  min-width: 4.68cqw;
  height: 4.68cqw;
  font-size: 2.98cqw;
  margin-left: 3px;
}
body.land .helper {
  width: clamp(90px, calc(19 * var(--uh)), 140px) !important;
  height: clamp(90px, calc(19 * var(--uh)), 140px) !important;
}
body.land .hlabel {
  font-size: clamp(16px, calc(3 * var(--uh)), 24px);
}

.home {
  padding-top: calc(var(--sat) + 4vh);
  padding-bottom: calc(var(--sab) + 6vh);
  gap: 1.2vh;
}
.home-mascot {
  height: min(25vh, 260px);
  margin-bottom: -7vh;
}
.logo {
  width: min(94vw, 600px);
  max-height: 46vh;
}
.modal.pause .m-face {
  margin-bottom: -4.26cqw;
}
.modal.win .m-face {
  height: 40.43cqw;
  margin: -31.91cqw auto -5.53cqw;
}
.modal.win .stars {
  position: relative;
}
.modal.win .stars::before {
  content: '';
  position: absolute;
  inset: -30% -10%;
  z-index: -1;
  background: radial-gradient(ellipse, rgba(255, 236, 140, 0.95), rgba(255, 236, 140, 0) 70%);
}
.modal.win .row .btn {
  font-size: clamp(4.68cqw, 6cqw, 5.96cqw);
  padding: 2.98cqw 2.13cqw;
}
.m-foot {
  width: 40%;
  margin-top: 3.83cqw;
}
.modal.lose .row .btn.yellow {
  white-space: normal;
  line-height: 1.05;
}
.modal.lose .scene {
  height: 20cqh;
  background-position: 30% 18%;
  background-size: 260% auto;
}
.ribbon {
  width: 116%;
  margin-left: -8%;
}
.hand {
  width: clamp(90px, 24vw, 128px);
  transform: translate(-6%, 12%);
}
body.land .home-mascot {
  height: min(calc(48 * var(--uh)), 360px);
}
body.land .home-row {
  position: absolute;
  top: calc(var(--sat) + 10px);
  left: 12px;
  margin: 0;
  gap: 12px;
}
body.land .helpers {
  right: calc(var(--sx) + 4 * var(--sw) / 100);
}

.modal.lose .row .btn.yellow {
  white-space: nowrap;
  color: var(--ink);
  -webkit-text-stroke: 0;
}
.mini-tray i.pair {
  box-shadow: 0 0 2.13cqw 3px rgba(255, 220, 90, 0.95);
  background-color: #fff3c4;
}
.modal.lose .scene {
  border: none;
  background-color: transparent;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 55%, transparent 78%);
}
.switch span {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.85cqw;
}
.switch {
  font-size: 3.19cqw;
  padding: 1.7cqw 1.7cqw;
}
.stars {
  position: relative;
}
.stars .spark {
  width: 40px;
  height: 32px;
  left: -8px;
  top: 10px;
}
.stars .spark.r {
  left: auto;
  right: -8px;
  transform: scaleX(-1);
}
.plate {
  display: none;
  height: 46px;
  position: absolute;
  left: 16%;
  top: -2px;
}
.plate.show,
body.land .plate {
  display: block;
}
.rays {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ray {
  position: absolute;
  width: 34px;
  height: 30px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 24'%3E%3Cpath d='M4 16 9 13M8 7l4 4M17 3v6' stroke='%23ffc531' stroke-width='3.4' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
}
.ray.l {
  left: 14%;
  top: 14%;
}
.ray.r {
  right: 14%;
  top: 14%;
  transform: scaleX(-1);
}
.ray.l2 {
  left: 2%;
  bottom: 14%;
}
.ray.r2 {
  right: 2%;
  bottom: 14%;
  transform: scaleX(-1);
}
.home-mascot {
  height: min(28vh, 290px);
}
body.land .home-next {
  right: calc(var(--sx) + 9 * var(--sw) / 100);
  top: 16vh;
}
body.land .home-next::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 4%;
  bottom: 4%;
  width: 46px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(#e9d3a8 0 22px, #d8bb88 22px 26px);
  border-radius: 22px;
  border: 2.5px solid rgba(107, 69, 41, 0.45);
  z-index: -1;
}
body.land .home > .rays:first-child {
  position: absolute;
  left: calc(var(--sx) + 4 * var(--sw) / 100);
  bottom: 4vh;
}
body.land .home > .rays:first-child .home-mascot {
  position: static;
}
.modal.lose .row .btn.yellow {
  font-size: 3.62cqw !important;
}
.plate {
  height: 62px;
  top: -8px;
}

.mascot.hop {
  animation:
    hop 0.42s ease-out,
    breathe 3.2s 0.42s ease-in-out infinite;
}
@keyframes hop {
  35% {
    transform: translateY(-8%);
  }
  70% {
    transform: translateY(0) scale(1.03, 0.97);
  }
}
.home-mascot {
  height: min(34vh, 340px);
  margin-bottom: -10vh;
}
.small-btn {
  width: clamp(78px, 21vw, 112px) !important;
  height: clamp(78px, 21vw, 112px) !important;
  border: 4px solid #c98a2a !important;
  box-shadow:
    0 0 0 3px var(--line),
    0 6px 0 rgba(107, 69, 41, 0.6) !important;
}
.btn.ghost {
  background: linear-gradient(#fff6dc, #f1d9a6);
  border-color: #9b6a2e !important;
}
.btn.wide .bi {
  width: 1.3em;
  height: 1.3em;
}
.m-foot {
  margin-top: 5.53cqw;
  width: 38%;
}
.modal.win .m-face {
  animation:
    pop 0.3s 0.22s backwards ease-out,
    winHop 0.9s 0.6s ease-in-out infinite;
}
@keyframes winHop {
  50% {
    transform: translateY(-7%);
  }
}
.modal.win .row {
  margin-top: 0.85cqw;
}
.modal.lose .row .btn.yellow {
  white-space: normal !important;
  line-height: 1.05;
  font-size: 3.83cqw !important;
}
.modal.lose .two {
  display: inline-block;
  max-width: none;
  white-space: nowrap;
  vertical-align: middle;
}
.helper {
  width: min(23vw, 124px) !important;
  height: min(23vw, 124px) !important;
}
body.land .home-mascot {
  height: min(calc(40 * var(--uh)), 300px);
}
body.land .plate {
  left: 6.5%;
  height: 56px;
}
@media (prefers-reduced-motion: reduce) {
  .mascot.hop,
  .modal.win .m-face {
    animation: none;
  }
}
.logo {
  max-height: 36vh;
}
.home-mascot {
  height: min(30vh, 320px);
  margin-bottom: -9vh;
}
.home {
  justify-content: flex-start;
}

.home {
  justify-content: center;
}
.home-mascot {
  height: min(33vh, 340px);
}
.logo {
  max-height: 41vh;
  width: min(96vw, 620px);
}
.modal-back {
  align-items: start;
  padding-top: calc(var(--sat) + 22cqh);
}
.earn.wait {
  visibility: hidden;
}
.modal {
  animation: pop 0.38s ease-out;
}
@keyframes pop {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  55% {
    transform: scale(1.06);
    opacity: 1;
  }
  80% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}
.modal.lose .row .btn.yellow {
  color: #3a2416 !important;
  font-weight: 800;
}
.modal.lose .scene {
  background-size: 200% auto;
  background-position: 18% 20%;
}
.m-foot {
  margin-top: 7.23cqw;
}
body.land .home-mascot {
  height: min(calc(52 * var(--uh)), 380px);
}
.modal-back {
  align-items: center;
  padding-top: 0;
}
.modal-back:has(.win) {
  align-items: start;
  padding-top: calc(var(--sat) + 22cqh);
}

.modal.win img.star {
  width: 18.3cqw !important;
  height: 18.3cqw !important;
  margin-top: 0 !important;
}
.modal.win img.star:nth-of-type(2) {
  width: 22.98cqw !important;
  height: 22.98cqw !important;
  margin-top: -5.11cqw !important;
}
.btn::after {
  top: 5%;
  height: 24%;
  background: rgba(255, 255, 255, 0.3);
  z-index: 0;
}
.btn.yellow {
  color: #3a2416 !important;
}
.modal.lose .row .btn.yellow {
  font-size: 4.04cqw !important;
}
.modal .row .btn {
  font-size: clamp(4.68cqw, 6cqw, 5.96cqw);
  padding: 3.19cqw 2.13cqw;
}
.modal.pause .m-face {
  height: 31.91cqw;
  margin-top: -25.53cqw;
}
.m-foot {
  width: 32%;
  margin: 6.38cqw auto -7.23cqw;
}
.sep {
  display: flex;
  align-items: center;
  gap: 1.7cqw;
  margin: 2.13cqw 0.85cqw 2px;
  color: #ff8fb8;
  font-size: 4.26cqw;
}
.sep span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(155, 106, 46, 0.45);
}
.sep i {
  font-style: normal;
}
.hand {
  transform: translate(18%, 30%);
}
.modal-back:has(.pause) {
  align-items: start;
  padding-top: calc(var(--sat) + 19cqh);
}

.home {
  padding-top: calc(var(--sat) + 8vh);
}
.home-coins,
.topbar .coins {
  margin-top: 6px;
}
.modal-back:has(.pause) {
  padding-top: calc(var(--sat) + 24cqh);
}
.modal-back:has(.win) {
  padding-top: calc(var(--sat) + 26cqh);
}
body.land .hlabel {
  margin-top: 4px;
}
body.land .home-next {
  gap: calc(2.5 * var(--uh));
}
body.land .home-next::before {
  display: none;
}
body.land .home-next .stop:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 14px;
  height: calc(2.5 * var(--uh));
  transform: translateX(-50%);
  background: #e9d3a8;
  border: 2px solid rgba(107, 69, 41, 0.4);
  border-radius: 6px;
}
.modal-back:has(.pause) {
  padding-top: calc(var(--sat) + 17cqh);
}
.modal.pause .btn.wide {
  padding: 2.34cqw 0;
  margin: 0.85cqw 0;
}
.modal.pause .m-foot {
  margin-bottom: -5.53cqw;
}
.modal-back:has(.pause) {
  padding-top: calc(var(--sat) + 20cqh);
}
.modal.pause .m-face {
  height: 25.11cqw;
  margin-top: -19.57cqw;
}
.modal.pause .ribbon span {
  font-size: clamp(5.96cqw, 7.6cqw, 8.09cqw);
}

.home {
  padding-top: calc(var(--sat) + 11vh);
}
.modal-back:has(.win) {
  padding-top: calc(var(--sat) + 29cqh);
}
.modal.win {
  padding-bottom: 8.51cqw;
}
.modal.win .stars .spark {
  width: 11.06cqw;
  height: 8.94cqw;
  top: 0;
}
body.land .topbar {
  top: calc(var(--sat) + 14px);
}
body.land .helpers {
  top: 56%;
  right: calc(var(--sx) + 5 * var(--sw) / 100);
}
body.land .logo {
  width: min(calc(52 * var(--su) / 100), 700px);
  max-height: calc(56 * var(--uh));
}
body.land .home-next {
  right: calc(var(--sx) + 6 * var(--sw) / 100);
}

.home {
  padding-top: calc(var(--sat) + 7vh);
  padding-bottom: calc(var(--sab) + 4vh);
}
.home-mascot {
  height: min(29vh, 300px);
}
.home-coins {
  z-index: 2;
}
.modal.win {
  padding-bottom: 12.34cqw;
}
.modal.win .row .btn {
  font-size: clamp(5.11cqw, 6.6cqw, 6.38cqw);
}
.helpers {
  bottom: calc(var(--sab) + 3.5vh);
}
.helper {
  width: min(21vw, 118px) !important;
  height: min(21vw, 118px) !important;
}
.hand {
  transform: translate(34%, 46%);
}
body.land .hlabel {
  font-size: clamp(18px, calc(3.4 * var(--uh)), 26px);
}
body.land .lvw,
body.land .pill.level b {
  font-size: 28px;
}

.hand {
  transform: translate(-12%, -6%);
}
body.land .helpers {
  top: 47%;
}
body.land .home-next {
  right: calc(var(--sx) + 10 * var(--sw) / 100);
  top: 18vh;
  gap: calc(3.2 * var(--uh));
}
body.land .home-next .stop {
  width: 84px;
  height: 76px;
}
body.land .home-next .stop.cur {
  width: 108px;
  height: 96px;
}

body.land .helpers {
  top: 58%;
}
body.land .topbar .coins,
body.land .home-coins {
  margin-right: calc(3 * var(--su) / 100);
}
body.land .home-next {
  right: calc(var(--sx) + 14 * var(--sw) / 100);
  top: 20vh;
}
body.land .home-next .stop {
  width: 96px;
  height: 86px;
}
body.land .home-next .stop.cur {
  width: 120px;
  height: 106px;
}
body.land .home-next .stop:not(:last-child)::after {
  width: 22px;
  height: calc(3.2 * var(--uh));
}
body.land .helpers {
  top: 54%;
  gap: calc(2.4 * var(--uh));
}
body.land .helper {
  width: clamp(76px, calc(14 * var(--uh)), 108px) !important;
  height: clamp(76px, calc(14 * var(--uh)), 108px) !important;
}

.stop {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(64px, 17.5vw, 106px);
  aspect-ratio: 240 / 210;
  height: auto;
  padding: 14% 0 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: url(../assets/ui/stop-wood.webp) center / contain no-repeat;
  filter: drop-shadow(0 3px 2px rgba(107, 69, 41, 0.35));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stop b {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1;
  color: #5a3518;
  font-weight: 800;
  -webkit-text-stroke: 0;
}
.stop .sstars {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  display: flex;
}
.sstars .star {
  width: clamp(13px, 3.8vw, 20px);
  height: clamp(13px, 3.8vw, 20px);
  animation: none;
  stroke-width: 2.4;
  margin: 0;
}
.stop.cur {
  background-image: url(../assets/ui/stop-gold.webp);
  width: clamp(74px, 21vw, 124px);
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(255, 215, 70, 0.95));
  animation: curPulse 1.6s ease-in-out infinite;
}
.stop.cur b {
  font-size: clamp(28px, 7.6vw, 42px);
  color: #fff;
  -webkit-text-stroke: 5px #8a5a14;
  paint-order: stroke fill;
}
@keyframes curPulse {
  50% {
    transform: translate(-50%, -50%) scale(1.06);
  }
}

.stop.locked {
  background-image: url(../assets/ui/stop-stone.webp);
}
.stop.locked b {
  color: #4f4a45;
  top: 32%;
}
.stop .lock {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  width: 32%;
  aspect-ratio: 1;
  background: url(../assets/ui/lock.webp) center / contain no-repeat;
}
.stop .spark {
  left: -14px;
  top: -6px;
}
.stop .spark.r {
  left: auto;
  right: -14px;
  transform: scaleX(-1);
}
.map-mascot {
  position: absolute;
  height: clamp(130px, 32vw, 200px);
  transform: translate(-135%, -112%);
  pointer-events: none;
}
.map-head {
  position: absolute;
  top: calc(var(--sat) + 30px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}
.logo-s {
  width: min(62vw, 320px);
  max-height: 17vh;
  object-fit: contain;
}
.map-head .sign {
  margin-top: -6px;
  background: var(--cream);
  border: 2.5px solid var(--line);
  border-radius: 20px;
  padding: 3px 18px 4px;
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(15px, 4vw, 20px);
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(107, 69, 41, 0.35);
}
body.land .home-next .stop {
  position: relative;
  transform: none;
  width: 96px;
}
body.land .home-next .stop.cur {
  width: 132px;
  animation: none;
}
body.land .home-next .stop {
  height: auto;
}
body.land .home-next .stop::after {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .stop.cur {
    animation: none;
  }
}

/* End of css/01-base.css */
