/* Glossy Toy: the inside of each screen. Where the pieces go comes from the screen designs (src/ui/pecas.js); this file only says how
   each one is built inside, in proportion to its own --w and --h. */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.2s,
    visibility 0s 0.2s;
}
.screen.on {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s;
}
.screen img.logo {
  object-fit: contain;
}
.screen > .duke {
  z-index: 1;
}
.screen > :not(.duke) {
  z-index: 2;
}
.screen h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--h) * 0.9);
  line-height: 1;
  white-space: nowrap;
}
.ver {
  position: absolute;
  right: 2.5%;
  bottom: 1.6%;
  font-size: calc(var(--u) * 2.6);
  opacity: 0.75;
}

/* ---- small cards ---- */
canvas.mc {
  display: block;
  aspect-ratio: 1 / 1.36;
  filter: drop-shadow(0 0.05em 0.08em rgba(0, 22, 74, 0.35));
}
.fan4 canvas.mc {
  position: absolute;
  top: 5%;
  width: 30%;
}
.fan4 canvas.mc:nth-child(1) {
  left: 0;
  top: 11%;
  rotate: -12deg;
}
.fan4 canvas.mc:nth-child(2) {
  left: 23.5%;
  top: 1%;
  rotate: -4deg;
}
.fan4 canvas.mc:nth-child(3) {
  left: 46.5%;
  top: 1%;
  rotate: 4deg;
}
.fan4 canvas.mc:nth-child(4) {
  left: 70%;
  top: 11%;
  rotate: 12deg;
}
.fan3 {
  position: relative;
}
.fan3 canvas.mc {
  position: absolute;
  top: 7%;
  height: 86%;
  aspect-ratio: 1 / 1.36;
}
#m-daily-fan canvas.mc:nth-child(1) {
  left: 0;
  rotate: -10deg;
}
#m-daily-fan canvas.mc:nth-child(2) {
  left: 30%;
  top: 2%;
  rotate: -1deg;
}
#m-daily-fan canvas.mc:nth-child(3) {
  right: 0;
  rotate: 10deg;
}
.tile {
  position: relative;
  display: block;
  font-size: calc(var(--h) * 0.22);
  line-height: 1;
  --o: #052264;
}
.tile > span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--c) * -0.3);
  display: flex;
  justify-content: center;
  white-space: nowrap;
}
.tf {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--c) * -0.6);
  height: calc(var(--h) * 0.55);
}
.tf canvas.mc {
  height: 100%;
  top: 0;
}
#fan-k canvas.mc:nth-child(1) {
  left: 5%;
  rotate: -9deg;
  top: 4%;
}
#fan-k canvas.mc:nth-child(2) {
  left: 26%;
  rotate: 0deg;
}
#fan-k canvas.mc:nth-child(3) {
  left: 44%;
  rotate: 8deg;
}
#fan-f canvas.mc:nth-child(1) {
  left: 0;
  rotate: -12deg;
  top: 5%;
}
#fan-f canvas.mc:nth-child(2) {
  left: 18%;
  rotate: -4deg;
}
#fan-f canvas.mc:nth-child(3) {
  left: 36%;
  rotate: 4deg;
}
#fan-f canvas.mc:nth-child(4) {
  left: 53%;
  rotate: 13deg;
  top: 5%;
}
#fan-s canvas.mc:nth-child(1) {
  left: 0;
  rotate: -12deg;
  top: 5%;
}
#fan-s canvas.mc:nth-child(2) {
  left: 18%;
  rotate: -4deg;
}
#fan-s canvas.mc:nth-child(3) {
  left: 36%;
  rotate: 4deg;
}
#fan-s canvas.mc:nth-child(4) {
  left: 53%;
  rotate: 13deg;
  top: 5%;
}
#d-fan {
  flex: 1;
  align-self: stretch;
  min-height: 0;
  margin-top: 0.25em;
}
#d-fan canvas.mc {
  height: 100%;
  top: 0;
}
#d-fan canvas.mc:nth-child(1) {
  left: 6%;
  rotate: -8deg;
}
#d-fan canvas.mc:nth-child(2) {
  left: 30%;
  rotate: -3deg;
}
#d-fan canvas.mc:nth-child(3) {
  left: 44%;
  rotate: 2deg;
}
#d-fan canvas.mc:nth-child(4) {
  left: 58%;
  rotate: 9deg;
}

