/* The opening and the close of the evening (P6): the first-run explainer, the private comfort
   check, "You're both set", and the recap. Candlelight tokens only (tokens.css). Animate only
   transform and opacity.

   The comfort check is the deck before the deal: each topic is a small card, and setting one
   aside turns it face down. The recap is what you keep: the winner in the candle's light,
   awards as wax seals with a monogram, and the evening's things in common. */

/* ---------------------------------------------------------------------------------------
   Explainer: three cards to swipe through */
.explain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.explain-lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--gold);
  font-weight: 700;
}

.explain-flame {
  width: 12px;
  height: 17px;
}

.explain-head .btn-quiet {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  margin-right: -12px;
}

.explain-strip {
  position: relative;
  display: flex;
  gap: 14px;
  /* Room below the cards for their shadow: a scrolling strip clips anything outside it. */
  margin: var(--space-3) calc(-1 * var(--pad)) -22px;
  padding: 10px var(--pad) 48px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.explain-strip::-webkit-scrollbar {
  display: none;
}

.explain-strip:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
  border-radius: var(--r-card);
}

.explain-card {
  flex: 0 0 86%;
  scroll-snap-align: center;
  padding: 30px 24px 26px;
  border-radius: var(--r-card);
  background: radial-gradient(120% 60% at 50% 0%, rgb(244 199 123 / 0.14) 0%, var(--card-hi) 50%, var(--card) 100%);
  box-shadow: var(--foil), 0 14px 26px rgb(0 0 0 / 0.42);
}

.explain-glyph {
  display: block;
  width: 60px;
  height: 60px;
  margin-bottom: 18px;
  color: var(--gold);
}

.explain-title {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.1;
}

.explain-body {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: var(--fs-body);
  line-height: 1.55;
}

/* Where you are in the three: three little cards, the current one in gold. */
.explain-marks {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.explain-mark {
  width: 12px;
  height: 17px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform var(--dur-ui) var(--spring-pop), opacity var(--dur-ui) var(--ease);
  opacity: 0.7;
}

.explain-mark.is-on {
  background: var(--gold);
  box-shadow: none;
  opacity: 1;
  transform: translateY(-3px);
}

/* ---------------------------------------------------------------------------------------
   The private check: set topics aside */
.aside {
  --player: var(--gold);
}

.aside-title {
  margin: 0 0 var(--space-2);
  font-size: 30px;
  line-height: 1.12;
}

.aside-sheet .aside-title {
  font-size: 26px;
}

.aside-lead {
  margin: 0 0 var(--space-4);
  color: var(--text-soft);
}

.aside-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aside-card {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: var(--r-tile);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  perspective: 600px;
  touch-action: manipulation;
}

.aside-face,
.aside-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-tile);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 460ms var(--spring-flip);
}

.aside-face {
  gap: 4px;
  padding: 10px 12px 9px;
  background: linear-gradient(170deg, hsl(var(--hue, 260) 42% 27%) 0%, var(--card) 70%);
  /* The foil line, set closer to the edge than on the big cards, so the names have room. */
  box-shadow: inset 0 0 0 1px rgb(244 199 123 / 0.6), inset 0 0 0 4px var(--card), inset 0 0 0 5px rgb(244 199 123 / 0.24), 0 8px 18px rgb(0 0 0 / 0.38);
}

.aside-emoji {
  font-size: 22px;
  line-height: 1;
}

.aside-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.12;
  font-variation-settings: 'SOFT' 100;
}

/* Face down: the back of a playing card, quiet, with the topic's name small. */
.aside-back {
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(45deg, rgb(244 199 123 / 0.07) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgb(244 199 123 / 0.07) 0 2px, transparent 2px 9px),
    var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 5px var(--ink), inset 0 0 0 6px rgb(244 199 123 / 0.3);
}

.aside-back-name {
  font-size: 14px;
  line-height: 1.15;
  color: var(--muted);
}

.aside-back-note {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.aside-card.is-aside .aside-face {
  transform: rotateY(-180deg);
}

.aside-card.is-aside .aside-back {
  transform: rotateY(0deg);
}

.aside-card:disabled {
  cursor: default;
}

.aside-card:disabled:not(.is-aside) .aside-face {
  opacity: 0.45;
}

.aside-card.is-locked .aside-back-note {
  color: var(--muted);
}

.aside-card:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.aside-note {
  margin: var(--space-3) 0 0;
  color: var(--gold);
  font-size: var(--fs-small);
  font-weight: 600;
}

.aside-sheet {
  max-height: calc(100dvh - 2 * var(--pad));
  overflow-y: auto;
}

.aside-wait {
  padding-top: 18vh;
}

/* ---------------------------------------------------------------------------------------
   You're both set */
.all-set {
  padding-top: 6vh;
}

.all-set-title {
  margin: 0 0 var(--space-2);
  font-size: 42px;
  line-height: 1.05;
}

.all-set-lead {
  margin: 0 0 var(--space-6);
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-style: italic;
  color: var(--text-soft);
}

.promises {
  margin: 0;
  padding: 0;
  list-style: none;
}

.promises li {
  margin-bottom: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  color: var(--text-soft);
}

.promises strong {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  color: var(--text);
}

.all-set-foot {
  margin-top: var(--space-4);
  font-size: var(--fs-small);
}

/* ---------------------------------------------------------------------------------------
   The recap */
.screen-recap {
  padding-bottom: 40px;
}

/* The winner in the candle's light: the one bold moment of the recap. */
.recap-head {
  --player: var(--gold);
  position: relative;
  padding: 5vh 0 4px;
  text-align: center;
}

.recap-head::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -10px;
  width: 300px;
  height: 220px;
  margin-left: -150px;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--player) 28%, transparent), transparent);
  pointer-events: none;
}

