/* ==========================================================================
   ESA ARCADE - Participants, Normal / Evil variants, Guests
   The Evil look's numbers come from js/variants.js (CSS custom properties
   --evil-*), so menus and gameplay share one definition.
   ========================================================================== */

/* --------------------------------------------------------------------------
   EVIL - DOM treatment (matches the cached canvas used in games)
   -------------------------------------------------------------------------- */
.is-evil-art { filter: var(--evil-tone, brightness(.8) contrast(1.16) saturate(.84)); }
.art-frame.is-evil > .art-img {
  filter: var(--evil-tone, brightness(.8))
          drop-shadow(0 0 var(--evil-rim, 2px) var(--evil-rim-color, var(--x-e21a3e-a85)))
          drop-shadow(0 0 var(--evil-haze, 9px) var(--evil-haze-color, var(--x-701280-a55)));
}
.vs-art.is-evil { --evil-rim: 3px; --evil-haze: 20px; }
.fn-art.is-evil, .ch-art.is-evil { --evil-rim: 3px; --evil-haze: 16px; }

/* Overlay: no z-index, so the glows SCREEN-blend with the art beneath. */
.evil-eyes { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.evil-eyes.is-head::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--x-e21a3e-a45), inset 0 -8px 16px var(--x-701280-a42);
}
.ee-eye {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: var(--ee-a, 1);
}
.ee-eye::before {                     /* bloom: 2.5x the pupil glow */
  content: "";
  position: absolute;
  inset: -75%;
  border-radius: 50%;
  background: var(--evil-bloom);
  mix-blend-mode: screen;
}
.ee-eye::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--evil-iris);
}
.ee-lens {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--evil-lens);
  mix-blend-mode: screen;
}
.ee-lens.is-soft { opacity: .7; }
.ee-debug {                            /* index.html?eyes only */
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--x-00ffe1);
  border-radius: 50%;
}

/* "EVIL" in names */
.evil-word {
  color: var(--x-ff4d5e);
  text-shadow: 0 0 10px var(--x-e21a3e-a55);
}
.vs-half.is-evil .vs-name .evil-word { text-shadow: 0 0 18px var(--x-e21a3e-a80), 0 3px 0 var(--x-030b16-a80); }

/* --------------------------------------------------------------------------
   Roster tiles: Guest + "Add Guest" (Casual and Tournament)
   -------------------------------------------------------------------------- */
.cs-tile-name, .ps-tile-name {
  max-width: var(--tile);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guest-tag {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--x-2a1a02);
  background: var(--gold-400);
  box-shadow: 0 2px 0 var(--x-000000-a40);
  pointer-events: none;
}
/* Delete Guest (js/menus.js confirmDeleteGuest): a small trash button in the
   tile's top corner - findable, but too small and too far from the centre
   to hit by accident, and it always asks first. Tournament tiles use the
   top-left corner (their check mark owns the top-right). */
.guest-del {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--x-ffc9c2);
  background: var(--x-040d19-a80);
  border: 1px solid var(--x-ff8a80-a50);
  box-shadow: 0 2px 0 var(--x-000000-a45);
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s var(--ease-out);
}
.guest-del svg { width: 13px; height: 13px; pointer-events: none; }
.ps-tile .guest-del { right: auto; left: 5px; }
@media (hover: hover) {
  .guest-del:hover { color: var(--x-ffffff); background: var(--x-b8323a); transform: scale(1.1); }
}
body.is-touch .guest-del { width: 28px; height: 28px; -webkit-tap-highlight-color: transparent; }
body.is-touch .guest-del svg { width: 15px; height: 15px; }

.is-add .cs-tile-img, .is-add .ps-tile-img {
  display: grid;
  place-items: center;
  background: var(--x-05101f-a55);
  border: 3px dashed var(--x-f3c35a-a50);
  filter: none;
}
.is-add .cs-tile-name, .is-add .ps-tile-name { color: var(--gold-300); }
.add-plus { position: relative; display: block; width: 34%; aspect-ratio: 1; }
.add-plus::before, .add-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 4px;
  background: var(--gold-400);
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 0 var(--x-000000-a45);
}
.add-plus::before { width: 100%; height: 16%; }
.add-plus::after { width: 16%; height: 100%; }
@media (hover: hover) {
  .is-add:hover .cs-tile-img, .is-add:hover .ps-tile-img { border-color: var(--gold-300); }
}