/* ---- menu ---- */
.dtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--h) * 0.98);
  line-height: 1;
  white-space: nowrap;
}
#m-date-chip,
#m-streak-chip {
  font-size: calc(var(--h) * 0.62);
}
#m-streak-chip {
  border-image-source: url(../assets/ui/chip-violet.webp);
  --o: #3b1e45;
}
#m-streak-chip img {
  position: absolute;
  left: calc(var(--h) * -0.62);
  top: 50%;
  width: auto;
  height: 136%;
  transform: translateY(-50%);
  margin: 0;
}
#m-streak-chip {
  font-size: calc(var(--h) * 0.52);
}
#m-streak-chip i {
  flex: 1;
  min-width: 0;
  text-align: center;
  margin: 0 calc(var(--h) * -0.3) 0 calc(var(--h) * 0.68);
}
.cont {
  font-size: calc(var(--h) * 0.56);
  padding-bottom: calc(var(--h) * 0.3);
}
.cont:not(:has(small:not([hidden]))) {
  padding-bottom: calc(var(--h) * 0.07);
}
.cont small {
  font-weight: 600;
}
.navb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--h) * 0.25);
  line-height: 1;
  white-space: nowrap;
}
.navb > * {
  margin: calc(var(--c) * -0.5) calc(var(--c) * -0.62);
}
.navb img {
  height: calc(var(--h) * 0.56);
  width: auto;
  flex: none;
}
.navb span {
  margin-top: calc(var(--c) * 0.55);
}
.land .navb {
  flex-direction: row;
  gap: calc(var(--h) * 0.16);
  font-size: calc(var(--h) * 0.42);
  padding-bottom: calc(var(--h) * 0.05);
}
.land .navb > * {
  margin: 0;
}
.land .navb > :first-child {
  margin-left: calc(var(--h) * -0.2);
}
.land .navb > :last-child {
  margin-right: calc(var(--h) * -0.2);
}
.land .navb img {
  height: calc(var(--h) * 0.74);
}

/* ---- new game ---- */
.rows {
  font-size: calc(var(--h) * 0.09);
}
.rows .sw i {
  display: none !important;
}
.rows .seg {
  font-size: 0.84em;
}
.rows .row > span b {
  display: block;
  font-size: 0.94em;
  line-height: 1;
}
.rows .row small {
  font-size: 0.66em;
  line-height: 1;
  margin-top: 0.12em;
}
.rows .sw {
  height: 68%;
}
.dealn {
  height: 76%;
  display: flex;
  align-items: center;
  gap: 0.3em;
  flex: none;
}
.dealn .chip {
  --h: calc(var(--u) * 7);
  height: 92%;
  font-size: 0.92em;
  min-width: 5.2em;
}
.dealn .sq {
  height: 100%;
  aspect-ratio: 1.3;
}

/* ---- daily ---- */
.cal {
  font-size: calc(var(--h) * 0.062);
}
.cal h3 {
  align-self: center;
  --h: 2.1em;
  height: 2.1em;
  font-size: 1.32em;
  padding-inline: 1.6em;
  margin-bottom: 0.22em !important;
}
.calw,
.cald {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.32em;
  text-align: center;
}
.calw {
  margin-bottom: 0.32em;
  font-size: 0.86em;
  line-height: 1.5;
}
.calw i {
  background: url(../assets/ui/day.webp) center / 100% 100% no-repeat;
  padding-bottom: 0.1em;
}
.cald {
  flex: 1;
  min-height: 0;
  grid-auto-rows: minmax(0, 1fr);
}
.cald span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.08em;
  padding-bottom: 0.12em;
  font-size: 1.32em;
  background: url(../assets/ui/day.webp) center / 100% 100% no-repeat;
}
.cald span.won {
  background-image: url(../assets/ui/day-won.webp);
}
.cald span.won img {
  height: 0.82em;
  width: 0.82em;
  flex: none;
}
.cald span.future {
  background-image: url(../assets/ui/day-future.webp);
  color: #98a8c9;
}
.cald span.none {
  background-image: url(../assets/ui/day-empty.webp);
}
.cald span.now {
  background-image: url(../assets/ui/day-now.webp);
}
.today b {
  max-width: 80%;
}
.today {
  align-items: center;
  text-align: center;
  font-size: calc(var(--h) * 0.125);
  line-height: 1.08;
}

