/* ==========================================================================
   Perfils · screens.css  (14/10/2026)
   --------------------------------------------------------------------------
   App shell, home ("the box lid"), setup, "Como jogar", menu, confirmations,
   toasts, end-of-round card and end-of-game podium.
   Built ONLY on theme.css tokens and components (.p-*). Loads after style.css.

   Scene: friends around a coffee table at night, one screen. The page is the dark
   table (deep teal-black with a barely-there mosaic); everything the players touch
   is an object from the box: lacquered keys, plaques, white cards, ink panels.
   Typography: Poiret One only >= 28px (titles), Josefin Sans 600 for labels, buttons
   and numbers, Jost for running text.
   ========================================================================== */

/* ---------------------------------------------------------------- icons (masks) */
:root {
  --ic-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v16M4 12h16' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='square'/%3E%3C/svg%3E");
  --ic-pause: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 4v16M16 4v16' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='square'/%3E%3C/svg%3E");
  --ic-check-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 12.6 9.1 18.2 20.6 5.8' fill='none' stroke='%230f0f12' stroke-width='3.6' stroke-linecap='square'/%3E%3C/svg%3E");
  --ic-cross-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5 19 19M19 5 5 19' fill='none' stroke='%230f0f12' stroke-width='3.6' stroke-linecap='square'/%3E%3C/svg%3E");
  --shell-teal: #062e2b;
}
.p-ic--plus { --ic: var(--ic-plus); }
.p-ic--pause { --ic: var(--ic-pause); }
.p-ic.is-back { transform: scaleX(-1); }

.p-btn--icon { min-width: var(--tap); padding: 0; }
.p-btn--danger {
  color: var(--p-paper);
  background: linear-gradient(180deg, var(--p-red-hi) 0%, var(--p-red-ink) 55%, var(--p-red-lo) 100%);
}
.p-btn small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-xs);
  letter-spacing: 0;
  text-transform: none;
}

/* ==========================================================================
   1. App shell: the table, the header of the game, the footer
   ========================================================================== */
html { background: var(--p-black); }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--p-cream);
  background: transparent;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* The table: deep teal-black, the box mosaic only a whisper, darker towards the edges. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 75% at 50% 38%, rgb(6 46 43 / 0) 0%, rgb(4 20 20 / 0.7) 100%),
    linear-gradient(rgb(6 46 43 / 0.86), rgb(6 46 43 / 0.86)),
    var(--img-mosaic) center top / 96px 168px;
  background-color: var(--shell-teal);
}
.stage { flex: 1 0 auto; min-height: 0; }

.skip-link {
  position: fixed;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0 1.2rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--p-black);
  background: var(--p-orange);
  border: 2px solid var(--p-black);
  border-radius: var(--r-3);
  text-decoration: none;
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: 0.75rem; }
.noscript { margin: 0; padding: 1rem; text-align: center; font-weight: 700; color: var(--p-black); background: var(--p-orange); }

/* Game header: ink bar, violet hairline, the logo in colour. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem clamp(0.75rem, 2vw, 1.5rem);
  background: var(--p-black);
  box-shadow: 0 10px 22px -12px rgb(0 0 0 / 0.7);
}
.topbar-title { display: flex; align-items: center; gap: 0.9rem; margin: 0; white-space: nowrap; }
.topbar-logo {
  display: block;
  width: 7.6rem;
  height: 2.15rem;
  font-size: 0;
  background: var(--img-logo) left center / contain no-repeat;
}
.topbar-round {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--p-aqua-3);
}
.topbar-round b { margin-left: 0.3em; font-size: var(--fs-md); letter-spacing: 0.04em; color: var(--p-cream); font-variant-numeric: lining-nums; }
.topbar .icon-btn:last-child { margin-left: auto; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  color: var(--p-black);
  background: linear-gradient(180deg, var(--p-teal-hi) 0%, var(--p-teal) 46%, var(--p-teal-lo) 100%);
  border: 2px solid var(--p-black);
  border-radius: var(--r-3);
  box-shadow: 0 0 0 1px var(--p-violet-2), inset 0 1px 0 rgb(255 255 255 / 0.3), 0 3px 0 var(--p-black);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (hover: hover) {
  .icon-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
}
.icon-btn:active { transform: translateY(2px); }
.icon-btn:focus-visible { outline: 3px solid var(--p-focus); outline-offset: 3px; }
.icon-btn svg { width: 1.6rem; height: 1.6rem; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.icon-btn .ico-wave, .icon-btn .ico-off { fill: none; }
.icon-btn[aria-pressed='false'] .ico-wave { display: none; }
.icon-btn:not([aria-pressed='false']) .ico-off { display: none; }
.burger { display: block; width: 1.4rem; height: 3px; background: currentColor; box-shadow: 0 -0.45rem 0 currentColor, 0 0.45rem 0 currentColor; }

/* Footer: only on the home and setup screens; the game fits the window. */
.app-foot { display: none; }
body[data-view='home'] .app-foot,
body[data-view='setup'] .app-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 1.6rem;
  padding: 1.1rem 1rem 1.5rem;
  font-size: var(--fs-xs);
  color: var(--p-aqua-3);
}
.app-foot::before {
  content: '';
  flex: 0 0 100%;
  height: 0.6rem;
  margin-bottom: 0.7rem;
  background: var(--img-strip) repeat-x center / 0.69rem 0.6rem;
  opacity: 0.35;
}
.app-foot p { margin: 0; }
.app-foot__name { font-family: var(--font-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--p-cream); }
.app-foot__link { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: 0.5rem; color: inherit; text-underline-offset: 0.2em; }   /* 44px+ target */
.app-foot__link:hover { color: var(--p-cream); }

