/* Screens: start, menu, briefing, dressing room, result, lookbook. Each screen has a .slot (where the doll stands, read by JS) and the interface on top. */
.panel {
  --bw: calc(var(--u) * 4.6);
  --rh: max(calc(var(--u) * 9.4), 38px);
  --pt: calc(var(--rh) * 0.82 - var(--bw) + var(--u) * 3.6);
  position: absolute;
  left: 50%;
  translate: -50% 0;
  width: calc(var(--u) * 90);
  padding: var(--pt) calc(var(--u) * 4) calc(var(--u) * 2.4);
  border: var(--bw) solid transparent;
  border-image: url(../assets/ui/panel-glass.webp) 140 fill / var(--bw) stretch;
  border-radius: calc(var(--bw) * 0.93);
  isolation: isolate; /* thinner glass frame (was 7u): leaves more room inside */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2.2);
}
/* dark glass: the glass art stays (assembled by nine.js) and a solid deep teal layer goes over it and under the content.
   Before, the light glass left the white text, the empty stars and the gold ones with poor contrast (1.2:1 to 1.7:1). */
.panel::before {
  content: '';
  position: absolute;
  inset: calc(var(--u) * 1.3 - var(--bw));
  z-index: -1;
  border-radius: calc(var(--bw) * 0.93 - var(--u) * 1.2);
  background: rgba(5, 60, 72, 0.84);
  pointer-events: none;
}
/* title strip: height --rh (was 11.9u, too big for the panel); the width follows the art's proportion (889 x 165), never deforms */
.ribbon {
  position: absolute;
  left: 50%;
  top: calc(-1 * var(--bw) - var(--rh) * 0.18);
  translate: -50% 0;
  width: var(--rw, calc(var(--rh) * 5.388));
  height: var(--rh);
  display: grid;
  place-items: center;
  padding: 0 calc(var(--rh) * 0.14);
  border-style: solid;
  border-color: transparent;
  border-width: 0 calc(var(--rh) * 0.364);
  border-image: url(../assets/ui/ribbon.webp) 0 60 fill / 0 calc(var(--rh) * 0.364) stretch;
} /* 9 slices: the strip can be wider for a long title without deforming the ends */
.ribbon {
  --fy: 0.046;
} /* center of the strip face, measured with the UI check: 4.6% of the height above the box center */
.ribbon .lbl {
  width: 100%;
  font-size: calc(var(--rh) * 0.52);
  top: calc(var(--cap) - var(--fy) * var(--rh));
}
.btns {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 2.5);
  width: 100%;
}
.btns .pill {
  --ph: calc(var(--u) * 13);
  width: calc(var(--u) * 40);
}

/* ---- start ---- */
#s-start .slot {
  left: 0;
  right: 0;
  top: calc(var(--u) * 57);
  bottom: calc(var(--u) * 24);
}
#logo {
  position: absolute;
  left: 50%;
  top: calc(var(--sat) + var(--u) * 6);
  translate: -50% 0;
  width: calc(var(--u) * 84);
  animation: floaty 3.6s ease-in-out infinite;
}
@keyframes floaty {
  50% {
    transform: translateY(calc(var(--u) * -1));
  }
}
#start-btn {
  --ph: calc(var(--u) * 15);
  position: absolute;
  left: 50%;
  bottom: calc(var(--sab) + var(--u) * 6);
  translate: -50% 0;
  width: calc(var(--u) * 68);
  animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge {
  50% {
    scale: 1.05;
  }
}
/* landscape and ultrawide: the same composition as the portrait phone, inside the 16:9 stage (logo on top, doll in the middle, button at the bottom) */
body.land #s-start .slot {
  left: calc(var(--u) * 40);
  right: calc(var(--u) * 40);
  top: calc(var(--u) * 29);
  bottom: calc(var(--u) * 21);
}
body.land #logo {
  top: calc(var(--sat) + var(--u) * 2.5);
  width: calc(var(--u) * 42);
}
body.land #start-btn {
  --ph: calc(var(--u) * 13);
  bottom: calc(var(--sab) + var(--u) * 4);
  width: calc(var(--u) * 58);
}