/* ---- collection ---- */
.coll {
  pointer-events: none;
}
#c-grid {
  display: contents;
}
.citem {
  display: block;
  transition: transform 0.1s;
  z-index: 3;
}
.citem > .art {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: 50% 0;
}
.citem.table > img.art {
  object-fit: cover;
  border-radius: 12%;
  box-shadow: 0 0 0 calc(var(--w) * 0.035) #e7ddf6;
}
.citem.sel::after {
  content: '';
  position: absolute;
  inset: -3%;
  border: calc(var(--w) * 0.04) solid #ffd21f;
  border-radius: 16%;
  box-shadow: 0 0 calc(var(--w) * 0.05) #ffd21f;
}
.citem .lock {
  position: absolute;
  left: 50%;
  bottom: 13%;
  width: 34%;
  transform: translateX(-50%);
}
.citem .chip {
  position: absolute;
  left: -2%;
  right: -2%;
  top: 102%;
  --h: calc(var(--w) * 0.2);
  height: var(--h);
  font-size: calc(var(--h) * 0.56);
  border-image-source: url(../assets/ui/pill-violet.webp);
  --o: #472353;
}
.citem .check {
  position: absolute;
  right: -4%;
  bottom: -3%;
  width: 34%;
  height: auto;
  z-index: 1;
}

.cprev {
  position: relative;
}
.cprev > * {
  position: absolute;
  top: 0;
  height: 100%;
  width: 54%;
  object-fit: contain;
  aspect-ratio: auto;
}
.cprev > :first-child {
  left: 0;
  z-index: 1;
}
.cprev > :last-child {
  right: 0;
}

/* ---- stats ---- */
.sgrid {
  display: contents;
}
.stile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.stile > * {
  margin: calc(var(--c) * -0.4) calc(var(--c) * -0.5);
}
.stile i {
  font-size: calc(var(--h) * 0.27);
  margin-bottom: calc(var(--h) * 0.04);
}
.stile b {
  font-size: calc(var(--h) * 0.5);
}
.chart {
  font-size: calc(var(--h) * 0.12);
}
.chart h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-size: 1.12em;
  line-height: 1;
  height: 1.5em;
  flex: none;
}
.chart h3 img {
  height: 100%;
  width: auto;
}
.bars {
  flex: 1;
  min-height: 0;
  margin-top: 0.3em !important;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 1.1em;
  padding: 0.4em 1em 0;
  border-radius: 0.6em;
  background: rgba(5, 30, 90, 0.5)
    repeating-linear-gradient(rgba(255, 255, 255, 0.1) 0 0.08em, transparent 0.08em 1.5em);
}
.bars span {
  flex: 1;
  min-height: 0.2em;
  border-radius: 0.3em 0.3em 0 0;
  background: linear-gradient(#ffe14d, #ffb800);
  box-shadow: inset 0 0.14em 0 rgba(255, 255, 255, 0.55);
}
.bars span:nth-child(even) {
  background: linear-gradient(#3de893, #19a760);
}
.best {
  justify-content: space-between;
  font-size: calc(var(--h) * 0.52);
  padding-inline: 0.2em;
}
.best b {
  padding: 0.16em 0.9em 0.22em;
  border-radius: 99px;
  background: url(../assets/ui/tab-violet.webp) center / 100% 100% no-repeat;
  margin-right: calc(var(--h) * -0.3);
}

/* ---- language ---- */
#l-grid {
  display: contents;
}
.ltitle {
  font-size: calc(var(--h) * 0.95) !important;
}
#l-grid .pill {
  border-image-source: url(../assets/ui/pill-royal.webp);
  --o: #052264;
  font-size: calc(var(--h) * 0.5);
}
#l-grid .pill.on {
  border-image-source: url(../assets/ui/pill-yellow.webp);
  --o: #cf8400;
}
#l-grid .pill.on span::after {
  content: '';
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.3em;
  vertical-align: -0.12em;
  background: #ffffff;
  -webkit-mask: var(--tick) center / contain no-repeat;
  mask: var(--tick) center / contain no-repeat;
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 13l6 6L21 6' fill='none' stroke='%23000' stroke-width='4.500' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- game ---- */
#scr-game > .duke {
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}
#board {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  touch-action: none;
}
#btn-pause,
#scr-game .chip,
#scr-game .pill {
  z-index: 3;
}
#scr-game .chip {
  font-size: calc(var(--h) * 0.6);
}
#scr-game .pill {
  font-size: calc(var(--h) * 0.48);
}
.land #scr-game .pill {
  font-size: calc(var(--h) * 0.59);
}
#bubble {
  z-index: 4;
}
.won #btn-undo,
.won #btn-hint,
.won #btn-new,
.won #game-duke,
.won #chip-score,
.won #chip-moves,
.won #chip-time,
.won #btn-pause {
  visibility: hidden;
}
#win-glow {
  display: none;
  z-index: 1 !important;
  border-radius: 50%;
}
.won #win-glow {
  display: block;
  box-shadow:
    0 0 calc(var(--w) * 0.08) calc(var(--w) * 0.035) rgba(255, 222, 110, 0.9),
    0 0 calc(var(--w) * 0.2) calc(var(--w) * 0.05) rgba(255, 222, 110, 0.35);
  background: radial-gradient(ellipse 30% 7% at 50% 84%, rgba(255, 222, 100, 0.95), transparent 72%);
}
.won #win-glow::before {
  content: '';
  position: absolute;
  left: 30%;
  right: 30%;
  top: -5%;
  height: 74%;
  background: linear-gradient(rgba(255, 240, 170, 0.9), rgba(255, 240, 170, 0));
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
}
.won #win-glow::after {
  content: '';
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--w) * 0.06) calc(var(--w) * 0.018) rgba(255, 226, 120, 0.9);
}
#win-glow img {
  position: absolute;
  width: 5.4%;
  height: auto;
  translate: -50% -50%;
}

