/* Start, menu, map, story, deck builder, result and the big card. */
.logo {
  position: absolute;
  left: 50%;
  top: calc(var(--sat) + var(--u) * 13);
  width: calc(var(--u) * 84);
  transform: translateX(-50%);
  filter: drop-shadow(0 calc(var(--u) * 1) calc(var(--u) * 1.2) rgba(4, 30, 26, 0.5));
}
body.land .logo {
  top: calc(var(--sat) + var(--u) * 5);
  width: calc(var(--u) * 74);
}
.touch {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sab) + var(--u) * 20);
  translate: -50% 0;
  display: flex;
  justify-content: center;
}
.touch .tag {
  --h: calc(var(--u) * 13);
  min-width: calc(var(--u) * 58);
} /* on its own plate: readable over the bright stump */
body.land .touch {
  bottom: calc(var(--sab) + var(--u) * 9);
}

/* the menu toy: a fan of cards on the stump */
.menu-fan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.menu-fan .card {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
}
.menu-fan .shadow {
  position: absolute;
  right: auto;
  bottom: auto;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 18, 0, 0.42), transparent);
}
@media (hover: hover) and (pointer: fine) {
  .menu-fan .card:hover .c-in {
    translate: 0 -7%;
    transition: translate 0.14s;
  }
}
/* characters standing on a point of the scene: the box is placed by its feet */
.menu-hero,
.actor {
  position: absolute;
  width: 0;
  pointer-events: none;
}
.menu-hero .char,
.actor .char {
  position: absolute;
  bottom: calc(var(--pad, 0) * -100%);
  left: 0;
  height: 100%;
  width: auto;
  max-width: none;
  translate: -50% 0;
  scale: var(--flip, 1) 1;
}
.menu-hero .shadow,
.actor .shadow {
  left: auto;
  right: auto;
  width: calc(var(--u) * 26);
  margin-left: calc(var(--u) * -13);
  bottom: calc(var(--u) * -1.4);
  height: calc(var(--u) * 5);
}

.menu-btns {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sab) + var(--u) * 7);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2.4);
  width: calc(var(--u) * 74);
}
.menu-btns .btn {
  width: 62%;
}
.menu-btns .btn.big {
  width: 100%;
}
body.land .menu-btns {
  left: auto;
  right: calc(var(--sar) + var(--u) * 12);
  bottom: 50%;
  transform: translateY(58%);
  width: calc(var(--u) * 60);
}
body.land #s-menu .logo {
  left: calc(var(--sal) + var(--u) * 46);
  top: calc(var(--sat) + var(--u) * 6);
  width: calc(var(--u) * 66);
}