.recap-flame {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 36px;
  color: var(--gold);
}

.recap-flame svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px rgb(255 170 80 / 0.7));
}

.recap-winner {
  position: relative;
  margin: 8px 0 6px;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.02;
  color: color-mix(in oklab, var(--player) 80%, white);
}

.recap-head.is-draw .recap-winner {
  color: var(--text);
}

.recap-sub {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  color: var(--text-soft);
}

.recap-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0 8px;
}

.recap-player {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 18px 10px;
  border-radius: var(--r-card);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--player) 45%, transparent);
}

.recap-player.is-winner {
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 44px rgb(244 199 123 / 0.22);
}

.recap-name {
  font-weight: 700;
  color: color-mix(in oklab, var(--player) 82%, white);
}

.recap-points {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.recap-section {
  margin-top: 26px;
}

.recap-h {
  margin: 0 0 12px;
  font-size: 26px;
}

/* How far you went: four steps, lit in their heat colours up to the highest one opened. */
.recap-ladder {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.ladder-step {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 4px 6px;
  border-radius: 12px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.ladder-step.is-reached {
  box-shadow: none;
}

.ladder-step.heat-1.is-reached {
  background: var(--heat-1);
  color: var(--heat-1-ink);
}

.ladder-step.heat-2.is-reached {
  background: var(--heat-2);
  color: var(--heat-2-ink);
}

.ladder-step.heat-3.is-reached {
  background: var(--heat-3);
  color: var(--heat-3-ink);
}

.ladder-step.heat-4.is-reached {
  background: var(--heat-4);
  color: var(--heat-4-ink);
}

.recap-reached {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-lead);
}

.recap-connection {
  font-family: var(--font);
  font-size: var(--fs-body);
  color: var(--text-soft);
}

.recap-connection strong {
  color: var(--gold);
}

.recap-story {
  margin: 0;
  color: var(--text-soft);
}

/* Awards: a wax seal with the award's first letter, then the title, who, and why. */
.awards {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.award {
  --player: var(--gold-hi);
  display: flex;
  align-items: center;
  gap: 14px;
}

.award-seal {
  position: relative;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--gold);
}

.award-seal .seal-glyph {
  position: absolute;
  inset: 0;
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 3px 8px rgb(0 0 0 / 0.45));
}

.award-letter {
  position: relative;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--gold-ink);
}

.award-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.award-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.15;
}

.award-who {
  font-size: var(--fs-small);
  font-weight: 700;
  color: color-mix(in oklab, var(--player) 82%, white);
}

.award.is-shared .award-who {
  color: var(--gold);
}

.award-line {
  font-size: var(--fs-small);
  color: var(--muted);
}

/* Things in common: a short list on gold hairlines, the topic's emoji in the margin. */
.common-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.common-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.common-item:first-child {
  border-top: 1px solid var(--line-soft);
}

.common-mark {
  flex: 0 0 28px;
  text-align: center;
  font-size: 20px;
  line-height: 1;
}

.common-item.is-pick .common-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--gold);
}

.common-label {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.25;
}

.common-label strong {
  font-weight: 600;
}

/* Photos: small prints on the table, slightly askew. */
.print-strip {
  display: flex;
  gap: 16px;
  margin: 0 calc(-1 * var(--pad));
  padding: 8px var(--pad) 18px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.print-strip::-webkit-scrollbar {
  display: none;
}

.keep-print {
  flex: 0 0 auto;
  padding: 8px 8px 22px;
  border-radius: 5px;
  background: var(--text);
  box-shadow: var(--shadow-lift);
  transform: rotate(var(--tilt, -1.5deg));
}

.keep-print img {
  display: block;
  width: 124px;
  height: 150px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--card);
}

.recap-note {
  margin: 0 0 4px;
  font-size: var(--fs-small);
}

.confirm-row {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: var(--r-control);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.confirm-q {
  margin: 0;
  font-weight: 600;
}

.recap-actions {
  margin-top: 32px;
}

@media (prefers-reduced-motion: reduce) {
  .aside-face,
  .aside-back {
    transition: none;
  }
}
