/* The sheets and the taps (screens plan 4). A sheet rises from the bottom of the mat, over the
   cloth and never over the hand, so the cards a choice is about stay in sight; its top corners
   are the sheet radius because it comes up from an edge (spec §4.4). Carton buttons on the
   lisière; a choice waiting for its second tap turns to ink, the one state that says "tap again
   here". Gilt stays the turn's alone (spec §4.1). */

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: var(--lisiere);
  box-shadow: 0 -1px 0 var(--filet);
}

.sheet__title { font: 700 20px/1.2 var(--font-index); text-align: center; }
.sheet__hint { font-size: 13px; line-height: 1.3; text-align: center; opacity: .85; }
.sheet__count { font: 700 15px/1.2 var(--font-index); font-variant-numeric: tabular-nums; text-align: center; }

.sheet .btn { min-height: 52px; font-size: 17px; }
.sheet .btn[disabled] { opacity: .35; cursor: default; }
.band__action[disabled] { opacity: .5; cursor: default; }

/* waiting for the second tap: ink ground, carton ring */
.sheet .btn.is-pending,
.sheet__tier.is-on {
  background: var(--encre);
  color: var(--carton);
  box-shadow: 0 0 0 2px var(--carton);
}

/* the bid bar: two rows, so the seats' bids above it stay in sight; Passe last and widest,
   nearest the thumb */
.sheet__bids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet__bid { padding: 0 6px; font-family: var(--font-index); font-weight: 700; line-height: 1.1; }
.sheet__bid[data-bid="pass"] { grid-column: span 2; }

/* cards to choose: the call's are large, the poignée's pool compact; chosen ones stand up */
.sheet__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sheet__card { --card-w: 72px; cursor: pointer; transition: transform calc(120ms * var(--motion)) ease-out; }
.sheet__card.is-selected { transform: translateY(-6px); outline: 3px solid var(--craie); outline-offset: 1px; }
.sheet__cards--pool { gap: 6px 4px; padding-top: 6px; }
.sheet__cards--pool .sheet__card { --card-w: 44px; }
.sheet__cards--pool .sheet__card:not(.is-selected) { filter: brightness(calc(var(--card-dim) * .55)) saturate(.5); }

.sheet__confirm { width: 100%; font-weight: 700; }

.sheet__choices { display: flex; align-items: center; gap: 8px; }
.sheet__choices .btn { flex: 1 1 0; }
.sheet__choices .btn.sheet__no, .sheet__choices .btn.sheet__decline { flex-grow: 2; font-weight: 700; }
.sheet .btn.sheet__no { min-height: 60px; font: 700 22px/1 var(--font-index); }
.sheet .btn.sheet__yes { font-family: var(--font-index); font-weight: 700; }

.sheet__tiers { display: flex; gap: 6px; }
.sheet .btn.sheet__tier { flex: 1 1 0; min-height: 44px; font-size: 15px; }

/* the poignée: declining is the wide carton button at the bottom, showing the quiet outlined one
   above it; the sheet scrolls rather than clip when the pool is long */
.sheet--poignee { max-height: 100%; overflow-y: auto; }
.sheet--poignee .sheet__choices { flex-direction: column-reverse; align-items: stretch; }
.sheet .btn.sheet__show { background: transparent; color: var(--craie); box-shadow: inset 0 0 0 2px var(--carton); }

/* ---- the écart: a tray of the offer's slots on the mat, the validate button in the band ---- */

.tray {
  position: absolute;
  left: 50%;
  bottom: 44px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
}

.tray__head { display: flex; gap: 10px; align-items: baseline; font: 700 16px/1.2 var(--font-index); }
.tray__count { font-variant-numeric: tabular-nums; }
.tray__trumps { font-size: 13px; }
.tray__slots { display: flex; gap: 6px; }
.tray__slot { --card-w: 44px; position: relative; display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.tray__slot .card { --card-w: 44px; cursor: pointer; }
.tray__slot.is-empty {
  width: 44px;
  aspect-ratio: 320 / 576;
  border: 2px dashed var(--filet);
  border-radius: 5.5% / 3.06%;
}
.tray__shown { font-size: 11px; line-height: 1.3; }

.hand .card.is-shown { outline-style: dashed; }

.band__line { display: flex; align-items: center; justify-content: center; gap: 12px; }
.band__line { max-width: 100%; }
.band__line:has(.band__action) .band__text { min-width: 0; font-size: 22px; line-height: 1.1; }
/* a long word in the band never widens the screen: the grid's one column is the viewport's */
.play { grid-template-columns: minmax(0, 1fr); }
.band__action {
  position: relative;
  z-index: 1;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 0 16px;
  background: var(--encre);
  color: var(--carton);
  font: 700 16px/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---- landscape: the mat is a strip; bid and chelem lie in it, the call and the poignée take
   the screen above the hand like the review ---- */

.play[data-orientation="landscape"] .sheet {
  top: 32px;
  left: 20%;
  right: 20%;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sheet);
}
.play[data-orientation="landscape"] .sheet .btn { min-height: 44px; font-size: 15px; }
.play[data-orientation="landscape"] .sheet--bid .sheet__hint { display: none; }
.play[data-orientation="landscape"] .sheet__bids { display: flex; flex: 1; }
.play[data-orientation="landscape"] .sheet__bid { flex: 1 1 0; padding: 0 6px; }
.play[data-orientation="landscape"] .sheet--jeu .sheet__title { font-size: 17px; white-space: nowrap; }
.play[data-orientation="landscape"] .sheet--jeu .sheet__choices { flex: 1; }
.play[data-orientation="landscape"] .sheet--poignee .sheet__choices { flex-direction: row-reverse; }
.play[data-orientation="landscape"] .sheet .btn.sheet__no { min-height: 44px; font-size: 18px; }

.play[data-orientation="landscape"] .sheet--call,
.play[data-orientation="landscape"] .sheet--poignee {
  position: fixed;
  top: 8px;
  bottom: auto;
  left: 8%;
  right: 8%;
  max-height: calc(100% - 16px);
  z-index: 20;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  box-shadow: 0 0 0 1px var(--filet);
  overflow-y: auto;
}
.play[data-orientation="landscape"] .sheet--call .sheet__card { --card-w: 64px; }
.play[data-orientation="landscape"] .sheet--poignee .sheet__cards--pool { flex-wrap: wrap; }
.play[data-orientation="landscape"] .sheet__choices,
.play[data-orientation="landscape"] .sheet__tiers,
.play[data-orientation="landscape"] .sheet__confirm { align-self: stretch; }

/* on its side the mat is too short for a row of cards: the tray is its count alone, and a card
   goes back by a second tap on it in the fan, where it stands raised */
.play[data-orientation="landscape"] .tray { bottom: 6px; }
.play[data-orientation="landscape"] .tray__slots { display: none; }
.play[data-orientation="landscape"] .tray__shown { display: none; }

/* the trick is where a tap plays the lifted card: its cards are disabled buttons, and a disabled
   button swallows a tap without passing it on, so they let it through to the area */
.trick .card[disabled] { pointer-events: none; }
