/* The Parent Zone and the grown-up's setup screen (WP4; core DESIGN §1, §7.3, §9.2, §9.3).
   Forked from demo app.css L595-606 (the grown-ups sheet's own parts: promise, notes, week, privacy picture) and L617-631
   (made-here rows, the clear and export rows, the PIN form) @7aafc93. Changes: the rules the sheet skeleton, seg, the
   confirm row and the gate already style live in grownup.css (WP3) and are not repeated; sections sit apart with a hair
   rule; the week tiles, the icon seg, the troupe and playtest rows and the build label are new; the setup screen is new
   (paper page, cards, big picture options with a coral ring when chosen, the hand-over card). Light theme only; tokens only. */

/* ── Parent Zone ─────────────────────────────────────────────────────── */
/* The title and the close key stay in reach while the long sheet scrolls. */
.sheet.pz .sheet-head { position: sticky; top: -18px; z-index: 2; background: var(--card); margin: -18px -22px 0; padding: 18px 22px 8px; }
.sheet .g-promise { font-weight: 750; margin-top: 12px; }
.pz-sec { padding-top: 4px; }
.pz-sec + .pz-sec { border-top: 1px solid var(--hair); margin-top: 18px; padding-top: 6px; }
.sheet h4.pz-sub { font-size: 16px; margin: 14px 0 6px; line-height: 1.3; }
.g-note { display: flex; gap: 10px; align-items: flex-start; }
.g-note .ico { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.g-note.warn { background: var(--coral-field); border-radius: 14px; padding: 10px 14px; }
.privacy-fig { margin: 4px 0 12px; color: var(--ink); }
.privacy-pic { width: 100%; max-width: 360px; height: auto; display: block; }
.privacy-pic .pp-toy { fill: var(--coral-field); }
.privacy-fig figcaption { font-size: 15px; margin-top: 4px; }
.g-real3d { font-weight: 650; }
.g-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px; border-radius: 16px; background: var(--paper); }
.g-thumb { width: 56px; height: 56px; flex: none; display: grid; place-items: center; color: var(--muted); }
.g-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.g-thumb .ico { width: 30px; height: 30px; }
.g-name { flex: 1 1 120px; min-width: 0; font-weight: 750; overflow-wrap: anywhere; display: flex; flex-direction: column; }
.g-name small { font-weight: 600; font-size: 14px; }
.g-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet .g-acts .btn-quiet { min-height: 48px; padding: 0 14px; margin: 0; font-size: var(--muted-size); }
.g-acts .ico { width: 20px; height: 20px; }
.g-confirm { width: 100%; }
.g-clear { margin: 16px 0 4px; }
.pin-form label, .pz-form label { display: block; }
.pz-sec .gate-row { flex-wrap: wrap; }

