/* The decks: the door (#s-dkhome) and the table of 20 places
   (#s-deck). Loaded last: it replaces the old tray rules of screens.css / screens-extra.css for these two screens. */

/* ---- a table of 20 places: 5 x 4 standing, 10 x 2 lying; the card size follows the room (vh keeps short phones whole) ---- */
#dk-tray {
  --cw: min(calc(var(--u) * 14.6), 6vh);
  --cw: min(calc(var(--u) * 14.6), 6svh);
} /* svh: the iPhone toolbar showing */
.deck20 {
  margin-bottom: calc(var(--u) * 4);
  width: auto;
  align-self: center;
}
#s-deck #dk-row,
#s-dkhome #dh-row {
  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) * 1.6) calc(var(--u) * 1.6) calc(var(--u) * 5);
  display: grid;
  grid-template-columns: repeat(5, var(--cw));
  justify-content: center;
  gap: calc(var(--u) * 1.2);
}
body.land #dk-tray {
  --cw: calc(var(--u) * 8.2);
  width: max-content;
}
body.land #s-deck #dk-row {
  --cw: calc(var(--u) * 8.2);
  padding: calc(var(--u) * 1.2) calc(var(--u) * 1.2) calc(var(--u) * 4.4);
  gap: calc(var(--u) * 0.8);
}
body.land #s-deck #dk-row,
body.land #s-dkhome #dh-row {
  grid-template-columns: repeat(10, var(--cw));
  gap: calc(var(--u) * 1);
}
.dk-slot {
  position: relative;
  width: var(--cw);
  aspect-ratio: 1 / 1.4;
  display: grid;
  place-items: center;
}
.dk-slot:not(.full)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(../assets/fx/slot2.webp) center / 100% 100% no-repeat;
  opacity: 0.85;
}
.dk-slot > b {
  position: relative;
  font-size: calc(var(--cw) * 0.34);
  color: rgba(255, 255, 255, 0.55);
  --o: 0.1em;
  padding-bottom: var(--cap);
}
.dk-slot .card.mini {
  position: relative;
  left: auto;
  top: auto;
  margin: 0;
  transform: none;
}
.dk-slot.full {
  cursor: pointer;
}
/* the count "12/20" on a small plate across the bottom edge of the table */
.tray > .dk-plate {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bb) * -1);
  translate: -50% 55%;
  --h: calc(var(--u) * 8.5);
  width: calc(var(--u) * 24);
  z-index: 8;
}
.dk-plate b {
  font-size: calc(var(--u) * 4.2);
  padding-bottom: var(--cap);
  position: relative;
  top: calc(var(--u) * 0.12);
} /* to the centre of the plate face */
.deck20.full .dk-plate b,
#dk-tray.full .dk-plate b {
  color: var(--gold);
}

/* ---- the builder ---- */
#dk-tray {
  --k: calc(var(--u) * 0.12);
}
#s-deck > #dk-tray,
#s-dkhome > #dh-tray {
  width: max-content;
  max-width: 100%;
  flex: none;
}
#dk-tray.deck20 {
  min-height: 0;
}
body #s-deck #dk-row {
  overflow: visible;
  touch-action: auto;
  min-height: 0;
  -webkit-mask-image: none;
  mask-image: none;
  position: static;
  inset: auto;
}
body:not(.land) #dk-curve {
  display: none;
} /* standing, the room goes to the table; the advice says the same in words */
#dk-info {
  min-height: 0;
  justify-content: center;
}
#dk-advice {
  flex: 0 1 auto;
  text-align: center;
}
/* one sign of copies per card: "in the deck / owned", small, under the card; the "new" seal on the top right corner */
.cell .cnt {
  left: 50%;
  right: auto;
  top: auto;
  bottom: calc(var(--cw) * -0.12);
  translate: -50% 0;
  font-size: calc(var(--cw) * 0.17);
  height: calc(var(--cw) * 0.21);
  line-height: calc(var(--cw) * 0.21);
}
.cell .ck {
  display: none !important;
}
.cell .seal-new {
  left: auto;
  right: calc(var(--cw) * -0.09);
  top: calc(var(--cw) * -0.11);
  translate: none;
}
/* the magnifier: the top right corner of every card of the collection (the "new" seal moves to the middle); the small cards
   of the table only have room for it under a mouse */
.zoom.rb {
  position: absolute;
  z-index: 8;
  width: max(24px, calc(var(--cw) * 0.36));
  height: max(24px, calc(var(--cw) * 0.36));
  right: calc(var(--cw) * -0.1);
  top: calc(var(--cw) * -0.1);
  touch-action: pan-y;
}
#dk-grid .cell .seal-new {
  left: 54%;
  right: auto;
  translate: -50% 0;
}
.cell:has(.zoom:active) {
  transform: none;
}
.dk-slot .zoom.rb {
  display: none;
  width: calc(var(--cw) * 0.46);
  height: calc(var(--cw) * 0.46);
}
.dk-slot .zoom.rb::before {
  inset: 0;
}
@media (hover: hover) and (pointer: fine) {
  .dk-slot.full:hover .zoom.rb {
    display: block;
  }
}
.cell.soon {
  aspect-ratio: 1 / 1.4;
  display: grid;
  place-items: center;
  align-content: center;
  gap: calc(var(--cw) * 0.06);
  padding: calc(var(--cw) * 0.1);
}
.cell.soon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(../assets/fx/slot2.webp) center / 100% 100% no-repeat;
  opacity: 0.9;
}
.cell.soon .lk {
  position: relative;
  left: auto;
  top: auto;
  width: 34%;
}
.cell.soon p {
  position: relative;
  font-size: calc(var(--cw) * 0.12);
  text-align: center;
  line-height: 1.15;
  text-wrap: balance;
}