/* Casual: P1 / P2 badge turns crimson on an Evil pick. */
.cs-tile.evil-p1 .cs-cursor.p1, .cs-tile.evil-p2 .cs-cursor.p2 { background: var(--x-b3122f); }
.cs-tile.evil-p1 .cs-cursor.p1::before, .cs-tile.evil-p2 .cs-cursor.p2::before { content: "EVIL "; color: var(--x-ffd0d6); }
.cs-tile.evil-p1 .cs-cursor.p1 { box-shadow: 0 3px 0 var(--x-000000-a50), inset 0 0 0 2px var(--p1); }
.cs-tile.evil-p2 .cs-cursor.p2 { box-shadow: 0 3px 0 var(--x-000000-a50), inset 0 0 0 2px var(--p2); }

/* --------------------------------------------------------------------------
   Casual side panel: Add Guest placeholder + NORMAL / EVIL control
   -------------------------------------------------------------------------- */
.cs-add-ph {
  display: none;
  position: absolute;
  inset: 10% 16% 8%;
  place-items: center;
  border-radius: 18px;
  border: 2px dashed var(--x-f3c35a-a50);
  background: var(--x-05101f-a40);
}
.cs-add-ph .add-plus { width: 30%; }
.cs-side.is-add .cs-add-ph { display: grid; }
.cs-side.is-add .cs-art { visibility: hidden; }

.cs-variant {
  display: flex;
  gap: 4px;
  width: 100%;
  padding: 3px;
  border-radius: 10px;
  background: var(--x-020810);
  border: 1px solid var(--x-f3c35a-a25);
}
.cs-side:not(.has-variants) .cs-variant,
.cs-side:not(.has-variants) .cs-vkeys { display: none; }
.cs-vbtn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 0 6px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  transition: background .14s, color .14s, box-shadow .14s;
}
@media (hover: hover) {
  .cs-vbtn:not(.is-on):not(.is-taken):hover { color: var(--cream); background: var(--x-ffffff-a6); }
}
.cs-vbtn.is-on { color: var(--x-2a1a02); background: linear-gradient(180deg, var(--x-fde7ae), var(--gold-500)); }
.cs-vbtn.is-evil.is-on {
  color: var(--x-ffffff);
  background: linear-gradient(180deg, var(--x-e2304f), var(--x-7a0c22));
  box-shadow: 0 0 14px var(--x-e21a3e-a55);
}
.cs-vbtn.is-taken { opacity: .45; }
.cs-vbtn.is-taken::after {
  content: attr(data-taken);
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--x-ffffff);
  background: var(--x-ffffff-a18);
}
.cs-variant.is-nudge { animation: confirmNudge .32s ease-out; }
.cs-vbtn:focus-visible { outline: 2px solid var(--p1); outline-offset: 1px; }

/* --------------------------------------------------------------------------
   Tournament: Normal / Evil pills on roster tiles
   -------------------------------------------------------------------------- */
.ps-vars {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 2;
  display: flex;
  gap: 3px;
  pointer-events: none;
}
.ps-vars i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted-dim);
  background: var(--navy-700);
  border: 1.5px solid var(--x-ffffff-a20);
  box-shadow: 0 2px 0 var(--x-000000-a45);
}
.ps-tile.has-normal .pv-n { color: var(--x-2a1a02); background: var(--gold-400); border-color: var(--x-fff1c8); }
.ps-tile.has-evil .pv-e { color: var(--x-ffffff); background: var(--x-c0142f); border-color: var(--x-ff8a98); box-shadow: 0 0 8px var(--x-e21a3e-a60); }
.is-fixed-grid .ps-vars { top: 5px; left: 5px; }
.is-fixed-grid .ps-vars i { width: 20px; height: 20px; font-size: 10px; }