/* map */
#map-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#map-nodes {
  position: absolute;
  inset: 0;
}
.node {
  position: absolute;
  width: var(--ns);
  height: var(--ns);
  margin: calc(var(--ns) * -0.5) 0 0 calc(var(--ns) * -0.5);
  transition: transform 0.13s var(--pop);
}
.node:active {
  transform: scale(0.92);
}
.node .base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.node.now .base {
  inset: -22%;
  width: 144%;
  height: 144%;
  animation: nodenow 2s ease-in-out infinite;
}
@keyframes nodenow {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
body.calm .node.now .base {
  animation: none;
}
.node b {
  position: absolute;
  inset: 0 0 6% 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--ns) * 0.46);
}
.node .who {
  position: absolute;
  left: 4%;
  bottom: 66%;
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 calc(var(--ns) * 0.04) 0 rgba(4, 30, 26, 0.6));
  transform-origin: 50% 100%;
  animation: breathe 3.2s ease-in-out infinite;
}
.node.boss .who {
  border-radius: 50%;
}
.node .crown {
  position: absolute;
  left: 30%;
  bottom: 150%;
  width: 40%;
}
.node.now .crown {
  bottom: 152%;
}
.node.now b {
  inset: 0;
}
.node:not(.now):not(.boss) .who {
  display: none;
}
.node.lock b {
  opacity: 0.75;
  inset: 0 0 27% 0;
  font-size: calc(var(--ns) * 0.32);
}
.node .lk {
  position: absolute;
  left: 34%;
  bottom: 4%;
  width: 32%;
}
.node .stars {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 84%;
  display: flex;
  justify-content: center;
}
.node .stars img {
  width: 34%;
  margin: 0 -2%;
}
/* the bar of the map and the line of the story hang from the top of the WINDOW, not of the centred stage: on a tall window it does not float in the middle */
#s-map,
#s-story {
  --sat: calc(env(safe-area-inset-top, 0px) + var(--hud-y));
}
#map-back {
  position: absolute;
  left: calc(var(--sal) + var(--u) * 2.5 + var(--hud-x));
  top: calc(var(--sat) + var(--u) * 2.5);
  z-index: 5;
}
#map-stars {
  position: absolute;
  left: calc(var(--sal) + var(--u) * 16 + var(--hud-x));
  top: calc(var(--sat) + var(--u) * 3.2);
  z-index: 5;
}
#map-stars {
  width: calc(var(--u) * 25);
}
#map-stars.done {
  width: calc(var(--u) * 36);
}
#map-stars .champ {
  width: calc(var(--h) * 0.62);
  margin-right: calc(var(--u) * 1);
}
/* campaign complete: crown + stars on the menu, top left (the corner on the right belongs to sound and gear) */
#menu-champ {
  position: absolute;
  left: calc(var(--sal) + var(--u) * 2.5 + var(--hud-x));
  top: calc(env(safe-area-inset-top, 0px) + var(--hud-y) + var(--u) * 2.5);
  width: calc(var(--u) * 36);
  z-index: 5;
}
#menu-champ img {
  width: calc(var(--h) * 0.62);
  margin-right: calc(var(--u) * 1);
}
#menu-champ b {
  font-size: calc(var(--u) * 4.8);
}
#map-stars img {
  width: calc(var(--h) * 0.7);
  margin-right: calc(var(--u) * 1.4);
}
#map-stars b {
  font-size: calc(var(--u) * 4.8);
}
#map-title {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--sat) + var(--u) * 16);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 1.5);
  z-index: 5;
  pointer-events: none;
}
#map-title > * {
  pointer-events: auto;
} /* the full-width row never covers the back button (lying, it sits on the same line) */
#map-title .tag {
  --h: calc(var(--u) * 11);
  min-width: calc(var(--u) * 50);
  max-width: calc(var(--u) * 62);
}
#map-title .rb.off {
  filter: grayscale(0.9) brightness(0.7);
}
.map-btns {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--sab) + var(--u) * 5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 3);
  z-index: 5;
  padding: 0 calc(var(--u) * 4);
}
.map-btns .btn.secondary {
  width: calc(var(--u) * 38);
}
.map-btns .btn.primary {
  width: calc(var(--u) * 50);
}
body.land #map-title {
  top: calc(var(--sat) + var(--u) * 3);
}
body.land .map-btns {
  left: auto;
  right: calc(var(--sar) + var(--u) * 3);
  bottom: calc(var(--sab) + var(--u) * 3);
  flex-direction: column-reverse;
  align-items: flex-end;
  padding: 0;
  gap: calc(var(--u) * 2);
}

#s-start {
  cursor: pointer;
} /* (iOS sends a click to a plain box only when it looks tappable) */

/* story */
#st-box {
  position: absolute;
  left: 50%;
  top: calc(var(--sat) + var(--u) * 16);
  transform: translateX(-50%);
  width: calc(var(--u) * 92);
  max-width: calc(100% - var(--u) * 6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#st-box > .tag {
  margin-left: calc(var(--u) * 6);
  margin-bottom: calc(var(--u) * -4.5);
  z-index: 2;
  max-width: 80%;
}
#st-panel {
  --k: calc(var(--u) * 0.056);
  width: 100%;
}
#st-text {
  margin: calc(var(--ft) - var(--bt)) calc(var(--fr) - var(--br)) calc(var(--fb) - var(--bb))
    calc(var(--fl) - var(--bl));
  padding: calc(var(--u) * 4.5) calc(var(--u) * 5) calc(var(--u) * 3);
  min-height: calc(var(--u) * 16);
  font-size: calc(var(--u) * 4.8);
  --o: 0.13em;
  line-height: 1.22;
  display: grid;
  align-items: center;
}
.st-btns {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--sab) + var(--u) * 5);
  display: flex;
  justify-content: center;
} /* the one button, at the bottom: the two characters stand whole between the text and it */
/* a panel is open over the story (how to play, sound...): its big buttons leave, and come back after it has closed. The
   delay is longer than the panel's exit: closing the tutorial starts the duel at once, with no flash of DUEL! on the way */