/* ---- cards ---- */
.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  transform-origin: 0 0;
  pointer-events: none;
}
.slot.tab {
  background: url(../assets/ui/slot.webp) center / 100% 100% no-repeat;
  opacity: 0.42;
}
.slot.stock,
.slot.fnd,
.slot.cell,
.slot.done {
  background: url(../assets/ui/slot.webp) center / 100% 100% no-repeat;
}
.slot.fnd::after {
  content: '';
  position: absolute;
  inset: 22%;
  background: rgba(160, 234, 246, 0.85);
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
}
/* a dark pool inside the empty slots, so the suit stays readable on a bright table; the base table needs none (--pool unset) */
.slot.fnd::before,
.slot.cell::before,
.slot.done::before,
.slot.stock:not(.full)::before {
  content: '';
  position: absolute;
  inset: 6% 7%;
  border-radius: 12% / 9%;
  background: var(--pool, transparent);
}
.slot.s0 {
  --m: url(../assets/cards/s0.webp);
}
.slot.s1 {
  --m: url(../assets/cards/s1.webp);
}
.slot.s2 {
  --m: url(../assets/cards/s2.webp);
}
.slot.s3 {
  --m: url(../assets/cards/s3.webp);
}
.slot.stock.full {
  background: none;
}
.slot.stock.full::before {
  content: '';
  position: absolute;
  inset: 5% 3% -8%;
  border-radius: 15% / 11%;
  box-shadow: 0 calc(var(--cw) * 0.05) calc(var(--cw) * 0.16) rgba(0, 27, 90, 0.34);
}
.slot.stock {
  pointer-events: auto;
}
.slot.stock.recycle::after {
  content: '';
  position: absolute;
  inset: 26%;
  border: calc(var(--cw) * 0.07) solid rgba(197, 244, 251, 0.85);
  border-right-color: transparent;
  border-radius: 50%;
}
.card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  perspective: 600px;
  touch-action: none;
  pointer-events: auto;
  will-change: transform;
  transform-origin: 0 0;
  transition: transform 0.27s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.instant .card,
