/* Trait Garden: the Inheritance Greenhouse inside the practice shell's stage (about 1066 x 628 at 1366 x 768).
 * Foundations: every word in the play area is 18 px or more; every tap target is 48 px or more.
 * Pictures and allele tiles sit on a lit cream slide that stays the same in light and dark (the art is drawn for it). */
.tg { position: absolute; inset: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 14px; padding: 10px 14px; color: #1d2a1f; font-size: 18px; line-height: 1.3;
  background: linear-gradient(#eef6e9, #dcebd3);
  --tg-panel: rgba(255, 253, 246, .96); --tg-line: #a9bf9a; --tg-soft: #46563f; --tg-accent: #3f6b2e; --tg-accent-bg: #e3f0da;
  --tg-slide: #fffdf4; --tg-ink: #1d2a1f; }
html[data-theme="dark"] .tg { color: #edf3ea; background: linear-gradient(#1b211b, #141814);
  --tg-panel: rgba(32, 38, 32, .97); --tg-line: #5c6f55; --tg-soft: #cddbc6; --tg-accent: #a9d98a; --tg-accent-bg: #27361f; }
.tg *, .tg *::before, .tg *::after { box-sizing: border-box; }
.tg p, .tg figure, .tg figcaption { margin: 0; padding: 0; }
.tg button { font: inherit; color: inherit; }
.tg svg { display: block; }
.tg :focus-visible { outline: 4px solid #ffb000; outline-offset: 2px; }
.tg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* allele tiles: capital (dominant) dark, small (recessive) light; always on their own fill, readable in both themes */
.tg-pair { display: inline-flex; gap: 4px; vertical-align: middle; }
.tg-al { display: inline-grid; place-items: center; min-width: 34px; height: 38px; padding: 0 5px; border-radius: 8px; font: 800 24px/1 system-ui, sans-serif; letter-spacing: 0; }
.tg-al--dom { background: #2f6b3a; color: #fff; border: 2px solid #1b4523; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22); }
.tg-al--rec { background: #fffdf4; color: #1f3d22; border: 2px solid #4f8a45; box-shadow: inset 0 -3px 0 rgba(79, 138, 69, .25); }
.tg-al--q { background: #f6ecd2; color: #7a5a1c; border: 2px dashed #b08a3c; }
.tg-pair--big .tg-al { min-width: 54px; height: 60px; font-size: 34px; border-radius: 10px; }
.tg-or { margin: 0 4px; font-weight: 700; color: #46563f; }

/* ── picture (left) ── */
.tg .tg-scenebox { container: tgscene / inline-size; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: var(--tg-panel); border: 1.5px solid var(--tg-line); }
.tg-scene-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; border-radius: 10px; background: var(--tg-slide); color: var(--tg-ink); box-shadow: inset 0 0 0 1px rgba(40, 60, 30, .22); overflow: hidden; }
.tg p.tg-cap { flex: none; font-weight: 600; }
.tg p.tg-model { flex: none; color: var(--tg-soft); font-style: italic; }
.tg.is-revealed .tg-scenebox { border-color: var(--tg-accent); box-shadow: 0 0 0 3px var(--tg-accent-bg); }

/* parents */
.tg-parents { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tg-x { font-size: 30px; font-weight: 800; color: #5b4636; }
.tg-parent { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 12px; border: 2px solid; }
.tg-parent--left { background: #fbe7d2; border-color: #c98a4a; }
.tg-parent--top { background: #dcebf6; border-color: #5d8fb3; }
.tg-parent--me { background: #e3f0da; border-color: #5f8f4b; }
.tg-parent--other { background: #f7e1ec; border-color: #b0688c; }
.tg-parent.is-path { box-shadow: 0 0 0 4px #e0a21c; }
.tg-ppic { flex: none; display: block; width: 62px; height: 100px; }
.tg--reproduce .tg-ppic { width: 80px; height: 130px; }
.tg-ppic svg { width: 100%; height: 100%; }
.tg-ptext { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tg-ptext b { font-size: 18px; line-height: 1.15; }

/* Punnett square */
.tg-square { --box: 112px; display: grid; grid-template-columns: 58px repeat(2, var(--box)); grid-template-rows: 54px repeat(2, var(--box)); gap: 6px; }
.tg-corner { border-radius: 8px; background: linear-gradient(135deg, #fbe7d2 50%, #dcebf6 50%); border: 1px solid #c8bca8; }
.tg-h { display: grid; place-items: center; border-radius: 10px; border: 2px solid; }
.tg-h--top { background: #dcebf6; border-color: #5d8fb3; }
.tg-h--left { background: #fbe7d2; border-color: #c98a4a; }
.tg-h.is-path { box-shadow: 0 0 0 4px #e0a21c; }
.tg-box { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px; background: #ffffff; border: 2px solid #b8c9a8; }
.tg-box.is-lane { background: #fff6dc; }
.tg-box.is-q { border: 3px dashed var(--tg-accent, #3f6b2e); background: #f4f9ef; }
.tg-box.is-q.is-filled { border-style: solid; border-color: #e0a21c; }
.tg-box.is-q.is-answer { border-style: solid; }
.tg-qmark { font-size: 40px; font-weight: 800; color: #3f6b2e; line-height: 1; }
.tg-boxpic:empty, .tg-num:empty { display: none; }
.tg-boxpic { display: block; width: 46px; height: 60px; }
.tg-boxpic svg { width: 100%; height: 100%; }
.tg-box.has-pic .tg-al { min-width: 28px; height: 32px; font-size: 20px; }
.tg-box.is-hit, .tg-box.is-answer { border-color: #2f9a5c; box-shadow: 0 0 0 3px #2f9a5c; }
.tg-num { position: absolute; left: -10px; top: -10px; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #17663a; color: #fff; font-weight: 800; font-size: 18px; }
.tg-cross { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tg-cross.is-compact .tg-square { --box: 84px; grid-template-rows: 50px repeat(2, var(--box)); }
.tg p.tg-plabels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tg-band { display: flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 10px; border: 2px solid; }
.tg-band--left { background: #fbe7d2; border-color: #c98a4a; }
.tg-band--top { background: #dcebf6; border-color: #5d8fb3; }

/* seed trays (batch) */
.tg-trays { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tg-tray { width: 130px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tg-traypic { display: block; width: 118px; height: 125px; }
.tg-traypic svg { width: 100%; height: 100%; }
.tg-tray figcaption { text-align: center; }

/* seed -> grown plant (look) */
.tg-grow { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tg-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.tg-card figcaption { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tg-seedpic { display: block; width: 150px; height: 112px; }
.tg-growpic, .tg-newpic { display: block; width: 190px; height: 248px; }
.tg-seedpic svg, .tg-growpic svg, .tg-newpic svg, .tg-podpic svg, .tg-beepic svg, .tg-runpic svg { width: 100%; height: 100%; }
.tg-arrow { display: block; width: 64px; height: 32px; flex: none; }
.tg-arrow svg { width: 100%; height: 100%; }

/* garden beds (common) */
.tg-bed { position: relative; width: 100%; max-width: 560px; }
.tg-bedpic svg { width: 100%; height: auto; }
.tg-badges { position: absolute; inset: 0; pointer-events: none; }
.tg-badge { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: 18px; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.tg-badge--rec { background: #fffdf4; color: #1f3d22; border: 3px solid #4f8a45; }
.tg-badge--dom { background: #2f6b3a; color: #fff; border: 3px solid #1b4523; }
.tg p.tg-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }

/* new plants (reproduce) */
.tg-repro { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tg-repro--seed { display: grid; grid-template-columns: auto minmax(90px, 160px) auto; gap: 8px 10px; justify-items: center; }
.tg-repro--seed .tg-card--pod { grid-column: 1 / -1; flex-direction: row; gap: 12px; }
.tg-beepic { display: block; width: 100%; height: 70px; }
.tg-podpic { display: block; width: 150px; height: 82px; }
.tg-repro--runner { flex-direction: column; width: 100%; }
.tg-runpic { display: block; width: 100%; max-width: 520px; }
.tg-runpic svg { height: auto; }
.tg p.tg-runcap { display: flex; justify-content: space-between; gap: 12px; width: 100%; max-width: 520px; flex-wrap: wrap; }
.tg-runcap > span { display: flex; align-items: center; gap: 6px; }
.tg-runcap.is-path > span:first-child { box-shadow: 0 0 0 4px #e0a21c; border-radius: 10px; padding: 2px 6px; }
.tg-newcap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tg-newcap.is-answer { outline: 3px solid #2f9a5c; outline-offset: 3px; border-radius: 10px; }
.tg-slot { display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 10px; border: 2px solid; }
.tg-slot--me { background: #e3f0da; border-color: #5f8f4b; }
.tg-slot--other { background: #f7e1ec; border-color: #b0688c; }
.tg-plus { font-size: 24px; font-weight: 800; }

/* ── task (right) ── */
.tg-task { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.tg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 48px; flex-wrap: wrap; }
.tg p.tg-title { min-width: 0; padding: 6px 14px; border-radius: 12px; background: var(--tg-panel); border: 1.5px solid var(--tg-line); }
.tg-title b { font-size: 20px; }
html .tg-say { flex: none; min-height: 48px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--tg-line); background: var(--tg-panel); font-weight: 700; cursor: pointer; white-space: nowrap; }
.tg-say[aria-pressed="true"] { border-color: var(--tg-accent); }
.tg-say:hover { background: var(--tg-accent-bg); }
.tg-k { flex: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.tg-k span { color: var(--tg-soft); }
.tg-msg { font-weight: 700; flex: none; }
.tg-msg:empty { display: none; }
.tg button:disabled { opacity: 1; cursor: default; }

.tg-choices { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
html .tg-choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 2.5px solid var(--tg-line); background: var(--tg-panel); text-align: left; cursor: pointer; }
.tg-cpic { flex: none; display: grid; place-items: center; width: 108px; height: 108px; background: var(--tg-slide); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(40, 60, 30, .22); overflow: hidden; }
.tg-cpic > svg { width: 100%; height: 100%; }
.tg-two { display: flex; width: 100%; height: 100%; }
.tg-two svg { width: 50%; height: 100%; }
.tg-fan { position: relative; display: block; width: 100%; height: 100%; }
.tg-fan svg { position: absolute; width: 62%; height: 62%; }
.tg-fan svg:nth-child(1) { left: 2%; top: 4%; transform: rotate(-8deg); }
.tg-fan svg:nth-child(2) { left: 36%; top: 6%; transform: rotate(6deg); }
.tg-fan svg:nth-child(3) { left: 19%; top: 36%; }
.tg-choice-t { flex: 1 1 auto; min-width: 0; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
html .tg-choice:hover:not(:disabled) { border-color: var(--tg-accent); background: var(--tg-accent-bg); }
html .tg-choice.is-chosen { border-color: var(--tg-accent); box-shadow: 0 0 0 3px var(--tg-accent); }
/* the allele-pair choices (fill the square): three big tile buttons in a row */
.tg-choices--cell { flex-direction: row; flex: none; }
html .tg-choices--cell .tg-choice { flex: 1 1 0; flex-direction: column; justify-content: center; padding: 14px 8px; min-height: 120px; }
.tg-choices--cell .tg-cpic { width: auto; height: auto; padding: 10px 12px; }

/* ✓ / ✗ after Check: at the end of the choice, never on a picture */
.tg-mark { display: none; }
.tg.is-revealed .tg-mark:not(:empty) { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; font-weight: 800; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html .tg.is-revealed .tg-choice.is-right { border-color: #2f9a5c; box-shadow: 0 0 0 3px #2f9a5c; }
html .tg.is-revealed .tg-choice.is-wrong { border-color: #c4473d; box-shadow: 0 0 0 3px #c4473d; }
.tg.is-revealed .is-right .tg-mark { background: #17663a; }
.tg.is-revealed .is-wrong .tg-mark { background: #a3241f; }

/* ── Briefing example and Start art ── */
.tg-example { position: static; display: grid; grid-template-columns: 1fr 1.1fr 1.2fr; gap: 14px; align-items: start; padding: 0; background: none; overflow: visible; color: inherit; }
.tg-example figure { display: flex; flex-direction: column; gap: 6px; }
.tg-example figcaption { line-height: 1.3; }
.tg-ex-parents, .tg-ex-square, .tg-ex-plants { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; background: #fffdf4; border-radius: 10px; color: #1d2a1f; box-shadow: inset 0 0 0 1px rgba(40, 60, 30, .22); }
.tg-ex-square .tg-square { --box: 76px; grid-template-columns: 46px repeat(2, var(--box)); grid-template-rows: 46px repeat(2, var(--box)); }
.tg-ex-square .tg-al, .tg-ex-parents .tg-al { min-width: 26px; height: 30px; font-size: 19px; padding: 0 3px; }
.tg-ex-plants { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.tg-ex-pl { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tg-ex-pl svg { width: 46px; height: 74px; }
.tg-ex-pl .tg-al { min-width: 26px; height: 30px; font-size: 19px; }
.ps-brief--drawer .tg-example { grid-template-columns: 1fr; }
.tg-start { width: 100%; height: 100%; display: grid; place-items: center; background: #eaf4ea; border-radius: 12px; overflow: hidden; }
.tg-start svg { width: 100%; height: 100%; }

/* ── Foundations: 18 px for the shell's words beside the play area too ── */
body[data-activity="trait-garden"] .ps-bubble, body[data-activity="trait-garden"] .ps-cust-detail, body[data-activity="trait-garden"] .ps-feedback,
body[data-activity="trait-garden"] .ps-hint, body[data-activity="trait-garden"] .ps-gloss, body[data-activity="trait-garden"] .ps-cust-who,
body[data-activity="trait-garden"] .ps-nudge { font-size: 18px; line-height: 1.3; }
body[data-activity="trait-garden"] .ps-cust-detail { color: var(--tlg-text); }
body[data-activity="trait-garden"] .ps-say { width: 48px; height: 48px; font-size: 22px; margin: -2px -4px 4px 8px; }
body[data-activity="trait-garden"] .ps-hint-btn { min-height: 48px; }
body[data-activity="trait-garden"] .ps-hint .ps-hint-note { font-size: 16px; }
body[data-activity="trait-garden"] .ps-side:has(.ps-feedback:not([hidden])) .ps-cust-detail,
body[data-activity="trait-garden"] .ps-side:has(.ps-feedback:not([hidden])) .ps-hint { display: none; }

/* a narrower right column: smaller pictures */
@container (max-width: 420px) {
  .tg-cpic { width: 88px; height: 88px; }
  html .tg-choice { gap: 10px; }
  .tg-pair--big .tg-al { min-width: 40px; height: 46px; font-size: 28px; }
  html .tg-choices--cell .tg-choice { padding: 10px 4px; min-height: 96px; }
  .tg-choices--cell .tg-cpic { padding: 6px; }
  .tg-choices--cell { gap: 8px; }
}
/* a narrow picture panel: the seed scene stacks, the boxes shrink */
@container tgscene (max-width: 520px) {
  .tg-repro--seed { grid-template-columns: 1fr; }
  .tg-repro--seed .tg-card--pod { grid-column: auto; flex-wrap: wrap; justify-content: center; }
  .tg-beepic { width: 170px; height: 64px; }
  .tg-square { --box: 96px; }
  .tg-cross.is-compact .tg-square { --box: 76px; grid-template-rows: 46px repeat(2, var(--box)); }
  .tg-tray { width: 112px; }
  .tg-traypic { width: 100px; height: 106px; }
}
@container tgscene (max-width: 380px) {
  .tg-square { --box: 84px; grid-template-columns: 50px repeat(2, var(--box)); }
  .tg-box.has-pic .tg-al { min-width: 24px; height: 28px; font-size: 18px; padding: 0 2px; }
  .tg-boxpic { width: 36px; height: 46px; }
  .tg-tray { width: 100px; }
  .tg-traypic { width: 90px; height: 96px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .tg { overflow-y: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .tg-scene-body { flex: none; overflow: visible; }
}
@media (max-width: 900px) {
  .tg { position: relative; inset: auto; overflow: visible; grid-template-columns: minmax(0, 1fr); padding: 10px 10px 16px; }
  .tg-scene-body { overflow: visible; }
  .tg-growpic, .tg-newpic { width: 140px; height: 183px; }
  .tg-repro--seed { grid-template-columns: 1fr; }
  .tg-beepic { width: 160px; }
  .tg-example { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .tg-parent { padding-right: 8px; }
  .tg-ppic { width: 48px; height: 78px; }
  .tg-seedpic { width: 110px; height: 82px; }
  .tg-arrow { width: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tg-choice { transition: border-color .12s, background-color .12s, box-shadow .12s; }
  .tg.is-revealed .tg-scenebox { animation: tg-pop .35s ease-out; }
  @keyframes tg-pop { 0% { transform: scale(.98); opacity: .6; } 100% { transform: scale(1); opacity: 1; } }
}