/* ---- menu ---- */
#s-menu .slot {
  left: 0;
  right: 0;
  top: calc(var(--u) * 12);
  bottom: calc(var(--u) * 64);
}
#logo-s {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: calc(var(--sat) + var(--u) * 2.5);
  width: calc(var(--u) * 38);
} /* logo at the top and center, as on the start screen */
#m-list {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: calc(var(--sab) + var(--u) * 5);
  width: calc(var(--u) * 74);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.4);
}
#m-list .pill {
  --ph: calc(var(--u) * 12.5);
  width: 100%;
}
#m-list .pill > img {
  height: 76%;
  filter: drop-shadow(0 calc(var(--u) * 0.3) calc(var(--u) * 0.3) rgba(60, 0, 40, 0.3));
}
#m-list .pill .lbl {
  font-size: max(19px, calc(var(--ph) * 0.4));
}
#m-doll {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 40%;
} /* the menu doll is a button: JS puts her rectangle here */
body.land #s-menu .slot {
  left: calc(var(--u) * 30);
  right: calc(var(--u) * 30);
  top: calc(var(--u) * 4);
  bottom: calc(var(--u) * 31);
}
body.land #logo-s {
  left: 50%;
  translate: -50% 0;
  width: calc(var(--u) * 32);
  top: calc(var(--sat) + var(--u) * 2.5);
} /* landscape: logo at the top and center, as on the start screen (never in a corner with the buttons in the middle) */
body.land #m-list {
  bottom: calc(var(--sab) + var(--u) * 4);
  width: calc(var(--u) * 110);
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--u) * 2.4);
}
body.land #m-list .pill {
  --ph: calc(var(--u) * 11);
  width: calc(var(--u) * 52);
}

/* ---- briefing ---- */
#br-panel {
  bottom: calc(var(--sab) + var(--u) * 3);
}
#s-brief .slot {
  left: 0;
  right: 0;
  top: calc(var(--u) * 12);
  bottom: calc(var(--u) * 80);
}
.br-head {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 1.4);
}
.br-head b {
  font-size: max(15px, calc(var(--u) * 4));
}
.br-head h2 {
  margin: 0;
  font-size: calc(var(--u) * 7.2);
}
.tags {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 2);
  width: 100%;
}
.chip {
  position: relative;
  width: calc(var(--u) * 22);
  aspect-ratio: 286 / 330;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 1);
  background: url(../assets/ui/chip-lilac.webp) center / 100% 100% no-repeat;
}
.chip.c1 {
  background-image: url(../assets/ui/chip-pink.webp);
}
.chip.c2 {
  background-image: url(../assets/ui/chip-yellow.webp);
}
.chip > img {
  height: 42%;
  width: auto;
  max-width: 70%;
  object-fit: contain;
  filter: drop-shadow(0 calc(var(--u) * 0.5) calc(var(--u) * 0.4) rgba(80, 20, 70, 0.25));
}
.chip .tag-l {
  font-size: max(14px, calc(var(--u) * 3.6));
  max-width: 100%;
} /* the same width fitText uses (with 92% the long Russian word overflowed by 6 px) */
.br-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 2);
  width: 100%;
}
.br-go .pill {
  --ph: calc(var(--u) * 12.5);
  width: calc(var(--u) * 46);
}
.br-go .arrow {
  width: calc(var(--u) * 9);
  height: calc(var(--u) * 9);
}
body.land #br-panel {
  left: auto;
  right: calc(var(--u) * 4);
  translate: none;
  top: calc(50% + var(--u) * 7);
  bottom: auto;
  transform: translateY(-50%);
  width: calc(var(--u) * 80);
}
body.land #s-brief .slot {
  left: calc(var(--u) * 6);
  right: calc(var(--u) * 90);
  top: calc(var(--u) * 9);
  bottom: calc(var(--u) * 9);
}