.reduced .card,
.instant .card .inner,
.reduced .card .inner {
  transition-duration: 0s !important;
}
.card .inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  transition: transform 0.24s ease-out;
}
.card.up .inner {
  transform: rotateY(180deg);
}
.card .face,
.card .back {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: drop-shadow(0 calc(var(--cw) * 0.018) calc(var(--cw) * 0.028) rgba(0, 22, 74, 0.38));
}
.card .face {
  transform: rotateY(180deg);
}
.card .back {
  background: var(--back) center / 100% 100% no-repeat;
}
.card[data-zone^='t'] .back {
  background-image: var(--back-col);
}
.card.lifted {
  transition: none;
  filter: drop-shadow(0 calc(var(--cw) * 0.12) calc(var(--cw) * 0.1) rgba(0, 22, 74, 0.45));
}
.card.flat .face,
.card.flat .back {
  filter: none;
}
.card.hint .face,
.card.hint .back {
  filter: drop-shadow(0 0 calc(var(--cw) * 0.03) rgba(255, 232, 130, 0.95))
    drop-shadow(0 0 calc(var(--cw) * 0.11) rgba(255, 205, 50, 0.65));
}
.card.drop .face {
  filter: drop-shadow(0 0 calc(var(--cw) * 0.025) #56fba9) drop-shadow(0 0 calc(var(--cw) * 0.05) #56fba9);
}
.slot.drop {
  filter: drop-shadow(0 0 calc(var(--cw) * 0.07) #56fba9);
}
.slot.hint {
  filter: drop-shadow(0 0 calc(var(--cw) * 0.07) #ffd21f);
}
.slot.tab.drop {
  outline: calc(var(--cw) * 0.04) solid #56fba9;
  border-radius: calc(var(--cw) * 0.12);
}
.slot.tab.hint {
  outline: calc(var(--cw) * 0.04) solid #ffd21f;
  border-radius: calc(var(--cw) * 0.12);
}
.hintpath {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 900;
  pointer-events: none;
  overflow: visible;
}
.hintpath path {
  fill: none;
  stroke-linecap: round;
}
.h-line {
  stroke: rgba(255, 240, 170, 0.5);
}
.h-glow {
  stroke: #ffd84a;
  opacity: 0.85;
  filter: blur(calc(var(--cw) * 0.022));
  stroke-dashoffset: 300;
}
.h-core {
  stroke: #fffbe6;
  filter: drop-shadow(0 0 calc(var(--cw) * 0.025) #ffe680);
  stroke-dashoffset: 300;
}
.h-ring {
  fill: none;
  stroke: #ffe680;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 calc(var(--cw) * 0.05) #ffd84a);
}
.h-spark {
  fill: #fff3b0;
  opacity: 0;
  filter: drop-shadow(0 0 calc(var(--cw) * 0.02) #ffd84a);
}
.encore .card {
  pointer-events: none;
}
.encore .slot {
  opacity: 0;
}

/* ---- panels over the game ---- */
.panel[id^='p-'],
.how,
.win {
  z-index: 80;
  animation: pop 0.28s ease-out backwards;
}
.panel h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: calc(var(--h) * 0.92);
  line-height: 1;
  white-space: nowrap;
}
.panel p {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: calc(var(--h) * 0.72);
  line-height: 1.05;
}
.pause .duke {
  z-index: -1;
}
.stuck .duke {
  z-index: 1;
}
.land .pause .duke {
  z-index: 1;
}
.sound {
  --o: #052264;
  justify-content: space-evenly;
}
.srow {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 0.36em;
  font-size: calc(var(--h) * 0.135);
}
.srow > i {
  height: 62%;
  aspect-ratio: 1;
  flex: none;
}
.srow > i svg {
  width: 100%;
  height: 100%;
  fill: #ffffff;
  filter: drop-shadow(0 0.06em 0 #082b7e);
}
.srow > span {
  flex: none;
  min-width: 3.1em;
}
.srow .sq {
  height: 74%;
  aspect-ratio: 1.42;
}
.gear .ptitle {
  font-size: calc(var(--h) * 0.62);
}
#gear-rows {
  display: flex;
  flex-direction: column;
  font-size: max(calc(var(--h) * 0.062), 14px);
  z-index: 2;
  overflow: hidden auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #75c3cf transparent;
}
#gear-rows.more {
  -webkit-mask-image: linear-gradient(#000000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(#000000 calc(100% - 26px), transparent);
} /* there is more below */
#gear-rows .row {
  flex: 1 0 44px;
  background: rgba(5, 38, 115, 0.5);
  border-radius: 0.7em;
  padding: 0 0.55em;
  margin: 0.09em 0;
}
#gear-rows h3 {
  align-self: center;
  flex: none;
  --h: 1.7em;
  height: 1.7em;
  font-size: 1.06em;
  padding-inline: 1.5em;
  margin: 0.1em 0 !important;
}
#gear-rows .sw {
  font-size: 0.82em;
  height: 88%;
}
.seg.mini button {
  padding-inline: 1.7em;
}
#gear-rows .seg {
  font-size: 0.9em;
}
#s-lang {
  --h: 1.56em;
  height: 1.56em;
  font-size: 0.88em;
  min-width: 5.4em;
  flex: none;
}
#s-lang.pill {
  font-size: 1em;
}
#s-lang span {
  font-size: 0.84em;
}
.gear .duke {
  z-index: 3;
  pointer-events: none;
}
.land .gear .duke {
  z-index: -1;
}
.how {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.how > *,
.how .panel > * {
  pointer-events: auto;
}
.how > .duke {
  pointer-events: none;
  z-index: 1;
}
.howp {
  z-index: 2;
}
#how-rows {
  display: contents;
}
.how .bubble {
  z-index: 3;
  font-size: calc(var(--h) * 0.23);
  font-style: normal;
}
.how .close {
  z-index: 3;
}
.how #how-next {
  z-index: 3;
}
.hrow {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0 0.7em;
  font-size: calc(var(--h) * 0.21);
  line-height: 1.08;
  border-radius: 1.1em;
  background: rgba(10, 61, 180, 0.55);
  box-shadow: inset 0 0 0 0.1em rgba(98, 131, 209, 0.45);
  z-index: 2;
}
.hrow .ill {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46%;
  height: 84%;
}
.hrow .mc {
  height: 100%;
  margin-right: -9%;
  flex: none;
}
.hrow .mc:last-child {
  margin-right: 0;
}
.hrow .ill img {
  height: 76%;
  width: auto;
}
.hrow .ill .arrow {
  height: 42%;
  width: auto;
  margin: 0 4%;
  fill: #ffc61a;
  flex: none;
}
.hrow .ill .arrow.big {
  height: 72%;
  fill: #ffffff;
}
.hrow .ill .slotmini {
  position: relative;
  height: 100%;
  aspect-ratio: 1 / 1.3;
  background: url(../assets/ui/slot.webp) center / 100% 100% no-repeat;
  flex: none;
}
.slotmini.blank::after {
  display: none;
}
.slotmini::after {
  content: '';
  position: absolute;
  inset: 24%;
  background: #99e8f4;
  -webkit-mask: url(../assets/cards/s3.webp) center / contain no-repeat;
  mask: url(../assets/cards/s3.webp) center / contain no-repeat;
}
.hrow .ill:has(> .mc:nth-child(4)) .mc:not(:last-child) {
  margin-right: -23%;
}
.hrow > span {
  flex: 1;
  min-width: 0;
}
.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28%;
  z-index: 3;
}
.dots i {
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}
.dots i.on {
  background: #ffffff;
  box-shadow: 0 0 0 calc(var(--h) * 0.22) #2eb0c5;
}