/* lying (phone, tablet, computer): the title and the family tabs on top; the table and its side (curve, advice, buttons)
   centred in the middle; the collection below, the width of the stage */
body.land #s-deck {
  grid-template-columns: 1fr auto auto 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: 'top top tabs tabs' '. tray side .' 'grid grid grid grid';
  row-gap: calc(var(--u) * 1.6);
  column-gap: calc(var(--u) * 1.6);
} /* (3u between the columns made the table and its side wider than a 16:9 window) */
/* the first row is shared by hand: with all the families (7 tabs) half of it was too short, and sound covered the last tab */
body.land #s-deck > .dk-top,
body.land #s-deck > #dk-tabs {
  grid-area: 1 / 1 / 2 / -1;
}
body.land #s-deck > .dk-top {
  justify-self: start;
  width: calc(var(--u) * 66);
}
body.land #s-deck > #dk-tabs {
  justify-self: end;
  width: calc(100% - var(--u) * 69);
}
body.land #dk-tray {
  grid-area: tray;
  align-self: start;
}
body.land #s-deck .dk-side {
  grid-area: side;
}
body.land #dk-info {
  grid-area: auto;
  min-height: 0;
  padding: 0;
}
body.land #s-deck .dk-btns {
  grid-area: auto;
}
.dk-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(var(--u) * 1.6);
}
body:not(.land) .dk-side {
  display: contents;
}
body:not(.land) #s-deck .dk-btns {
  order: 9;
}
body:not(.land) #s-deck .dk-btns,
body:not(.land) #s-deck #dk-info {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--u) * 112);
}
body.land .dk-side .dk-btns {
  gap: calc(var(--u) * 2);
}
body.land .dk-side .dk-btns .btn {
  --h: calc(var(--u) * 11);
  flex: none;
  width: calc(var(--u) * 24.5);
}
body.land .dk-side .dk-btns #dk-auto {
  width: calc(var(--u) * 28);
} /* it carries an icon: more room than Save (52.5u the two, so the side still fits a 16:9 window) */
body.land .dk-side #dk-advice {
  max-width: calc(var(--u) * 40);
  font-size: calc(var(--u) * 3.3);
}
body.land #dk-grid {
  padding: calc(var(--u) * 1.8) calc(var(--u) * 2.5) calc(var(--u) * 3);
  row-gap: calc(var(--u) * 2.8);
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 16.5), 1fr));
}
body.land #dk-grid .cell {
  --cw: calc(var(--u) * 14.5);
}

/* a short phone (an iPhone inside the browser bars, 390x676): smaller places and four cards a row, or the collection showed
   only three cards at a time */
@media (orientation: portrait) and (min-aspect-ratio: 10 / 19) {
  body:not(.land) #s-deck {
    gap: calc(var(--u) * 1.3);
  }
  body:not(.land) #dk-tray {
    --cw: 5svh;
    margin-bottom: calc(var(--u) * 3.4);
  }
  body:not(.land) #s-deck #dk-row {
    padding: calc(var(--u) * 0.8) calc(var(--u) * 1.6) calc(var(--u) * 4);
    gap: calc(var(--u) * 0.9) calc(var(--u) * 2);
  }
  body:not(.land) #dk-grid {
    grid-template-columns: repeat(4, 1fr);
    row-gap: calc(var(--u) * 3);
    padding-top: calc(var(--u) * 2.4);
  }
  body:not(.land) #dk-grid .cell {
    --cw: calc(var(--u) * 20);
  }
}

/* ---- the door ---- */
#s-dkhome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 2.2);
  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);
}
#s-dkhome > * {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--u) * 112);
  flex: none;
}
#s-dkhome > .scene {
  position: absolute;
  z-index: 0;
  max-width: none;
  filter: brightness(0.55) saturate(0.9);
}
#dh-title {
  --h: calc(var(--u) * 10.5);
  flex: 1;
  min-width: 0;
}
#dh-title b {
  font-size: calc(var(--u) * 4.2);
  text-transform: uppercase;
  white-space: nowrap;
}
#dh-title .fam {
  height: calc(var(--h) * 0.6);
  margin-right: calc(var(--u) * 1.2);
  flex: none;
}
#dh-tray {
  --k: calc(var(--u) * 0.12);
  width: auto;
  max-width: 100%;
}
#dh-tray {
  --cw: min(calc(var(--u) * 15.5), 7vh);
  --cw: min(calc(var(--u) * 15.5), 7svh);
}
body.land #dh-tray {
  --cw: calc(var(--u) * 9.4);
  width: max-content;
}
#dh-say {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 1.5);
}
/* the fox sits in the same medallion as in the duel: a bust floating on its own looked cut. The ring art is
   wider than the face (--rw, --rh: ui-art.css), so the margins keep it clear of the panel and of the rows around it */