/* ---- dressing room ---- */
#s-play .slot {
  left: 0;
  right: 0;
  top: calc(var(--u) * 20);
  bottom: calc(var(--u) * 58);
}
#goal {
  position: absolute;
  left: calc(var(--u) * 16.5);
  top: calc(var(--sat) + var(--u) * 2.2);
  width: calc(var(--u) * 56);
  height: calc(var(--u) * 17);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 calc(var(--u) * 0.4);
  border: calc(var(--u) * 4) solid transparent;
  border-image: url(../assets/ui/rowplate.webp) 52 fill / calc(var(--u) * 4) stretch;
  border-radius: calc(var(--u) * 6);
}
.gchip {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 0.3);
}
.gchip > img {
  height: 56%;
  width: auto;
  max-width: 80%;
  object-fit: contain;
}
.gchip .tag-l,
.chip .tag-l {
  color: var(--ink);
  text-shadow: 0 0.05em 0 rgba(255, 255, 255, 0.65);
} /* light plate: dark letters */
.gchip .tag-l {
  font-size: calc(var(--u) * 3.6);
  max-width: 100%;
}
.gchip .ok {
  position: absolute;
  right: 4%;
  top: -6%;
  width: calc(var(--u) * 5);
  height: auto;
  scale: 0;
  transition: scale 0.3s var(--pop);
}
.gchip.on .ok {
  scale: 1;
}
.gchip.on > img:not(.ok) {
  filter: drop-shadow(0 0 calc(var(--u) * 0.8) #fff);
}
#tools {
  position: absolute;
  left: calc(var(--u) * 2.4);
  top: calc(var(--sat) + var(--u) * 20);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.2);
}
#t-done {
  position: absolute;
  right: calc(var(--u) * 3);
  bottom: calc(var(--sab) + var(--u) * 57);
}
#tray {
  background-color: rgba(26, 126, 136, 0.38);
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: calc(var(--sab) + var(--u) * 17);
  width: calc(var(--u) * 95);
  height: calc(var(--u) * 37);
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 0.5);
  padding: calc(var(--u) * 0.8) calc(var(--u) * 1);
  border: calc(var(--u) * 3.4) solid transparent;
  border-image: url(../assets/ui/tray-glass.webp) 72 fill / calc(var(--u) * 3.4) stretch;
  border-radius: calc(var(--u) * 7);
}
#tray {
  isolation: isolate;
}
#tray::before {
  content: '';
  position: absolute;
  inset: calc(var(--u) * -2.2);
  z-index: -1;
  border-radius: calc(var(--u) * 5.6);
  background: rgba(5, 60, 72, 0.82);
  pointer-events: none;
} /* dark glass: a white or light piece does not disappear into light glass */
#view {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
#pages {
  position: absolute;
  inset: 0 0 var(--swh, 0px) 0;
}
.pg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--per), var(--card));
  grid-template-rows: repeat(var(--rows), var(--card));
  gap: var(--gap);
  justify-content: center;
  align-content: center;
}
.pg.out-r,
.pg.out-l {
  pointer-events: none;
}
.card .meta {
  position: absolute;
  top: -6%;
  left: -6%;
  width: 40%;
  overflow: visible;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  box-shadow: 0 calc(var(--u) * 0.3) calc(var(--u) * 0.5) rgba(60, 10, 50, 0.3);
  pointer-events: none;
}
.card .meta.m1 {
  left: 36%;
} /* the second badge does not touch the first */
.card .meta img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  overflow: visible;
} /* icon at 70% of the diameter, centered, nothing is cut */
.pg.in-r {
  animation: inr var(--slide, 0.24s) ease-out;
}
.pg.in-l {
  animation: inl var(--slide, 0.24s) ease-out;
}
.pg.out-r {
  animation: outr var(--slide, 0.24s) ease-in forwards;
}
.pg.out-l {
  animation: outl var(--slide, 0.24s) ease-in forwards;
}
@keyframes inr {
  from {
    translate: 30% 0;
    opacity: 0;
  }
}
@keyframes inl {
  from {
    translate: -30% 0;
    opacity: 0;
  }
}
@keyframes outr {
  to {
    translate: -30% 0;
    opacity: 0;
  }
}
@keyframes outl {
  to {
    translate: 30% 0;
    opacity: 0;
  }
}
.card {
  position: relative;
  width: var(--card);
  height: var(--card);
  background: url(../assets/ui/card.webp) center / 100% 100% no-repeat;
  transition:
    transform 0.16s var(--pop),
    filter 0.16s;
}
.card .th {
  position: absolute;
  inset: 7%;
  width: 86%;
  height: 86%;
  margin: auto;
  object-fit: contain;
  image-rendering: auto;
  max-width: var(--nw, none);
  max-height: var(--nw, none);
} /* never larger than the file (no stretching) and no pixelation */
.card .sel {
  position: absolute;
  inset: -9%;
  width: 118%;
  height: 118%;
  opacity: 0;
  scale: 0.85;
  transition:
    opacity 0.16s,
    scale 0.26s var(--pop);
  pointer-events: none;
}
.card.on .sel {
  opacity: 1;
  scale: 1;
}
.card .lock {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: 34%;
  height: auto;
  filter: drop-shadow(0 calc(var(--u) * 0.4) calc(var(--u) * 0.3) rgba(60, 0, 40, 0.35));
}
.card.scn .th {
  object-fit: cover;
  border-radius: 12%;
} /* scene thumbnail: the portrait art filling the card */
.card.lk .th {
  filter: grayscale(0.7) brightness(0.82);
  opacity: 0.75;
}
#swatches {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--swh, 0px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(var(--swd, 0px) * 0.2);
}
.sw {
  position: relative;
  width: var(--swd, calc(var(--u) * 6.4));
  height: var(--swd, calc(var(--u) * 6.4));
  border-radius: 50%;
  background: var(--c) url(../assets/ui/swatch.webp) center / 100% 100%;
  background-blend-mode: multiply;
  transition: transform 0.16s var(--pop);
}
.sw::after {
  content: '';
  position: absolute;
  inset: -22%;
  background: url(../assets/ui/sel-ring.webp) center / 100% 100% no-repeat;
  opacity: 0;
  scale: 0.8;
  transition:
    opacity 0.16s,
    scale 0.26s var(--pop);
}
.sw.on::after {
  opacity: 1;
  scale: 1;
}
#dots {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 0.5);
  translate: -50% 0;
  display: flex;
  gap: calc(var(--u) * 0.9);
}
#dots b {
  width: calc(var(--u) * 1.3);
  height: calc(var(--u) * 1.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
#dots b.on {
  background: #fff;
  scale: 1.3;
}
/* row of 8 dots: diameter --cd, gap of 16% of the diameter between edges (never less than 12%), width 8d + 7 x 0.16d = 9.12d.
   Buttons have a fixed size (nothing jumps on selection); the selected one grows only 5% and the ring stays outside, without touching its neighbors. */