/* ==========================================================================
   2. Notice (warnings), toasts
   ========================================================================== */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.85rem 1.1rem;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--p-cream);
  background: var(--p-black);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px var(--p-violet), inset 0 0 0 4px var(--p-black), inset 0 0 0 5px var(--p-violet-2), var(--shadow-object);
}
.notice::before {                       /* warning triangle, drawn: the state is not only a colour */
  content: '!';
  flex: none;
  display: grid;
  place-items: end center;
  width: 1.4rem;
  height: 1.2rem;
  margin-top: 0.1rem;
  padding-bottom: 0.02rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--p-black);
  background: linear-gradient(180deg, var(--p-orange), var(--p-gold-lo));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.notice--inline {
  max-width: none;
  margin: var(--sp-4) 0 0;
  color: var(--p-ink);
  background: var(--p-paper-2);
  box-shadow: inset 0 0 0 1px rgb(13 150 141 / 0.55);
}
.view-home > .notice { margin-top: 0; }

.toasts {
  position: fixed;
  inset: auto 0 max(1rem, env(safe-area-inset-bottom)) 0;
  z-index: 200;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  width: min(26rem, calc(100vw - 2rem));
  height: auto;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  color: inherit;
  background: transparent;
  border: 0;
  pointer-events: none;
}
.toasts[popover]:not(:popover-open) { display: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.7rem 1.15rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  line-height: 1.25;
  color: var(--p-cream);
  background: var(--p-black);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px var(--p-orange-2), inset 0 0 0 4px var(--p-black), inset 0 0 0 5px var(--p-violet-2), var(--shadow-object);
  animation: scr-toast-in var(--dur-3) var(--ease-out) both;
}
.toast.is-leaving { animation: scr-toast-out var(--dur-out) var(--ease-out) both; }
.toast__ico {
  flex: none;
  width: 0.9rem;
  height: 0.8rem;
  background: linear-gradient(180deg, var(--p-orange), var(--p-red));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
@keyframes scr-toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes scr-toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   3. Home: the lid of the box
   ========================================================================== */
.view-home {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  padding: clamp(0.75rem, 2.5vw, 2rem) clamp(0.75rem, 3vw, 2rem) 0.5rem;
}
.lid {
  --mosaic: 104px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  gap: clamp(1.1rem, 3vh, 2rem);
  width: min(74rem, 100%);
  min-height: min(50rem, calc(100dvh - 8.5rem));
  padding: clamp(2.4rem, 6vh, 4rem) clamp(1rem, 4vw, 3rem) clamp(1.6rem, 4vh, 2.8rem);
  animation: scr-lid-in var(--dur-4) var(--ease-out) both;
}
.lid__seal {                           /* top right: the edition stamp */
  position: absolute;
  top: clamp(1.1rem, 2.4vw, 1.7rem);
  right: clamp(1.1rem, 2.4vw, 1.7rem);
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.5rem 0.95rem 0.45rem;
  line-height: 1;
  text-align: center;
  color: var(--p-cream);
  background: var(--p-black);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 2px var(--p-orange-2), inset 0 0 0 4px var(--p-black), inset 0 0 0 5px var(--p-violet-2), var(--shadow-1);
}
.lid__seal span { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--p-aqua-3); }
.lid__seal b { font-family: var(--font-label); font-weight: 600; font-size: 1.55rem; letter-spacing: 0.1em; font-variant-numeric: lining-nums; color: var(--p-orange); }

.lid__qmark { position: absolute; top: 3px; left: clamp(1.4rem, 7vw, 4.4rem); font-size: 1.3rem; filter: drop-shadow(0 2px 0 rgb(15 15 18 / 0.45)); }

.lid__plate {
  width: min(100%, 60rem);
  padding: clamp(1.4rem, 4.6vh, 3rem) clamp(1.6rem, 8vw, 5.5rem) clamp(1.1rem, 3.2vh, 1.9rem);
  gap: clamp(0.5rem, 1.6vh, 1rem);
  align-content: center;
  justify-items: center;
  filter: drop-shadow(0 8px 10px rgb(15 15 18 / 0.35));
}
.lid__logo {
  width: min(100%, 45.9rem);
  aspect-ratio: 1259 / 342;
  margin: 0;
  background: var(--img-logo) center / contain no-repeat;
  filter: drop-shadow(0 0.06em 0 rgb(15 15 18 / 0.3));
}
.lid__slogan { margin: 0; font-size: clamp(1rem, 0.85rem + 0.5vw, 1.25rem); }

.lid__facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }

.lid__tray {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 1rem;
  width: min(100%, 58rem);
  padding: 1.1rem 1.5rem 1.4rem;
}
.lid__actions .p-btn { max-width: 100%; }
.lid__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.9rem 1.2rem; }
.lid__continue { flex-direction: column; gap: 0.2rem; padding-block: 0.55rem; }
.lid__continue small { max-width: 19rem; font-size: var(--fs-xs); line-height: 1.25; white-space: normal; text-align: center; }

/* ==========================================================================
   4. Setup: the game sheet
   ========================================================================== */
.view-setup { padding: clamp(0.75rem, 2.5vw, 2rem) clamp(0.75rem, 3vw, 2rem) 1rem; }
.setup { display: grid; gap: clamp(1rem, 2.2vw, 1.6rem); width: min(72rem, 100%); margin: 0 auto; }

.setup-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.5rem; }
.setup-head__kicker {
  margin: 0 0 0.2rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--p-aqua-3);
}
.setup-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: 0.02em;
  color: var(--p-cream);
  -webkit-text-stroke: var(--poiret-boost) currentColor;
  outline: none;
}
.setup-head__logo { width: 10.9rem; aspect-ratio: 1259 / 342; background: var(--img-logo) center / contain no-repeat; }

.setup-form {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1rem, 2.2vw, 1.6rem);
  align-items: start;
}
.setup-col { display: grid; gap: clamp(1rem, 2.2vw, 1.6rem); min-width: 0; }
.step--fronts, .setup-foot { grid-column: 1 / -1; }