#dh-say .medal {
  position: relative;
  flex: none;
  width: var(--md);
  height: var(--md);
  margin: calc(var(--md) * 0.16) calc(var(--md) * 0.08) calc(var(--md) * 0.06);
  --md: calc(var(--u) * 14);
  filter: drop-shadow(0 calc(var(--u) * 0.4) calc(var(--u) * 0.5) rgba(0, 0, 0, 0.4));
}
#dh-say .face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #14564c;
}
#dh-say .ringart {
  position: absolute;
  width: calc(var(--rw) * 100%);
  height: calc(var(--rh) * 100%);
  left: calc(50% - var(--rx));
  top: calc(50% - var(--ry));
  max-width: none;
}
#dh-say .panel {
  --k: calc(var(--u) * 0.034);
  width: auto;
  max-width: calc(var(--u) * 80);
}
#dh-say p {
  margin: calc(var(--ft) - var(--bt)) calc(var(--fr) - var(--br)) calc(var(--fb) - var(--bb))
    calc(var(--fl) - var(--bl));
  padding: var(--safe-y) var(--safe-x);
  font-size: calc(var(--u) * 4);
  text-align: center;
  --o: 0.13em;
  line-height: 1.18;
}
.dh-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2.2);
  margin-top: calc(var(--u) * 3);
}
.dh-btns #dh-play {
  --h: calc(var(--u) * 17);
  width: 100%;
  max-width: calc(var(--u) * 70);
}
.dh-btns #dh-play > span {
  font-size: calc(var(--h) * 0.36);
}
.dh-two {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 2.5);
  width: 100%;
  max-width: calc(var(--u) * 80);
}
.dh-two .btn {
  flex: 1;
  --h: calc(var(--u) * 12.5);
}
#dh-play.dim {
  filter: grayscale(0.7) brightness(0.8);
}
body.land #s-dkhome {
  justify-content: center;
  gap: calc(var(--u) * 1.4);
}
body.land #s-dkhome .dk-top {
  padding-right: calc(var(--u) * 27);
}
body.land .dh-btns {
  flex-direction: row;
  margin-top: 0;
}
body.land .dh-btns #dh-play {
  --h: calc(var(--u) * 13);
  width: calc(var(--u) * 50);
  order: 2;
}
body.land .dh-btns #dh-play > span {
  translate: 0 calc(var(--u) * -0.28);
} /* lying, the big label sits 0.28u higher */
body.land .dh-two {
  display: contents;
}
body.land .dh-two .btn {
  flex: none;
  width: calc(var(--u) * 36);
  --h: calc(var(--u) * 11.5);
}
body.land #dh-edit {
  order: 1;
}
body.land #dh-surprise {
  order: 3;
}
body.land #dh-say .medal {
  --md: calc(var(--u) * 11);
}
body.land #dh-say p {
  font-size: calc(var(--u) * 3.6);
}

/* a computer window with height to spare (body.roomy, main.js): everything centred, the whole window height: the title and
   tabs; the table of 20 in the middle, with the small curve on its left and the advice on its right; the collection taking
   the rest (two rows at 1920x1080); and the buttons (Album, Build, Save) centred at the bottom */
body.land.roomy #s-deck {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--u) * 2.5);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--u) * 2.5);
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: 'top top tabs tabs' 'curve tray tray advice' 'grid grid grid grid' 'btns btns btns btns';
}
body.land.roomy #dk-tray {
  justify-self: center;
}
body.land.roomy #s-deck #dk-row {
  --cw: calc(var(--u) * 7.6);
}
body.land.roomy #dk-grid {
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 14), 1fr));
}
body.land.roomy #dk-grid .cell {
  --cw: calc(var(--u) * 12.4);
}
body.land.roomy .dk-side,
body.land.roomy #dk-info {
  display: contents;
}
body.land.roomy #dk-curve,
body.land.roomy #dk-advice,
body.land.roomy #s-deck .dk-btns {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
} /* over the scene, like the direct children */
body.land.roomy #dk-curve {
  grid-area: curve;
}
body.land.roomy #dk-advice {
  grid-area: advice;
  max-width: calc(var(--u) * 32);
  font-size: calc(var(--u) * 3.4);
}
body.land.roomy #s-deck .dk-btns {
  grid-area: btns;
}
body.land.roomy .cv {
  width: calc(var(--u) * 5);
}
body.land.roomy .cv .cs {
  width: calc(var(--u) * 4.4);
}
body.land.roomy .cv .stack img {
  width: calc(var(--u) * 2.8);
  margin-top: calc(var(--u) * -2);
}
body.land.roomy .cv .stack img:first-child {
  margin-top: 0;
}

/* a panel open: the corner buttons (sound, gear) step aside; the X of a tall panel sits on that corner */
body.modal #corner {
  visibility: hidden;
}
/* End of css/decks.css (complete file). */