.st-btns {
  transition:
    opacity 0.2s 0.18s,
    visibility 0s 0.18s;
}
body.modal .st-btns {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.12s,
    visibility 0s 0.12s;
}
.st-btns .btn.primary {
  width: calc(var(--u) * 52);
}
body.land #st-box {
  width: calc(var(--u) * 88);
  top: calc(var(--sat) + var(--u) * 3);
}
body.land .st-btns {
  bottom: calc(var(--sab) + var(--u) * 3);
}
body.land #st-text {
  min-height: calc(var(--u) * 11);
  padding-top: calc(var(--u) * 3.5);
  font-size: calc(var(--u) * 4.4);
}

/* deck builder */
#s-deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--sat) + var(--u) * 2.5) calc(var(--sar) + var(--u) * 3) calc(var(--sab) + var(--u) * 3)
    calc(var(--sal) + var(--u) * 3);
  gap: calc(var(--u) * 1.8);
}
#s-deck > * {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--u) * 112);
}
#s-deck > .scene {
  position: absolute;
  z-index: 0;
  max-width: none;
  filter: brightness(0.55) saturate(0.9);
}
.dk-top {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 2);
  min-height: calc(var(--u) * 11.5);
  padding-right: calc(var(--u) * 27);
}
#dk-title {
  --h: calc(var(--u) * 10.5);
  flex: 1;
  min-width: 0;
  justify-content: center;
}
#dk-title b {
  font-size: calc(var(--u) * 3.9);
  text-transform: uppercase;
  white-space: nowrap;
}
#dk-title i {
  flex: none;
  width: calc(var(--u) * 2.6);
} /* room between the two texts (no drawn bar) */
#dk-slots {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 1.6);
}
#dk-slots .btn {
  --h: calc(var(--u) * 9.5);
  flex: 1;
  max-width: calc(var(--u) * 34);
  filter: brightness(0.8);
}
#dk-slots .btn.sel {
  filter: brightness(1.3) saturate(1.3);
}
#dk-slots .use {
  position: absolute;
  right: calc(var(--u) * -1 - var(--br));
  top: calc(var(--u) * -1.6 - var(--bt));
  width: calc(var(--u) * 4.2);
  z-index: 1;
} /* on the corner, above the letters, never over them */
#dk-tray {
  --k: calc(var(--u) * 0.12);
  --cw: calc(var(--u) * 14.5);
}
#dk-tray .label {
  position: absolute;
  left: calc(var(--u) * 4.5);
  top: calc(var(--u) * 0.3);
  font-size: calc(var(--u) * 3.9);
  text-transform: uppercase;
  z-index: 2;
}
#dk-tray .need {
  position: absolute;
  right: calc(var(--u) * 4.5);
  top: calc(var(--u) * 0.3);
  font-size: calc(var(--u) * 3.9);
  color: var(--gold);
  z-index: 2;
}
.dk-empty {
  align-self: center;
  width: 100%;
  text-align: center;
  font-size: calc(var(--u) * 3.8);
  line-height: 1.2;
  --o: 0.12em;
  padding: 0 calc(var(--u) * 3);
  white-space: normal;
}
#dk-row {
  margin: calc(var(--ft) - var(--bt)) calc(var(--fr) - var(--br)) calc(var(--fb) - var(--bb))
    calc(var(--fl) - var(--bl));
  display: flex;
  gap: calc(var(--u) * 1);
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
  padding: calc(var(--u) * 8.6) calc(var(--u) * 1.5) calc(var(--u) * 1.2);
  min-height: calc(var(--cw) * 1.4 + var(--u) * 9.8);
  scrollbar-width: none;
}
#dk-row::-webkit-scrollbar,
#dk-grid::-webkit-scrollbar {
  display: none;
}
/* standing, the list scrolls sideways: its two ends fade instead of cutting a card dry */
body:not(.land) #dk-row {
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 calc(var(--u) * 2),
    #000 calc(100% - var(--u) * 2),
    transparent
  );
  mask-image: linear-gradient(90deg, transparent, #000 calc(var(--u) * 2), #000 calc(100% - var(--u) * 2), transparent);
}
/* more cards below: a small arrow on the bottom edge of the list, where the cards have faded, until the end of the list */
#s-deck > #dk-more {
  position: relative;
  flex: none;
  width: calc(var(--u) * 6);
  height: calc(var(--u) * 4.9);
  margin-top: calc(var(--u) * -6.2);
  background: url(../assets/fx/arrow.webp) center / contain no-repeat;
  rotate: 180deg;
  filter: drop-shadow(0 0 calc(var(--u) * 0.4) rgba(0, 0, 0, 0.6));
  animation: more 1.3s ease-in-out infinite;
  pointer-events: none;
  z-index: 8;
}
body.land #s-deck > #dk-more {
  grid-area: grid;
  align-self: end;
  justify-self: center;
  margin: 0;
}
#dk-grid.end + #dk-more {
  visibility: hidden;
}
body.calm #dk-more {
  animation: none;
}
.card.mini,
.cell .card,
.insp-card .card,
.pz .card {
  position: relative;
  left: auto;
  top: auto;
  margin: 0;
  flex: none;
  transform: none;
}
#dk-tabs {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 1.6);
}
#dk-tabs .tab {
  flex: 0 1 calc(var(--u) * 12.5);
  width: auto;
  height: auto;
  min-width: 0;
  aspect-ratio: 1;
  filter: brightness(0.8);
} /* the row shrinks to its room: never under sound and gear */
#dk-tabs .tab.sel {
  filter: brightness(1.25) drop-shadow(0 0 calc(var(--u) * 1.2) #b6f08a);
  transform: scale(1.08);
}
#dk-tabs .tab .ic {
  left: 15%;
  top: 12%;
  width: 70%;
  height: 70%;
}
#dk-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 27), 1fr));
  gap: calc(var(--u) * 3.4) calc(var(--u) * 2);
  padding: calc(var(--u) * 3) calc(var(--u) * 2.5) calc(var(--u) * 4);
  border-radius: calc(var(--u) * 4);
  background: rgba(4, 40, 35, 0.72);
  box-shadow: inset 0 0 0 calc(var(--u) * 0.5) rgba(110, 220, 150, 0.35);
  scrollbar-width: none;
  align-content: start;
  -webkit-mask-image: linear-gradient(
    transparent,
    #000 calc(var(--u) * 3),
    #000 calc(100% - var(--u) * 9),
    transparent
  );
  mask-image: linear-gradient(transparent, #000 calc(var(--u) * 3), #000 calc(100% - var(--u) * 9), transparent);
}
/* a card inside a list: a finger moving up or down on it scrolls the list (in the duel .card takes every touch) */
.cell,
.cell .card,
.gcell .card,
.scroll .card {
  touch-action: pan-y;
}
.cell {
  position: relative;
  --cw: calc(var(--u) * 24);
  width: var(--cw);
  justify-self: center;
  transition: transform 0.13s var(--pop);
}
.cell:active {
  transform: scale(0.95);
}
.cell .cnt {
  position: absolute;
  right: calc(var(--cw) * -0.04);
  top: calc(var(--cw) * -0.06);
  padding: 0 calc(var(--cw) * 0.06);
  height: calc(var(--cw) * 0.24);
  line-height: calc(var(--cw) * 0.24);
  border-radius: 999px;
  background: rgba(4, 40, 35, 0.95);
  font-size: calc(var(--cw) * 0.21);
  --o: 0.13em;
  z-index: 6;
}
.cell .lk {
  position: absolute;
  left: 34%;
  top: 30%;
  width: 32%;
  z-index: 6;
}
.cell .ck {
  position: absolute;
  right: -2%;
  bottom: 24%;
  width: 26%;
  z-index: 6;
  display: none;
}
.cell.in .ck {
  display: block;
}
.cell.locked .card {
  filter: grayscale(0.85) brightness(0.5);
}
.cell.max .card {
  filter: brightness(0.72);
}
.dk-btns {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 3);
}
.dk-btns .btn {
  flex: 1;
  max-width: calc(var(--u) * 52);
}
.dk-btns #dk-auto {
  flex: 1.3;
}
body.land .dk-btns {
  gap: calc(var(--u) * 2);
}
body.land .dk-btns #dk-auto {
  flex: 1.7;
  max-width: none;
} /* lying: the left column is narrow; the long label gets the room */ /* icon + longer label: a little more room, so its letters match SAVE */
#toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sab) + var(--u) * 24);
  transform: translateX(-50%);
  z-index: 80;
  --h: calc(var(--u) * 11);
  max-width: 92%;
  pointer-events: none;
}
#toast b {
  text-transform: none;
  font-size: calc(var(--u) * 4);
}

