/* Truco Showdown - title, menu, quick match and circuit. The landscape menu is the portrait
   composition centred on the landscape scene; everything is placed in % of the stage. */
#s-title > *,
#s-menu > * {
  position: absolute;
  left: calc(var(--pw) * var(--x));
  top: calc(var(--ph) * var(--y));
  width: calc(var(--pw) * var(--w));
}
.logo {
  display: block;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 calc(var(--ph) * 0.6) calc(var(--ph) * 0.8) rgba(5, 10, 40, 0.4));
}
#s-title {
  --off: calc((var(--vh) - var(--sh)) / 2);
} /* extra room above and below the stage on tall phones */
#s-title .logo {
  --x: 17;
  --y: 7.6;
  --w: 65.5;
  top: calc(var(--ph) * var(--y) - var(--off) * 0.85);
}
#s-title .tap {
  --x: 16;
  --y: 89;
  --w: 67.5;
  --h: calc(var(--ph) * 9.4);
  top: calc(var(--ph) * var(--y) + var(--off) * 0.85);
  font-size: calc(var(--ph) * 4.2);
}
#s-menu .logo {
  --x: 25;
  --y: 2.4;
  --w: 50;
}
.menu-box {
  --x: 14.6;
  --y: 64.2;
  --w: 70.1;
  height: calc(var(--ph) * 34.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--ph) * 1.2) calc(var(--pw) * 1.5);
}
.menu-box .pill {
  width: 100%;
  --h: calc(var(--ph) * 9);
  font-size: calc(var(--ph) * 5);
}
@media (orientation: landscape) {
  #s-title .logo {
    --x: 32;
    --y: 4.8;
    --w: 36;
  }
  #s-title .tap {
    --x: 33.8;
    --y: 86.6;
    --w: 32.3;
    --h: max(46px, calc(var(--ph) * 10.1));
    font-size: calc(var(--ph) * 6.2);
  }
  #s-menu .logo {
    --x: 35;
    --y: 1.5;
    --w: 30;
  } /* in the sky, above the heads */
  /* landscape menu: the three buttons in one row on the table, where TAP TO START sits on the title */
  .menu-box {
    --x: 15;
    --y: 85.6;
    --w: 70;
    height: calc(var(--ph) * 11);
    flex-direction: row;
    gap: calc(var(--pw) * 1.2);
    padding: 0;
    border: 0;
    border-image: none;
    filter: none;
  }
  .menu-box .pill {
    flex: 1 1 0;
    min-width: 0;
    --h: max(45px, calc(var(--ph) * 11));
    font-size: calc(var(--ph) * 5);
  }
}

/* quick match: a navy panel centred on the real table */
#app[data-screen='quick'] #s-quick,
#s-quick[data-leaving] {
  top: calc(var(--sh) - var(--vh));
  display: grid; /* the stage stands on the window's bottom: centred in the whole window */
  place-items: center;
  padding: calc(var(--u) * 60) calc(var(--u) * 24) calc(var(--u) * 34);
}
#scene .dark .bg {
  filter: brightness(0.45) saturate(0.9);
} /* the real table, darkened */
.quick {
  position: relative;
  width: min(calc(var(--u) * 660), 100%, var(--vw) - 46px);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 10);
  padding: calc(var(--u) * 40) calc(var(--u) * 14) calc(var(--u) * 16);
}
.quick > .band {
  --bh: calc(var(--u) * 74);
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: calc(var(--u) * -48);
  width: 78%;
}
.quick > .x {
  position: absolute;
  --s: max(44px, calc(var(--u) * 64));
  top: calc(var(--s) * -0.5 - var(--u) * 16);
  right: calc(var(--s) * -0.5 - var(--u) * 16);
}
.q-row {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 8);
  padding: calc(var(--u) * 8) calc(var(--u) * 10) calc(var(--u) * 12);
  border-bottom: 2px solid rgba(110, 140, 230, 0.22);
  font-size: calc(var(--u) * 34);
  text-transform: uppercase;
}
.q-row > span {
  white-space: nowrap;
}
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: calc(var(--u) * 10);
}
/* option pills: navy, the chosen one yellow (pictures opt / opt-on) */
.seg button {
  --h: max(44px, calc(var(--u) * 78));
  height: var(--h);
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 calc(var(--h) * 0.12);
  border: solid transparent;
  border-width: 0 calc(var(--h) * 0.36);
  border-image: url(../assets/img/ui/opt.webp) 0 28 fill;
  font-size: calc(var(--h) * 0.42);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.seg button > span {
  display: block;
  margin: 0 calc(var(--h) * -0.2);
  white-space: nowrap;
}
.seg button.on {
  border-image-source: url(../assets/img/ui/opt-on.webp);
  color: var(--navy);
}
.q-rules {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: max(46px, calc(var(--u) * 70));
  margin: calc(var(--u) * 4) 0;
  padding: 0 calc(var(--u) * 14) calc(var(--u) * 6);
  border: calc(var(--u) * 12) solid transparent;
  border-image: url(../assets/img/ui/opt.webp) 24 28 30 28 fill;
  font-size: calc(var(--u) * 28);
  text-transform: uppercase;
}
.q-rules img {
  height: calc(var(--u) * 34);
  width: auto;
}
#q-start {
  width: 100%;
}

/* circuit: the empty place of the table shown (scenery.js), a straight navy title, the 5 x 2 grid,
   the rival pair's card and the table arrows with five dots */