#cats {
  --n: 8;
  --cd: min(calc(var(--u) * 12.4), calc((100vw - var(--u) * 2.4) / (var(--n) + 0.16 * (var(--n) - 1))));
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--sab) + var(--u) * 2.2);
  display: flex;
  justify-content: center;
  gap: calc(var(--cd) * 0.16);
  padding: 0 calc(var(--u) * 1.2);
}
.cat {
  position: relative;
  flex: 0 0 var(--cd);
  width: var(--cd);
  height: var(--cd);
  transition:
    transform 0.2s var(--pop),
    filter 0.16s;
}
.cat::before {
  content: '';
  position: absolute;
  inset: -8%;
} /* touch area up to half the gap (44 px pitch at 360 px) */
.cat > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cat::after {
  content: '';
  position: absolute;
  inset: -5%;
  background: url(../assets/ui/sel-ring.webp) center / 100% 100% no-repeat;
  opacity: 0;
  scale: 0.8;
  transition:
    opacity 0.16s,
    scale 0.26s var(--pop);
  pointer-events: none;
}
.cat.on {
  transform: translateY(-3%) scale(1.05);
}
.cat.on::after {
  opacity: 1;
  scale: 1;
}
.cat:active {
  transform: scale(0.92);
}
#hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--u) * 55);
  width: calc(var(--u) * 6);
  animation: hint 1s ease-in-out infinite;
  rotate: 90deg;
}
@keyframes hint {
  50% {
    translate: 0 calc(var(--u) * -2);
  }
}
body.land #s-play .slot {
  left: calc(var(--u) * 14);
  right: auto;
  width: calc(var(--u) * 80);
  top: calc(var(--u) * 6);
  bottom: calc(var(--u) * 17);
}
body.land #goal {
  left: calc(var(--u) * 92);
  width: calc(var(--u) * 56);
  height: calc(var(--u) * 15);
  top: calc(var(--sat) + var(--u) * 2);
}
body.land #tools {
  top: calc(var(--sat) + var(--u) * 16);
  gap: calc(var(--u) * 1.8);
}
body.land #tools .rb {
  width: calc(var(--u) * 11);
  height: calc(var(--u) * 11);
}
body.land #tray {
  left: auto;
  right: calc(var(--u) * 3);
  translate: none;
  bottom: calc(var(--sab) + var(--u) * 21);
  top: calc(var(--sat) + var(--u) * 19);
  width: calc(var(--u) * 78);
  height: auto;
}
body.land #t-done {
  bottom: calc(var(--sab) + var(--u) * 3);
}
body.land #cats {
  --cd: calc(var(--u) * 11.6);
  left: auto;
  right: calc(var(--u) * 21);
  bottom: calc(var(--sab) + var(--u) * 4);
  width: calc(var(--cd) * (var(--n) + 0.16 * (var(--n) - 1)) + var(--u) * 0.4);
}
body.land #hint {
  display: none;
}