/* how to play: one big picture per step, a caption under it, dots, back / next (src/app/tutorial.js). The picture is sized
   by the room in height, so no step ever scrolls (phone standing, lying, desktop) */
.panel.tut {
  --ti: calc(min(calc(var(--u) * 61), calc(100dvh - var(--stage-y) * 2 - var(--u) * 62)) - var(--go, 0px));
  width: calc(var(--u) * 88);
} /* standing: room for a caption of 3 lines under the picture */
body.land .panel.tut {
  --ti: min(calc(var(--u) * 60), calc(100dvh - var(--stage-y) * 2 - var(--u) * 44));
  width: calc(var(--ti) + var(--u) * 50);
}
/* lying: the picture on the left, the caption beside it (the height goes to the picture, never to empty space) */
body.land .tut-view {
  height: var(--ti);
}
body.land .tut-page:not(.tut-ab) {
  flex-direction: row;
  gap: calc(var(--u) * 4);
}
body.land .tut-cap {
  font-size: calc(var(--u) * 4.8);
  text-align: left;
  place-items: center start;
}
.tut-view {
  position: relative;
  width: 100%;
  height: calc(var(--ti) + var(--u) * 16.5);
  touch-action: pan-y;
}
.tut-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 1.6);
}
.tut-pic {
  flex: none;
  width: var(--ti);
  height: var(--ti);
  border-radius: calc(var(--u) * 3);
  overflow: hidden;
  box-shadow:
    0 0 0 calc(var(--u) * 0.5) rgba(255, 222, 140, 0.85),
    0 calc(var(--u) * 1) calc(var(--u) * 2.4) rgba(0, 0, 0, 0.45);
}
.tut-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tut-cap {
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  font-size: calc(var(--u) * 4.1);
  line-height: 1.18;
  text-align: center;
  --o: 0.12em;
  text-wrap: balance;
}
.tut-ab {
  justify-content: flex-start;
}
.tut-abt {
  font-size: calc(var(--u) * 4.4);
  text-transform: uppercase;
  color: var(--gold);
}
.tut-abs {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--u) * 0.9);
  width: 100%;
  align-content: center;
  flex: 1;
}
body.land .tut-abs {
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: center;
  gap: calc(var(--u) * 2) calc(var(--u) * 5);
} /* the two columns as wide as their text, the block centred: same air on both sides */
body.land .tut-abs .row.help p {
  max-width: calc(var(--u) * 48);
  text-wrap: pretty;
}
.tut-abs .row.help p {
  font-size: calc(var(--u) * 3.3);
  line-height: 1.13;
}
.tut-abs .row.help p b {
  display: block;
  margin-bottom: calc(var(--u) * 0.15);
} /* the name is a title line, the text under it */
.tut-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: calc(var(--u) * 3);
  width: 100%;
}
.tut-a {
  justify-self: end;
}
.tut-b {
  justify-self: start;
  display: flex;
}
.tut-b .tut-go {
  width: calc(var(--u) * 30);
}
/* standing, the last page: the button has a row of its own under the dots (beside 11 dots it ran out of the panel). The picture gives that row its height (--go = button + row gap), so the panel keeps its size from page to page */
body:not(.land) .panel.tut.last {
  --go: calc(var(--u) * 14.5);
}
body:not(.land) .panel.tut.last .tut-nav {
  row-gap: calc(var(--u) * 2);
}
body:not(.land) .panel.tut.last .tut-b {
  display: contents;
}
body:not(.land) .panel.tut.last .tut-go {
  --h: calc(var(--u) * 12.5);
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  width: calc(var(--u) * 46);
}
body.land .tut-b .tut-go {
  width: calc(var(--u) * 24);
} /* lying: as wide as the free side column, so the dots stay in the middle */
.tut-nav .rb.off {
  filter: grayscale(0.9) brightness(0.6);
  pointer-events: none;
}
.tut-dots {
  display: flex;
  gap: calc(var(--u) * 1.6);
}
.tut-dots i {
  width: calc(var(--u) * 2.6);
  height: calc(var(--u) * 3.2);
  background: url(../assets/ui/fx-acorn.webp) center / contain no-repeat;
  filter: grayscale(0.75) brightness(0.55);
  transition:
    filter 0.2s,
    scale 0.2s;
}
.tut-dots i.on {
  filter: drop-shadow(0 0 calc(var(--u) * 0.5) rgba(255, 214, 90, 0.9));
  scale: 1.3;
}

