@font-face {
  font-family: "Hidden Lilita One";
  src: url("../assets/fonts/lilita-one.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #fffaf0;
  --blue: #5870ee;
  --blue-dark: #304bbb;
  --pink: #e14e9b;
  --pink-dark: #c82168;
  --cyan: #11bce8;
  --yellow: #ffdc52;
  --night: #202127;
  --night-deep: #101119;
  --muted: #c7c7d2;
  --danger: #ff6a77;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  color: var(--ink);
  background: var(--night);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  min-height: 100dvh;
  background: var(--night) url("../assets/ui/menu-bg.webp") center / 364px 730px repeat;
}

button,
select { font: inherit; }

button { color: inherit; }

button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(56, 115, 225, .26), transparent 17rem),
    var(--night);
}

.boot__logo {
  width: min(280px, 66vw);
  height: auto;
  filter: drop-shadow(0 9px 0 rgba(0, 0, 0, .22));
}

.boot__track,
.preparing__track {
  overflow: hidden;
  width: min(290px, 72vw);
  height: 12px;
  border: 3px solid #0b0c12;
  border-radius: 99px;
  background: #444754;
}

.boot__track span,
.preparing__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #76d6ff);
  transition: width .25s ease;
}

.boot__label {
  min-height: 1.4em;
  color: var(--muted);
  font-weight: 800;
}

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100dvh;
  padding:
    calc(10px + var(--safe-top))
    calc(18px + var(--safe-right))
    calc(8px + var(--safe-bottom))
    calc(18px + var(--safe-left));
  background:
    linear-gradient(180deg, rgba(32, 33, 39, .16), rgba(14, 15, 21, .08)),
    url("../assets/ui/menu-bg.webp") center / 364px 730px repeat;
}

.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  grid-row: 1;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  margin-right: 15px;
  margin-left: 5px;
}

.brand-logo {
  display: block;
  width: min(256px, calc(100% - 145px));
  height: auto;
  margin-top: -10px;
  filter: drop-shadow(0 7px 0 rgba(0, 0, 0, .2));
}

.topbar__actions {
  position: absolute;
  top: 2px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  padding: 0;
  border: 2px solid #0c0d126e;
  border-radius: 18px;
  background: #0c0d126e;
  cursor: pointer;
}

.icon-button img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.store-open.retention-shortcut {
  position: absolute;
  left: max(0px, calc(50% - 196px));
  top: 2px;
}

.store-open .retention-shortcut__icon > img {
  width: 50px;
  height: 50px;
  margin-left: 8px;
  margin-bottom: 4px;
}

#store-dialog .store-card {
  display: flex;
  flex-direction: column;
  width: min(600px, 100%);
  max-height: min(900px, calc(100dvh - 40px - var(--safe-top) - var(--safe-bottom)));
  overflow: hidden;
  gap: 0;
  padding: 0;
  border: 5px solid #101119;
  border-radius: 28px;
  background: #eedfe9;
  box-shadow: 0 10px 0 #080910, inset 0 0 0 3px #fff6;
  color: #101119;
}

.store-card__header {
  position: relative;
  flex: 0 0 auto;
  padding: 20px 20px 13px;
  background: #eedfe9;
  box-shadow: 0 5px 9px #10111918;
  z-index: 2;
}

#store-dialog .store-card h2 {
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 45px 14px;
  border: 4px solid #101119;
  border-radius: 12px;
  background: linear-gradient(175deg, #ff69b5, #ec3893);
  color: white;
  font-family: "Hidden Lilita One", sans-serif;
  font-size: 34px;
  letter-spacing: 1px;
  transform: rotate(-2deg);
  -webkit-text-stroke: 1px #101119;
}