/* ---- victory ---- */
.ribbon.big {
  font-size: calc(var(--h) * 0.5);
}
.ribbon.big img {
  height: 80%;
  margin-right: calc(var(--h) * -0.34);
}
.ribbon.big img.flip {
  margin: 0 0 0 calc(var(--h) * -0.34);
}
.win {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  animation: fade 0.5s both;
}
.win > * {
  pointer-events: auto;
}
.win > .duke {
  animation: none;
  pointer-events: none;
}
.res {
  align-items: center;
  justify-content: space-between;
  --o: #052264;
}
.res > :first-child {
  margin-top: calc(var(--b) * -0.5);
}
.res .chips2 {
  --c2: calc(var(--h) * 0.21);
  display: flex;
  justify-content: center;
  gap: 2%;
  width: 100%;
  flex: none;
  height: var(--c2);
}
.res .chip {
  --h: var(--c2);
  height: 100%;
  font-size: calc(var(--c2) * 0.6);
  flex: 1;
  min-width: 0;
}
.wscore {
  font-size: calc(var(--h) * 0.29);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stars {
  display: flex;
  justify-content: center;
  gap: 4%;
  flex: none;
  height: calc(var(--h) * 0.3);
  width: 100%;
}
.stars img {
  height: 100%;
  width: auto;
  transition:
    transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1),
    filter 0.3s;
}
.stars img.off {
  filter: grayscale(1) brightness(0.5);
  transform: scale(0.8);
}
/* ---- the bird: on some screens the design draws it bigger, with the feet behind the buttons or past the edge ---- */
#scr-coll > .duke {
  z-index: 3;
}
#scr-menu > .duke {
  scale: 1.26;
  translate: 0 5%;
}
.land #scr-menu > .duke {
  scale: 1;
  translate: none;
}
#game-duke {
  scale: calc(1.24 * var(--bs, 1));
  translate: var(--bx, 0px) calc(6% + var(--by, 0px));
  transition:
    scale 0.3s ease-out,
    translate 0.3s ease-out;
}
.land #game-duke {
  scale: calc(1.06 * var(--bs, 1));
  translate: var(--bx, 0px) calc(2% + var(--by, 0px));
}
#bubble {
  translate: var(--tx, 0px) var(--ty, 0px);
  transition: translate 0.3s ease-out;
}
.reduced #game-duke,
.reduced #bubble {
  transition: none;
}
.land #scr-start > .duke {
  scale: 1.28;
  translate: 3% 20%;
}
#scr-lang > .duke {
  scale: 1.36;
  translate: 0 18%;
}
.land #scr-lang > .duke {
  scale: 1;
  translate: none;
}
#app:has(#p-pause:not([hidden]), #p-stuck:not([hidden]), #p-gear:not([hidden]), #p-how:not([hidden])) .screen > .duke {
  visibility: hidden;
} /* one bird at a time */