/* This week: one tile per film or new member, the still on paper. */
.pz-week { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pz-tile { background: var(--paper); border-radius: 16px; padding: 8px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.pz-tile-pic { aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); }
.pz-tile-pic img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.pz-tile-pic .ico { width: 34px; height: 34px; }
.pz-tile-name { font-weight: 750; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.pz-tile small { font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }

/* Rows of grown-up actions, inputs, status lines. */
.pz-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.sheet .pz-acts .btn-quiet { margin: 0; }
.pz-msg { font-weight: 700; }
.pz-code { font-weight: 700; letter-spacing: .04em; }
.seg-icons button { min-width: 64px; display: inline-grid; place-items: center; }
.seg-icons .ico { width: 26px; height: 26px; }
.pz-input { width: 180px; min-height: 56px; border-radius: 16px; border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font: inherit; font-size: 20px; font-weight: 700; padding: 0 14px; letter-spacing: .04em; }
.pz-input.wide { flex: 1 1 180px; max-width: 320px; letter-spacing: 0; }
.pz-input:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.pz-input.pz-pin { width: 120px; font-size: 26px; font-weight: 800; text-align: center; letter-spacing: .08em; }
.sheet .pz-go { min-height: 56px; border-radius: 999px; background: var(--ink); color: var(--paper); padding: 0 26px; font-weight: 750; }
.sheet .pz-go:disabled { opacity: .5; cursor: default; }
.pz-formmsg { min-height: 1.5em; }
/* The file pickers: the label is the button; the input stays reachable for the picker but out of sight. */
.pz-file, .setup-act { position: relative; cursor: pointer; }
.pz-file-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.pz-label { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--butter) 55%, var(--card)); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.pz-label .ico { width: 22px; height: 22px; margin-top: 2px; flex: none; }

/* ── The setup screen (D-46) ─────────────────────────────────────────── */
.setup { width: min(560px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.setup-head { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 4px 8px 2px; }
.setup-mark { width: 56px; height: 56px; object-fit: contain; }
.setup-title { font-size: 30px; line-height: 1.15; margin: 2px 0 0; letter-spacing: 0; }
.setup-label { display: inline-flex; gap: 8px; align-items: center; background: var(--butter); color: var(--ink); border-radius: 999px; padding: 6px 14px;
  font-weight: 750; font-size: 16px; line-height: 1.3; margin: 2px 0; text-align: left; }
.setup-label .ico { width: 20px; height: 20px; flex: none; }
.setup-sub { color: var(--muted); font-size: var(--muted-size); line-height: 1.4; margin: 0; max-width: 30em; }

.setup-block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 18px; }
.setup-block.flash { animation: setup-flash 900ms ease both; }
@keyframes setup-flash { 30% { box-shadow: 0 0 0 4px var(--coral), var(--shadow); } }
.setup-bh { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 1.25; margin: 0 0 12px; letter-spacing: 0; }
.setup-bi { width: 28px; height: 28px; flex: none; color: var(--coral-deep); }
.setup-line { font-size: 17px; line-height: 1.45; margin: 0 0 12px; color: var(--ink); }
.setup-fine { font-size: 14px; line-height: 1.45; margin: -4px 0 12px; color: var(--muted); }
.setup .privacy-fig { margin: 0 0 10px; }
.setup .privacy-fig figcaption { font-size: 17px; margin-top: 8px; }

/* Options: big targets, a picture or icon each, a coral ring and tick when chosen. */
.setup-opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--tap-gap); }
.setup-opts.one { grid-template-columns: 1fr; }
.setup-opt { position: relative; appearance: none; margin: 0; min-height: 76px; border: 2px solid transparent; border-radius: 20px; background: var(--paper);
  box-shadow: var(--press); color: var(--ink); font: inherit; font-weight: 750; text-align: left; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform var(--t-micro) var(--spring), background var(--t-micro), border-color var(--t-micro); }
.setup-opt:active { transform: scale(.96); }
.setup-opt[aria-checked="true"] { background: var(--coral-field); border-color: var(--coral); }
.setup-opt .opt-pic { flex: none; display: grid; place-items: center; }
.setup-opt .opt-pic > .ico { width: 32px; height: 32px; }
.setup-opt .opt-txt { display: grid; gap: 2px; min-width: 0; }
.setup-opt .opt-label { font-size: 19px; line-height: 1.2; }
.setup-opt .opt-txt small { font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.3; }
/* The chosen mark: a coral badge on the corner, so the label keeps the whole width. */
.setup-opt .opt-tick { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--coral); color: var(--ink);
  box-shadow: var(--shadow); opacity: 0; transform: scale(.6); transition: opacity var(--t-micro), transform var(--t-micro) var(--spring); }
.setup-opt[aria-checked="true"] .opt-tick { opacity: 1; transform: none; }
.setup-opt:focus-visible, .setup-act:focus-within, .setup-hand:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Who plays: two picture cards with the felt starters. */
.setup-block[data-block="age"] .setup-opt { flex-direction: column; justify-content: center; text-align: center; min-height: 176px; padding: 14px 10px; gap: 6px; }
.setup-block[data-block="age"] .opt-label { font-size: 24px; }
.age-pic { height: 96px; display: flex; align-items: flex-end; justify-content: center; }
.age-pic img { object-fit: contain; filter: drop-shadow(0 6px 8px rgba(93, 63, 26, .16)); }
.age-pic.one img { width: 92px; height: 92px; }
.age-pic.two img { width: 70px; height: 70px; }
.age-pic.two img + img { margin-left: -12px; transform: translateY(-10px); }