.store-card__status { min-height: 1.4em; margin: 0; text-align: center; font-size: 12px; line-height: 1.4; font-weight: 700; color: #554754; }
#store-dialog .game-dialog__close {
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background: #fff2fa;
  color: #101119;
  box-shadow: 0 3px 0 #101119;
}
.store-card__scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 18px 22px;
  scrollbar-width: thin;
  scrollbar-color: #ba5b91 transparent;
}
.store-products { display: grid; width: 100%; gap: 13px; }
.store-product {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 112px;
  padding: 12px;
  border: 3px solid #101119;
  border-radius: 16px;
  background: radial-gradient(circle at 15% 10%, #91c3ff60, transparent 65%), linear-gradient(135deg, #557fea, #344daf);
  color: white;
  box-shadow: 0 4px 0 #101119, inset 0 0 0 3px #ffffff20;
}
.store-product--starter { background: radial-gradient(circle at 15% 20%, #fffca0, transparent 65%), linear-gradient(135deg, #ffd840, #eca925); }
.store-product--starter { position: relative; }
.store-product__alert {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}
.store-product__art { position: relative; display: grid; place-items: center; height: 78px; }
.store-product__art img { width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 4px 0 #10111940); }
.store-product__art:has(img:nth-child(2)) img { position: absolute; width: 62px; height: 62px; }
.store-product__art img:first-child:not(:only-child) { left: -4px; top: 0; transform: rotate(-12deg); }
.store-product__art img:nth-child(2) { right: -2px; bottom: 0; transform: rotate(10deg); }
.store-product__info { min-width: 0; }
.store-product__name { display: block; font-family: "Hidden Lilita One", sans-serif; font-size: 21px; font-weight: 400; line-height: 1.05; text-shadow: 0 2px 0 #10111980; }
.store-product--starter .store-product__name { color: #442b0f; text-shadow: none; }
.store-product__contents { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.store-product__resource { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; border-radius: 9px; background: #07164442; }
.store-product__resource img { width: 26px; height: 26px; object-fit: contain; }
.store-product__resource strong { font-size: 17px; font-family: "Hidden Lilita One", sans-serif; font-weight: 400; }
.store-product__buy {
  min-width: 90px;
  padding: 10px 12px;
  border: 3px solid #101119;
  border-radius: 12px;
  background: #48c900;
  color: white;
  font-family: "Hidden Lilita One", sans-serif;
  font-size: 19px;
  cursor: pointer;
}
.store-product__buy:disabled { background: #697c67; color: #fff; cursor: default; }

.mode-pill {
  padding: 7px 11px;
  border: 2px solid #0c0d12;
  border-radius: 12px;
  color: #fff;
  background: var(--pink-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.campaign-status {
  display: grid;
  grid-row: 2;
  width: min(480px, 70vw);
  justify-self: center;
  gap: 5px;
  margin: -2px 0 3px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.campaign-status__track {
  overflow: hidden;
  height: 8px;
  border: 2px solid #090a0e;
  border-radius: 99px;
  background: #444754;
}

.campaign-status__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  transition: width .25s ease;
}

.journey {
  position: relative;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.location-list {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  grid-auto-columns: clamp(255px, 25vw, 335px);
  grid-auto-flow: column;
  gap: clamp(18px, 3vw, 48px);
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px max(9vw, 70px) 12px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--pink) rgba(255, 255, 255, .1);
  scrollbar-width: thin;
}

.location-list.uses-wheel { scroll-snap-type: none; }

.location-list::-webkit-scrollbar { height: 8px; }
.location-list::-webkit-scrollbar-track { border-radius: 8px; background: rgba(255, 255, 255, .12); }
.location-list::-webkit-scrollbar-thumb { border-radius: 8px; background: var(--pink); }

.scroll-arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: grid;
  width: 52px;
  height: 60px;
  place-items: center;
  padding: 0 0 5px;
  border: 3px solid #090a0e;
  border-radius: 18px;
  background: var(--blue);
  box-shadow: inset 0 5px rgba(104, 190, 255, .46), 0 6px rgba(0, 0, 0, .22);
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.scroll-arrow--prev { left: 4px; }
.scroll-arrow--next { right: 4px; }

.location-card {
  position: relative;
  display: grid;
  max-height: 100%;
  min-height: 370px;
  grid-template-rows: 52px 52px minmax(210px, 1fr) 128px;
  align-self: center;
  padding: 0 9px 5px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  isolation: isolate;
}

.campaign-end-card { container-type: inline-size; }
.campaign-end-card__panel {
  grid-row: 1 / -1;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 5cqi;
  padding: 9cqi 6cqi;
  border: 4px solid #161722;
  border-radius: 24px;
  background: linear-gradient(155deg, #575fbc, #34364f);
  box-shadow: inset 0 0 0 3px #959ce4, 0 6px 0 #12131b;
  color: #fff;
  text-align: center;
  line-height: 1.3;
}
.campaign-end-card__star { color: #ffdc71; font-size: 23cqi; line-height: 1; text-shadow: 0 3px #171722; }
.campaign-end-card__panel h2 { margin: 0; font-size: 10cqi; text-transform: uppercase; }
.campaign-end-card__panel p { margin: 0; font-size: 6.5cqi; }
.campaign-end-card__panel p:last-child { color: #ffe79b; }

.location-card__name-ribbon,
.location-card__difficulty-ribbon,
.location-card__progress-ribbon {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  margin: 0 -10px;
  color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35));
  font-weight: 1000;
  letter-spacing: .02em;
  text-align: center;
  /* Keep shell labels clean at small sizes: no shadow and no dark outline. */
  text-shadow: none;
  text-transform: uppercase;
}

.location-card__name-ribbon {
  z-index: 5;
  width: 82%;
  aspect-ratio: 300 / 100;
  justify-self: center;
  align-self: center;
  margin: 0;
  padding: 7px 52px 5px 39px;
  background-image: url("../assets/ui/ribbon-blue.webp");
  font-size: clamp(13px, 1.9vh, 18px);
  line-height: 1;
  overflow-wrap: break-word;
  transform: rotate(-1deg) translateY(18px);
}

.location-card.is-complete .location-card__name-ribbon {
  background-image: url("../assets/ui/ribbon-pink.webp");
}

.location-card.is-complete .location-card__name-ribbon::after {
  position: absolute;
  top: 26px;
  right: -4px;
  width: 58px;
  aspect-ratio: 1;
  background: url("../assets/ui/location-complete.webp") center / contain no-repeat;
  content: "";
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3));
  pointer-events: none;
  transform: rotate(5deg);
}

.location-card__difficulty-ribbon {
  z-index: 4;
  width: 110%;
  aspect-ratio: 500 / 150;
  justify-self: center;
  margin: -4px 0 0;
  background-image: url("../assets/ui/name-ribbon.webp");
  font-size: clamp(19px, 3vh, 29px);
  transform: rotate(0deg);
}

.location-card__ribbon-text {
  display: block;
  max-width: 100%;
}

.location-card__name-ribbon .location-card__ribbon-text {
  transform: rotate(-4deg);
}

.location-card__difficulty-ribbon .location-card__ribbon-text {
  transform: rotate(-5deg) translateY(.24em);
}

.location-card__number {
  position: absolute;
  top: 50%;
  right: 9%;
  font-size: clamp(10px, 1.8vh, 16px);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%) rotate(-5deg);
}

.location-card__image-button {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 0;
  align-items: flex-end;
  margin: -4px 15px 0;
  padding: 0;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .24));
  cursor: pointer;
}

.location-card__image-button::before,
.location-card__image-button::after {
  display: none;
}

.location-card__image {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  max-height: none;
  border: 0;
  background: transparent;
  opacity: 0;
  transition: opacity .25s ease;
}

.location-card__image.is-loaded {
  width: 100%;
  height: auto;
  opacity: 1;
}

.location-card__lock {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 4;
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 5px solid #0b0c10;
  border-radius: 22px;
  background: var(--blue-dark);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .3);
  font-size: 40px;
  transform: translate(-50%, -50%);
}

.location-card__progress-ribbon {
  position: absolute;
  right: 15%;
  bottom: 52px;
  left: 15%;
  min-height: 75px;
  margin: 0;
  background-image: url("../assets/ui/ribbon-pink.webp");
  font-size: 20px;
}

.location-card__progress-text {
  display: block;
  transform: rotate(-4deg);
}

.location-card__progress-text.is-completed {
  max-width: 84%;
  font-size: .72em;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.location-card__difficulties {
  display: grid;
  width: min(90%, 219px);
  grid-template-columns: repeat(3, 1fr);
  gap: 7px 4px;
  align-content: center;
  justify-self: center;
  justify-items: center;
  padding: 10px 0 0;
}

.difficulty-button {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 61px;
  aspect-ratio: 1;
  height: auto;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent url("../assets/ui/difficulty-blue.webp") center / contain no-repeat;
  color: #fff;
  font-size: 25px;
  font-weight: 1000;
  text-shadow: none;
  cursor: pointer;
}

.difficulty-button__label {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.difficulty-button__special-icon {
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.difficulty-button.is-selected {
  background-image: url("../assets/ui/difficulty-selected.webp");
  color: var(--pink-dark);
  transform: scale(1.08);
}

.difficulty-button.is-complete::after {
  position: absolute;
  top: -13px;
  right: -12px;
  z-index: 4;
  width: 34px;
  aspect-ratio: 1;
  background: url("../assets/ui/difficulty-complete.webp") center / contain no-repeat;
  content: "";
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .28));
  pointer-events: none;
  transform: rotate(7deg);
}

.difficulty-button.is-locked {
  background-image:
    linear-gradient(rgba(10, 11, 17, .36), rgba(10, 11, 17, .36)),
    url("../assets/ui/difficulty-blue.webp");
  cursor: not-allowed;
}

.difficulty-button.is-locked::before {
  position: absolute;
  right: -7px;
  bottom: -8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  background: url("../assets/ui/lock.webp") center / contain no-repeat;
  content: "";
  pointer-events: none;
}

.difficulty-button.is-locked .difficulty-button__label {
  filter: grayscale(.35) brightness(.64);
  opacity: .7;
}

.inventory-bar {
  position: relative;
  z-index: 8;
  display: flex;
  grid-row: 3;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  margin: 4px calc(-18px - var(--safe-right)) calc(-8px - var(--safe-bottom)) calc(-18px - var(--safe-left));
  padding:
    6px calc(22px + var(--safe-right))
    calc(8px + var(--safe-bottom))
    calc(22px + var(--safe-left));
  background: rgba(10, 11, 17, .5);
  box-shadow: 0 -9px 24px rgba(0, 0, 0, .18);
}

.island-button {
  position: relative;
  display: grid;
  width: 120px;
  grid-template-columns: 64px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.island-button[hidden] {
  display: none;
}

.island-button[hidden] + .inventory-bar__resources {
  margin-left: auto;
  margin-right: 20px;
}

.island-button > img {
  width: 76px;
  height: 76px;
  grid-row: 1 / 3;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .3));
}

.island-button__label {
  align-self: end;
  color: #fff;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.island-button .notification-dot {
  position: static;
  width: 35px;
  height: 35px;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: start;
  border: 0;
  border-radius: 0;
  background: none;
}

.island-button .notification-dot[hidden] { display: none; }

.island-button .notification-dot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.notification-dot {
  position: absolute;
  top: 0;
  left: 28px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 3px solid #0c0d12;
  border-radius: 50%;
  background: var(--pink);
  font-size: 18px;
  font-weight: 1000;
}

.inventory-bar__resources {
  display: flex;
  gap: 18px;
  margin-right: 20px;
}

.resource-button {
  position: relative;
  display: flex;
  min-width: 145px;
  height: 58px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 60px 0 19px;
  border: 3px solid #090a0e;
  border-radius: 14px;
  background: var(--pink-dark);
  box-shadow: inset 0 5px rgba(255, 101, 184, .42), 0 5px rgba(0, 0, 0, .25);
  cursor: pointer;
}

.resource-button__count {
  font-size: 29px;
  font-weight: 1000;
  text-shadow: none;
}

.resource-button img {
  position: absolute;
  right: -17px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25));
}

.resource-button__plus {
  position: absolute;
  top: -8px;
  right: -18px;
  z-index: 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #090a0e;
  border-radius: 50%;
  background: var(--yellow);
  color: #171820;
  font-size: 18px;
  font-weight: 1000;
}

.unity-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  width: 100%;
  height: calc(100% - var(--continuity-height, 0px));
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: #000;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: #000;
}

.scene-transition {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: auto;
  isolation: isolate;
}

.scene-transition::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #c7e4f7;
  content: "";
  opacity: 0;
  transition: opacity 220ms ease 250ms;
}

.scene-transition.is-closing::before,
.scene-transition.is-covered::before {
  opacity: 1;
}

.scene-transition.is-opening::before {
  opacity: 0;
  transition-delay: 260ms;
}

.scene-transition__side {
  position: absolute;
  top: -12vh;
  bottom: -12vh;
  z-index: 1;
  width: 60vw;
  min-width: 0;
}

.scene-transition__side--left {
  left: 0;
}

.scene-transition__side--right {
  right: 0;
}

.scene-transition__cloud {
  --cloud-duration: 650ms;
  --cloud-delay: 0ms;
  --cloud-scale: 1;
  --cloud-rotation: 0deg;
  position: absolute;
  width: clamp(260px, 42vw, 700px);
  max-width: none;
  filter: drop-shadow(0 5px 0 rgba(48, 91, 134, .12));
  pointer-events: none;
  transform: scale(var(--cloud-scale)) rotate(var(--cloud-rotation));
  translate: -180vw 0;
  transition: translate var(--cloud-duration) cubic-bezier(.58, 0, .2, 1) var(--cloud-delay);
  user-select: none;
  will-change: translate;
}

.scene-transition__side--right .scene-transition__cloud {
  translate: 180vw 0;
}

.scene-transition.is-closing .scene-transition__cloud,
.scene-transition.is-covered .scene-transition__cloud {
  translate: 0 0;
}

.scene-transition.is-covered .scene-transition__cloud {
  transition: none;
}

.scene-transition.is-opening .scene-transition__side--left .scene-transition__cloud {
  translate: -180vw 0;
}

.scene-transition.is-opening .scene-transition__side--right .scene-transition__cloud {
  translate: 180vw 0;
}

.scene-transition__cloud:nth-child(1)  { left: -22%; top: -9%; --cloud-scale: 1.08; --cloud-rotation: -3deg; }
.scene-transition__cloud:nth-child(2)  { left: 18%;  top: -7%; --cloud-scale: 1.02; --cloud-rotation: 2deg; }
.scene-transition__cloud:nth-child(3)  { left: 58%;  top: -8%; --cloud-scale: 1.06; --cloud-rotation: -2deg; }
.scene-transition__cloud:nth-child(4)  { left: -20%; top: 5%;  --cloud-scale: 1.03; --cloud-rotation: 3deg; }
.scene-transition__cloud:nth-child(5)  { left: 20%;  top: 6%;  --cloud-scale: 1.09; --cloud-rotation: -3deg; }
.scene-transition__cloud:nth-child(6)  { left: 57%;  top: 5%;  --cloud-scale: 1.02; --cloud-rotation: 2deg; }
.scene-transition__cloud:nth-child(7)  { left: -23%; top: 19%; --cloud-scale: 1.07; --cloud-rotation: -2deg; }
.scene-transition__cloud:nth-child(8)  { left: 17%;  top: 20%; --cloud-scale: 1.01; --cloud-rotation: 3deg; }
.scene-transition__cloud:nth-child(9)  { left: 59%;  top: 19%; --cloud-scale: 1.08; --cloud-rotation: -3deg; }
.scene-transition__cloud:nth-child(10) { left: -19%; top: 33%; --cloud-scale: 1.02; --cloud-rotation: 2deg; }
.scene-transition__cloud:nth-child(11) { left: 21%;  top: 34%; --cloud-scale: 1.08; --cloud-rotation: -2deg; }
.scene-transition__cloud:nth-child(12) { left: 56%;  top: 33%; --cloud-scale: 1.04; --cloud-rotation: 3deg; }
.scene-transition__cloud:nth-child(13) { left: -22%; top: 47%; --cloud-scale: 1.09; --cloud-rotation: -3deg; }
.scene-transition__cloud:nth-child(14) { left: 18%;  top: 48%; --cloud-scale: 1.02; --cloud-rotation: 2deg; }
.scene-transition__cloud:nth-child(15) { left: 58%;  top: 47%; --cloud-scale: 1.06; --cloud-rotation: -2deg; }
.scene-transition__cloud:nth-child(16) { left: -20%; top: 61%; --cloud-scale: 1.03; --cloud-rotation: 3deg; }
.scene-transition__cloud:nth-child(17) { left: 20%;  top: 62%; --cloud-scale: 1.09; --cloud-rotation: -3deg; }
.scene-transition__cloud:nth-child(18) { left: 57%;  top: 61%; --cloud-scale: 1.02; --cloud-rotation: 2deg; }
.scene-transition__cloud:nth-child(19) { left: -23%; top: 75%; --cloud-scale: 1.07; --cloud-rotation: -2deg; }
.scene-transition__cloud:nth-child(20) { left: 17%;  top: 76%; --cloud-scale: 1.01; --cloud-rotation: 3deg; }
.scene-transition__cloud:nth-child(21) { left: 59%;  top: 75%; --cloud-scale: 1.08; --cloud-rotation: -3deg; }
.scene-transition__cloud:nth-child(22) { left: -19%; top: 89%; --cloud-scale: 1.06; --cloud-rotation: 2deg; }
.scene-transition__cloud:nth-child(23) { left: 21%;  top: 90%; --cloud-scale: 1.1;  --cloud-rotation: -2deg; }
.scene-transition__cloud:nth-child(24) { left: 56%;  top: 89%; --cloud-scale: 1.05; --cloud-rotation: 3deg; }

.scene-transition__side--right .scene-transition__cloud {
  transform: scaleX(-1) scale(var(--cloud-scale)) rotate(var(--cloud-rotation));
}

.game-dialog,
.preparing {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding:
    calc(18px + var(--safe-top))
    calc(18px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(18px + var(--safe-left));
  background: rgba(5, 6, 10, .75);
  backdrop-filter: blur(8px);
}

.preparing {
  z-index: 70;
  background: transparent;
  backdrop-filter: none;
}

.game-dialog__card,
.preparing__card {
  position: relative;
  display: grid;
  width: min(390px, 100%);
  justify-items: center;
  gap: 14px;
  padding: 30px 28px 26px;
  border: 4px solid #090a0e;
  border-radius: 22px;
  background: #2b2d36 url("../assets/ui/menu-bg.webp") center / 300px auto repeat;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .08), 0 18px 0 rgba(0, 0, 0, .22);
}

.game-dialog__card h2,
.preparing__card p {
  margin: 0;
  font-size: 28px;
  font-weight: 1000;
  text-align: center;
  text-shadow: none;
  text-transform: uppercase;
}

.game-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 3px solid #090a0e;
  border-radius: 11px;
  background: var(--pink-dark);
  font-size: 29px;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}

.game-dialog__logo {
  width: 130px;
  height: auto;
}

#settings-dialog .utility-card,
#language-dialog .utility-card {
  position: relative;
  display: block;
  width: min(calc(100vw - 40px - var(--safe-left) - var(--safe-right)), 57dvh);
  max-height: none;
  aspect-ratio: 756 / 1160;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.utility-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("../assets/retention/original/popup-panel.png") center / 100% 100% no-repeat;
  content: "";
  filter: drop-shadow(0 12px 0 rgba(0, 0, 0, .42));
}

#settings-dialog .utility-card {
  aspect-ratio: 756 / 1389;
  width: min(calc(100vw - 40px - var(--safe-left) - var(--safe-right)), 47dvh);
}