/* panels: big card, result */
.panel .scroll {
  width: 100%;
  max-height: 58vh;
  overflow-y: auto;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1.6);
  scrollbar-width: none;
  padding: calc(var(--u) * 2.5);
  border-radius: calc(var(--u) * 3.5);
  background: rgba(2, 30, 26, 0.55);
  box-shadow: inset 0 0 0 calc(var(--u) * 0.4) rgba(110, 220, 150, 0.3);
}
.scrollbox {
  position: relative;
  width: 100%;
}
.scrollbox::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * -4.4);
  width: calc(var(--u) * 6);
  height: calc(var(--u) * 4.9);
  margin-left: calc(var(--u) * -3);
  background: url(../assets/fx/arrow.webp) center / contain no-repeat;
  rotate: 180deg;
  animation: more 1.3s ease-in-out infinite;
}
.scrollbox.end::after {
  display: none;
}
@keyframes more {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -18%;
  }
} /* (the arrow is turned 180deg: -y is down) */
.panel .scroll::-webkit-scrollbar {
  display: none;
}
body.land #p-help .panel {
  width: calc(var(--u) * 150);
}
body.land #p-help .scroll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--u) * 1.6) calc(var(--u) * 4);
  align-items: start;
}
.row.help {
  min-height: 0;
  align-items: flex-start;
  flex: none;
}
.row.help .ri {
  width: calc(var(--u) * 7.5);
  height: calc(var(--u) * 7.5);
  flex: none;
}
.row.help p {
  flex: 1;
  font-size: calc(var(--u) * 4);
  --o: 0.12em;
  line-height: 1.2;
  text-align: left;
}
.row.help p b {
  color: var(--gold);
}
.insp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2.5);
  width: 100%;
}
.insp-card {
  --cw: calc(var(--u) * 46);
  padding-top: calc(var(--u) * 3);
}
.insp-lines {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1.6);
}
body.land .insp {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}
body.land .insp-card {
  --cw: calc(var(--u) * 34);
}

