/* Family Deck. The page is built like the deck box: the Smile Red sleeve is
   the stage (headline, the dealt hand, the big reveals), the cream drawer is
   where people work (names, card choices, progress). Story Blue carries text,
   Gold is a small accent only. Card faces are always the real printed shells. */

:root {
  color-scheme: light;
  --accent: #c42a1d;
  --accent-deep: #a52317;
  --ink: #173b57;
  --ink-soft: #4b6173;
  --cream: #fff8f1;
  --paper: #ffffff;
  --gold: #b9934b;
  --line: #eadfd3;
  --on-red: #fce3dd;
  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lattice:
    repeating-linear-gradient(45deg, rgba(255, 248, 241, 0.085) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(-45deg, rgba(255, 248, 241, 0.085) 0 1px, transparent 1px 24px);
  --ease-out: cubic-bezier(0.2, 0.85, 0.25, 1);
  --shadow-ink: 0 18px 30px -18px rgba(23, 59, 87, 0.5);
  --shadow-red: 0 16px 28px -14px rgba(80, 10, 5, 0.7);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--cream);
}

img {
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.stage :focus-visible {
  outline-color: var(--cream);
}

svg {
  flex: none;
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ─── Buttons ─────────────────────────────────────────────── */

.primary-button,
.ghost-button,
.stage-button,
.stage-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
}

.primary-button {
  padding: 14px 26px;
  border: 0;
  background: var(--accent);
  color: var(--cream);
  font-size: 17px;
  box-shadow: 0 16px 28px -14px rgba(120, 22, 12, 0.6);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button:disabled {
  background: #d8c9bf;
  color: #6f6159;
  box-shadow: none;
  cursor: not-allowed;
}

.ghost-button {
  padding: 11px 18px;
  border: 1.5px solid rgba(23, 59, 87, 0.28);
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--ink);
}

.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost-button--block {
  width: 100%;
}

.text-button {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(23, 59, 87, 0.3);
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.text-button--danger {
  color: var(--accent-deep);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 59, 87, 0.07);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(23, 59, 87, 0.13);
}

/* Buttons that sit on the red stage. */
.stage-button {
  padding: 17px 28px;
  border: 0;
  background: var(--cream);
  color: var(--accent);
  font-size: 19px;
  box-shadow: var(--shadow-red);
}

.stage-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px -14px rgba(80, 10, 5, 0.75);
}

.stage-button:active {
  transform: translateY(1px);
}

.stage-ghost {
  padding: 13px 20px;
  border: 1.5px solid rgba(255, 248, 241, 0.6);
  background: transparent;
  color: var(--cream);
  font-size: 16px;
  font-weight: 600;
}

.stage-ghost:hover {
  border-color: var(--cream);
}

/* ─── Shell and header ────────────────────────────────────── */

.app-shell {
  max-width: 1344px;
  margin: 0 auto;
  padding: 0 48px 96px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.brand-words strong {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 85;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-words small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13px;
}

.steps {
  display: flex;
  gap: 4px;
}

/* Completed steps double as back-navigation; app.js guards the same rule. */
.step-dot {
  padding: 10px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 15.5px;
  font-weight: 600;
  pointer-events: none;
}

.step-dot.done {
  color: var(--ink);
  pointer-events: auto;
  cursor: pointer;
}

.step-dot.done:hover {
  background: rgba(23, 59, 87, 0.07);
}

.step-dot.active {
  background: var(--accent);
  color: var(--cream);
}

/* Once the whole deck is painting, the wizard only goes forward. */
.step-dot.locked {
  color: var(--ink-soft);
  opacity: 0.55;
  pointer-events: none;
}

.decks-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid rgba(23, 59, 87, 0.28);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s;
}