/* ---- result ---- */
#rs-panel {
  bottom: calc(var(--sab) + var(--u) * 3);
  gap: calc(var(--u) * 2);
}
#s-result .slot {
  left: 0;
  right: 0;
  top: calc(var(--u) * 10);
  bottom: calc(var(--u) * 94);
}
#rs-judges {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 5);
}
.judge {
  position: relative;
  width: calc(var(--u) * 21);
  padding-bottom: calc(var(--u) * 4.5);
}
.judge > img {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
}
.judge .note {
  --ph: calc(var(--u) * 7);
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  min-width: calc(var(--ph) * 1.9);
  width: calc(var(--u) * 12);
  opacity: 0;
  scale: 0.6;
  transition:
    opacity 0.2s,
    scale 0.3s var(--pop);
}
.judge .note.in {
  opacity: 1;
  scale: 1;
}
.judge .note .lbl {
  font-size: calc(var(--ph) * 0.56);
}
#rs-gift {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 2);
  height: calc(var(--u) * 10);
  position: relative;
  transition: transform 0.16s var(--pop);
}
#rs-gift img {
  height: 100%;
  width: auto;
}
#rs-gift .lbl {
  font-size: calc(var(--u) * 4.6);
}
#rs-gift.in {
  animation: pop 0.5s var(--pop);
}
#rs-panel {
  padding-left: calc(var(--u) * 2);
  padding-right: calc(var(--u) * 2);
} /* more room for "Photo" and "Next" (the text used to shrink to 15 px) */
#rs-panel .btns .pill {
  --ph: calc(var(--u) * 11.5);
  --fy: 0.06;
  flex: 1 1 0;
  min-width: 0;
}
body.land #rs-panel .btns .pill {
  --ph: calc(var(--u) * 13);
}
body.land #rs-panel {
  left: auto;
  right: calc(var(--u) * 4);
  translate: none;
  top: calc(50% + var(--u) * 7);
  bottom: auto;
  transform: translateY(-50%);
  width: calc(var(--u) * 92);
}
body.land #s-result .slot {
  left: calc(var(--u) * 6);
  right: calc(var(--u) * 100);
  top: calc(var(--u) * 9);
  bottom: calc(var(--u) * 9);
}