.panel.res {
  width: calc(var(--u) * 96);
}
.panel.res > .in {
  gap: calc(var(--u) * 2);
  padding-top: 0;
}
.panel.res.prize .res-hero {
  height: calc(var(--u) * 30);
  width: calc(var(--u) * 30);
}
.ribbon {
  position: relative;
  width: calc(var(--u) * 82);
  margin-top: calc(var(--u) * -5);
  aspect-ratio: 1024 / 208;
  flex: none;
}
.ribbon.lose {
  aspect-ratio: 1024 / 154;
}
.ribbon > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* the face of the art (it sits at 10%..84% of the height for both ribbons) */
.ribbon > b {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 10%;
  bottom: 16%;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: calc(var(--u) * 6.4);
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.03em;
  padding-bottom: var(--cap);
}
.ribbon.lose > b {
  left: 11%;
  right: 11%;
  top: 12%;
  bottom: 14%;
  font-size: calc(var(--u) * 4.7);
}
.res-stars {
  display: flex;
  gap: calc(var(--u) * 1.5);
  margin-top: calc(var(--u) * 1);
} /* (the middle star is 2.5u higher: it was touching the ribbon) */
.rstar {
  position: relative;
  width: calc(var(--u) * 15);
  aspect-ratio: 231 / 220;
}
.rstar:nth-child(2) {
  margin-top: calc(var(--u) * -2.5);
}
.rstar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.rstar .on {
  opacity: 0;
  transform: scale(0.3);
  transition:
    opacity 0.12s,
    transform 0.3s var(--pop);
}
.rstar.got .on {
  opacity: 1;
  transform: none;
}
.res-hero {
  position: relative;
  height: calc(var(--u) * 40);
  width: calc(var(--u) * 40);
  flex: none;
}
.res-hero .char {
  position: absolute;
  left: 50%;
  bottom: calc(var(--pad, 0) * -100%);
  height: 100%;
  width: auto;
  translate: -50% 0;
}
.res-hero .shade {
  left: 50%;
}
.res-hero .rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 130%;
  margin: -65% 0 0 -65%;
  max-width: none;
  opacity: 0.38;
  animation: rays 26s linear infinite;
} /* the rays art, turning slowly behind the winner */
@keyframes rays {
  to {
    transform: rotate(360deg);
  }
}
body.calm .res-hero .rays {
  animation: none;
}
body.land .res-hero .rays {
  width: 100%;
  height: 100%;
  margin: -50% 0 0 -50%;
} /* landscape: the fox column is narrow, the rays stay inside the panel */
.res-line {
  font-size: calc(var(--u) * 4.6);
  --o: 0.12em;
  text-align: center;
  line-height: 1.2;
}
.res-prizes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2);
  width: 100%;
}
.res-cards {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 2.5);
  --cw: calc(var(--u) * 23);
}
.res-cards:has(.pz:only-child) {
  --cw: calc(var(--u) * 37);
}
.pz {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 1);
  width: calc(var(--cw) * 1.12);
}
.pz .card.big .c-name {
  display: none;
} /* the name of a new card is written under it, whole, never cut */
.pz-name {
  width: 100%;
  text-align: center;
  font-size: calc(var(--u) * 3.6);
  line-height: 1.1;
  --o: 0.12em;
  white-space: normal;
  text-wrap: balance;
}
.res-prizes > .tag {
  --h: calc(var(--u) * 11);
}