/* Count: "12 / 25" */
.ps-count { gap: 10px; }
.ps-count .ps-count-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cream);
}
.ps-count b { white-space: nowrap; padding: 4px 10px; }
.ps-count b span { font: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.ps-count b i { font-style: normal; font-size: 20px; color: var(--muted); }
.ps-count b #psMax { font-size: 20px; color: var(--muted); }
.ps-count.is-full b { color: var(--x-ffb4ad); box-shadow: inset 0 0 12px var(--x-e8584f-a45); }
.ps-note.is-full { color: var(--x-ffd0cb); background: var(--x-e8584f-a12); border-color: var(--x-e8584f-a60); }

/* Selected participants: compact chips, never a wall */
.ps-picked-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 4px;
}
.ps-picked-label {
  flex: none;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.ps-picked {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 82px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 3px 2px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.ps-picked.is-empty { align-items: center; font-size: 13px; color: var(--muted-dim); }
.ps-chip {
  --cc: var(--gold-500);
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  height: 34px;
  padding: 0 9px 0 4px;
  border-radius: 17px;
  background: var(--x-05101f-a88);
  border: 1.5px solid color-mix(in srgb, var(--cc) 65%, transparent);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color .14s, background .14s;
}
.ps-chip .t-face.xs { width: 26px; height: 26px; }
.ps-chip .pc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ps-chip .pc-x { flex: none; font-size: 17px; line-height: 1; color: var(--muted); }
.ps-chip.is-evil { background: var(--x-1c050e-a90); }
@media (hover: hover) {
  .ps-chip:hover { border-color: var(--danger); }
  .ps-chip:hover .pc-x { color: var(--danger); }
}

/* --------------------------------------------------------------------------
   Normal / Evil sheet (Tournament)
   -------------------------------------------------------------------------- */
.modal-card.variant-sheet { width: min(620px, 100%); gap: 14px; }
.vsh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vsh-opt {
  --cc: var(--gold-400);
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 12px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--cc) 34%, var(--navy-600)), var(--x-050f1d) 76%);
  border: 2px solid var(--x-ffffff-a12);
  box-shadow: 0 6px 0 var(--x-020810);
  transition: transform .14s var(--ease-out), border-color .14s, box-shadow .14s;
}
.vsh-opt.is-evil { background: radial-gradient(circle at 50% 36%, var(--x-961030-a55), var(--x-12040b) 78%); }
.vsh-opt.is-focus { border-color: var(--x-4aa3ff-a80); }
.vsh-opt.is-on { border-color: var(--gold-400); box-shadow: 0 6px 0 var(--x-020810), 0 0 22px var(--x-f3c35a-a45); }
.vsh-opt.is-evil.is-on { border-color: var(--x-ff4d5e); box-shadow: 0 6px 0 var(--x-020810), 0 0 26px var(--x-e21a3e-a55); }
@media (hover: hover) { .vsh-opt:hover { transform: translateY(-3px); } }
.vsh-art { width: 100%; height: clamp(150px, 30vh, 260px); display: flex; align-items: flex-end; justify-content: center; }
.vsh-figure.art-frame { --cap-h: 100cqh; --cap-w: 92cqw; }
.vsh-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
}
.vsh-status {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.vsh-opt.is-on .vsh-status { color: var(--gold-300); }
.vsh-opt.is-evil.is-on .vsh-status { color: var(--x-ff8a98); }
.vsh-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vsh-count { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.vsh-done { min-width: 140px; }

/* --------------------------------------------------------------------------
   Guest creator
   -------------------------------------------------------------------------- */
.modal-card.guest-creator {
  width: min(860px, 100%);
  max-height: calc(var(--view-h, 100dvh) - 40px);
  gap: 14px;
  padding: 18px 20px 16px;
  text-align: left;
}
.modal-card.guest-creator[data-step="name"] { width: min(520px, 100%); }
.modal-card.guest-creator[data-step="random"] { width: min(460px, 100%); }
.gc-head { position: relative; text-align: center; padding: 0 44px; }
.gc-close { position: absolute; right: -8px; top: -6px; width: 40px; height: 40px; min-height: 40px; padding: 0; font-size: 16px; }
.gc-name { display: flex; flex-direction: column; gap: 7px; }
.gc-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.gc-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--x-020810);
  border: 2px solid var(--x-f3c35a-a45);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  outline: none;
}
.gc-input:focus { border-color: var(--gold-300); box-shadow: 0 0 0 3px var(--x-f3c35a-a25); }
.gc-input::placeholder { color: var(--x-8ba2bd-a50); }
.gc-hint { font-size: 12px; color: var(--muted); }
.gc-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gc-choice {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: normal;
}
.gc-choice b { font-size: 16px; letter-spacing: .1em; text-transform: uppercase; }
.gc-choice small { font-size: 11px; font-weight: 500; letter-spacing: .03em; text-transform: none; opacity: .8; }