/* Add to home screen: two numbered steps, each with the pictogram of the key to look for. */
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.setup-steps li { counter-increment: step; background: var(--paper); border-radius: 18px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 17px; line-height: 1.3; min-height: 60px; }
.setup-steps li::before { content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.setup-steps .step-pic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--card); display: grid; place-items: center; }
.setup-steps .step-pic .ico { width: 26px; height: 26px; display: block; color: var(--cobalt); }

.setup-act { min-height: 68px; width: 100%; border-radius: 20px; background: var(--paper); box-shadow: var(--press); display: flex; align-items: center; justify-content: center;
  gap: 10px; font-weight: 750; font-size: 18px; padding: 0 16px; touch-action: manipulation; transition: transform var(--t-micro) var(--spring); }
.setup-act:active { transform: scale(.96); }
.setup-act > .ico { width: 30px; height: 30px; flex: none; }

.setup-pics { display: grid; grid-template-columns: 1fr 1fr; gap: var(--tap-gap); }
.setup-pics figure { margin: 0; background: var(--paper); border-radius: 18px; padding: 14px 10px; display: grid; justify-items: center; gap: 6px; text-align: center;
  font-weight: 700; font-size: 16px; line-height: 1.3; }
.setup-pics .ico { width: 44px; height: 44px; color: var(--green); }

.setup-done { display: flex; gap: 8px; align-items: center; color: var(--green); font-weight: 700; font-size: 16px; margin: 12px 0 0; }
.setup-done .ico { width: 22px; height: 22px; flex: none; }
.setup-msg { font-weight: 700; font-size: 16px; color: var(--coral-deep); margin: 10px 0 0; }
.setup-msg.ok { color: var(--green); }

.setup-foot { display: grid; gap: 12px; padding: 4px 0 8px; }
.setup-foot .setup-msg { margin: 0; text-align: center; }
.setup-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; background: color-mix(in srgb, var(--butter) 45%, var(--card)); border-radius: 18px;
  padding: 12px 14px; font-size: 16px; line-height: 1.4; font-weight: 650; }
.setup-note .ico { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.setup-go[aria-disabled="true"] { background: var(--sand); color: rgba(24, 22, 18, .55); box-shadow: none; }

/* The hand-over card: a starter, the play key, one line for the grown-up. The whole card is the button. */
.setup-handed { min-height: calc(100dvh - 120px); justify-content: center; }
.setup-hand { appearance: none; border: 0; margin: 0; width: 100%; background: var(--card); color: var(--ink); border-radius: 36px; box-shadow: var(--shadow-lift);
  padding: 28px 20px 30px; display: grid; justify-items: center; gap: 16px; font: inherit; cursor: pointer; touch-action: manipulation;
  transition: transform var(--t-micro) var(--spring); }
.setup-hand:active { transform: scale(.97); }
.hand-toy img { width: 200px; height: 200px; object-fit: contain; display: block; filter: drop-shadow(0 10px 14px rgba(93, 63, 26, .18)); }
.hand-play { width: 96px; height: 96px; border-radius: 50%; background: var(--coral); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow), var(--press); }
.hand-play .ico { width: 46px; height: 46px; margin-left: 6px; }
.hand-play .ico path { fill: currentColor; }
.hand-line { font-size: 22px; font-weight: 750; line-height: 1.25; }

@media (max-width: 359px) {
  .setup-pics { grid-template-columns: 1fr; }
  .setup-opt .opt-label { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .setup-opt, .setup-act, .setup-hand { transition: none; }
  .setup-opt:active, .setup-act:active, .setup-hand:active { transform: none; }
  .setup-block.flash { animation: none; box-shadow: 0 0 0 4px var(--coral), var(--shadow); }
}