/* ---- lookbook ---- */
#lk-panel {
  top: calc(var(--sat) + var(--u) * 17);
  bottom: calc(var(--sab) + var(--u) * 3);
  width: calc(var(--u) * 92);
  gap: calc(var(--u) * 1.6);
}
.tabs {
  display: flex;
  gap: calc(var(--u) * 2);
}
.tabs .pill {
  --ph: calc(var(--u) * 10);
  width: calc(var(--u) * 34);
  filter: saturate(0.6);
}
.tabs .pill.on {
  filter: saturate(1.15);
} /* outer tab: only less saturated; the letters stay white (transparent or darkened they turned gray and were hard to read) */
#lk-sub:empty {
  display: none;
}
#lk-sub {
  margin: 0;
  font-size: max(14px, calc(var(--u) * 3.6));
  text-align: center;
  min-height: calc(var(--u) * 3.6);
  --og: 0.9;
}
#lk-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  touch-action: pan-y;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--u) * 2);
  align-content: start;
  justify-content: center;
  padding: calc(var(--u) * 3);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.8) transparent;
}
.lk {
  position: relative;
  aspect-ratio: 1;
  background: url(../assets/ui/card.webp) center / 100% 100% no-repeat;
  transition: transform 0.16s var(--pop);
}
.lk canvas,
.lk .th {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  margin: auto;
  object-fit: contain;
  image-rendering: auto;
}
.lk .th {
  max-width: var(--nw, none);
  max-height: var(--nw, none);
}
.lk .sel {
  position: absolute;
  inset: -9%;
  width: 118%;
  height: 118%;
  opacity: 0;
  transition: opacity 0.16s;
}
.lk.on .sel {
  opacity: 1;
}
.lk.miss .th {
  filter: brightness(0);
  opacity: 0.22;
}
.lk .lock {
  position: absolute;
  right: 6%;
  bottom: 6%;
  width: 30%;
  height: auto;
}
#lk-act {
  padding-top: calc(var(--u) * 1);
}
#lk-act .pill {
  --ph: calc(var(--u) * 11);
  width: calc(var(--u) * 38);
}
body.land #lk-panel {
  width: calc(var(--u) * 124);
  top: calc(var(--sat) + var(--u) * 14);
  bottom: calc(var(--sab) + var(--u) * 3);
}
body.land #lk-grid {
  grid-template-columns: repeat(5, 1fr);
}
body.land #lk-grid.looks {
  grid-template-columns: repeat(5, 1fr);
  gap: calc(var(--u) * 2.4);
  padding: calc(var(--u) * 2) calc(var(--u) * 3);
}

#s-start {
  pointer-events: auto;
}

#br-stars img {
  width: calc(var(--u) * 10);
}
#br-panel {
  gap: calc(var(--u) * 1.8);
}