.decks-button:hover {
  border-color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  cursor: pointer;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-initials {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.profile-initials--lg {
  font-size: 24px;
}

/* ─── The red stage ───────────────────────────────────────── */

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  color: var(--cream);
  background-color: var(--accent);
  background-image:
    radial-gradient(ellipse 55% 70% at 70% 58%, rgba(255, 248, 241, 0.12), transparent 70%),
    var(--lattice);
  box-shadow: 0 34px 60px -34px rgba(120, 22, 12, 0.55);
}

/* Cream keyline inset from the edge, as on the printed card back. */
.stage::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 4;
  border: 1.5px solid rgba(255, 248, 241, 0.5);
  border-radius: 20px;
  pointer-events: none;
  transition: border-color 0.2s, border-width 0.2s;
}

.stage.is-dragover::before {
  border: 3px dashed var(--cream);
}

.stage-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 80;
  font-size: clamp(56px, 7vw, 104px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.stage-title--md {
  font-size: clamp(38px, 4.6vw, 66px);
  line-height: 0.95;
}

.stage-lede {
  margin-top: 24px;
  max-width: 32ch;
  color: var(--on-red);
  font-size: 20px;
  line-height: 1.5;
}

.stage-hint {
  margin-top: 16px;
  color: var(--on-red);
  font-size: 15px;
}

.stage--hero {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  gap: 24px;
  min-height: clamp(600px, calc(100svh - 120px), 720px);
  padding: 0 64px;
}

.stage-copy {
  position: relative;
  z-index: 3;
  padding: 104px 0 64px;
}

.stage-copy .stage-button {
  margin-top: 36px;
}

/* ─── The dealt hand ──────────────────────────────────────── */

.hand-stage {
  position: relative;
  min-height: 520px;
  perspective: 1600px;
}

.hand {
  --fan: 12deg;
  position: absolute;
  left: 50%;
  top: 150px;
  width: 0;
  height: 0;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  /* Flat on purpose: the hand leans as one piece, while the cards stack in
     plain z-index order inside it. With preserve-3d the cards shared one 3D
     space where z-index doesn't count, the browser couldn't settle which of
     two overlapping cards was on top while the hand leaned, and hover
     flickered between them as the mouse moved. */
  transform-style: flat;
  transition: transform 0.5s var(--ease-out);
}

.hand-card {
  position: absolute;
  left: -118px;
  top: 0;
  z-index: var(--z, 1);
  width: 236px;
  aspect-ratio: 63.5 / 89;
  rotate: calc(var(--o, 0) * var(--fan));
  transform-origin: 50% 165%;
  animation: deal-in 0.9s var(--ease-out) backwards;
  animation-delay: calc(140ms + var(--i, 0) * 110ms);
}

/* The card's own box never moves, so it stays a fixed hover target; only the
   face inside lifts. Lifting the box itself slid it out from under the
   pointer, which un-hovered it, dropped it back, and so on: the cards shook. */
.hand-lift {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transition: translate 0.25s var(--ease-out);
}

.hand-card:hover .hand-lift {
  translate: 0 -22px;
}

.hand-card .playing-card {
  filter: drop-shadow(0 26px 22px rgba(70, 8, 4, 0.5));
}

/* Solid (cream at 12% over Smile Red, pre-mixed) so the cards behind it never
   show through the "Your card" label. */
.hand-card--blank {
  display: block;
  pointer-events: auto;
  cursor: pointer;
}

.hand-card--blank .hand-lift {
  border-radius: 15px;
  background: #cb4336;
  box-shadow: inset 0 0 0 1.5px rgba(255, 248, 241, 0.55), 0 26px 30px -16px rgba(70, 8, 4, 0.55);
}

.hand-card--blank:hover .hand-lift {
  background: #cf4f43;
}

.blank-window {
  position: absolute;
  left: 13.4%;
  top: 9.3%;
  width: 73.2%;
  height: 81.2%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  border: 2px dashed rgba(255, 248, 241, 0.85);
  border-radius: 8px;
  color: var(--cream);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.blank-window small {
  max-width: 14ch;
  color: var(--on-red);
  font-size: 13.5px;
  font-weight: 500;
}

.blank-plus {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--accent);
  box-shadow: 0 10px 18px -8px rgba(70, 8, 4, 0.6);
}

@keyframes deal-in {
  from {
    translate: 440px -360px;
    rotate: 34deg;
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ─── Playing cards (real printed shells) ─────────────────── */

.playing-card {
  position: relative;
  width: 100%;
  aspect-ratio: 63.5 / 89;
  overflow: hidden;
  isolation: isolate;
  border-radius: 3.4%;
  filter: drop-shadow(0 14px 16px rgba(23, 59, 87, 0.22));
}

.card-shell {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.art-window {
  position: absolute;
  left: var(--inner-x);
  top: var(--inner-y);
  z-index: 2;
  width: var(--inner-width);
  height: var(--inner-height);
  overflow: hidden;
  border: 1px solid rgba(30, 27, 25, 0.62);
  border-radius: var(--inner-radius);
  background: #efe6dc;
}

.art-window img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.art-retry {
  border: 0;
  background: #fbe6e2;
  color: var(--accent-deep);
  cursor: pointer;
}

.art-retry:hover {
  background: #f7d4cd;
}

.playing-card.failed .art-window {
  border-color: var(--accent);
}

/* A face-down card shows the approved deck back. */
.playing-card.card-back {
  border-radius: 4.7% / 3.37%;
}

.card-back-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Painting: the card turns over slowly, back first, until its art lands. */
.playing-card.generating {
  animation: card-turn 2.4s ease-in-out infinite alternate;
}

@keyframes card-turn {
  from { transform: perspective(700px) rotateY(-56deg); }
  to { transform: perspective(700px) rotateY(-14deg); }
}

/* Assign screen: the person's photo sits in the window before it is painted. */
.art-person {
  filter: saturate(0.9);
}

.art-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1.5px dashed rgba(23, 59, 87, 0.3);
  border-radius: inherit;
  background: #f6efe7;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

/* ─── Upload: people ──────────────────────────────────────── */

.upload-flow .players {
  display: none;
}

.upload-flow.has-people .players {
  display: block;
}

.players {
  padding: 72px 0 16px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
}

.section-title {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 80;
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.section-sub {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 18px;
}

.players-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 34px 30px;
}

.person-card {
  position: relative;
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.person-photo {
  padding: 8px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(23, 59, 87, 0.06), 0 20px 30px -16px rgba(23, 59, 87, 0.45);
}

.person-card:nth-child(3n + 1) .person-photo { rotate: -3deg; }
.person-card:nth-child(3n + 2) .person-photo { rotate: 2deg; translate: 0 10px; }
.person-card:nth-child(3n) .person-photo { rotate: -1deg; translate: 0 -4px; }

.person-photo img,
.person-initials {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 7px;
  object-fit: cover;
}

.person-initials {
  display: grid;
  place-items: center;
  background: #f1e7dd;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
}

.person-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.person-name input {
  width: 100%;
  min-height: 40px;
  padding: 4px 0 6px;
  border: 0;
  border-bottom: 2px solid rgba(23, 59, 87, 0.22);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}

.person-name input::placeholder {
  color: rgba(23, 59, 87, 0.4);
}

.person-name input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.person-meta {
  padding: 0 4px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.35;
}

.person-meta.is-warning {
  color: var(--accent-deep);
}

.remove-person {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 6px 14px -4px rgba(23, 59, 87, 0.5);
  cursor: pointer;
}

.remove-person:hover {
  background: var(--accent);
}

.inline-status {
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font-weight: 600;
}

.inline-status.error {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ─── Shared page sections ────────────────────────────────── */

.page-head {
  padding: 36px 0 32px;
}

.page-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "wdth" 80;
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-wrap: balance;
}

.page-sub {
  margin-top: 14px;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 18px;
}

.mini-title {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.screen-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.screen-actions > :only-child {
  margin-left: auto;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px;
  border: 1.5px dashed rgba(23, 59, 87, 0.25);
  border-radius: 18px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
}

/* ─── Assign ──────────────────────────────────────────────── */

.style-picker {
  margin-bottom: 28px;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.style-option {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out);
}

.style-option:hover {
  border-color: rgba(23, 59, 87, 0.4);
}

.style-option img {
  grid-row: 1 / 3;
  width: 64px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.style-option-name {
  align-self: end;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.style-option-blurb {
  align-self: start;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.35;
}

.style-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 42, 29, 0.14);
}

.style-option.selected .style-option-name {
  color: var(--accent);
}

.assign-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.slot-groups {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.slot-group-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.slot-group-heading span + span {
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.slot-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px 24px;
}

.slot-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.slot-preview {
  width: 100%;
  max-width: 190px;
}

.slot-card:nth-child(odd) .slot-preview { rotate: -1.2deg; }
.slot-card:nth-child(even) .slot-preview { rotate: 1deg; }

.slot-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.slot-card select {
  width: 100%;
  max-width: 220px;
  min-height: 44px;
  padding: 10px 38px 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23173b57' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}

.slot-card select:focus-visible {
  border-color: var(--ink);
}

.slot-meta {
  color: var(--ink-soft);
  font-size: 13px;
}

.slot-meta.failed {
  color: var(--accent-deep);
  font-weight: 600;
}

.joker-gender {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.joker-gender-label {
  margin-right: 2px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.joker-gender-option {
  min-height: 36px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.joker-gender-option.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

/* Picked from the photo rather than by hand: the wand marks it, and the note
   below says what was read. Tapping either option makes it a manual choice. */
.joker-gender-option.is-auto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 0 3px rgba(185, 147, 75, 0.45);
}

.joker-gender-option.is-auto svg {
  color: #e6c98d;
}

.joker-gender-note {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.joker-gender-note.is-auto {
  color: var(--ink);
  font-weight: 600;
}

.joker-gender-note.is-warning {
  color: var(--accent-deep);
  font-weight: 600;
}

/* Auto-assign reads every face first; keep the button visibly busy. */
.ghost-button.is-busy {
  opacity: 0.6;
  cursor: progress;
}

/* ─── Preview (3 cards on the stage) ──────────────────────── */

.stage--showcase {
  padding: 56px 64px 64px;
}

.showcase-head {
  position: relative;
  z-index: 3;
  max-width: 680px;
  margin-bottom: 44px;
}

.preview-cards {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 240px));
  justify-content: center;
  gap: clamp(18px, 4vw, 52px);
}

.preview-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-card-wrap:nth-child(1) .playing-card { rotate: -3deg; }
.preview-card-wrap:nth-child(3) .playing-card { rotate: 3deg; }

.preview-card-wrap .playing-card {
  margin-bottom: 14px;
  filter: drop-shadow(0 26px 22px rgba(70, 8, 4, 0.5));
}

.preview-card-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.preview-card-status {
  color: var(--on-red);
  font-size: 14.5px;
}

.preview-card-error {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}

/* Notification switch on the Preview and Generate screens. */
.notify-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 15px;
}

.progress + .notify-bar {
  margin: -16px 0 36px;
  max-width: 560px;
}

.notify-bar svg {
  color: var(--ink);
}

.notify-text {
  flex: 1;
  min-width: 200px;
}

.notify-bar[data-state="granted"] svg {
  color: var(--gold);
}

.notify-bar[data-state="denied"] .notify-text {
  color: var(--accent-deep);
}

.notify-action {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.notify-action:hover {
  background: #0f2a40;
}

/* A painted card finishes its turn and lands face up: the back keeps turning
   past edge-on, the front lands with a small lift, then a single warm glint
   crosses the portrait. Re-renders resume it via the negative --reveal-at. */
.card-flip {
  position: relative;
  transform-style: preserve-3d;
  animation: card-flip-in 1.3s linear both;
  animation-delay: var(--reveal-at, 0ms);
}

.card-face {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.card-face--back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

.card-flip .art-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 236, 190, 0.6) 48%, transparent 66%);
  background-size: 260% 100%;
  /* The shine crosses the face while it swings in (from edge-on at ~550ms)
     and is gone before the card lands at 1.3s: the settled card is the
     finished product, with nothing over it. */
  animation: card-glint 0.6s ease-out both;
  animation-delay: calc(var(--reveal-at, 0ms) + 560ms);
}

/* Three beats, each with its own easing: the back keeps turning and gathers
   speed (it starts where the painting wobble sits, so there is no jump), the
   card passes edge-on and the front swings in with a small lift, then it
   settles flat. A single front-loaded curve made the back vanish in ~100ms. */
@keyframes card-flip-in {
  0% {
    transform: perspective(900px) rotateY(-215deg);
    animation-timing-function: cubic-bezier(0.45, 0.05, 0.75, 0.4);
  }
  42% {
    transform: perspective(900px) rotateY(-90deg) translateY(-4px);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  78% {
    transform: perspective(900px) rotateY(6deg) translateY(-8px);
    animation-timing-function: ease-in-out;
  }
  100% { transform: perspective(900px) rotateY(0deg) translateY(0); }
}

@keyframes card-glint {
  0% { background-position: 130% 0; opacity: 0; }
  20% { opacity: 1; }
  75% { opacity: 1; }
  100% { background-position: -130% 0; opacity: 0; }
}

/* ─── Generate ────────────────────────────────────────────── */

.progress {
  max-width: 560px;
  margin-bottom: 40px;
}

.progress-label {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(23, 59, 87, 0.12);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--gold);
  transition: width 0.6s var(--ease-out);
}

.card-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 34px 22px;
  perspective: 1200px;
}

.generation-card-wrap,
.result-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.generation-card-wrap .playing-card,
.result-card .playing-card {
  margin-bottom: 10px;
}

.card-table > :nth-child(4n + 1) .playing-card { rotate: -2deg; }
.card-table > :nth-child(4n + 2) .playing-card { rotate: 1.4deg; }
.card-table > :nth-child(4n + 3) .playing-card { rotate: -0.8deg; }
.card-table > :nth-child(4n) .playing-card { rotate: 2deg; }

.generation-card-label,
.result-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}

.generation-card-status,
.result-meta {
  color: var(--ink-soft);
  font-size: 14px;
}

.status-word {
  font-weight: 700;
}

.status-word.ok { color: var(--ink); }
.status-word.generating { color: var(--accent); }
.status-word.failed { color: var(--accent-deep); }

/* On the red stage every status reads in cream; red-on-red would vanish. */
.stage .status-word,
.stage .status-word.failed,
.stage .status-word.generating {
  color: var(--cream);
}

/* ─── Results ─────────────────────────────────────────────── */

.stage--results {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 40px;
  padding: 56px 64px;
}

.stage--results > * {
  position: relative;
  z-index: 3;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.result-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.change-card-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1.5px solid rgba(196, 42, 29, 0.45);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.change-card-button:hover {
  border-color: var(--accent);
  background: rgba(196, 42, 29, 0.06);
}

.ghost-link {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

/* ─── Modals ──────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 59, 87, 0.55);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(450px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 32px;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: 0 40px 80px -30px rgba(23, 59, 87, 0.6);
}

.modal-card--wide {
  width: min(660px, 100%);
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--cream);
}

.modal-title {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 85;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.modal-copy {
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 16px;
}

.modal-fineprint {
  color: var(--ink-soft);
  font-size: 13.5px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-form .primary-button {
  margin-top: 6px;
}

.field-label {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.field-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

.field-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 59, 87, 0.12);
}

.form-error {
  margin-top: 10px;
  color: var(--accent-deep);
  font-size: 14.5px;
  font-weight: 600;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.google-button:hover {
  border-color: rgba(23, 59, 87, 0.4);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.auth-terms-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.auth-terms-row a {
  color: var(--ink);
}

.terms-shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-sent {
  text-align: center;
}

.auth-sent .modal-icon {
  margin: 0 auto 14px;
}

.auth-sent-title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.source-photo-preview-wrap {
  margin-bottom: 16px;
}

.source-photo-preview-wrap img {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 14px;
  background: var(--paper);
  object-fit: contain;
}

.detected-faces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 14px;
}

.detected-face {
  position: relative;
  display: block;
  overflow: hidden;
  border: 3px solid var(--accent);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}

.detected-face.unchecked {
  border-color: var(--line);
  opacity: 0.5;
}

.detected-face input {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.detected-face img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.detected-face-warning {
  position: absolute;
  inset: auto 0 0;
  padding: 6px 8px;
  background: rgba(23, 59, 87, 0.88);
  color: var(--cream);
  font-size: 11.5px;
  line-height: 1.3;
}

/* ─── Profile ─────────────────────────────────────────────── */

.profile-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.profile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 59, 87, 0.45);
}

.profile-sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: min(410px, 100%);
  padding: 28px;
  overflow: auto;
  background: var(--cream);
  box-shadow: -30px 0 60px -30px rgba(23, 59, 87, 0.5);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
}

.profile-identity {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
}

.profile-email,
.profile-since {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-heading {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
}

.profile-empty {
  color: var(--ink-soft);
  font-size: 14px;
}

/* ─── Your decks ──────────────────────────────────────────── */

.decks-sheet {
  gap: 18px;
}

.decks-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.decks-top .profile-heading {
  margin: 0;
}

.new-deck-tile,
.deck-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease-out);
}

.new-deck-tile {
  border: 1.5px dashed rgba(196, 42, 29, 0.55);
  background: transparent;
  color: var(--ink);
}

.new-deck-tile:hover {
  border-color: var(--accent);
}

.new-deck-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--cream);
}

.new-deck-words,
.deck-words {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.new-deck-words strong,
.deck-words strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.deck-words strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-deck-words small,
.deck-words span,
.deck-words small {
  color: var(--ink-soft);
  font-size: 14px;
}

.deck-words small {
  font-size: 12.5px;
}

.decks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deck-tile {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.deck-tile:hover {
  border-color: rgba(23, 59, 87, 0.4);
  transform: translateY(-1px);
}

.deck-tile.is-current {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.deck-cover {
  flex: none;
  width: 54px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 8px 14px -10px rgba(23, 59, 87, 0.7);
}

.deck-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-badge {
  flex: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.deck-tile.is-current .deck-badge {
  color: var(--gold);
}

.results-remaining {
  margin: 0 0 28px;
}

.profile-more-section {
  margin-top: 8px;
}

.profile-delete-warning {
  margin-bottom: 12px;
  color: var(--accent-deep);
  font-weight: 600;
}

/* ─── Changing a finished card ────────────────────────────── */

.card-editor {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  width: min(760px, 100%);
}

.card-editor.is-comparing {
  grid-template-columns: minmax(0, 1fr);
}

.card-editor-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.card-editor-close[hidden] {
  display: none;
}

.card-editor-cards {
  display: grid;
  gap: 16px;
}

.card-editor-cards.is-compare {
  grid-template-columns: repeat(2, minmax(0, 210px));
  justify-content: center;
}

.card-editor-cards figure {
  margin: 0;
}

.card-editor-cards figcaption {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.card-editor-cards .is-new figcaption {
  color: var(--accent);
}

.card-editor-kicker {
  margin-bottom: 6px;
  padding-right: 48px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.photo-tip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.photo-tip .modal-icon {
  flex: none;
  margin: 0;
}

.photo-tip strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 17px;
}

.photo-tip p {
  color: var(--ink-soft);
  font-size: 15px;
}

.editor-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 14.5px;
}

.editor-photo-row img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.editor-photo-row span {
  flex: 1;
  min-width: 0;
}

.editor-photo-row strong {
  display: block;
  color: var(--ink);
}

.editor-photo-row .text-button {
  min-height: 36px;
  white-space: nowrap;
}

.fix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}

.fix-chip {
  min-height: 40px;
  padding: 8px 16px;
  border: 1.5px solid rgba(23, 59, 87, 0.25);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.fix-chip:hover:not(:disabled) {
  border-color: var(--ink);
}

.fix-chip.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}

.fix-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.field-optional {
  color: var(--ink-soft);
  font-weight: 500;
}

.edit-note {
  min-height: 64px;
  margin-top: 8px;
  font-family: inherit;
  resize: vertical;
}

.repaints-left {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* ─── Toast ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(560px, calc(100% - 32px));
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  box-shadow: 0 20px 40px -18px rgba(23, 59, 87, 0.7);
  transform: translateX(-50%);
}

/* ─── Smaller screens ─────────────────────────────────────── */

@media (max-width: 1100px) {
  .step-dot:not(.active) {
    display: none;
  }

  .stage--hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 0 48px;
  }

  .stage-copy {
    padding: 64px 0 0;
  }

  .hand-stage {
    min-height: 500px;
  }

  .style-options,
  .slot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0 10px 72px;
  }

  .site-header {
    min-height: 68px;
    gap: 10px;
    padding: 0 6px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .brand-words strong {
    font-size: 20px;
  }

  .brand-words small {
    display: none;
  }

  .decks-button {
    padding: 10px 12px;
  }

  .decks-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .step-dot.active {
    padding: 6px 12px;
    font-size: 13.5px;
  }

  .stage {
    border-radius: 26px;
  }

  .stage::before {
    inset: 9px;
    border-radius: 18px;
  }

  .stage--hero {
    padding: 0 22px;
  }

  .stage-copy {
    padding-top: 34px;
  }

  .stage-title {
    font-size: 54px;
  }

  .stage-title--md {
    font-size: 38px;
  }

  .stage-lede {
    margin-top: 16px;
    font-size: 16.5px;
  }

  .stage-copy .stage-button {
    display: flex;
    width: 100%;
    margin-top: 22px;
    padding: 16px;
    font-size: 18px;
  }

  .stage-hint {
    font-size: 13.5px;
    text-align: center;
  }

  .hand-stage {
    min-height: 330px;
  }

  .hand {
    --fan: 13deg;
    top: 72px;
  }

  .hand-card {
    left: -74px;
    width: 148px;
    transform-origin: 50% 190%;
  }

  .blank-window {
    gap: 8px;
    font-size: 13.5px;
  }

  .blank-window small {
    display: none;
  }

  .blank-plus {
    width: 40px;
    height: 40px;
  }

  .players {
    padding: 48px 6px 8px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 32px;
  }

  .players-row {
    gap: 30px 20px;
  }

  .person-card {
    width: calc(50% - 10px);
  }

  .page-head,
  .style-picker,
  .assign-toolbar,
  .slot-groups,
  .screen-actions,
  .progress,
  .card-table,
  .notify-bar {
    margin-left: 6px;
    margin-right: 6px;
  }

  .page-head {
    padding: 22px 0 24px;
  }

  .style-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .style-option {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 10px;
    padding: 8px;
  }

  .style-option img {
    width: 44px;
  }

  .style-option-blurb {
    display: none;
  }

  .style-option-name {
    align-self: center;
    grid-row: 1 / 3;
    font-size: 15px;
  }

  .slot-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 16px;
  }

  .screen-actions .primary-button {
    flex: 1;
  }

  .stage--showcase {
    padding: 34px 18px 38px;
  }

  .showcase-head {
    margin-bottom: 30px;
  }

  .preview-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .preview-card-label {
    font-size: 14px;
  }

  .preview-card-status {
    font-size: 12.5px;
  }

  .card-table {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .generation-card-label,
  .result-card h3 {
    font-size: 13.5px;
  }

  .generation-card-status,
  .result-meta {
    font-size: 12.5px;
  }

  .stage--results {
    padding: 34px 22px;
  }

  .results-actions,
  .results-actions .stage-button {
    width: 100%;
  }

  .modal-card {
    padding: 24px;
    border-radius: 22px;
  }

  .modal-actions > * {
    flex: 1;
  }

  .card-editor {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 24px 20px;
  }

  .card-editor-cards:not(.is-compare) {
    width: 150px;
    margin: 0 auto;
  }

  .card-editor-cards.is-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (hover: none) {
  .hand-card:hover .hand-lift,
  .stage-button:hover,
  .primary-button:hover:not(:disabled) {
    translate: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .hand-card,
  .playing-card.generating,
  .card-flip,
  .card-flip .art-window::after,
  .terms-shake {
    animation: none;
  }

  .card-face--back {
    display: none;
  }

  .hand,
  .hand-lift,
  .progress-fill {
    transition: none;
  }
}