.step { min-width: 0; }
.step.p-panel { padding: var(--sp-5); }
.step__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2rem 1rem;
  margin-bottom: var(--sp-4);
}
.step__no {                            /* the pink numbered triangle of the style tile */
  display: grid;
  place-items: end center;
  width: 2.9rem;
  height: 2.5rem;
  padding-bottom: 0.1rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1;
  font-variant-numeric: lining-nums;
  color: var(--p-plum);
  background: linear-gradient(180deg, var(--p-pink-hi), var(--p-pink) 80%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.step__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-2xl);
  line-height: 1;
  letter-spacing: 0.02em;
  -webkit-text-stroke: var(--poiret-boost) currentColor;
}
.step__hint { margin: 0.35rem 0 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--p-aqua-3); }
.p-card .step__hint { color: var(--p-muted); }
.step__tools { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }

/* Players (the paper sheet) */
.step--players { padding-inline: var(--sp-5); }
.player-rows { display: grid; gap: 0; margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--tap);
  align-items: end;
  gap: 0.4rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgb(13 150 141 / 0.45);
}
.player-row:first-child { border-top: 1px solid rgb(13 150 141 / 0.45); }
.player-row .p-field__label { color: var(--p-teal-ink); }
.player-row .p-field__hint { color: var(--p-muted); min-height: 0; }
.player-row .p-field__hint:empty { display: none; }
.player-row__pawn { display: grid; gap: 0.4rem; }
.add-player { justify-self: start; }

.pawn-pick { display: flex; gap: 0.2rem; }
.pawn-pick__opt {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  width: 2.85rem;
  height: 3.3rem;
  padding-bottom: 0.3rem;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.pawn-pick__input { position: absolute; inset: -2px; z-index: 1; width: calc(100% + 4px); height: calc(100% + 4px); margin: 0; opacity: 0; cursor: pointer; }
.pawn-pick__piece { display: block; line-height: 0; transform-origin: 50% 90%; transition: transform var(--dur-2) var(--ease-out); }
.pawn-pick__opt:hover .pawn-pick__piece { transform: translateY(-3px); }
.pawn-pick__opt:has(:checked) {
  background: var(--p-paper-2);
  border-color: var(--p-black);
  box-shadow: 0 2px 0 var(--p-black);
}
.pawn-pick__opt:has(:checked) .pawn-pick__piece { transform: translateY(-3px) scale(1.1); }
.pawn-pick__opt:has(:checked)::after {          /* drawn check: selection is not only colour */
  content: '';
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1.15rem;
  height: 1.15rem;
  background: var(--p-black) var(--ic-check-cream) center / 78% no-repeat;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--p-paper);
}
.pawn-pick__opt:has(:focus-visible) { outline: 3px solid var(--p-focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--p-black); }
.pawn-pick__owner {                              /* who already holds this pawn (picking it swaps the two) */
  position: absolute;
  right: 0.12rem;
  bottom: 0.2rem;
  display: none;
  place-items: center;
  min-width: 1.05rem;
  height: 1.05rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--p-cream);
  background: var(--p-black);
  border-radius: 50%;
}
.pawn-pick__opt.is-taken:not(:has(:checked)) .pawn-pick__piece { opacity: 0.6; }
.pawn-pick__opt.is-taken:not(:has(:checked)):hover .pawn-pick__piece { opacity: 1; }

/* Plaques: goal and difficulty */
.plaques { display: grid; gap: 0.6rem; }
.plaques--goal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plaques--diff { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pq { position: relative; display: block; cursor: pointer; }
.pq__input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pq__face {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
  min-height: 4.2rem;
  padding: 0.7rem 0.5rem;
}
.pq__label { font-size: var(--fs-xs); letter-spacing: var(--track-label); }
.pq__big { font-size: 2.4rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1; font-variant-numeric: lining-nums; }
.pq__sub { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-xs); letter-spacing: 0; text-transform: none; line-height: 1.1; }
.plaques--goal .pq__face { min-height: 7.2rem; }
.pq:hover .pq__face { filter: brightness(1.06); }
.pq__input:checked + .pq__face {                 /* lit: gold, with the drawn marker */
  background: linear-gradient(180deg, var(--p-gold-glow) 0%, var(--p-orange) 55%, var(--p-gold-lo) 100%);
  box-shadow: inset 0 1px 0 rgb(255 252 235 / 0.9), inset 0 -2px 0 rgb(110 55 0 / 0.25), 0 2px 0 var(--p-black),
    0 0 0 3px rgb(244 235 173 / 0.55), 0 0 22px 2px rgb(232 163 58 / 0.5);
  transform: translateY(-1px);
}
.pq__input:checked + .pq__face::before { border-color: rgb(15 15 18 / 0.55); }
.pq__input:checked + .pq__face::after {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: 0.55rem;
  width: 0.62rem;
  height: 0.54rem;
  background: currentColor;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}
.pq__input:focus-visible + .pq__face { outline: 3px solid var(--p-focus); outline-offset: 3px; }

/* Fronts: toggleable chips with the colour and emoji of each category */
.fronts { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 0.6rem; }
.front-chip { width: 100%; min-height: 3rem; padding: 0.3rem 0.85rem 0.3rem 0.75rem; text-align: left; }
.front-chip__ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.95rem;
  height: 1.95rem;
  font-size: 1.05rem;
  line-height: 1;
  background: var(--cat, var(--p-pink));
  border: 2px solid var(--p-black);
  border-radius: var(--r-1);
}
.front-chip__name { flex: 1; min-width: 0; line-height: 1.15; }
.front-chip .p-chip__count { margin-left: auto; padding-left: 0.3rem; }
.front-chip[aria-pressed='true'] .p-chip__count { color: var(--p-black); }
.front-chip[aria-pressed='false'] .front-chip__ico { filter: saturate(0.55); }