/* ---- challenge selection ---- */
/* the panel goes from the title to the bottom of the screen and shrinks if the list fits entirely (no leftover space below); the grid scrolls inside it */
#sel-panel {
  --t: calc(var(--sat) + var(--u) * 16);
  --b: calc(var(--sab) + var(--u) * 3);
  top: calc((var(--t) + 100% - var(--b)) / 2);
  translate: -50% -50%;
  bottom: auto;
  max-height: calc(100% - var(--t) - var(--b));
  width: calc(var(--u) * 96);
  padding-left: calc(var(--u) * 1.2);
  padding-right: calc(var(--u) * 1.2);
  padding-bottom: calc(var(--u) * 1.6);
}
#sel-grid {
  flex: 0 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.4);
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--u) * 1.4) calc(var(--u) * 1.6) calc(var(--u) * 2);
  touch-action: pan-y;
  scrollbar-width: none;
} /* 4 chapters of 10: the grid scrolls inside the panel */
#sel-grid::-webkit-scrollbar {
  display: none;
} /* no thin stray line on the right: the edge fade already says it scrolls */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: calc(var(--u) * 1.8);
}
.ch-h {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.6);
  margin: 0 0 calc(var(--u) * 1.4);
  color: #fff;
  font-size: max(15px, calc(var(--u) * 4.4));
  line-height: 1;
  text-shadow: 0 0.07em 0 rgba(4, 40, 48, 0.7);
  white-space: nowrap;
}
.ch-h .cb {
  flex: none;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  background: rgba(107, 26, 74, 0.9);
  display: grid;
  place-items: center;
  box-shadow: 0 0.08em 0.16em rgba(0, 30, 40, 0.35);
} /* chapter icon on a plum badge, like the stars plaque */
.ch-h .ci {
  width: 74%;
  height: 74%;
  object-fit: contain;
}
.ch-h span {
  color: #ffe27a;
}
.ch-h b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
} /* "Chapter 2" in yellow, the name in white */
.cell {
  position: relative;
  aspect-ratio: 1 / 1.08;
  background: url(../assets/ui/card.webp) center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding-top: 4%;
  transition:
    transform 0.16s var(--pop),
    filter 0.16s;
}
.cell:active {
  transform: scale(0.93);
}
.cell .num {
  font-size: calc(var(--u) * 6.4);
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 0.05em 0 rgba(255, 255, 255, 0.7);
  line-height: 1;
}
/* stars on a small dark plaque inside the card: the gold and the empty ones show up (before 1.1:1 and 1.3:1 over the pink) */
.cell .st {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3%;
  width: 84%;
  padding: 4% 5%;
  border-radius: 999px;
  background: rgba(107, 26, 74, 0.86);
}
.cell .st img {
  width: 30%;
  height: auto;
  aspect-ratio: 317 / 297;
}
.cell .st img.off {
  opacity: 1;
}
.cell.now {
  filter: drop-shadow(0 0 calc(var(--u) * 1.2) #ffe27a);
}
.cell.lk {
  filter: saturate(0.8) brightness(0.93);
}
.cell.lk .num {
  color: #7e4069;
  text-shadow: none;
} /* locked: lighter number, still legible (3:1 or more); the padlock says it is closed */
.cell .st .lock {
  position: static;
  width: 24%;
  height: auto;
  aspect-ratio: 281 / 320;
} /* padlock on the plaque, in place of the stars */
#sel-grid {
  --ft: 0px;
  --fb: 0px;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--ft) * 0.3),
    #000 var(--ft),
    #000 calc(100% - var(--fb)),
    transparent calc(100% - var(--fb) * 0.3),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--ft) * 0.3),
    #000 var(--ft),
    #000 calc(100% - var(--fb)),
    transparent calc(100% - var(--fb) * 0.3),
    transparent 100%
  );
} /* the edge disappears completely (before, small smudges of the plaques were left) */
#sel-grid.fade-t {
  --ft: calc(var(--u) * 10);
}
#sel-grid.fade-b {
  --fb: calc(var(--u) * 8);
}
body.land #sel-panel {
  width: calc(var(--u) * 128);
  --t: calc(var(--sat) + var(--u) * 13);
} /* centered in the space below the corner buttons */
body.land .ch-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: calc(var(--u) * 1.3);
}
body.land #sel-grid {
  gap: calc(var(--u) * 1.8);
}
body.land .ch-h {
  font-size: calc(var(--u) * 4);
}
@media (max-height: 520px) {
  body.land #sel-panel {
    width: calc(var(--u) * 160);
  }
} /* landscape phone: the unit is small, the panel uses more of the width so the star does not get tiny */
body.land .panel {
  --rh: max(calc(var(--u) * 7.2), 38px);
}
body.land .ribbon {
  --fy: 0.073;
} /* in landscape the UI check asks for slightly taller text */ /* in landscape the unit is larger: slightly smaller strip */
body.land .cell .num {
  font-size: calc(var(--u) * 4.4);
}
body.land .cell .st {
  width: 92%;
}
body.land .cell .st img {
  width: 31%;
} /* in landscape the cell is smaller: stars take up more of it */