.settings-card__website {
  display: block;
  width: 100%;
  flex-shrink: 0;
  font-size: clamp(10px, 2dvh, 16px);
  padding: clamp(4px, 1dvh, 8px) 10px;
}

.support-button.settings-card__website {
  background: #172b70;
  color: #fff;
}

.utility-card__ribbon {
  position: absolute;
  z-index: 4;
  top: -1.5%;
  left: 7%;
  display: flex;
  width: 86%;
  height: 18%;
  align-items: center;
  justify-content: center;
  padding: 3% 12% 4%;
  margin: 0;
  transform: rotate(-1.4deg);
}

.utility-card__ribbon::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("../assets/retention/original/title-ribbon.png") center / 100% 100% no-repeat;
  content: "";
  filter: hue-rotate(137deg) saturate(1.45) brightness(1.03) drop-shadow(0 7px 0 rgba(0, 0, 0, .4));
}

.utility-card__ribbon h2 {
  margin: 0;
  color: #fff;
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(22px, 4.1vw, 43px);
  font-weight: 1000;
  letter-spacing: .6px;
  line-height: .95;
  filter:
    drop-shadow(2px 0 #090a0e)
    drop-shadow(-2px 0 #090a0e)
    drop-shadow(0 2px #090a0e)
    drop-shadow(0 -2px #090a0e);
  text-align: center;
  text-transform: uppercase;
}

.utility-card__body {
  position: absolute;
  top: 10%;
  right: 9%;
  bottom: 19%;
  left: 9%;
  display: grid;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: clamp(10px, 2dvh, 16px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4% 3%;
  scrollbar-color: rgba(9, 10, 14, .55) transparent;
  scrollbar-width: thin;
}

.utility-card__body::-webkit-scrollbar { width: 8px; }
.utility-card__body::-webkit-scrollbar-track { background: transparent; }
.utility-card__body::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(9, 10, 14, .55); }

#settings-dialog .utility-card > .game-dialog__close,
#language-dialog .utility-card > .game-dialog__close {
  z-index: 8;
  top: -3.5%;
  right: -0.5%;
  width: clamp(46px, 12%, 76px);
  height: auto;
  aspect-ratio: 1;
  border: clamp(2px, .8vw, 7px) solid #090a0e;
  border-radius: 50%;
  background: #f8eff8;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .28);
  color: #090a0e;
  font-size: clamp(38px, 7vw, 58px);
  line-height: .72;
}

.utility-card .game-dialog__logo {
  width: clamp(112px, 35%, 145px);
}

.settings-card__build-version {
  display: block;
  margin: 8px 0 -7px;
  color: rgba(255, 255, 255, .48);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
  pointer-events: none;
}

.setting-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 3px solid #090a0e;
  border-radius: 12px;
  background: var(--blue);
  font-size: 18px;
  font-weight: 1000;
  cursor: pointer;
}

.setting-row__switch {
  position: relative;
  width: 54px;
  height: 28px;
  border: 3px solid #090a0e;
  border-radius: 20px;
  background: #646672;
}

.setting-row__switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform .16s ease;
}

.setting-row.is-on .setting-row__switch {
  background: #4bcf81;
}

.setting-row.is-on .setting-row__switch::after {
  transform: translateX(26px);
}

.setting-row--language strong {
  min-width: 66px;
  padding: 5px 12px;
  border: 3px solid #090a0e;
  border-radius: 9px;
  background: #f7eaa1;
  color: #14151b;
  font-size: 21px;
  text-align: center;
  text-transform: lowercase;
}

.language-list {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.language-list button {
  min-height: 58px;
  border: 3px solid #090a0e;
  border-radius: 10px;
  background: #f7eaa1;
  box-shadow: inset 0 5px rgba(255, 255, 255, .6), 0 4px rgba(0, 0, 0, .24);
  color: #16171d;
  font-size: 26px;
  font-weight: 1000;
  text-shadow: none;
  text-transform: lowercase;
  cursor: pointer;
}

.language-list button.is-selected {
  background: #17df32;
  box-shadow: inset 0 5px rgba(119, 255, 139, .8), 0 4px rgba(0, 0, 0, .24);
}

#reward-dialog {
  padding-inline: max(12px, var(--safe-left)) max(12px, var(--safe-right));
  background: rgba(5, 6, 10, .6);
  backdrop-filter: blur(3px);
}

#reward-dialog .reward-card {
  display: block;
  width: min(520px, 100%, 82dvh);
  aspect-ratio: 540 / 590;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: url("../assets/mini-store/panel.png") center / 100% 100% no-repeat;
  box-shadow: none;
  overflow: visible;
  container-type: inline-size;
}

.reward-card__title {
  position: absolute;
  top: -5%;
  left: 27%;
  width: 46%;
  height: 20%;
  display: grid;
  place-items: center;
  background: url("../assets/mini-store/title.png") center / 100% 100% no-repeat;
}

#reward-dialog h2 {
  margin: 0;
  color: white;
  font: 9cqw/1 "Hidden Lilita One", sans-serif;
  text-transform: uppercase;
  -webkit-text-stroke: 1.5px #080811;
  paint-order: stroke fill;
  text-shadow: 0 3px #080811;
  transform: rotate(-9deg);
}

#reward-dialog .game-dialog__close {
  top: -2%;
  right: -1%;
  z-index: 2;
  width: 15%;
  height: auto;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: url("../assets/mini-store/close.png") center / contain no-repeat;
}

.reward-card__offers,
.reward-card__messages {
  position: absolute;
  left: 8%;
  right: 8%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7%;
}

.reward-card__offers { top: 23%; height: 49%; }

.reward-card__offer {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 6% 5% 5%;
  border: 2px solid #07070e;
  border-radius: 8px;
  background: #c4eff2;
  box-shadow: -3px 4px #bb3b83;
}

.reward-card__icon-wrap {
  position: relative;
  display: grid;
  width: 100%;
  flex: 1;
  min-height: 0;
  place-items: start center;
}

.reward-card__icon { width: 85%; height: 78%; object-fit: contain; }

.reward-card__amount {
  position: absolute;
  bottom: 9%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 47%;
  height: 32%;
  background: url("../assets/mini-store/amount.png") center / 100% 100% no-repeat;
  color: white;
  font: 8cqw/1 "Hidden Lilita One", sans-serif;
  -webkit-text-stroke: 1.5px #080811;
  paint-order: stroke fill;
  text-shadow: 0 2px #080811;
  transform: translateX(-50%);
}

.reward-card__action {
  flex: 0 0 28%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 4% 9%;
  border: 0;
  border-radius: 7px;
  background: url("../assets/mini-store/button.png") center / 100% 100% no-repeat;
  color: white;
  font: 6.7cqw/1 "Hidden Lilita One", sans-serif;
  -webkit-text-stroke: 1px #080811;
  paint-order: stroke fill;
  text-shadow: 0 2px #080811;
  white-space: nowrap;
  cursor: pointer;
}

.reward-card__watch { justify-content: space-between; gap: 5%; }
.reward-card__watch span { font-size: min(6.7cqw, 26px); }
.reward-card__watch img { width: 20%; max-height: 70%; object-fit: contain; }
.reward-card__action:disabled { filter: saturate(.25); opacity: .72; cursor: default; }
.reward-card__action:not(:disabled):active { transform: translateY(2px); }
.reward-card__messages { top: 74%; }
.reward-card__status {
  margin: 0;
  color: #301c2b;
  font: 700 clamp(10px, 2.8cqw, 14px)/1.15 Arial, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
}
.reward-card__status:empty { display: none; }
#reward-status { grid-column: 1; }
#reward-buy-status { grid-column: 2; }

.debug-panel button {
  padding: 9px 16px;
  border: 3px solid #090a0e;
  border-radius: 10px;
  background: var(--blue);
  font-weight: 900;
  cursor: pointer;
}