/* Kits: one real checkbox per card kit (originais / novas); both checked = every card */
.kits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.kit-chip { width: 100%; min-height: 4.6rem; padding: 0.65rem 0.85rem 0.65rem 0.75rem; align-items: flex-start; text-align: left; }
.kit-chip::before { width: 1.15em; height: 1.15em; margin-top: 0.05em; }
.kit-chip__text { display: grid; gap: 0.3rem; flex: 1; min-width: 0; }
.kit-chip__name { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-sm); letter-spacing: var(--track-label); text-transform: uppercase; line-height: 1.15; }
.kit-chip__desc { font-weight: 400; font-size: var(--fs-xs); line-height: 1.3; color: var(--p-muted); }
.kit-chip__count { white-space: nowrap; }
.kit-chip:has(input:checked) .kit-chip__desc, .kit-chip:has(input:checked) .kit-chip__count { color: var(--p-black); }

/* Sound and history */
.step--extras { display: grid; gap: var(--sp-3); }
.history { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding-top: var(--sp-3); border-top: 1px solid var(--p-violet); }
.history__text { flex: 1 1 14rem; margin: 0; font-size: var(--fs-xs); line-height: 1.45; color: var(--p-aqua-3); }

/* Switch: the state is the knob position AND the drawn mark on it AND the word */
.p-switch { position: relative; display: inline-flex; align-items: center; gap: 0.95rem; min-height: var(--tap); cursor: pointer; }
.p-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.p-switch__ui {
  position: relative;
  flex: none;
  width: 3.7rem;
  height: 2.05rem;
  background: var(--p-disabled-face);
  border: 2px solid var(--p-black);
  border-radius: var(--r-2);
  box-shadow: inset 0 2px 0 rgb(15 15 18 / 0.2);
  transition: background-color var(--dur-2) var(--ease-out);
}
.p-switch__ui::after {
  content: '';
  position: absolute;
  top: 0.13rem;
  left: 0.13rem;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--ic-cross-ink) center / 62% no-repeat, linear-gradient(180deg, var(--p-paper-hi), var(--p-paper-lo));
  border: 2px solid var(--p-black);
  border-radius: var(--r-1);
  transition: transform var(--dur-2) var(--ease-out);
}
.p-switch input:checked + .p-switch__ui,
.p-switch input:checked ~ .p-switch__ui { background: var(--p-teal); }
.p-switch input:checked + .p-switch__ui::after,
.p-switch input:checked ~ .p-switch__ui::after {
  transform: translateX(1.55rem);
  background: var(--ic-check-ink) center / 66% no-repeat, linear-gradient(180deg, var(--p-gold-glow), var(--p-orange));
}
.p-switch:has(input:focus-visible) .p-switch__ui { outline: 3px solid var(--p-focus); outline-offset: 3px; }
.p-switch__text b, .menu-item__text b { display: block; font-family: var(--font-label); font-weight: 600; font-size: var(--fs-sm); letter-spacing: var(--track-label); text-transform: uppercase; line-height: 1.2; }
.p-switch__text small { display: block; font-size: var(--fs-xs); color: var(--p-aqua-3); }

/* Foot: deck, validation, start */
.setup-foot {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem 1.5rem;
  padding: 0.8rem 1.2rem;
}
.deck { display: flex; align-items: center; gap: 1.1rem; }
.deck__stack { width: 4.2rem; padding: 0; background-size: 28px 49px; }
.deck__text { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.5rem; margin: 0; }
.deck__label { flex: 0 0 100%; font-family: var(--font-label); font-weight: 600; font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--p-aqua-3); }
.deck__count { font-family: var(--font-label); font-weight: 600; font-size: 2rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; color: var(--p-cream); }
.deck__unit { font-size: var(--fs-sm); color: var(--p-aqua-3); }
.deck__hint { flex: 0 0 100%; font-size: var(--fs-2xs); color: var(--p-aqua-3); }
.setup-status { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0; font-size: var(--fs-sm); line-height: 1.4; }
.setup-status::before {
  content: '';
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.12rem;
  background: var(--p-aqua);
  -webkit-mask: var(--ic-check) center / contain no-repeat;
  mask: var(--ic-check) center / contain no-repeat;
}
.setup-status.is-warn::before { background: var(--p-orange); -webkit-mask: none; mask: none; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.setup-status.is-error { color: var(--p-error-text); font-weight: 700; }
.setup-status.is-error::before { background: var(--p-error-icon); -webkit-mask-image: var(--ic-cross); mask-image: var(--ic-cross); }

/* ==========================================================================
   5. Modals (the shell of every <dialog class="p-modal">)
   ========================================================================== */
.p-modal { overscroll-behavior: contain; scrollbar-width: thin; }
/* theme.css gives .p-modal position: relative (anchor of its ::before strip), and in the top layer that computes to
   absolute: the open dialog would ride the document and slide out of view when the page is scrolled (phones).
   Fixed keeps it centred on the screen and still anchors the strip. */
dialog.p-modal:modal { position: fixed; }
.p-modal--narrow { width: min(28rem, calc(100vw - 2rem)); }
.p-modal--wide { width: min(66rem, calc(100vw - 2rem)); }
.p-modal__title { color: var(--p-ink); }
.dlg-title:focus, .dlg-title:focus-visible { outline: none; box-shadow: none; }
.p-modal__body { max-width: 60ch; }
.p-modal__actions { align-items: center; }
dialog.dlg-pause::backdrop { background: var(--p-black); }
dialog.dlg-confirm .p-modal__body { color: var(--p-ink); }

/* Menu */
.menu-list { display: grid; gap: 0.6rem; margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 3.6rem;
  padding: 0.55rem 1.1rem;
  text-align: left;
  color: var(--p-ink);
  background: linear-gradient(180deg, var(--p-paper-hi) 0%, var(--p-paper) 50%, var(--p-paper-lo) 100%);
  border: 2px solid var(--p-black);
  border-radius: var(--r-3);
  box-shadow: inset 0 0 0 2px var(--p-paper), inset 0 0 0 3px var(--p-teal-deep), 0 3px 0 var(--p-black);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), background var(--dur-2) var(--ease-out);
}
@media (hover: hover) {
  .menu-item:hover { background: linear-gradient(180deg, var(--p-paper-hi) 0%, var(--p-mist-hi) 55%, var(--p-mist) 100%); transform: translateY(-1px); }
}
.menu-item:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--p-paper), inset 0 0 0 3px var(--p-teal-deep), 0 1px 0 var(--p-black); }
.menu-item:focus-visible { outline: 3px solid var(--p-focus); outline-offset: 2px; }
.menu-switch:has(input:focus-visible) { outline: 3px solid var(--p-focus); outline-offset: 2px; }
.menu-switch:has(input:focus-visible) .p-switch__ui { outline: 0; }
.menu-item__text { min-width: 0; }
.menu-item__text small { display: block; margin-top: 0.15rem; font-size: var(--fs-xs); line-height: 1.3; color: var(--p-muted); }
.menu-item .p-switch__text small { color: var(--p-muted); }
.menu-item > .p-ic { flex: none; width: 1.15rem; height: 1.15rem; color: var(--p-teal-ink); }
.menu-switch .menu-item__text small[data-switch-state] { color: var(--p-teal-ink); font-weight: 700; }
.menu-danger .menu-item__text b, .menu-danger > .p-ic { color: var(--p-red-ink); }