.rstar.got .on {
  animation: twinkle 2.2s ease-in-out infinite;
}
.rstar:nth-child(2).got .on {
  animation-delay: 0.35s;
}
.rstar:nth-child(3).got .on {
  animation-delay: 0.7s;
}
@keyframes twinkle {
  0%,
  100% {
    scale: 1;
    filter: none;
  }
  50% {
    scale: 1.08;
    filter: brightness(1.18);
  }
}
body.calm .rstar.got .on {
  animation: none;
}
.panel.res.lose .res-hero {
  height: calc(var(--u) * 50);
  width: calc(var(--u) * 50);
}
/* the last victory: the five bosses beaten and every star of the campaign */
.res-champ {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 1.5);
}
.res-bosses {
  display: flex;
  gap: calc(var(--u) * 1.2);
}
.res-bosses img {
  width: calc(var(--u) * 11);
  height: calc(var(--u) * 11);
  border-radius: 50%;
  background: radial-gradient(#1f6e62, #0b3a34);
  box-shadow: 0 0 0 calc(var(--u) * 0.5) rgba(255, 222, 140, 0.85);
  object-fit: cover;
}
.res-total {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.2);
  font-size: calc(var(--u) * 6);
}
.res-total img {
  width: calc(var(--u) * 8);
}
.res-btns {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 2.5);
  width: 100%;
  margin-top: calc(var(--u) * 1);
}
.res-btns .btn.secondary {
  flex: 1.1;
  max-width: calc(var(--u) * 34);
}
.res-btns .btn.primary {
  flex: 1.35;
  max-width: calc(var(--u) * 44);
}
body.land .panel.res {
  width: calc(var(--u) * 120);
}
body.land .res-hero {
  height: calc(var(--u) * 26);
  width: calc(var(--u) * 26);
}
body.land .res-cards {
  --cw: calc(var(--u) * 16);
}

/* ---- lying window: result in two columns, deck builder in two columns ---- */
body.land .panel.res {
  width: calc(var(--u) * 128);
}
body.land .panel.res.lose {
  width: calc(var(--u) * 112);
}
body.land #res-in {
  display: grid;
  grid-template-columns: calc(var(--u) * 44) minmax(0, 1fr);
  grid-template-areas: 'rib rib' 'hero stars' 'hero line' 'hero prizes' 'hero btns';
  justify-items: center;
  align-items: center;
  gap: calc(var(--u) * 1.5) calc(var(--u) * 3);
}
body.land #res-in > .ribbon {
  grid-area: rib;
  width: calc(var(--u) * 66);
  margin-top: calc(var(--u) * -4);
}
body.land #res-in > .res-stars {
  grid-area: stars;
}
body.land #res-in > .res-hero {
  grid-area: hero;
  height: calc(var(--u) * 40);
  width: calc(var(--u) * 40);
} /* the fox carries the left half: big, centred in its column */
body.land #res-in > .res-line {
  grid-area: line;
}
body.land #res-in > .res-prizes {
  grid-area: prizes;
}
body.land #res-in > .res-btns {
  grid-area: btns;
  margin-top: 0;
}
body.land #res-in > .res-hero:first-of-type {
}
body.land .rstar {
  width: calc(var(--u) * 11);
}
body.land .res-cards {
  --cw: calc(var(--u) * 17);
}
body.land .res-cards:has(.pz:only-child) {
  --cw: calc(var(--u) * 22);
}
body.land .panel.res.lose #res-in > .res-hero {
  height: calc(var(--u) * 42);
  width: calc(var(--u) * 42);
}
body.land .panel.res.lose #res-in {
  grid-template-areas: 'rib rib' 'hero line' 'hero btns';
  align-content: center;
  row-gap: calc(var(--u) * 4);
}