/* ---- tutorial hand ---- */
#tut {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}
#tut img {
  position: absolute;
  height: auto;
  animation: tap 1.1s ease-in-out infinite;
  transform-origin: 30% 5%;
  filter: drop-shadow(0 calc(var(--u) * 0.5) calc(var(--u) * 0.5) rgba(40, 20, 50, 0.35));
}
@keyframes tap {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  45% {
    transform: translate(calc(var(--u) * -0.8), calc(var(--u) * -1.6)) scale(0.94);
  }
  60% {
    transform: translate(calc(var(--u) * -0.8), calc(var(--u) * -1.6)) scale(0.88);
  }
}
#tut .tl {
  position: absolute;
  translate: -50% 0;
  width: max-content;
  padding: calc(var(--u) * 1.6) calc(var(--u) * 3.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  max-width: calc(var(--u) * 62);
  box-shadow: 0 calc(var(--u) * 0.5) calc(var(--u) * 1.2) rgba(40, 20, 50, 0.3);
}
#tut .tl .lbl {
  color: var(--ink);
  text-shadow: none;
  font-size: calc(var(--u) * 3.7);
  white-space: normal;
  line-height: 1.1;
}

/* ---- result: judges and panel ---- */
.judge.meh > img {
  animation: meh 0.9s ease-in-out;
  transform-origin: 50% 90%;
}
@keyframes meh {
  30% {
    transform: rotate(-4deg) translateY(3%);
  }
  65% {
    transform: rotate(3deg) translateY(2%);
  }
}
#rs-panel {
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#rs-panel.away {
  opacity: 0;
  pointer-events: none;
}
body.land #rs-panel.away {
  transform: translateY(-50%) scale(0.96);
}

/* ---- lookbook: large thumbnails, delete confirmation, sign that it scrolls ---- */
/* look card in 9 slices: the square card stretched to 2:3 bent the corners and the frame did not match the photo */
.lk.look {
  --lb: calc(var(--u) * 6);
  aspect-ratio: 2 / 3;
  background: none;
  border: var(--lb) solid transparent;
  border-image: url(../assets/ui/card.webp) 90 fill / var(--lb) stretch;
  border-radius: var(--lb);
}
.lk.look canvas {
  inset: calc(var(--u) * 1.1 - var(--lb));
  width: calc(100% + var(--lb) * 2 - var(--u) * 2.2);
  height: calc(100% + var(--lb) * 2 - var(--u) * 2.2);
}
.lk.look .sel {
  inset: calc(-1 * var(--lb) - var(--u) * 1.2);
  width: calc(100% + var(--lb) * 2 + var(--u) * 2.4);
  height: calc(100% + var(--lb) * 2 + var(--u) * 2.4);
} /* the ring fits in the grid gap */
body.land .lk.look {
  --lb: calc(var(--u) * 4.4);
}
#lk-panel.more #lk-grid {
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent);
  mask-image: linear-gradient(180deg, #000 82%, transparent);
}
#lk-del.ask {
  filter: brightness(1.12) saturate(1.2);
  animation: pop 0.3s var(--pop);
}

#lk-grid.looks {
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--u) * 2.6);
  padding: calc(var(--u) * 2.4) calc(var(--u) * 4);
} /* portrait: 2 columns, large thumbnails */
/* End of src/screens.css (complete file). */