/* Pause */
.pause { display: grid; justify-items: center; gap: 0.5rem; padding: var(--sp-3) 0 var(--sp-2); text-align: center; }
.pause__mark {
  display: grid;
  place-items: end center;
  width: 4.4rem;
  height: 3.8rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.6rem;
  color: var(--p-black);
  background: linear-gradient(180deg, var(--p-gold-glow), var(--p-orange) 55%, var(--p-red));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.pause__mark .p-ic { width: 1.35rem; height: 1.35rem; }
.pause .p-modal__title { margin: 0; }
.pause .p-modal__body { margin: 0 0 var(--sp-3); color: var(--p-muted); }

/* Rules: six steps, each with a small black plate that shows the thing */
.rules-lead { max-width: 56ch; margin: 0 0 var(--sp-5); font-size: var(--fs-lg); line-height: 1.4; text-wrap: pretty; }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-5); margin: 0; padding: 0; list-style: none; }
.rule { display: grid; grid-template-rows: auto auto 1fr; gap: 0.7rem; min-width: 0; }
.rule p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.rule__art {
  display: grid;
  place-items: center;
  min-height: 6.6rem;
  padding: 0.9rem 0.6rem;
  overflow: hidden;
  pointer-events: none;
  color: var(--p-cream);
  background: var(--p-black);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px var(--p-violet), inset 0 0 0 4px var(--p-black), inset 0 0 0 5px var(--p-violet-2);
}
.rule__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--p-ink);
}
.rule__no {
  display: grid;
  place-items: end center;
  flex: none;
  width: 1.9rem;
  height: 1.65rem;
  font-size: 0.8rem;
  letter-spacing: 0;
  line-height: 1;
  color: var(--p-plum);
  background: linear-gradient(180deg, var(--p-pink-hi), var(--p-pink) 80%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.rules-note {
  margin: var(--sp-5) 0 0;
  padding: 0.85rem 1.1rem;
  font-size: var(--fs-sm);
  line-height: 1.5;
  background: var(--p-paper-2);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px rgb(13 150 141 / 0.55);
}
.rules-tris { margin: 0; }
.rules-tris .p-tri-num { cursor: default; }
.rule-pts { display: flex; align-items: flex-end; gap: 1.1rem; }
.rule-pt { position: relative; display: grid; justify-items: center; gap: 0.15rem; }
.rule-pt b { font-family: var(--font-label); font-weight: 600; font-size: 2.1rem; line-height: 1; font-variant-numeric: lining-nums; color: var(--p-orange); }
.rule-pt:nth-child(2) b { font-size: 1.7rem; color: var(--p-gold-text); }
.rule-pt:nth-child(3) b { font-size: 1.3rem; color: var(--p-aqua-3); }
.rule-pt small { font-size: var(--fs-2xs); letter-spacing: 0.04em; color: var(--p-cream); }
.rule-pt:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -0.95rem;
  top: 0.8rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--p-aqua);
  -webkit-mask: var(--ic-arrow) center / contain no-repeat;
  mask: var(--ic-arrow) center / contain no-repeat;
}
.rule-keys { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.55rem; }
.rule-keys .p-ic { width: 0.85rem; height: 0.85rem; color: var(--p-aqua); }
.rule-key {
  display: inline-grid;
  place-items: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-black);
  background: linear-gradient(180deg, var(--p-paper-hi), var(--p-paper) 50%, var(--p-paper-lo));
  border: 2px solid var(--p-black);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px var(--p-paper), inset 0 0 0 2px var(--p-teal-deep), 0 2px 0 rgb(0 0 0 / 0.6);
}
.rule-key--gold { background: linear-gradient(180deg, var(--p-gold-hi), var(--p-orange) 52%, var(--p-gold-lo)); box-shadow: inset 0 1px 0 rgb(255 247 214 / 0.75), 0 2px 0 rgb(0 0 0 / 0.6); }
.rule-pick { display: flex; align-items: flex-end; gap: 1.1rem; }
.rule-pick .pw { position: relative; opacity: 0.7; }
.rule-pick .pw.is-pick { opacity: 1; transform: translateY(-4px); }
.rule-pick .pw.is-pick::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.5rem;
  width: 0.8rem;
  height: 0.55rem;
  margin-left: -0.4rem;
  background: var(--p-orange);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.rule-final { display: flex; align-items: center; gap: 1rem; }
.rule-final .p-tri-num { cursor: default; }
.rule-track { display: flex; align-items: center; gap: 0.7rem; }
.rule-track__row {
  position: relative;
  width: 9.5rem;
  height: 2.9rem;
  background: var(--p-teal-deep) var(--img-mosaic) center / 44px 77px;
  border: 2px solid var(--p-black);
  border-radius: var(--r-1);
  box-shadow: 0 0 0 1px var(--p-violet-2);
}
.rule-track__row .pw { position: absolute; left: 1.9rem; bottom: 0.15rem; }