body.land #s-deck {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: 'top tabs' 'slots grid' 'tray grid' 'btns grid';
  align-items: stretch;
  gap: calc(var(--u) * 1.6) calc(var(--u) * 3);
  padding-right: calc(var(--sar) + var(--u) * 3);
}
body.land #s-deck > * {
  max-width: none;
}
body.land #s-deck > .scene {
  grid-area: auto;
}
body.land .dk-top {
  grid-area: top;
  padding-right: 0;
}
body.land #dk-slots {
  grid-area: slots;
}
body.land #dk-tray {
  grid-area: tray;
  min-height: 0;
}
/* lying, the list scrolls up and down: it starts under the "In deck" label (never over it) and fades at both edges like the grid */
body.land #dk-row {
  flex-wrap: wrap;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  align-content: flex-start;
  position: absolute;
  inset: calc(var(--u) * 6.6) 0 0;
  padding-top: calc(var(--u) * 2);
  --cw: calc(var(--u) * 12.5);
  -webkit-mask-image: linear-gradient(
    transparent,
    #000 calc(var(--u) * 2),
    #000 calc(100% - var(--u) * 5),
    transparent
  );
  mask-image: linear-gradient(transparent, #000 calc(var(--u) * 2), #000 calc(100% - var(--u) * 5), transparent);
}
body.land #dk-tabs {
  grid-area: tabs;
  justify-content: flex-start;
  padding-right: var(--tabs-pr);
  min-height: calc(var(--u) * 12.5);
}
body.land #dk-grid {
  grid-area: grid;
}
body.land .dk-btns {
  grid-area: btns;
}

/* ---- lying and wide windows: everything centred on the stage (never logo on one side and buttons on the other) ---- */
body.land .logo,
body.land #s-menu .logo {
  left: 50%;
  top: calc(var(--sat) + var(--u) * 3);
  width: calc(var(--u) * 58);
  transform: translateX(-50%);
}
body.land .touch {
  bottom: calc(var(--sab) + var(--u) * 10);
}
body.land .menu-btns {
  left: 50%;
  right: auto;
  bottom: calc(var(--sab) + var(--u) * 4.5);
  transform: translateX(-50%);
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: auto;
  gap: calc(var(--u) * 3);
}
body.land .menu-btns .btn {
  width: calc(var(--u) * 46);
  flex: none;
}
body.land .menu-btns .btn.big {
  width: calc(var(--u) * 60);
}
body.land #m-decks {
  order: 1;
}
body.land #m-play {
  order: 2;
}
body.land #m-help {
  order: 3;
}
body.land .map-btns {
  left: 0;
  right: 0;
  bottom: calc(var(--sab) + var(--u) * 4);
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0 calc(var(--u) * 4);
  gap: calc(var(--u) * 3);
}
body.land #s-deck {
  padding-left: calc(var(--sal) + var(--stage-x) + var(--u) * 3);
  padding-right: calc(var(--sar) + var(--stage-x) + var(--u) * 3);
}
/* the family tabs reach the sound and gear buttons and stop 2u before them (the corner sits at --hud-x, the column ends at
   --stage-x): 7 tabs keep 44 px each on a 844x390 phone */
body.land #dk-tabs {
  --tabs-pr: max(0px, calc(var(--u) * 26.1 - var(--stage-x) + var(--hud-x)));
  padding-right: var(--tabs-pr);
}
/* End of css/screens.css (complete file). */