/* ---- how to play stands alone on the table; the sound panel does not dim the screen ---- */
#app:has(#p-how:not([hidden])) .screen.on {
  visibility: hidden;
}
#app:has(#p-how:not([hidden]), #p-sound:not([hidden])) .veil {
  background: transparent;
  animation: none;
}
.sound::before {
  content: '';
  position: absolute;
  top: calc(var(--b) * -1.7);
  left: 66%;
  width: calc(var(--b) * 1.6);
  height: calc(var(--b) * 0.95);
  background: #1950d1;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.land .sound::before {
  left: 61%;
}
.srow .sq {
  background: linear-gradient(#224db1, #092e83);
  border-radius: 24%;
  box-shadow:
    inset 0 0.08em 0 rgba(255, 255, 255, 0.4),
    0 0.06em 0 #052162;
}
.srow .sq.off {
  filter: saturate(0.3) brightness(0.7);
}
.land .srow {
  font-size: calc(var(--h) * 0.19);
}
.val {
  display: none;
  flex: none;
  font-size: 0.86em;
}
.land .val {
  display: block;
}

/* ---- what a move leaves behind (src/juice.js) ---- */
.fx-spark,
.fx-ring,
.fx-points,
.fx-combo {
  position: absolute;
  z-index: 950;
  pointer-events: none;
  will-change: transform, opacity;
}
.fx-spark {
  border-radius: 50%;
  box-shadow: 0 0 calc(var(--cw) * 0.05) rgba(255, 226, 122, 0.85);
}
.fx-ring {
  border-style: solid;
  box-shadow:
    0 0 calc(var(--cw) * 0.12) rgba(255, 226, 122, 0.8),
    inset 0 0 calc(var(--cw) * 0.08) rgba(255, 226, 122, 0.55);
  transform-origin: center;
}
.fx-points {
  font-size: calc(var(--cw) * 0.46);
  color: #ffffff;
  --o: #cf8400;
  white-space: nowrap;
  line-height: 1;
}
.fx-combo {
  color: #ffe14d;
  --o: #865396;
  line-height: 1;
  white-space: nowrap;
}
.card.gleam::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: calc(var(--cw) * 0.13);
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.55) 50%, transparent 62%) 130% 0 / 260%
    100% no-repeat;
  animation: gleam 0.46s ease-out both;
}
@keyframes gleam {
  to {
    background-position: -40% 0;
  }
}
.reduced .fx-spark,
.reduced .fx-ring,
.reduced .fx-points,
.reduced .fx-combo {
  display: none;
}

.fx-confetti {
  position: absolute;
  z-index: 55;
  pointer-events: none;
  will-change: transform;
}
.reduced .fx-confetti {
  display: none;
}
.win:not(.show) > :not(.duke) {
  visibility: hidden;
}
.win > .duke {
  animation: winPop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.75s backwards !important;
}
.win.show .ribbon {
  animation: winStamp 0.52s cubic-bezier(0.2, 1.3, 0.4, 1) 0.04s backwards;
}
.win.show .res {
  animation: winUp 0.44s cubic-bezier(0.2, 1.15, 0.4, 1) 0.2s backwards;
}
.win.show #w-new {
  animation: winPop 0.38s cubic-bezier(0.2, 1.5, 0.4, 1) 1.45s backwards;
}
.win.show #w-menu {
  animation: winPop 0.38s cubic-bezier(0.2, 1.5, 0.4, 1) 1.55s backwards;
}
.won #win-glow::before {
  animation: spotIn 0.9s ease-out 0.15s backwards;
  transform-origin: 50% 0;
}
@keyframes winStamp {
  from {
    opacity: 0;
    transform: scale(1.65) rotate(-4deg);
  }
  68% {
    opacity: 1;
    transform: scale(0.96) rotate(0.8deg);
  }
}
@keyframes winUp {
  from {
    opacity: 0;
    transform: translateY(14%) scale(0.96);
  }
}
@keyframes winPop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}
@keyframes spotIn {
  from {
    opacity: 0;
    transform: scaleY(0.15);
  }
}
.reduced .win *,
.reduced #win-glow::before {
  animation: none !important;
}