.gc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; min-height: 0; }
.gc-layout.is-random { grid-template-columns: 1fr; justify-items: center; }
.gc-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gc-stage {
  position: relative;
  width: 220px;
  height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 38%, var(--x-f3c35a-a26), var(--navy-800) 72%);
  border: 2px solid var(--x-f3c35a-a35);
}
.gc-art {
  height: 92%;
  width: auto;
  max-width: none;
  filter: drop-shadow(0 10px 14px var(--x-000000-a50));
  animation: idleBob 3.2s ease-in-out infinite;
}
.gc-ouch {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 31%;
  width: auto;
  max-width: none;
  padding: 3px;
  border-radius: 10px;
  background: var(--x-020810-a65);
  border: 1px solid var(--x-ffffff-a12);
}
.gc-plate { text-align: center; min-width: 0; }
.gc-plate small {
  display: block;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.gc-plate b {
  display: block;
  max-width: 236px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
}
.gc-rows {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  max-height: min(56vh, 460px);
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  overscroll-behavior: contain;
}
.gc-row { display: flex; flex-direction: column; gap: 6px; }
.gc-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.gc-swatch {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--sw);
  border: 3px solid var(--x-ffffff-a20);
  box-shadow: 0 3px 0 var(--x-000000-a45);
  transition: transform .12s var(--ease-back), border-color .12s;
}
.gc-swatch.is-on { border-color: var(--gold-300); box-shadow: 0 0 0 3px var(--x-f3c35a-a35), 0 3px 0 var(--x-000000-a45); transform: scale(1.08); }
.gc-chip {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 17px;
  background: var(--navy-700);
  border: 2px solid var(--x-ffffff-a14);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.gc-chip.is-on { color: var(--x-2a1a02); background: linear-gradient(180deg, var(--x-fde7ae), var(--gold-500)); border-color: var(--x-fff1c8); }
@media (hover: hover) {
  .gc-chip:not(.is-on):hover { color: var(--cream); border-color: var(--x-f3c35a-a50); }
  .gc-swatch:not(.is-on):hover { transform: scale(1.06); border-color: var(--x-ffffff-a50); }
}
.gc-swatch:focus-visible, .gc-chip:focus-visible, .gc-choice:focus-visible { outline: 3px solid var(--p1); outline-offset: 2px; }
.gc-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.gc-foot .is-primary { min-width: 170px; }

/* --- Touch: comfortable, safe-area aware sheets ----------------------- */
body.is-touch:not([data-state="play"]) #modalLayer {
  padding: calc(var(--sa-t) + 10px) calc(var(--sa-r) + 10px) calc(var(--sa-b) + 10px) calc(var(--sa-l) + 10px);
}
body.is-touch .modal-card.guest-creator,
body.is-touch .modal-card.variant-sheet {
  max-height: calc(var(--view-h) - var(--sa-t) - var(--sa-b) - 20px);
}
body.is-touch .gc-swatch { width: 40px; height: 40px; }
body.is-touch .gc-chip { min-height: 42px; padding: 0 14px; }
body.is-touch .gc-foot .btn, body.is-touch .vsh-done { min-height: 48px; }
body.is-touch .cs-vbtn { min-height: 40px; }
body.is-touch .ps-chip { height: 38px; }
/* Phones: chips scroll sideways in one row instead of stacking up. */
body.is-touch .ps-picked { flex-wrap: nowrap; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }

/*
 * Phones: the Customize sheet is three fixed regions and nothing overlaps:
 *   TOP     guest preview + nickname (shrinks once the options scroll)
 *   MIDDLE  the options - the ONLY scrolling part, bounded by the regions
 *           above and below, so no row can ever sit under the buttons
 *   BOTTOM  one solid action tray: BACK · RANDOMIZE · ADD GUEST, padded
 *           for the home indicator (safe-area inset)
 */
@media (max-width: 720px) {
  .modal-card.guest-creator { padding: 14px 14px 12px; gap: 10px; }
  .modal-card.guest-creator[data-step="custom"] {
    height: calc(var(--view-h, 100dvh) - var(--sa-t, 0px) - var(--sa-b, 0px) - 20px);
    overflow: hidden;
    padding: 12px 12px 0;
    gap: 8px;
  }
  .gc-layout { grid-template-columns: 1fr; gap: 10px; }
  .gc-layout:not(.is-random) { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 8px; }
  .gc-layout:not(.is-random) .gc-preview {
    flex: none;
    flex-direction: row;
    justify-content: center;
    gap: 14px;
    padding: 6px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--x-0d2f52), var(--x-071a30));
    border: 1px solid var(--x-f3c35a-a25);
  }
  .gc-layout:not(.is-random) .gc-stage { width: 104px; height: 140px; padding-bottom: 6px; transition: width .2s var(--ease-out), height .2s var(--ease-out); }
  .guest-creator.is-scrolled .gc-layout:not(.is-random) .gc-stage { width: 62px; height: 84px; padding-bottom: 3px; }
  .guest-creator.is-scrolled .gc-ouch { display: none; }
  .gc-layout:not(.is-random) .gc-plate { text-align: left; min-width: 0; }
  .gc-layout:not(.is-random) .gc-plate b { max-width: 52vw; font-size: 20px; }
  .gc-layout:not(.is-random) .gc-rows {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 2px 2px 14px;
    -webkit-overflow-scrolling: touch;
  }
  .gc-foot {
    flex: none;
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 8px;
    margin: 0 -12px;
    padding: 10px 12px calc(10px + var(--sa-b, 0px));
    background: var(--x-040d19);
    border-top: 1px solid var(--x-f3c35a-a30);
    border-radius: 0 0 16px 16px;
  }
  .gc-foot .btn { min-width: 0; min-height: 46px; padding: 0 8px; font-size: 13px; letter-spacing: .06em; white-space: nowrap; }
  .gc-foot .is-primary { min-width: 0; }
  .modal-card.guest-creator[data-step="random"] .gc-foot { margin: 0 -14px -12px; }
  /* Photo crop: BACK · DIFFERENT PHOTO share row 1, USE THIS PHOTO gets
     the full second row - no squeezed labels at phone widths. */
  .gc-foot.is-crop { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 0 -14px -12px; }
  .gc-foot.is-crop .is-primary { grid-column: 1 / -1; }
  .gc-foot.is-crop .btn { white-space: normal; line-height: 1.15; overflow-wrap: anywhere; }
  .gc-choices { grid-template-columns: 1fr; }
  .vsh-art { height: clamp(140px, 28vh, 220px); }
  .vsh-name { font-size: 15px; letter-spacing: .1em; }
}