.band.navy {
  --art: url(../assets/img/ui/plate.webp);
}
#app[data-screen='circuit'] #s-circuit,
#s-circuit[data-leaving] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(var(--u) * 366) calc(var(--u) * 16) calc(var(--u) * 20);
  gap: calc(var(--u) * 44);
}
#s-circuit {
  --ct: calc(var(--safe-t) + 80px - (var(--vh) - var(--sh)) / 2);
}
#s-circuit .back {
  position: absolute;
  top: max(var(--u) * 20, var(--ct) + var(--u) * 92);
  left: calc(var(--u) * 20);
}
/* portrait: the title sits under the corner row (sound / gear take the top right of a phone) */
.c-band {
  --bh: calc(var(--u) * 84);
  position: absolute;
  top: var(--ct);
  left: 50%;
  translate: -50% 0;
  max-width: calc(100% - 24px);
  font-size: calc(var(--bh) * 0.46);
}
.c-grid {
  display: grid;
  grid-template-columns: repeat(5, calc(var(--u) * 132));
  grid-auto-rows: calc(var(--u) * 150);
  gap: calc(var(--u) * 10);
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 2);
  padding-bottom: calc(var(--u) * 12);
  background: url(../assets/img/ui/tile-teal.webp) center / 100% 100% no-repeat;
  font-size: calc(var(--u) * 66);
  font-weight: 700;
  line-height: 1;
}
.tile b {
  display: block;
}
.tile .stars {
  display: flex;
}
.tile .stars img {
  width: calc(var(--u) * 30);
  height: calc(var(--u) * 30);
}
.tile.next {
  background-image: url(../assets/img/ui/tile-yellow.webp);
  color: var(--navy);
}
.tile.locked {
  background-image: url(../assets/img/ui/tile-navy.webp);
}
.tile .lock {
  width: calc(var(--u) * 30);
  height: auto;
}
.tile .lock.opening {
  position: absolute;
  left: 50%;
  bottom: 10%;
  margin-left: calc(var(--u) * -22);
  width: calc(var(--u) * 44);
  z-index: 2;
  pointer-events: none;
}
.c-band .c-champ {
  position: absolute;
  left: calc(100% + var(--bh) * 0.06);
  top: 50%;
  height: calc(var(--bh) * 1.05);
  width: auto;
  translate: 0 -56%;
  pointer-events: none;
} /* beside the band, never over its text */
/* on a narrow phone the band leaves room for the trophy beside it (away from the window's right edge) */
@media (orientation: portrait) {
  .c-band:has(.c-champ) {
    max-width: calc(100% - 24px - var(--bh) * 2.2);
    translate: calc(-50% - var(--bh) * 0.55) 0;
  }
}
.c-rivals {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 16);
  width: calc(var(--u) * 660);
  padding: calc(var(--u) * 4);
  filter: none;
  border-radius: calc(var(--u) * 34);
  box-shadow: 0 calc(var(--u) * 8) calc(var(--u) * 14) rgba(5, 10, 40, 0.4);
} /* no `filter` here: the faces inside move (6 fps on WebKit) */
.c-rivals .av {
  position: relative;
  width: calc(var(--u) * 190);
  aspect-ratio: 1;
  flex: none;
  border-radius: calc(var(--u) * 26);
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #a774ff, #5a2fc6 80%);
  box-shadow: 0 0 0 calc(var(--u) * 4) #fff;
}
.c-rivals .av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  scale: 1.14;
  transform-origin: 50% 0;
}
.c-rivals p {
  margin: 0;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: calc(var(--u) * 40);
  line-height: 1.1;
  text-transform: uppercase;
  text-wrap: balance;
}
.c-nav {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 26);
}
.c-dots {
  display: flex;
  gap: calc(var(--u) * 10);
}
.c-dots img {
  width: calc(var(--u) * 24);
  height: calc(var(--u) * 24);
}

@media (orientation: landscape) {
  .quick {
    width: calc(var(--u) * 820);
    padding-top: calc(var(--u) * 34);
    gap: calc(var(--u) * 4);
  }
  .q-row {
    flex-direction: row;
    align-items: center;
    padding: calc(var(--u) * 4) calc(var(--u) * 10);
  }
  .q-row > span {
    width: 28%;
    flex: none;
  }
  .q-row .seg {
    flex: 1;
  }
  .seg button {
    --h: max(44px, calc(var(--u) * 58));
  }
  #q-start {
    --h: max(46px, calc(var(--u) * 84));
  }
  #app[data-screen='circuit'] #s-circuit,
  #s-circuit[data-leaving] {
    padding-top: calc(var(--u) * 126);
    gap: calc(var(--u) * 6);
  }
  #s-circuit .back {
    top: calc(var(--u) * 20);
  }
  .c-band {
    top: calc(var(--u) * 26);
    left: 50%;
    translate: -50% 0;
    max-width: calc(100% - 320px);
  }
  .c-band {
    font-size: calc(var(--bh) * 0.52);
  }
  .c-grid {
    grid-template-columns: repeat(5, calc(var(--u) * 154));
    grid-auto-rows: calc(var(--u) * 144);
    gap: calc(var(--u) * 8);
    margin-bottom: calc(var(--u) * 22);
  }
  .tile {
    font-size: calc(var(--u) * 78);
  }
  .tile .stars img {
    width: calc(var(--u) * 38);
    height: calc(var(--u) * 38);
  }
  /* the faces are taller than the card and come out of its top */
  .c-rivals {
    width: calc(var(--u) * 850);
    height: calc(var(--u) * 168);
  }
  .c-rivals .av {
    width: calc(var(--u) * 164);
    align-self: flex-end;
    margin-bottom: calc(var(--u) * -10);
  }
  .c-nav .icon-btn {
    --s: max(44px, calc(var(--u) * 68));
  }
}
/* End of css/screens.css (complete file). */