/* ==========================================================================
   6. End of round: the white card of the original
   ========================================================================== */
.p-modal--card { --card-band: 1rem; width: min(62rem, calc(100vw - 2rem)); padding: 0; }   /* same band as .clue-card */
.p-modal--card::before { border-bottom: 0; }             /* the clue card has no rule under its strip */
.p-modal--card .p-modal__actions { margin-block: var(--sp-5) var(--sp-4); }
.rd {
  --rd-pad: clamp(1rem, 3.2vw, 2.25rem);
  padding: calc(var(--card-band) + 0.8rem) var(--rd-pad) 0;
}
.rd::after {                           /* the card's lower strip of triangles */
  content: '';
  display: block;
  height: var(--card-band);
  margin: 0 calc(var(--rd-pad) * -1);
  background: var(--img-strip) repeat-x left center / calc(var(--card-band) * 8 / 7) var(--card-band);
  transform: scaleY(-1);
  transform-origin: 50% 50%;
}
.rd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-bottom: var(--sp-3); }
.rd-head__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem 1rem; margin-left: auto; }
@media (max-width: 599px) { .rd-head__meta { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; } }
.rd-front, .rd-no {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.rd-front { color: var(--p-teal-ink); }
.rd-front__ico { font-size: 1rem; letter-spacing: 0; }
.rd-no { color: var(--p-muted); }
.rd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: var(--sp-5) clamp(1.2rem, 3vw, 2.2rem);
  align-items: start;
  padding-top: var(--sp-4);
  border-top: 2px solid var(--p-teal-deep);
  box-shadow: 0 -4px 0 -3px var(--p-paper);
}
.rd-main { min-width: 0; }
.rd-who { display: flex; align-items: center; gap: 0.9rem; }
.rd-who .pw { flex: none; }
.rd-who__text { min-width: 0; }
.rd-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: 0.015em;
  color: var(--p-ink);
  -webkit-text-stroke: var(--poiret-boost) currentColor;
  overflow-wrap: anywhere;
  text-wrap: balance;
  outline: none;
}
.is-burned .rd-title { color: var(--p-red-ink); }
.rd-sub { margin: 0.3rem 0 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--p-muted); }