/* ---- screens and controls come alive ---- */
.screen.on:not(#scr-game) > :not(.duke) {
  animation: pieceIn 0.38s cubic-bezier(0.2, 1.3, 0.4, 1) calc(var(--i, 0) * 36ms) backwards;
}
#scr-start.on > .logo,
#scr-menu.on > .logo {
  animation: logoIn 0.62s cubic-bezier(0.2, 1.45, 0.4, 1) 0.04s backwards;
}
#scr-start.on > #btn-start {
  animation:
    pieceIn 0.38s cubic-bezier(0.2, 1.3, 0.4, 1) 0.3s backwards,
    startBreath 2.3s ease-in-out 0.8s infinite;
}
@keyframes pieceIn {
  from {
    opacity: 0;
    transform: translateY(5%) scale(0.93);
  }
}
@keyframes logoIn {
  from {
    opacity: 0;
    transform: translateY(-9%) scale(0.72) rotate(-2deg);
  }
}
@keyframes startBreath {
  50% {
    scale: 1.035;
  }
}
.reduced .screen > * {
  animation: none !important;
}

/* ---- confirmation before leaving a game ---- */
.panel.confirm {
  --b: calc(var(--u) * 5.2);
  --h: calc(var(--u) * 11);
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(calc(var(--u) * 76), 92%);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.6);
  text-align: center;
}
.panel.confirm h2 {
  font-size: calc(var(--u) * 6.2);
  line-height: 1.05;
  white-space: normal;
}
.panel.confirm p {
  font-size: calc(var(--u) * 3.9);
  line-height: 1.15;
}
.cfbtns {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1.8);
}
.cfbtns .pill {
  flex: none;
  height: var(--h);
  font-size: calc(var(--u) * 5.2);
}

/* ---- small differences of single screens ---- */
#gear-rows .seg button::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -22%;
  bottom: -22%;
}
.srow .sq::before {
  height: 128%;
}
/* the title sits on a bump of the panel, in the panel's own colours */
.stuck h2 {
  z-index: 2;
}
.stuck h2::before {
  content: '';
  position: absolute;
  inset: -38% -5% 12%;
  z-index: -1;
  border-radius: 0.9em 0.9em 0 0;
  background: #012d94;
  box-shadow: 0 -0.09em 0 #75c3cf;
}
.land .stuck p {
  font-size: calc(var(--h) * 0.34);
}
.land .stuck .pill {
  font-size: calc(var(--h) * 0.44);
}
.land #st-undo {
  font-size: calc(var(--h) * 0.58);
}
#c-use:disabled {
  filter: none;
}
#s-lang span::after {
  content: '';
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.32em;
  border: solid #ffffff;
  border-width: 0.14em 0.14em 0 0;
  transform: rotate(45deg) translate(-0.06em, 0.06em);
}
.land #scr-stats h1.ribbon img {
  display: none;
}
.land #scr-stats h1.ribbon span {
  border: 0;
  border-image: none;
  justify-content: flex-start;
}
.land .tabs.three {
  border: 0;
  border-image: none;
  gap: 2%;
}
.land .tabs.three button,
.land .tabs.three button + button {
  margin: 0;
  border: solid transparent;
  border-width: 0 calc(var(--h) * 0.5);
  border-image: url(../assets/ui/pill-royal.webp) 0 80 fill / 0 calc(var(--h) * 0.5) stretch;
  background: none;
}
.land .tabs.three button.on {
  border-image-source: url(../assets/ui/tab-violet.webp);
  border-image-slice: 0 88 fill;
  background: none;
}
.slot {
  --pool: rgba(0, 22, 62, 0.5);
}
/* End of css/screens.css (complete file). */