/* Casual on phones (portrait): the side panels grow while a pick is being
   confirmed, so the NORMAL / EVIL preview stays visible above the controls. */
@media (orientation: portrait) {
  body.is-touch .cs-stage .cs-side { transition: height .2s var(--ease-out); }
  body.is-touch .cs-stage.has-pending .cs-side { height: clamp(250px, 37vh, 330px); }
}

@media (prefers-reduced-motion: reduce) {
  .gc-art { animation: none; }
  .cs-variant.is-nudge { animation: none; }
}

/* Rosters that grow with guests scroll; corner badges keep headroom and an
   overflowing grid never centres its first row out of reach. */
.ps-roster { padding: 10px 10px 4px; }
.cs-roster-wrap, .ps-roster-wrap { place-items: safe center; }
.ps-roster.is-fixed-grid { padding: 0; }   /* touch grids keep badges inside the cards */

/* Tablet landscape (touch): the P1 / P2 panels sit beside the roster. With
   many guests the roster grows tall, so the panels keep a screen-sized
   height and stay pinned while the roster scrolls - the preview and the
   NORMAL / EVIL / CONFIRM controls never slide out of view. */
@media (orientation: landscape) and (min-height: 561px) {
  body.is-touch .cs-stage > .cs-side {
    align-self: start;
    position: sticky;
    top: calc(var(--sa-t) + 58px);
    height: calc(var(--view-h) - var(--sa-t) - var(--sa-b) - 150px);
    min-height: 320px;
  }
}

/* Phone portrait: Start gets its own full-width row; helpers share one. */
@media (orientation: portrait) {
  body.is-touch .ps-actions { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
  body.is-touch .ps-actions .btn-small { flex: 1 1 0; min-height: 44px; }
  body.is-touch .ps-actions #psStartBtn { flex: 1 1 100%; min-height: 50px; order: 2; }
}

/* --------------------------------------------------------------------------
   V4.1 Guest face photo (all local - see js/guests.js)
   -------------------------------------------------------------------------- */
.gc-choices .gc-photo-choice { grid-column: 1 / -1; }
.gc-file { display: none; }
.gc-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 10px; }
.gc-photo-pick { width: 100%; }
/* Only one way in (no camera capture on this device): one centred button,
   never a half-width button beside an empty column. */
.gc-photo-pick.is-single { grid-template-columns: minmax(0, 1fr); width: min(100%, 340px); }
.gc-photo-note { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.4; max-width: 34em; }
.gc-photo-row .gc-photo-note { text-align: left; margin-top: 4px; }
.gc-photo-thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-400); }
.gc-photo-row .gc-opts { align-items: center; }
.gc-crop-wrap {
  position: relative;
  width: min(260px, 70vw);
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--x-050f1c);
  touch-action: none;
  border: 2px solid var(--x-f3c35a-a50);
}
.gc-crop { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.gc-crop:active { cursor: grabbing; }
/* The face oval (same 148:160 shape the avatar uses); outside is dimmed. */
.gc-crop-mask {
  position: absolute;
  left: 3.75%;
  right: 3.75%;
  top: 0;
  bottom: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px var(--x-030b16-a62);
  outline: 2px dashed var(--x-fdeec4-a80);
  outline-offset: -2px;
  pointer-events: none;
}
.gc-zoom { display: flex; align-items: center; gap: 10px; width: min(260px, 70vw); font-size: 12px; color: var(--muted); }
.gc-zoom input { flex: 1; accent-color: var(--gold-400); }