.click-recovery {
  position: fixed;
  top: calc(8px + var(--safe-top));
  left: 50%;
  z-index: 85;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border: 3px solid #101119;
  border-radius: 18px;
  background: #4590d9;
  box-shadow: 0 3px 0 #101119;
  color: white;
  font: 18px "Hidden Lilita One", sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
.click-recovery[hidden] { display: none; }
.click-recovery img { width: 32px; height: 32px; object-fit: contain; }

.legacy-recovery .game-dialog__card {
  width:min(620px, 100%); max-height:calc(100dvh - 48px); overflow:auto;
  box-sizing:border-box; justify-items:stretch; text-align:left;
}
.legacy-recovery h2 { text-align:center; }
.legacy-recovery p { line-height:1.45; }
.legacy-recovery [hidden] { display:none; }
.legacy-recovery input, .legacy-recovery select {
  width:100%; box-sizing:border-box; min-height:48px; padding:10px;
  border:3px solid #101019; border-radius:12px;
  background:#f3f4ff; color:#1c2438; font:inherit;
}
.legacy-recovery__gift { display:flex; align-items:center; gap:12px; color:#ffe58c; }
.legacy-recovery__gift img { width:44px; height:44px; object-fit:contain; }
.legacy-recovery__actions { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:20px; }
.legacy-recovery .support-button { width:100%; }
.legacy-recovery .legacy-recovery__secondary { background:#555a70; }
.legacy-recovery button:disabled { opacity:.6; cursor:not-allowed; }
.legacy-recovery__choices { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
.legacy-recovery .legacy-recovery__choice { background:#555a70; }
.legacy-recovery .legacy-recovery__choice[aria-pressed="true"] { background:#5365df; outline:3px solid #ffe58c; outline-offset:2px; }
.legacy-recovery__choice:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.legacy-recovery__choices .support-note { margin:12px 0 0; }
.legacy-recovery__location-row { display:flex; align-items:center; gap:14px; }
.legacy-recovery__stepper { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.legacy-recovery__stepper .support-button { width:40px; min-height:48px; padding:4px; font-size:24px; }
.legacy-recovery #legacy-recovery-count { width:60px; padding:8px 2px; text-align:center; appearance:textfield; -moz-appearance:textfield; }
.legacy-recovery #legacy-recovery-count::-webkit-inner-spin-button,
.legacy-recovery #legacy-recovery-count::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
#legacy-recovery-location { min-width:0; overflow-wrap:anywhere; font-weight:700; }
.legacy-recovery .legacy-recovery__warning { border-top:1px solid #77798b; padding-top:16px; margin-top:20px; color:#ffe58c; }
@media(max-width:480px) { .legacy-recovery__actions { grid-template-columns:1fr; } }
.toast {
  position: fixed;
  right: 18px;
  bottom: calc(108px + var(--safe-bottom));
  z-index: 80;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 3px solid #090a0e;
  border-radius: 12px;
  background: var(--pink-dark);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .3);
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  transition: .2s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.daily-task-completion {
  position: fixed;
  top: calc(22px + var(--safe-top));
  left: 50%;
  z-index: 70;
  width: min(860px, calc(100vw - 24px - var(--safe-left) - var(--safe-right)));
  padding: clamp(7px, 1.5vw, 14px);
  border: 4px solid #090a0e;
  border-radius: 26px;
  background: #fff3ff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .38);
  pointer-events: none;
  transform: translate(-50%, -150%);
}

.daily-task-completion.is-visible {
  animation: daily-task-flyaway 3.7s ease-in-out both;
}

.daily-task-completion__inner {
  display: flex;
  min-height: clamp(76px, 10vw, 132px);
  align-items: center;
  gap: clamp(8px, 2vw, 22px);
  padding: 8px clamp(10px, 2vw, 24px);
  border: 4px solid #090a0e;
  border-radius: 20px;
  background: #4c69df;
  text-align: center;
}

.daily-task-completion__star {
  flex: 0 0 auto;
  color: #fff336;
  font: 1000 clamp(42px, 9vw, 84px)/1 "Hidden Lilita One", "Trebuchet MS", sans-serif;
  text-shadow: 2px 3px 0 #e2ae1c, 0 0 6px #fff9aa;
  transform: rotate(-12deg);
}

.daily-task-completion__copy {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
  font-family: "Hidden Lilita One", "Trebuchet MS", sans-serif;
  line-height: 1.04;
  text-shadow: 2px 3px 0 #090a0e, -1px -1px 0 #090a0e, 1px -1px 0 #090a0e, -1px 1px 0 #090a0e;
}

.daily-task-completion__copy strong {
  color: #fff336;
  font-size: clamp(19px, 4.4vw, 52px);
  text-transform: uppercase;
}

.daily-task-completion__copy span {
  color: #fff;
  font-size: clamp(16px, 3.2vw, 36px);
}

@keyframes daily-task-flyaway {
  0% { opacity: 0; transform: translate(-50%, -150%); }
  12%, 77% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -150%); }
}

.debug-panel {
  position: fixed;
  right: 12px;
  bottom: 112px;
  z-index: 90;
  display: none !important;
  width: min(280px, calc(100vw - 24px));
  gap: 9px;
  padding: 14px;
  border: 3px solid #090a0e;
  border-radius: 14px;
  background: rgba(32, 33, 39, .97);
  font-size: 12px;
}

.debug-panel label { display: grid; gap: 5px; }
.debug-panel select { width: 100%; padding: 7px; color: white; border: 2px solid #090a0e; border-radius: 8px; background: #393b45; }
.debug-panel output { color: var(--muted); font-size: 10px; }

.retention-shortcuts {
  position: absolute;
  top: clamp(118px, 21vh, 210px);
  left: calc(14px + var(--safe-left));
  z-index: 12;
  display: grid;
  gap: 14px;
}

.holiday-shortcuts {
  position: absolute;
  left: 0;
  bottom: calc(24px + 4dvh);
  z-index: 7;
  display: grid;
  gap: 8px;
}
.holiday-card {
  position: relative;
  isolation: isolate;
  width: min(440px, 92vw);
  max-height: 94dvh;
  padding: 12px 20px 20px;
  overflow-y: auto;
  background: var(--holiday-background, #39264f);
}
.holiday-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--holiday-pattern) repeat;
  background-size: var(--holiday-tile, 384px);
  opacity: var(--holiday-opacity, .24);
}
.holiday-card h2 { margin: 8px 40px 12px; text-align: center; }
.holiday-card .location-card {
  width: 100%;
  height: min(620px, 72dvh);
  min-height: 350px;
  grid-template-rows: 40px 40px minmax(150px, 1fr) 140px;
}
.holiday-card .location-card__name-ribbon,
.holiday-card .location-card__difficulty-ribbon { font-size: 22px; }
.holiday-card .location-card__difficulties { gap: 9px 5px; grid-auto-rows: 56px; align-content: start; padding-top: 12px; }
.holiday-card .difficulty-button { width: 56px; height: 56px; min-width: 0; min-height: 0; }
@media (max-height: 550px) and (orientation: landscape) {
  .holiday-card { width: min(330px, 90vw); }
  .holiday-card .location-card { min-height: 290px; height: 65dvh; grid-template-rows: 30px 30px minmax(120px, 1fr) 100px; }
  .holiday-card .location-card__difficulties { grid-auto-rows: 38px; }
  .holiday-card .difficulty-button { width: 38px; height: 38px; font-size: 18px; }
}

.retention-shortcut {
  position: relative;
  display: grid;
  width: 100px;
  justify-items: center;
  gap: 0;
  padding: 0;
  color: #fff;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .34));
  font-family: "Hidden Lilita One", "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: .86;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.retention-shortcut__icon {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  background: url("../assets/retention/shortcut-circle.png") center / contain no-repeat;
}

.retention-shortcut__icon > img { width: 57px; height: 57px; object-fit: contain; }
.retention-shortcut__label {
  display: block;
  width: 84px;
  overflow-wrap: anywhere;
  -webkit-text-stroke: .7px #111117;
  text-shadow: 1px 2px 0 #111117, -1px 1px 0 #111117;
}
html[lang="fr"] .retention-shortcut__label,
html[lang="de"] .retention-shortcut__label,
html[lang="it"] .retention-shortcut__label,
html[lang="es"] .retention-shortcut__label {
  width: min(100px, 100%);
  font-size: 12px;
}
.retention-shortcut .notification-dot {
  top: -12px;
  right: -12px;
  left: auto;
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 0;
  background: none;
}
.retention-shortcut .notification-dot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.retention-dialog {
  background: rgba(2, 3, 7, .84);
  backdrop-filter: blur(3px);
}

.retention-card {
  position: relative;
  display: block;
  width: min(calc(100vw - 40px - var(--safe-left) - var(--safe-right)), 57dvh);
  max-height: none;
  aspect-ratio: 756 / 1160;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.retention-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("../assets/retention/original/popup-panel.png") center / 100% 100% no-repeat;
  content: "";
  filter: drop-shadow(0 12px 0 rgba(0, 0, 0, .42));
}

.retention-card--rewards::before {
  filter: hue-rotate(101deg) saturate(1.18) brightness(1.02) drop-shadow(0 12px 0 rgba(0, 0, 0, .42));
}

.retention-card__body {
  position: absolute;
  top: 11%;
  right: 7.5%;
  bottom: 18%;
  left: 7.5%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2% 1.5% 4%;
  scrollbar-color: rgba(9, 10, 14, .55) transparent;
  scrollbar-width: thin;
}

.retention-card__body::-webkit-scrollbar { width: 8px; }
.retention-card__body::-webkit-scrollbar-track { background: transparent; }
.retention-card__body::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(9, 10, 14, .55); }

.retention-card__ribbon {
  position: absolute;
  z-index: 4;
  top: -7.5%;
  left: 7%;
  display: flex;
  width: 86%;
  height: 18%;
  align-items: center;
  justify-content: center;
  padding: 3% 12% 4%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  transform: rotate(-1.4deg);
}

.retention-card__ribbon::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("../assets/retention/original/title-ribbon.png") center / 100% 100% no-repeat;
  content: "";
  filter: drop-shadow(0 7px 0 rgba(0, 0, 0, .4));
}

.retention-card--tasks .retention-card__ribbon::before {
  filter: hue-rotate(137deg) saturate(1.45) brightness(1.03) drop-shadow(0 7px 0 rgba(0, 0, 0, .4));
}

.retention-card__ribbon img { display: none; }
.retention-card__ribbon h2 {
  margin: 0;
  color: #fff;
  font-family: "Arial Black", "Trebuchet MS", sans-serif;
  font-size: clamp(22px, 4.1vw, 43px);
  font-weight: 1000;
  letter-spacing: .6px;
  line-height: .95;
  filter:
    drop-shadow(2px 0 #090a0e)
    drop-shadow(-2px 0 #090a0e)
    drop-shadow(0 2px #090a0e)
    drop-shadow(0 -2px #090a0e);
  text-align: center;
  text-transform: uppercase;
}

#daily-rewards-title { transform: rotate(-3deg); margin-top: 3px; }
#daily-tasks-title { transform: rotate(-3deg); margin-top: 3px; }

/* "Tagesaufgaben" is a long unbreakable word, so keep it inside the ribbon. */
html[lang="de"] #daily-tasks-title {
  font-size: clamp(19px, 3vw, 31px);
  letter-spacing: 0;
}

html[lang="fr"] #daily-tasks-title,
html[lang="it"] #daily-tasks-title,
html[lang="es"] #daily-tasks-title {
  font-size: clamp(18px, 2.8vw, 29px);
  letter-spacing: 0;
  line-height: .9;
}

html[lang="fr"] #daily-rewards-title,
html[lang="de"] #daily-rewards-title,
html[lang="it"] #daily-rewards-title,
html[lang="es"] #daily-rewards-title {
  font-size: clamp(17px, 2.5vw, 25px);
  letter-spacing: 0;
  line-height: .9;
}

.retention-card > .game-dialog__close {
  z-index: 8;
  top: -3.5%;
  right: -0.5%;
  width: clamp(46px, 12%, 76px);
  height: auto;
  aspect-ratio: 1;
  border: clamp(2px, .8vw, 7px) solid #090a0e;
  border-radius: 50%;
  background: #f8eff8;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .28);
  color: #090a0e;
  font-size: clamp(38px, 7vw, 58px);
  line-height: .72;
}

.retention-card > .game-dialog__close:focus-visible { outline: none; }

.retention-card__intro { margin: 0 0 3%; font-weight: 900; text-align: center; }
.retention-card--rewards .retention-card__intro { display: none; }

.daily-rewards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 2vw, 14px);
  padding: 1%;
}

.daily-reward-tile {
  position: relative;
  display: grid;
  height: clamp(96px, 12dvh, 120px);
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  place-items: center;
  gap: 2px;
  padding: 8px 7px 15px;
  border: 4px solid #090a0e;
  border-radius: 16px;
  background: linear-gradient(#18bbdc 0 54%, #08acd0 54% 100%);
  box-shadow: 0 8px 0 rgba(36, 38, 50, .55);
  text-align: center;
}

.daily-reward-tile--grand {
  grid-column: 1 / -1;
  height: clamp(78px, 10dvh, 96px);
  min-height: 0;
  grid-template-columns: 1fr 1.2fr;
}
.daily-reward-tile--grand .daily-reward-tile__day { grid-column: 1 / -1; }
.daily-reward-tile--grand .daily-reward-tile__mystery { grid-column: 2; grid-row: 2 / span 2; }
.daily-reward-tile.is-current {
  background: repeating-conic-gradient(from -8deg at 50% 58%, #ffc42a 0 11deg, #ffad17 11deg 22deg);
  animation: retention-pulse 1.4s ease-in-out infinite;
}
.daily-reward-tile.is-claimed {
  background: linear-gradient(#c0c0c0 0 54%, #a5a5a5 54% 100%);
}
.daily-reward-tile.is-claimed .daily-reward-tile__mystery { opacity: .63; filter: saturate(.65); }
.daily-reward-tile__day { font-size: 19px; font-weight: 1000; text-transform: uppercase; }
.daily-reward-tile__mystery { display: grid; place-items: center; }
.daily-reward-tile__mystery img { width: clamp(48px, 7vw, 62px); height: clamp(48px, 7vw, 62px); object-fit: contain; }
.daily-reward-tile--grand .daily-reward-tile__mystery img { width: clamp(70px, 11vw, 94px); height: clamp(58px, 9vw, 78px); }
.daily-reward-tile strong {
  max-width: 100%;
  font-size: 13px;
  line-height: .05;
}
.daily-reward-tile button,
.daily-task__claim {
  padding: 8px 16px;
  color: #fff;
  border: 3px solid #090a0e;
  border-radius: 10px;
  background: #48c900;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .28);
  font: inherit;
  font-weight: 1000;
  text-transform: uppercase;
  cursor: pointer;
}

.daily-task__claim {
  min-width: 96px;
  min-height: 44px;
}

.daily-reward-tile button {
  position: absolute;
  bottom: -10px;
  left: 50%;
  min-width: 82%;
  transform: translateX(-50%);
}

.daily-stars {
  display: flex;
  width: fit-content;
  min-width: 175px;
  min-height: 50px;
  align-items: center;
  justify-content: end;
  gap: 8px;
  padding: 2px 26px;
  margin: 4px auto 7px;
  background: url("../assets/retention/original/star-panel.png") center / 100% 100% no-repeat;
  font-size: 20px;
  font-weight: 1000;
}

.daily-milestones {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin: 0 0 8px;
}
.daily-milestones::before {
  position: absolute;
  top: 35px;
  right: 8%;
  left: 8%;
  height: 14px;
  background: url("../assets/retention/original/progress-track.png") center / 100% 100% no-repeat;
  content: "";
}
.daily-milestone {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 0;
  color: #fff;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 1000;
}
.daily-milestone__gift {
  position: relative;
  display: grid;
  width: min(100%, 64px);
  height: auto;
  aspect-ratio: 1;
  place-items: center;
  background: transparent;
  font-size: 30px;
}
.daily-milestone__gift img { width: 100%; height: 100%; object-fit: contain; }
.daily-milestone.is-ready { cursor: pointer; }
.daily-milestone.is-ready .daily-milestone__gift img { animation: retention-pulse 1.4s ease-in-out infinite; filter: brightness(1.12); }
.daily-milestone.is-ready .daily-milestone__gift::after {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 32px;
  height: 32px;
  background: url("../assets/retention/notification.png") center / contain no-repeat;
  content: "";
  pointer-events: none;
}
.daily-milestone.is-claimed { opacity: .5; }
.daily-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
}
.daily-reset::before {
  width: 27px;
  height: 27px;
  background: url("../assets/retention/original/timer.png") center / contain no-repeat;
  content: "";
}

.daily-task-list { display: grid; gap: 9px; }
.daily-task {
  display: grid;
  min-height: 82px;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 13px 8px 5px;
  border: 0;
  border-radius: 0;
  background: url("../assets/retention/original/task-panel.png") center / 100% 100% no-repeat;
}
.daily-task.is-claimed { opacity: 1; background: #ff67b6; }
.daily-task__stars { color: #ffe538; font-size: 22px; font-weight: 1000; text-align: center; }
.daily-task__body { min-width: 0; }
.daily-task__title { display: block; margin-bottom: 5px; font-weight: 1000; }
.daily-task__progress {
  display: block;
  height: 16px;
  overflow: hidden;
  padding: 3px 4px;
  background: url("../assets/retention/original/progress-track.png") center / 100% 100% no-repeat;
}
.daily-task__progress span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background-color: #ff67b6;
}
.daily-task__count { display: block; margin-top: 3px; font-size: 11px; font-weight: 900; text-align: center; }
.daily-task__claim[disabled] { display: none; }

@keyframes retention-pulse {
  50% { transform: translateY(-3px) scale(1.025); filter: brightness(1.08); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .app {
    padding-right: calc(8px + var(--safe-right));
    padding-left: calc(8px + var(--safe-left));
  }

  .topbar { min-height: 66px; }
  .topbar__actions { gap: 5px; }
  .mode-pill { display: none; }
  .icon-button img { width: 40px; height: 40px; }
  #store-dialog .store-card { padding: 0; }
  .store-card__header { padding: 18px 12px 10px; }
  .store-card__scroll { padding: 9px 10px 18px; }
  .store-product { grid-template-columns: 61px minmax(0, 1fr) auto; gap: 7px; padding: 10px 8px; min-height: 107px; }
  .store-product__art { height: 66px; }
  .store-product__art img { width: 60px; height: 65px; }
  .store-product__art:has(img:nth-child(2)) img { width: 48px; height: 48px; }
  .store-product__name { font-size: 17px; }
  .store-product__contents { gap: 4px; margin-top: 6px; }
  .store-product__resource img { width: 23px; height: 23px; }
  .store-product__resource strong { font-size: 15px; }
  .store-product__buy { min-width: 73px; padding: 8px 5px; font-size: 16px; }
  .campaign-status { width: min(320px, 74vw); }

  .location-list {
    grid-auto-columns: min(76vw, 330px);
    gap: 30px;
    padding-right: 12vw;
    padding-left: 12vw;
  }

  .location-card {
    max-height: 100%;
    grid-template-rows: 45px 46px minmax(180px, 1fr) 124px;
  }

  .location-card__difficulties { padding-right: 10px; padding-left: 10px; }
  .difficulty-button { max-width: 58px; height: auto; font-size: 23px; }
  .scroll-arrow { display: none; }

  .inventory-bar {
    min-height: 92px;
    margin-right: calc(-8px - var(--safe-right));
    margin-left: calc(-8px - var(--safe-left));
    padding-right: calc(12px + var(--safe-right));
    padding-left: calc(12px + var(--safe-left));
  }

  .island-button {
    width: 84px;
    grid-template-columns: 50px 1fr;
  }
  .island-button > img { width: 68px; height: 68px; }
  .island-button__label { display: none; }
  .island-button .notification-dot {
    width: 27px;
    height: 27px;
    grid-row: 1;
    align-self: center;
  }
  .inventory-bar__resources { gap: 18px; }
  .resource-button { min-width: 112px; height: 50px; }
  .resource-button__count { font-size: 23px; }
  .resource-button img { right: -14px; width: 61px; height: 61px; }
  .retention-shortcuts {
    top: 110px;
    left: calc(14px + var(--safe-left));
    gap: 17px;
  }
  .retention-shortcut { width: 68px; font-size: 13px; }
  .retention-shortcut__icon { width: 63px; height: 63px; }
  .retention-shortcut__icon > img { width: 40px; height: 40px; }
  .retention-shortcut__label { width: 62px; }
  .retention-shortcut .notification-dot { top: -7px; right: -7px; width: 27px; height: 27px; }
  .retention-dialog {
    padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  }
  .retention-card {
    width: min(calc(100vw - 40px - var(--safe-left) - var(--safe-right)), 57dvh);
    padding: 0;
  }
  .retention-card__ribbon {
    width: 86%;
    min-height: 0;
    height: 18%;
    padding: 3% 11% 4%;
    margin: 0;
  }
  .retention-card__ribbon h2 { font-size: clamp(18px, 6.1vw, 30px); }
  .retention-card--rewards .retention-card__ribbon h2 { max-width: 175px; font-size: clamp(18px, 5.5vw, 25px); }
  .retention-card__body { padding-right: 1%; padding-left: 1%; }
  .daily-rewards-grid { gap: 6px; margin-top: 20px; }
  .daily-reward-tile { height: 136px; min-height: 136px; padding: 6px 3px 13px; border-width: 3px; }
  .daily-reward-tile--grand { height: 100px; min-height: 0; }
  .daily-reward-tile__mystery { align-self: center; }
  .daily-reward-tile__mystery img { width: 55px; height: 57px; }
  .daily-reward-tile--grand .daily-reward-tile__mystery img {
    width: clamp(89px, 11vw, 94px);
    height: 85px;
  }
  .daily-reward-tile button { bottom: 4px; padding: 6px 11px; font-size: 18px; }
  .daily-stars { min-width: 175px; min-height: 50px; margin-bottom: 7px; font-size: 20px; }
  .daily-milestones { gap: 2px; }
  .daily-milestone__gift { width: 48px; height: 48px; font-size: 25px; }
  .daily-milestone.is-ready .daily-milestone__gift::after { top: -7px; right: -7px; width: 27px; height: 27px; }
  .daily-milestones::before { top: 23px; height: 11px; }
  .daily-reset { margin-bottom: 5px; font-size: 11px; }
  .daily-reset::before { width: 23px; height: 23px; }
  .daily-task-list { gap: 6px; }
  .daily-task { min-height: 68px; grid-template-columns: 43px minmax(0, 1fr) auto; gap: 5px; padding: 6px 8px 6px 3px; }
  .daily-task__stars { font-size: 17px; }
  .daily-task__title { margin-bottom: 3px; font-size: 12px; }
  .daily-task__progress { height: 13px; }
  .daily-task__claim { min-width: 68px; min-height: 42px; padding: 6px 4px; border-width: 2px; font-size: 16px; }
}

@media (max-width: 420px) {
  .daily-rewards-grid { gap: 11px; margin-top: 4px; }
  .daily-reward-tile:not(.daily-reward-tile--grand) { height: 110px; min-height: 110px; }
  .daily-reward-tile button { bottom: -4px; font-size: 13px; }
  .daily-reward-tile:not(.daily-reward-tile--grand) .daily-reward-tile__mystery img { width: 48px; height: 48px; margin-top: 0; }
  .daily-reward-tile--grand .daily-reward-tile__mystery img {
    width: 86px;
    height: 87px;
  }
}

/*
 * A wider card helps tablet portrait layouts, but applying 42vw to landscape
 * frames around 1280x720 leaves room for fewer than three cards. Facebook can
 * expose exactly that effective game viewport when its right rail is open.
 * Keep the larger tablet card only in portrait; landscape uses the regular
 * 25vw card metric and preserves the surrounding desktop layouts.
 */
@media (orientation: portrait) and (min-width: 681px) and (max-width: 1400px) {
  .location-list {
    grid-auto-columns: clamp(330px, 42vw, 430px);
  }
}

/*
 * Facebook sometimes embeds the game in a medium, nearly 16:10 landscape
 * frame. The desktop 335px cap makes those cards read as tablet cards and
 * leaves only about three locations visible. Use the compact desktop metric
 * only in this bounded frame; wide desktop and mobile layouts stay unchanged.
 */
@media (orientation: landscape) and (min-width: 900px) and (max-width: 1400px) and (min-height: 701px) {
  .location-list {
    grid-auto-columns: clamp(245px, 21vw, 285px);
    gap: clamp(22px, 2.5vw, 36px);
  }
}

@media (orientation: landscape) and (max-height: 700px) {
  .app {
    grid-template-rows: 50px minmax(0, 1fr) 72px;
    padding-top: calc(4px + var(--safe-top));
    padding-bottom: calc(3px + var(--safe-bottom));
  }

  .topbar { min-height: 48px; }
  .brand-logo { width: 172px; max-height: 43px; }
  .icon-button img { width: 37px; height: 37px; }
  .location-list {
    grid-auto-columns: min(29vw, 255px);
    gap: 28px;
    padding-top: 2px;
    padding-bottom: 5px;
  }

  .location-card {
    /* Keep the ribbons, stamp image and difficulty row as one proportional card. */
    height: min(100%, calc(min(44.08vw, 388px) + 60px));
    max-height: 100%;
    min-height: 0;
    grid-template-rows: 34px 34px minmax(105px, 1fr) 64px;
  }

  .location-card__name-ribbon { font-size: 11px; }
  .location-card.is-complete .location-card__name-ribbon::after {
    top: clamp(13px, 3.2dvh, 20px);
    right: -2px;
    width: clamp(30px, 7dvh, 42px);
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .3));
  }
  .location-card__difficulty-ribbon { font-size: 17px; }
  .location-card__progress-ribbon { min-height: 36px; font-size: 11px; }
  .location-card__difficulties { width: 118px; gap: 3px; padding: 4px 0 0; }
  .difficulty-button { width: 36px; height: 28px; aspect-ratio: auto; font-size: 15px; }

  .inventory-bar {
    min-height: 68px;
    margin-bottom: calc(-3px - var(--safe-bottom));
    padding-top: 2px;
    padding-bottom: calc(3px + var(--safe-bottom));
  }

  .island-button > img { width: 58px; height: 58px; }
  .island-button .notification-dot { width: 23px; height: 23px; }
  .resource-button { height: 44px; }
  .resource-button img { width: 55px; height: 55px; }
  .resource-button__count { font-size: 21px; }
  .retention-shortcuts {
    top: 110px;
    left: calc(14px + var(--safe-left));
    gap: 17px;
  }
  .retention-shortcut { width: 61px; font-size: 10px; }
  .retention-shortcut__icon { width: 46px; height: 46px; }
  .retention-shortcut__icon > img { width: 29px; height: 29px; }
  .retention-shortcut__label { width: 58px; }
  .retention-shortcut .notification-dot { top: -6px; right: -6px; width: 23px; height: 23px; }

  /*
   * Embedded QA tools can place the game in a wide, low iframe. Do not size popup
   * content from vw here: a wide iframe made the ribbon text, gifts, star and
   * task controls much larger than the card that contains them.
   */
  .retention-dialog {
    padding: calc(4px + var(--safe-top)) calc(6px + var(--safe-right))
      calc(4px + var(--safe-bottom)) calc(6px + var(--safe-left));
  }

  .retention-card__ribbon h2,
  html[lang="de"] #daily-tasks-title,
  html[lang="fr"] #daily-tasks-title,
  html[lang="it"] #daily-tasks-title,
  html[lang="es"] #daily-tasks-title,
  html[lang="fr"] #daily-rewards-title,
  html[lang="de"] #daily-rewards-title,
  html[lang="it"] #daily-rewards-title,
  html[lang="es"] #daily-rewards-title {
    font-size: clamp(16px, 4.6dvh, 28px);
    letter-spacing: 0;
    line-height: .9;
  }

  .retention-card > .game-dialog__close {
    width: clamp(38px, 9dvh, 54px);
    border-width: clamp(2px, .8dvh, 4px);
    font-size: clamp(30px, 7dvh, 44px);
  }

  .retention-card__body {
    padding: 1% 1% 3%;
    font-size: clamp(10px, 2.2dvh, 13px);
  }

  .daily-rewards-grid {
    gap: clamp(4px, 1.1dvh, 7px);
    padding: 0 1%;
    margin-top: 0;
  }

  .daily-reward-tile {
    height: clamp(68px, 14dvh, 84px);
    min-height: 0;
    gap: 1px;
    padding: 4px 3px 9px;
    border-width: 3px;
    border-radius: 12px;
    box-shadow: 0 5px 0 rgba(36, 38, 50, .55);
  }

  .daily-reward-tile--grand {
    height: clamp(52px, 10dvh, 64px);
  }

  .daily-reward-tile__day {
    font-size: clamp(10px, 2.5dvh, 14px);
  }

  .daily-reward-tile__mystery img {
    width: clamp(32px, 7.5dvh, 44px);
    height: clamp(32px, 7.5dvh, 44px);
    margin-top: 0;
  }

  .daily-reward-tile--grand .daily-reward-tile__mystery img {
    width: clamp(44px, 10dvh, 60px);
    height: clamp(36px, 8dvh, 50px);
    margin-bottom: 0;
    margin-left: 0;
  }

  .daily-reward-tile strong {
    font-size: clamp(8px, 1.9dvh, 11px);
  }

  .daily-reward-tile button {
    bottom: -6px;
    padding: 4px 6px;
    border-width: 2px;
    border-radius: 7px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
    font-size: clamp(8px, 1.9dvh, 11px);
  }

  .daily-stars {
    min-width: clamp(112px, 25dvh, 150px);
    min-height: clamp(34px, 7dvh, 42px);
    gap: 4px;
    padding: 1px 18px;
    margin: 2px auto 4px;
    font-size: clamp(14px, 3.2dvh, 19px);
  }

  .daily-milestones {
    gap: 2px;
    margin-bottom: 4px;
  }

  .daily-milestones::before {
    top: clamp(17px, 4dvh, 24px);
    height: clamp(8px, 1.8dvh, 11px);
  }

  .daily-milestone {
    gap: 0;
    font-size: clamp(9px, 2dvh, 12px);
  }

  .daily-milestone__gift {
    width: clamp(32px, 8dvh, 46px);
    font-size: clamp(18px, 4.5dvh, 27px);
  }
  .daily-milestone.is-ready .daily-milestone__gift::after {
    top: -5px;
    right: -6px;
    width: clamp(18px, 4dvh, 25px);
    height: clamp(18px, 4dvh, 25px);
  }

  .daily-reset {
    gap: 4px;
    margin-bottom: 4px;
    font-size: clamp(9px, 2dvh, 12px);
  }

  .daily-reset::before {
    width: clamp(18px, 4.5dvh, 26px);
    height: clamp(18px, 4.5dvh, 26px);
  }

  .daily-task-list { gap: 4px; }

  .daily-task {
    min-height: clamp(48px, 10dvh, 60px);
    grid-template-columns: clamp(32px, 7dvh, 42px) minmax(0, 1fr) auto;
    gap: 4px;
    padding: 4px 6px 4px 3px;
  }

  .daily-task__stars {
    font-size: clamp(13px, 3dvh, 18px);
  }

  .daily-task__title {
    margin-bottom: 2px;
    font-size: clamp(9px, 2.1dvh, 12px);
    line-height: 1.05;
  }

  .daily-task__progress {
    height: clamp(9px, 2.2dvh, 13px);
    padding: 2px 3px;
  }

  .daily-task__count {
    margin-top: 1px;
    font-size: clamp(8px, 1.8dvh, 10px);
  }

  .daily-task__claim {
    min-width: 62px;
    min-height: 36px;
    padding: 4px 5px;
    border-width: 2px;
    border-radius: 7px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
    font-size: clamp(8px, 1.8dvh, 10px);
  }
}

/*
 * Meta's desktop chrome can leave the game with a medium-width but low CSS
 * viewport (for example about 1024x640 on a high-DPI display). The generic
 * low-height layout above used 255px cards there, so the oversized ribbons
 * made only about three locations readable. Compact just this desktop-sized
 * band; phone landscape and large desktop layouts retain their own metrics.
 */
@media (orientation: landscape) and (min-width: 980px) and (max-width: 1400px) and (max-height: 700px) {
  .location-list {
    grid-auto-columns: clamp(215px, 22vw, 235px);
    gap: clamp(20px, 2.4vw, 28px);
  }
}

@media (orientation: landscape) {
  .retention-shortcuts {
    top: 71px;
    left: calc(14px + var(--safe-left));
    gap: 17px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .scroll-arrow {
    display: grid;
    width: 42px;
    height: 48px;
    border-radius: 14px;
    font-size: 38px;
  }
}

@media (orientation: landscape) and (min-height: 361px) and (max-height: 520px) {
  .difficulty-button.is-complete::after {
    top: -7px;
    right: -5px;
    width: 21px;
  }
}

@media (orientation: landscape) and (min-height: 521px) and (max-height: 700px) {
  .difficulty-button.is-complete::after {
    top: -8px;
    right: -6px;
    width: clamp(22px, 4.2dvh, 26px);
  }
}

/*
 * Ultra-low landscape viewports (embedded QA tools and split-screen windows).
 * At roughly 400px high the regular landscape metrics no longer fit: ribbons,
 * completion crowns and the inventory bar used to cover the playable cards.
 */
@media (orientation: landscape) and (max-height: 400px) {
  .app {
    grid-template-rows: 34px minmax(0, 1fr) 46px;
    padding:
      calc(2px + var(--safe-top))
      calc(8px + var(--safe-right))
      calc(1px + var(--safe-bottom))
      calc(8px + var(--safe-left));
  }

  .topbar {
    min-height: 32px;
    margin-top: 0;
    margin-right: 4px;
  }

  .brand-logo {
    width: 126px;
    max-height: 31px;
    margin-top: 0;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .2));
  }

  .topbar__actions { top: 0; gap: 5px; }
  .icon-button { width: 32px; height: 32px; border-radius: 10px; }
  .icon-button img { width: 28px; height: 28px; }
  .mode-pill { padding: 3px 6px; border-radius: 8px; font-size: 7px; }

  .location-list {
    grid-auto-columns: min(26vw, 160px);
    gap: 14px;
    padding: 0 max(6vw, 38px) 3px max(11vw, 70px);
    scrollbar-width: thin;
  }

  .location-list::-webkit-scrollbar { height: 4px; }

  .location-card {
    height: auto;
    min-height: 0;
    grid-template-rows: 23px 23px clamp(78px, 40dvh, 145px) 35px;
    padding: 0 4px 2px;
  }

  .location-card__name-ribbon {
    width: 80%;
    padding: 3px 27px 2px 21px;
    font-size: 8px;
    transform: rotate(-1deg) translateY(8px);
  }

  .location-card.is-complete .location-card__name-ribbon::after {
    top: 12px;
    right: -2px;
    width: 30px;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .3));
  }

  .location-card__difficulty-ribbon {
    width: 108%;
    margin-top: -2px;
    font-size: 11px;
  }

  .location-card__image-button {
    margin: -2px 8px 0;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .24));
  }

  .location-card__lock {
    width: 43px;
    height: 43px;
    border-width: 3px;
    border-radius: 12px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
    font-size: 21px;
  }

  .location-card__progress-ribbon {
    right: 16%;
    bottom: 28px;
    left: 16%;
    min-height: 25px;
    font-size: 10px;
  }

  .location-card__difficulties {
    width: 70px;
    gap: 1px;
    padding-top: 2px;
  }

  .difficulty-button {
    width: 22px;
    height: 19px;
    max-width: none;
    font-size: 10px;
  }

  .difficulty-button.is-complete::after {
    top: -4px;
    right: -3px;
    width: 13px;
  }

  .difficulty-button.is-locked::before {
    right: -4px;
    bottom: -5px;
    width: 17px;
    height: 17px;
  }

  .scroll-arrow {
    width: 31px;
    height: 46px;
    padding-bottom: 4px;
    border-width: 2px;
    border-radius: 11px;
    box-shadow: inset 0 3px rgba(104, 190, 255, .46), 0 3px rgba(0, 0, 0, .22);
    font-size: 31px;
  }

  .inventory-bar {
    min-height: 43px;
    margin-top: 1px;
    margin-bottom: calc(-1px - var(--safe-bottom));
    padding:
      1px calc(12px + var(--safe-right))
      calc(1px + var(--safe-bottom))
      calc(12px + var(--safe-left));
  }

  .island-button {
    width: 74px;
    grid-template-columns: 39px 1fr;
  }

  .island-button > img { width: 42px; height: 42px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
  .island-button__label { font-size: 7px; }
  .island-button .notification-dot {
    width: 18px;
    height: 18px;
  }

  .inventory-bar__resources { gap: 10px; margin-right: 9px; }

  .resource-button {
    min-width: 83px;
    height: 32px;
    padding: 0 35px 0 10px;
    border-width: 2px;
    border-radius: 9px;
    box-shadow: inset 0 3px rgba(255, 101, 184, .42), 0 3px rgba(0, 0, 0, .25);
  }

  .resource-button__count { font-size: 16px; }
  .resource-button img { right: -9px; width: 40px; height: 40px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
  .resource-button__plus { top: -5px; right: -10px; width: 17px; height: 17px; border-width: 1px; font-size: 12px; }

  .retention-shortcuts {
    top: 45px;
    left: calc(7px + var(--safe-left));
    gap: 5px;
  }

  .retention-shortcut { width: 42px; gap: 0; font-size: 7px; line-height: .88; }

  .retention-shortcut__icon {
    width: 34px;
    height: 34px;
  }

  .retention-shortcut__icon > img { width: 21px; height: 21px; }
  .retention-shortcut__label { width: 39px; -webkit-text-stroke: .35px #111117; }
  .retention-shortcut .notification-dot { top: -4px; right: -5px; width: 18px; height: 18px; }

  /*
   * Options uses the same tall illustrated frame as the retention dialogs,
   * but its regular controls were still desktop-sized in a 300px-high iframe.
   * Keep the frame consistent with Daily Tasks/Rewards and compact only its
   * contents so nothing is clipped on the right or hidden below the fold.
   */
  #settings-dialog .utility-card__ribbon {
    top: -1%;
    left: 7%;
    width: 86%;
    height: 18%;
    padding: 2% 11% 3%;
  }

  #settings-dialog .utility-card__ribbon h2 {
    max-width: 100%;
    font-size: clamp(13px, 5.2dvh, 18px);
    line-height: .9;
    white-space: nowrap;
  }

  #settings-dialog .utility-card__body--settings {
    top: 10%;
    right: 9%;
    bottom: 18%;
    left: 9%;
    gap: clamp(3px, 1.1dvh, 5px);
    overflow-y: auto;
    padding: 5% 3% 2%;
  }

  #settings-dialog .game-dialog__logo {
    width: clamp(44px, 27%, 62px);
    max-height: 19dvh;
  }

  #settings-dialog .setting-row {
    min-height: 25px;
    padding: 3px 5px;
    border-width: 2px;
    border-radius: 7px;
    font-size: clamp(8px, 3.4dvh, 11px);
    line-height: 1;
  }

  #settings-dialog .setting-row--language strong {
    min-width: 30px;
    padding: 2px 4px;
    border-width: 2px;
    border-radius: 6px;
    font-size: clamp(9px, 3.7dvh, 12px);
  }

  #settings-dialog .setting-row__switch {
    width: 31px;
    height: 17px;
    flex: 0 0 31px;
    border-width: 2px;
  }

  #settings-dialog .setting-row__switch::after {
    top: 2px;
    left: 2px;
    width: 9px;
    height: 9px;
  }

  #settings-dialog .setting-row.is-on .setting-row__switch::after {
    transform: translateX(14px);
  }

  #settings-dialog .settings-card__build-version {
    margin: 0;
    font-size: clamp(6px, 2.4dvh, 8px);
    line-height: 1;
  }

  #settings-dialog .utility-card > .game-dialog__close {
    top: -2.5%;
    right: -1%;
    width: clamp(30px, 11%, 38px);
    border-width: 2px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
    font-size: clamp(25px, 8dvh, 34px);
  }
}