.rd-answer-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  padding: var(--sp-4) 0;
  border-block: 2px solid var(--p-teal-deep);
  box-shadow: 0 -4px 0 -3px var(--p-paper), 0 4px 0 -3px var(--p-paper);
}
.rd-kicker { margin: 0 0 0.4rem; font-family: var(--font-label); font-weight: 600; font-size: var(--fs-2xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--p-teal-ink); }
.rd-answer {
  margin: 0;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-plum);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.rd-stamp {                            /* "+17": a marker triangle, like the ones on the board */
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: start center;
  align-content: start;
  width: 6.6rem;
  height: 6rem;
  padding-top: 0.75rem;
  color: var(--p-black);
  text-align: center;
  animation: scr-stamp var(--dur-4) var(--ease-spring) var(--dur-1) both;
}
.rd-stamp::before, .rd-stamp::after { content: ''; position: absolute; inset: 0; z-index: -1; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.rd-stamp::before { background: var(--p-black); }
.rd-stamp::after { background: linear-gradient(180deg, var(--p-gold-glow) 0%, var(--p-orange) 48%, var(--p-red) 100%); transform: scale(0.86); transform-origin: 50% 33.3%; }
.rd-stamp b { font-family: var(--font-label); font-weight: 600; font-size: 2.3rem; line-height: 1; letter-spacing: 0.01em; font-variant-numeric: lining-nums; }
.rd-stamp small { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; }
.rd-stamp.is-burned::after { background: linear-gradient(180deg, #d5e0de, var(--p-disabled-face)); }
.rd-stamp.is-burned .p-ic { width: 1.7rem; height: 1.7rem; margin-top: 0.3rem; }
@keyframes scr-stamp { from { opacity: 0; transform: rotate(-18deg) scale(1.7); } to { opacity: 1; transform: none; } }

.rd-rank { display: grid; gap: 0; margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.rd-rank__row {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 8.5rem) minmax(1rem, 1fr) auto;
  align-items: center;
  gap: 0 0.7rem;
  min-height: 2.6rem;
  padding: 0.2rem 0.5rem 0.2rem 0.1rem;
  border-bottom: 1px solid rgb(13 150 141 / 0.45);
}
.rd-rank__row .pw { display: grid; justify-items: center; }
.rd-rank__row.is-scorer { background: rgb(232 163 58 / 0.22); }
.rd-rank__name { font-weight: 700; font-size: var(--fs-sm); line-height: 1.15; overflow-wrap: anywhere; }
.rd-rank__bar { height: 0.45rem; overflow: hidden; background: var(--p-paper-3); border-radius: var(--r-round); box-shadow: inset 0 0 0 1px rgb(15 15 18 / 0.35); }
.rd-rank__bar i { display: block; height: 100%; background: var(--p-teal-deep); border-radius: inherit; }
.rd-rank__row[data-pc] .rd-rank__bar i { background: var(--pc, var(--p-teal-deep)); box-shadow: inset 0 0 0 1px rgb(15 15 18 / 0.55); }
.rd-rank__score { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-md); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.rd-rank__score em { font-style: normal; color: var(--p-red-ink); }

.rd-clues { min-width: 0; }
.rd-clues summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  padding-bottom: 0.4rem;
  list-style: none;
  cursor: pointer;
}
.rd-clues summary::-webkit-details-marker { display: none; }
.rd-clues summary::after {                       /* drawn chevron: the list opens and closes */
  content: '';
  flex: none;
  align-self: center;
  width: 0.8rem;
  height: 0.6rem;
  background: var(--p-teal-ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform var(--dur-2) var(--ease-out);
}
.rd-clues[open] summary::after { transform: rotate(180deg); }
.rd-clues__count { margin-left: auto; }
.rd-clues__title { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-sm); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--p-teal-ink); }
.rd-clues__count { font-size: var(--fs-xs); color: var(--p-muted); }
.rd-clues summary:focus-visible { outline: 3px solid var(--p-focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--p-black); }
.rd-lines { max-height: max(14rem, calc(100dvh - 26rem)); margin: 0; padding: 0 0.4rem 0 0; overflow: auto; list-style: none; scrollbar-width: thin; }
.rd-lines li {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgb(13 150 141 / 0.45);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.rd-lines__n {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  align-self: start;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-xs);
  font-variant-numeric: lining-nums;
  color: var(--p-muted);
  border: 1px solid rgb(90 77 94 / 0.55);
  border-radius: var(--r-1);
}
.is-open .rd-lines__n { color: var(--p-aqua-3); background: var(--p-open-face); border-color: var(--p-black); }
.is-open .rd-lines__t { color: var(--p-ink); }
.is-closed .rd-lines__t { color: var(--p-muted); }
.rd-lines__tag { display: inline-flex; align-items: center; gap: 0.35rem; align-self: start; padding-top: 0.2rem; color: var(--p-teal-ink); }
.rd-lines__tag .p-ic { width: 0.95rem; height: 0.95rem; }

/* ==========================================================================
   7. End of game: podium on the ink panel
   ========================================================================== */
.p-modal--lid {
  --card-band: 1.5rem;
  width: min(40rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--p-cream);
  text-align: center;
  background: var(--p-black);
  box-shadow: inset 0 0 0 1px var(--p-violet), inset 0 0 0 5px var(--p-black), inset 0 0 0 6px var(--p-violet-2),
    0 0 0 2px var(--p-orange), 0 0 0 5px var(--p-black), 0 30px 60px -12px rgb(15 15 18 / 0.7);
}
.p-modal--lid::before {
  height: var(--card-band);
  background: var(--p-teal-deep) var(--img-mosaic) center / 48px 84px repeat-x;
  border-bottom: 2px solid var(--p-orange-2);
}
.en { padding: calc(var(--card-band) + 1.6rem) clamp(1rem, 4vw, 2.4rem) 0; }
.en-kicker { margin: 0; font-family: var(--font-label); font-weight: 600; font-size: var(--fs-xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--p-orange); }
.en-title {
  margin: 0.4rem 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: 0.015em;
  color: var(--p-cream);
  -webkit-text-stroke: var(--poiret-boost) currentColor;
  overflow-wrap: anywhere;
  text-wrap: balance;
  outline: none;
}
.en-sub { max-width: 32rem; margin: 0 auto var(--sp-5); font-size: var(--fs-md); line-height: 1.45; color: var(--p-aqua-3); text-wrap: balance; }
.en-podium { display: flex; align-items: flex-end; justify-content: center; gap: 0.6rem; margin: 0 0 var(--sp-5); }
.en-step { display: grid; justify-items: center; gap: 0.3rem; width: min(30%, 9.5rem); }
.en-step__pawn { display: block; line-height: 0; }
.en-step--one .en-step__pawn { animation: scr-bob var(--dur-loop) var(--ease-in-out) infinite; }
.en-step__name { max-width: 100%; font-weight: 700; font-size: var(--fs-sm); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.en-step__block {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.15rem;
  width: 100%;
  padding-top: 0.6rem;
  color: var(--p-black);
  border: 2px solid var(--p-black);
  border-bottom: 0;
  border-radius: var(--r-2) var(--r-2) 0 0;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), inset 0 0 0 3px rgb(244 235 173 / 0.0);
}
.en-step__block b { font-family: var(--font-label); font-weight: 600; font-size: 2rem; line-height: 1; font-variant-numeric: lining-nums; }
.en-step__block small { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; }
.en-step--one .en-step__block { height: 7.6rem; background: linear-gradient(180deg, var(--p-gold-glow), var(--p-orange) 60%, var(--p-gold-lo)); }
.en-step--two .en-step__block { height: 5.6rem; background: linear-gradient(180deg, var(--p-aqua-hi), var(--p-teal) 70%, var(--p-teal-lo)); }
.en-step--three .en-step__block { height: 4.2rem; background: linear-gradient(180deg, var(--p-pink-hi), var(--p-pink-soft) 70%, var(--p-pink)); }
.en-podium--solo { flex-direction: column; align-items: center; gap: 0.5rem; }
.en-podium--solo .en-step__pawn { animation: scr-bob var(--dur-loop) var(--ease-in-out) infinite; }
.en-solo {
  width: 9rem;
  height: auto;
  padding: 0.5rem 0 0.6rem;
  border: 2px solid var(--p-black);
  border-radius: var(--r-2);
  background: linear-gradient(180deg, var(--p-gold-glow), var(--p-orange) 60%, var(--p-gold-lo));
}
@keyframes scr-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.4rem); } }

.en-rank { display: grid; gap: 0.35rem; margin: 0; padding: 0; text-align: left; list-style: none; }
.en-rank__row {
  display: grid;
  grid-template-columns: 2.6rem 1.9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 0.7rem;
  min-height: 2.9rem;
  padding: 0.25rem 0.9rem 0.25rem 0.5rem;
  background: rgb(87 69 102 / 0.22);
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px var(--p-violet);
}
.en-rank__row .pw { display: grid; justify-items: center; }
.en-rank__row.is-winner { color: var(--p-black); background: linear-gradient(180deg, var(--p-gold-glow), var(--p-orange) 70%, var(--p-gold-lo)); box-shadow: inset 0 1px 0 rgb(255 252 235 / 0.8), 0 0 0 1px var(--p-black); }
.en-rank__place { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-lg); text-align: center; font-variant-numeric: lining-nums; }
.en-rank__name { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.en-rank__score { font-family: var(--font-label); font-weight: 600; font-size: var(--fs-md); letter-spacing: 0.04em; font-variant-numeric: lining-nums tabular-nums; }
.en .notice--inline { color: var(--p-cream); background: rgb(87 69 102 / 0.3); box-shadow: inset 0 0 0 1px var(--p-violet); text-align: left; }
.en .p-modal__actions { justify-content: center; margin-block: var(--sp-5) var(--sp-5); }

/* ==========================================================================
   8. Pawn wrapper (picker, podium, rankings)
   ========================================================================== */
.pw { display: inline-block; line-height: 0; vertical-align: bottom; }
.pw > * { display: block; }

/* ==========================================================================
   9. Entrances and small screens
   ========================================================================== */
@keyframes scr-lid-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .lid { --mosaic: 88px; }
}

