/* The play screen's frame (spec §8, §9): header, mat, the turn band, the hand. Portrait stacks
   them; landscape keeps the same four rows with the seats moved into the mat's top strip
   (mat.css). Heights come from the measured box the JS is given, never from 100dvh. */

.play {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);   /* a crowded seat strip shrinks its names, never widens the page */
  height: 100%;
  overflow: hidden;
}

.play__header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  padding-top: max(4px, env(safe-area-inset-top));
  background: var(--lisiere);
}

.play__title {
  font: 700 18px/1.2 var(--font-index);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play__lp {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  font-size: 13px;
  opacity: .85;
}

/* red only when a push has failed — and as a mark, not as text: vermilion is unreadable on the
   header's green */
.play__lp.is-failed { opacity: 1; }
.play__lp.is-failed::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vermillon); }

/* the host's line is a button to the les-points page (screens plan 6): the same words, a 44 px
   target, the underline saying it opens something */
button.play__lp {
  min-height: 44px;
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  color: var(--craie);
  font: 13px/1.25 var(--font-ui);
  text-align: left;
  text-decoration: underline 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  touch-action: manipulation;
}
button.play__lp:focus-visible { outline: 3px solid var(--dorure); outline-offset: -3px; }

.play__mat { position: relative; min-height: 0; }

.band {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 16px;
  text-align: center;
  font: 700 20px/1.2 var(--font-index);
}

/* your turn: the gilt band across the full width, and nothing else is ever gilt */
.band.is-you {
  position: relative;
  background: var(--dorure);
  color: var(--encre);
  font-size: 28px;
}

/* the pulse animates a pseudo-element's opacity, never layout: it costs nothing for an hour */
.band.is-you::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--craie);
  opacity: 0;
  pointer-events: none;
  animation: band-pulse calc(1.8s * var(--motion)) ease-in-out infinite;
}

@keyframes band-pulse { 50% { opacity: .18; } }

.band__note { margin-top: 2px; font: 14px/1.3 var(--font-ui); }

.play__hand {
  --pad-x: 16px;
  position: relative;
  height: calc(var(--fan-h, 240px) + 12px + max(12px, env(safe-area-inset-bottom)));
}

.play[data-orientation="landscape"] .play__hand { --pad-x: 62px; }
.play[data-orientation="landscape"] .play__header { padding-top: 4px; }
.play[data-orientation="landscape"] .band { min-height: 36px; padding: 2px 16px; }
.play[data-orientation="landscape"] .band.is-you { font-size: 22px; }

/* the hand's review, over the mat until Continuer (spec §9): facts in two columns, the chien and
   the écart face up, and one button in thumb reach at the bottom */
.result {
  position: absolute;
  inset: 6px 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  border-radius: var(--radius-sheet);
  background: var(--lisiere);
  box-shadow: 0 0 0 1px var(--filet);
}

.result__title { font: 700 22px/1.2 var(--font-index); }
.result__note { font-size: 16px; }
.result__facts { display: grid; gap: 4px; margin: 0; }
.result__fact { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 12px; }
.result__fact dt { opacity: .8; }
.result__fact dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.result__label { font-size: 13px; opacity: .8; margin-bottom: 4px; }
.result__cards { display: flex; flex-wrap: wrap; gap: 4px; }
.result__cards .card { --card-w: 40px; }
.result__continue { position: sticky; bottom: 0; margin-top: auto; width: 100%; min-height: 52px; font-size: 18px; }

/* on its side the mat is a strip: the review takes the screen, facts beside the cards */
.play[data-orientation="landscape"] .result {
  position: fixed;
  inset: 8px 8%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
  column-gap: 24px;
}
.play[data-orientation="landscape"] .result__title,
.play[data-orientation="landscape"] .result__note,
.play[data-orientation="landscape"] .result__continue { grid-column: 1 / -1; }
.play[data-orientation="landscape"] .result__facts { grid-row: span 2; }