/* Keep all menu shortcuts on one compact rail in landscape, including Store
 * inside the header. Size by height so wide desktop frames do not enlarge them. */
@media (orientation: landscape) {
  .app {
    --shortcut-icon-size: clamp(34px, 8dvh, 63px);
    --shortcut-font-size: clamp(7px, 1.65dvh, 13px);
    --shortcut-left: calc(clamp(7px, 1.6dvh, 14px) + var(--safe-left));
    --shortcut-top: calc(clamp(4px, 2.4dvh, 22px) + var(--safe-top));
    --shortcut-gap: clamp(10px, 2.5dvh, 17px);
  }

  .store-open.retention-shortcut {
    position: fixed;
    left: var(--shortcut-left);
    top: var(--shortcut-top);
  }

  .retention-shortcuts {
    left: var(--shortcut-left);
    top: calc(var(--shortcut-top) + var(--shortcut-icon-size) + var(--shortcut-font-size) + var(--shortcut-gap));
    gap: var(--shortcut-gap);
  }

  .retention-shortcut {
    width: calc(var(--shortcut-icon-size) + 5px);
    font-size: var(--shortcut-font-size);
    line-height: .86;
  }

  .retention-shortcut__icon {
    width: var(--shortcut-icon-size);
    height: var(--shortcut-icon-size);
  }

  .retention-shortcut__icon > img { width: 64%; height: 64%; }

  .store-open .retention-shortcut__icon > img {
    width: 80%;
    height: 80%;
    margin-left: calc(var(--shortcut-icon-size) * .127);
    margin-bottom: calc(var(--shortcut-icon-size) * .064);
  }

  .app .retention-shortcut .retention-shortcut__label {
    width: calc(var(--shortcut-icon-size) - 1px);
    font-size: inherit;
  }

  .retention-shortcut .notification-dot {
    top: calc(var(--shortcut-icon-size) * -.11);
    right: calc(var(--shortcut-icon-size) * -.11);
    width: clamp(18px, 3.4dvh, 27px);
    height: clamp(18px, 3.4dvh, 27px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* CrazyGames has no approved IAP. Center the one rewarded offer. */
.reward-card--ad-only .reward-card__offers,
.reward-card--ad-only .reward-card__messages {
  left: 28%; right: 28%; grid-template-columns: minmax(0, 1fr);
}
#platform-blocker {
  position: fixed; inset: 0; z-index: 10000; display: grid;
  place-items: center; background: #101018e8; color: white;
  font: 24px sans-serif; text-align: center; padding: 24px;
}

#crazygames-gameplay-banner {
  position: fixed; width: 320px; height: 50px;
  padding: 0; margin: 0; border: 0; z-index: 36;
  overflow: hidden; background: transparent;
}

/* Loading dialog ported from Meta review v060. */
.preparing__card {
width: min(460px, 100%);
max-height: calc(100dvh - 64px);
gap: 16px;
padding: 0 28px 24px;
margin-top: 32px;
border: 10px solid #f2e4f2;
outline: 4px solid #090a0e;
border-radius: 26px;
background-color: #e454a0;
background-image: radial-gradient(ellipse 7px 5px at 18px 18px, #cb3a87 95%, transparent);
background-size: 52px 44px;
box-shadow: inset 0 0 0 4px #090a0e, 0 12px 0 rgba(9, 10, 14, .6);
overflow-y: auto;
scrollbar-width: thin;
}
.preparing__ribbon {
display: grid;
place-items: center;
width: 100%;
height: 98px;
margin: 12px 0 -4px;
padding: 16px 38px 19px;
background: url("../assets/ui/ribbon-blue.webp") center / 100% 100% no-repeat;
transform: rotate(-2deg);
}
.preparing__ribbon h2 {
margin: 0;
color: white;
font: clamp(22px, 6vw, 36px)/1 "Hidden Lilita One", sans-serif;
text-transform: uppercase;
-webkit-text-stroke: 2px #090a0e;
paint-order: stroke fill;
text-shadow: 0 3px #090a0e;
}
.preparing__hero {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
width: 100%;
min-width: 0;
}
.preparing__spinner { flex: 0 0 70px; width: 70px; height: 70px; }
.preparing__spinner img { display: block; width: 100%; height: 100%; object-fit: contain; }
.preparing__copy { min-width: 0; }
.preparing__card #preparing-title {
color: white;
font: 24px/1.05 "Hidden Lilita One", sans-serif;
text-align: left;
-webkit-text-stroke: 1.5px #090a0e;
paint-order: stroke fill;
text-shadow: 0 2px #090a0e;
}
.preparing__card .preparing__location {
margin-top: 8px;
color: #301b31;
font: 17px/1.15 "Hidden Lilita One", sans-serif;
text-align: left;
text-transform: none;
overflow-wrap: anywhere;
}
.preparing__numbers {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 8px 12px;
width: 100%;
font-family: "Hidden Lilita One", sans-serif;
}
#preparing-percent {
min-width: 112px;
padding: 6px 12px 9px;
border: 4px solid #090a0e;
border-radius: 10px;
background: #ff571d;
box-shadow: 0 4px #090a0e;
color: white;
font: 42px/1 "Hidden Lilita One", sans-serif;
text-align: center;
-webkit-text-stroke: 2px #090a0e;
paint-order: stroke fill;
transform: rotate(-2deg);
}
#preparing-percent.is-waiting { font-size: 24px; padding: 12px; }
.preparing__track {
width: 100%;
height: 30px;
border: 4px solid #090a0e;
border-radius: 14px;
background: #303547;
box-shadow: 0 4px #090a0e, inset 0 3px rgba(0, 0, 0, .4);
}
.preparing__track span {
border-right: 3px solid #090a0e;
border-radius: 7px;
background: linear-gradient(#83f2ff 0 24%, #15cae9 24% 70%, #0798c7 70%);
transition: width .2s linear;
}
.preparing__card #cancel-preparing {
min-width: 152px;
padding: 10px 24px 12px;
border: 4px solid #090a0e;
border-radius: 13px;
background: linear-gradient(#9691a6 0 55%, #797487 55%);
box-shadow: 0 5px #090a0e, inset 0 3px rgba(255, 255, 255, .3);
color: white;
font: 24px/1 "Hidden Lilita One", sans-serif;
-webkit-text-stroke: 1.5px #090a0e;
paint-order: stroke fill;
cursor: pointer;
}
.preparing__card #cancel-preparing:active { transform: translateY(3px); box-shadow: 0 2px #090a0e; }
.preparing__track.is-indeterminate span {
animation: preparing-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes preparing-pulse {
from { opacity: .35; }
to { opacity: 1; }
}
@media (max-width: 380px) {
  .preparing__card { padding-left: 16px; padding-right: 16px; }
  .preparing__ribbon { padding-left: 24px; padding-right: 24px; }
  .preparing__spinner { flex-basis: 48px; width: 48px; height: 48px; }
  .preparing__card #preparing-title { font-size: 22px; overflow-wrap: anywhere; }
}
@media (max-height: 500px) {
.preparing__card { gap: 10px; padding: 0 24px 16px; margin-top: 0; max-height: calc(100dvh - 32px); }
.preparing__ribbon { height: 68px; margin: 6px 0 -4px; padding: 10px 38px 14px; }
.preparing__ribbon h2 { font-size: 30px; }
.preparing__spinner { flex-basis: 48px; width: 48px; height: 48px; }
.preparing__card #preparing-title { font-size: 21px; }
.preparing__card .preparing__location { margin-top: 4px; font-size: 16px; }
#preparing-percent { font-size: 32px; padding: 4px 12px 6px; }
.preparing__card #cancel-preparing { font-size: 21px; padding: 7px 20px 9px; }
}
@media (prefers-reduced-motion: reduce) {
.preparing__track span { transition: none; animation: none; }
}

/* Support operations live in the menu, with a scrollable phone-sized dialog. */
.support-card { width: min(620px,100%); max-height: calc(100dvh - 48px); display:flex; flex-direction:column; align-items:stretch; gap:12px; padding:28px 20px 18px; font-family:Arial,sans-serif; }
.support-card h2 { padding:0 20px; font-family:inherit; font-size:24px; }
.support-body { overflow:auto; min-height:0; display:flex; flex-direction:column; gap:12px; padding:3px; }
.support-body p, .support-card #support-status { margin:0; line-height:1.4; font-size:15px; overflow-wrap:anywhere; }
.support-body h3 { margin:6px 0 0; }
.support-label { display:flex; flex-direction:column; gap:6px; font-size:16px; }
.support-label input, .support-label textarea, .support-label select { width:100%; box-sizing:border-box; padding:10px; background:#f2f5ff; color:#182033; border:2px solid #121622; border-radius:8px; font:16px Arial,sans-serif; }
.support-label textarea { resize:vertical; min-height:70px; }
#support-id { font-family:monospace; }
.support-button { padding:10px 14px; border:2px solid #101422; border-radius:10px; color:#fff; background:#5268df; font:700 16px Arial,sans-serif; text-align:center; cursor:pointer; text-decoration:none; }
.support-button:focus-visible, .support-body input:focus-visible, .support-body textarea:focus-visible, .support-body select:focus-visible { outline:3px solid #f6e994; outline-offset:2px; }
.support-tools { display:flex; gap:8px; flex-wrap:wrap; }
.support-tools > * { flex:1; }
.support-note { color:#d3d9ec; }
.support-level-list { display:flex; flex-direction:column; gap:10px; }
.support-level-list fieldset { border:1px solid #7f8aac; border-radius:8px; padding:10px; min-width:0; }
.support-level-list legend { font-weight:bold; padding:0 4px; }
.support-level { display:inline-flex; align-items:center; gap:7px; margin:8px; font-size:15px; }
.support-level input { width:20px; height:20px; accent-color:#6273ec; }
#support-status { flex-shrink:0; color:#ffed9d; }
#settings-dialog .utility-card__body--settings { top:18%; align-content:safe center; gap:clamp(3px,1dvh,8px); }
#settings-dialog .game-dialog__logo { width:clamp(44px,25%,100px); }
#support-open { flex-shrink:0; font-size:clamp(10px,2dvh,16px); padding:clamp(4px,1dvh,8px) 10px; }
.settings-card__support-actions, .delete-progress-actions { display:flex; gap:8px; width:100%; }
.settings-card__support-actions > .support-button { flex:1; min-width:0; font-size:clamp(10px,2dvh,16px); padding:clamp(4px,1dvh,8px) 6px; }
@media (max-height: 600px) {
  #settings-dialog .setting-row { padding:4px 6px; border-width:2px; font-size:clamp(10px,2.5dvh,15px); }
  #settings-dialog .setting-row--language strong { min-width:30px; padding:2px 5px; border-width:2px; font-size:14px; }
  #settings-dialog .setting-row__switch { width:36px; height:20px; flex:0 0 36px; border-width:2px; }
  #settings-dialog .setting-row__switch::after { width:12px; height:12px; }
  #settings-dialog .setting-row.is-on .setting-row__switch::after { transform:translateX(16px); }
  #settings-dialog .game-dialog__logo { width:clamp(32px,20%,55px); }
  #settings-dialog .settings-card__website { font-size:clamp(10px,2dvh,13px); padding:4px 6px; }
}
.delete-progress-actions > button { flex:1; }
.delete-progress-danger { background:#b82b64; }
#delete-progress-dialog .support-card { overflow:auto; }
#delete-progress-dialog p { margin:0; font-size:16px; line-height:1.45; }
#delete-progress-status { color:#ffed9d; }
@media(max-width:420px) { .support-card { padding:24px 12px 12px; } .support-card h2 { font-size:21px; } }
#continuity-status {
  position: fixed; z-index: 10000; bottom: 0; left: 0; right: 0;
  padding: 7px 12px; background: #292533; color: #fff; font: 13px/1.35 sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
#continuity-status[hidden] { display: none; }
#continuity-status button { flex-shrink: 0; padding: 7px 12px; }
#temporary-progress-choice { position: fixed; inset: 20% 5%; z-index: 10001;
  background: #292533; color: white; padding: 24px; border: 3px solid #5968dc;
  overflow: auto; }
#temporary-progress-choice button { padding: 12px; margin: 8px; }