@media (max-width: 899px) {
  .rd-grid { grid-template-columns: minmax(0, 1fr); }
  .rd-lines { max-height: none; overflow: visible; padding-right: 0; }
  .setup-form { grid-template-columns: minmax(0, 1fr); }
  .setup-form { display: flex; flex-direction: column; align-items: stretch; }
  .setup-col { display: contents; }
  .step--players { order: 1; }
  .step--goal { order: 2; }
  .step--kits { order: 2; }
  .step--diff { order: 3; }
  .step--fronts { order: 4; }
  .step--extras { order: 5; }
  .setup-foot { order: 6; }
  .setup-head__logo { display: none; }
  .setup-head { grid-template-columns: auto minmax(0, 1fr); }
  .setup-foot { grid-template-columns: minmax(0, 1fr) auto; bottom: 0.5rem; }
  .setup-status { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 760px) {
  .rules { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .rule { grid-template-columns: minmax(0, 1fr); }
  .rule__art { min-height: 5.4rem; }
}

@media (max-width: 640px) {
  .lid { --mosaic: 64px; padding-top: 1.6rem; padding-inline: 0.75rem; }
  .lid__seal { position: static; order: -1; grid-template-columns: auto auto; align-items: baseline; gap: 0.6rem; padding: 0.4rem 0.8rem; }
  .lid__seal b { font-size: 1.25rem; }
  .lid__qmark { display: none; }
  .lid__plate { --hex-cut: 9%; padding-inline: 1.9rem; }
  .lid__tray { padding: 0.9rem; }
  .lid__tray .p-btn { flex: 1 1 100%; }
  .lid__facts .p-plaque { padding: 0.5em 0.8em; }

  .setup-head { gap: 0.8rem; }
  .setup-title { font-size: var(--fs-3xl); }
  .step.p-panel, .step--players { padding-inline: var(--sp-4); }
  .step__head { grid-template-columns: auto minmax(0, 1fr); }
  .step__tools { grid-column: 1 / -1; justify-content: flex-start; }
  .player-row { grid-template-columns: minmax(0, 1fr) var(--tap); }
  .player-row__pawn { grid-column: 1 / -1; grid-row: 2; }
  .player-row__pawn .p-field__label { display: none; }
  .pawn-pick { justify-content: space-between; }
  .pawn-pick__opt { width: 2.9rem; }
  .plaques--diff { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fronts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .front-chip { align-items: center; padding-inline: 0.55rem; gap: 0.4rem; font-size: var(--fs-xs); }
  .front-chip::before { width: 0.9em; height: 0.9em; }
  .front-chip__ico { width: 1.6rem; height: 1.6rem; font-size: 0.9rem; }
  .front-chip .p-chip__count { display: none; }
  .kits { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .kit-chip { min-height: 3.6rem; }
  .setup-foot { grid-template-columns: auto minmax(0, 1fr); bottom: 0.5rem; padding: 0.7rem 0.8rem; }
  .setup-status { grid-column: 1 / -1; grid-row: 1; font-size: var(--fs-xs); }
  .deck__stack { width: 3.2rem; }
  .deck__count { font-size: 1.6rem; }
  .setup-start { width: 100%; }
  .setup-foot .deck { grid-row: 2; grid-column: 1 / -1; }
  .setup-foot .setup-start { grid-row: 3; grid-column: 1 / -1; padding-inline: 1rem; }

  .p-modal { padding-inline: var(--sp-4); }
  .p-modal--card, .p-modal--lid { padding-inline: 0; }
  .rd-answer-wrap { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .rd-stamp { width: 5.4rem; height: 4.9rem; padding-top: 0.55rem; }
  .rd-stamp b { font-size: 1.7rem; }
  .rd-rank__row { grid-template-columns: 1.7rem minmax(0, 7rem) minmax(0.5rem, 1fr) auto; gap: 0 0.5rem; }
  .en-step { width: min(31%, 8rem); }
  .en-rank__row { grid-template-columns: 2.2rem 1.9rem minmax(0, 1fr) auto; padding-right: 0.6rem; }
}

@media (min-width: 640px) and (max-height: 840px) {
  .lid__plate { padding-block: 1.3rem 1.1rem; }
}
/* 320px: six pawns of 46px do not fit one row inside the card, so they take two rows of three */
@media (max-width: 359px) {
  .pawn-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; row-gap: 0.2rem; }
  /* the longest words of the fronts ("Streaming", "Momentos") must not touch the chip's border */
  .front-chip { padding-inline: 0.4rem; gap: 0.3rem; }
  .front-chip__ico { width: 1.4rem; height: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lid, .rd-stamp, .toast, .toast.is-leaving, .en-step--one .en-step__pawn, .en-podium--solo .en-step__pawn { animation: none; }
  .pawn-pick__piece, .p-switch__ui, .p-switch__ui::after, .menu-item { transition-duration: 1ms; }
  .pawn-pick__opt:hover .pawn-pick__piece { transform: none; }
}

@media (forced-colors: active) {
  .pq__face, .menu-item, .toast, .notice { border: 2px solid ButtonText; }
  .pawn-pick__opt:has(:checked) { outline: 3px solid Highlight; }
  .p-switch__ui { border: 2px solid ButtonText; }
}
