/* ============================================================================
   Play-Along (OSG1, 2026-11-08; painted restyle 2026-11-18): the shelf of games to play together.
   The look follows the painted front screen: warm paper, big pictures, a few words, very few boxes.
   Sits on ../../shared/world.css (fonts, menu, PIN gate).
   Pieces: .pa-top (the one back button)  .pa-home (first screen)  .pa-sec / .pa-grid / .pa-card (painted cards under the five kinds)
           .pa-panel / .pa-sheet (the "How to play" sheet)  .pa-grown (sources, behind the PIN)
   ========================================================================== */
:root {
  --pa-paper: #FBF4E4; --pa-paper2: #F3E9D0; --pa-box: #FFFAEE; --pa-raise: #FFFDF6;
  --pa-ink: #2B2620; --pa-soft: #4F473D; --pa-line: rgba(43, 38, 32, .16);
  --pa-moss: #2F4A2A; --pa-focus: #1F6FB5;
}
/* the five kinds: band = title strip on a card, acc = number dot, deep = heading colour */
[data-c="coral"] { --band: #F8C9B5; --acc: #F8C9B5; --deep: #A9461E; }
[data-c="butter"] { --band: #F7E2A0; --acc: #F7E2A0; --deep: #7A5A0C; }
[data-c="sky"] { --band: #C6E0F5; --acc: #C6E0F5; --deep: #26639A; }
[data-c="mint"] { --band: #C8E8CF; --acc: #C8E8CF; --deep: #2B7344; }
[data-c="lilac"] { --band: #DCD2F0; --acc: #DCD2F0; --deep: #5B449F; }

html { background: var(--pa-paper); scroll-behavior: smooth; }
body.pa { margin: 0; padding: 10px 0 0; min-height: 100svh; color: var(--pa-ink); background: var(--pa-paper); font-family: var(--body); font-size: 18px; line-height: 1.55; overflow-x: hidden; }
body.pa.is-open { overflow: hidden; }
.pa :focus-visible { outline: 3px solid var(--pa-focus); outline-offset: 3px; border-radius: 10px; }
.pa .wnav { position: absolute; background: rgba(31, 51, 32, .95); }
.pa h1, .pa h2, .pa h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: .01em; color: var(--pa-ink); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the one back button: sits beside the small Home button and stays in reach on the long list ---------- */
.pa-top { position: sticky; top: 10px; z-index: 60; width: fit-content; margin-left: max(70px, calc((100% - 1100px) / 2 + 60px)); pointer-events: none; }
.pa-back { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px 0 10px; border-radius: 999px; text-decoration: none; font: 400 20px/1 var(--display); color: var(--pa-ink); background: var(--pa-raise); box-shadow: 0 6px 16px -8px rgba(43, 38, 32, .55); -webkit-tap-highlight-color: transparent; }
.pa-back::before { content: ""; width: 22px; height: 22px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 5l-7 7 7 7' fill='none' stroke='%232B2620' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pa-back:hover { background: #FFF1C9; }

/* ---------- page ---------- */
.pa-in { width: min(100% - 32px, 1100px); margin: 0 auto; position: relative; z-index: 1; }

/* ---------- the first screen (one big painted button + five painted kinds) ---------- */
.pa-home { max-width: 760px; margin: 0 auto; padding: 14px 0 24px; text-align: center; }
.pa-home[hidden], #pa-main[hidden] { display: none; }
.pa-home h1 { margin: 4px 0 14px; }
.pa-bigpick { display: block; width: 100%; max-width: 560px; margin: 0 auto 22px; padding: 0; border: 0; border-radius: 28px; overflow: hidden; cursor: pointer; background: #FFF8E8; box-shadow: 0 16px 34px -16px rgba(43, 38, 32, .65), 0 0 0 4px #F5D060; transition: transform .2s; }
.pa-bigpick img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.pa-bigpick span { display: block; padding: 14px 12px 16px; font-family: var(--display); font-size: clamp(26px, 6vw, 34px); line-height: 1.05; color: #2B2620; background: #F5D060; }
.pa-bigpick:hover, .pa-bigpick:focus-visible { transform: translateY(-3px); }
.pa-bigpick:active { transform: scale(.98); }
.pa-cats { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pa-cats li:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }
.pa-cat { display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; border-radius: 22px; overflow: hidden; cursor: pointer; background: #FFF8E8; box-shadow: 0 10px 22px -12px rgba(43, 38, 32, .6); transition: transform .2s; }
.pa-cat img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.pa-cat span { display: grid; place-items: center; min-height: 52px; padding: 6px 8px; font-family: var(--display); font-size: 21px; line-height: 1.05; color: #2B2620; background: var(--band); }
.pa-cat:hover, .pa-cat:focus-visible { transform: translateY(-3px); }
.pa-cat:active { transform: scale(.97); }
.pa-allbtn { margin: 22px auto 0; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer; font: 700 17px var(--body, inherit); color: #1D3019; background: rgba(255, 248, 232, .9); box-shadow: inset 0 0 0 2px rgba(29, 48, 25, .35); }

/* ---------- the list: big painted cards, the same shape as the five kinds ---------- */
.pa .pa-listh { margin: 26px 0 0; font-size: clamp(34px, 8vw, 50px); }
.pa-listh:focus { outline: none; }
.pa-sec { margin: 22px 0 0; scroll-margin-top: 70px; }
.pa-sec[hidden] { display: none; }
.pa .pa-sec__head { margin: 30px 0 12px; font-size: clamp(28px, 6.5vw, 38px); color: var(--deep); }
.pa-sec__head[hidden] { display: none; }
.pa-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pa-grid > li { display: flex; }
.pa-card { appearance: none; -webkit-appearance: none; display: flex; flex-direction: column; width: 100%; padding: 0; border: 0; border-radius: 22px; overflow: hidden; font: inherit; color: var(--pa-ink); background: var(--band); box-shadow: 0 10px 22px -12px rgba(43, 38, 32, .6); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .2s; }
.pa-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--pa-paper2); }
.pa-card__title { flex: 1 1 auto; display: grid; place-items: center; min-height: 60px; padding: 8px 10px; text-align: center; font: 400 22px/1.08 var(--display); }
.pa-card:hover, .pa-card:focus-visible { transform: translateY(-3px); }
.pa-card:active { transform: scale(.97); }

.pa-foot { position: relative; z-index: 1; margin-top: 56px; padding: 30px 16px calc(34px + env(safe-area-inset-bottom)); text-align: center; font-size: 15px; color: var(--pa-soft); background: var(--pa-paper2); }
.pa-foot p { margin: 4px auto; max-width: 56ch; }
.pa-foot .wfoot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0 0; }
.pa-foot a { color: var(--pa-ink); text-underline-offset: 3px; display: inline-block; min-height: 44px; line-height: 44px; }

/* ---------- the "How to play" sheet: picture on top, then calm text ---------- */
.pa-panel { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(43, 38, 32, .5); animation: paFade .25s ease-out both; }
.pa-panel[hidden] { display: none; }
@keyframes paFade { from { opacity: 0; } }
.pa-sheet { position: relative; box-sizing: border-box; width: min(100%, 680px); max-height: 94vh; max-height: min(94dvh, 100%); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 20px calc(28px + env(safe-area-inset-bottom)); background: var(--pa-box); color: var(--pa-ink); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5); animation: paRise .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes paRise { from { transform: translateY(40px); opacity: 0; } }
.pa-sheet:focus { outline: none; }
.pa-sheet__bar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; margin: 0 -20px; padding: 8px 12px; background: var(--pa-box); }
.pa-x { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 16px 0 12px; font: 400 20px/1 var(--display); color: var(--pa-ink); background: var(--pa-paper2); border: 0; border-radius: 999px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pa-x:hover { background: #FFF1C9; }
.pa-x svg { width: 18px; height: 18px; }
.pa-pic { display: block; width: min(100%, 52vh); height: auto; aspect-ratio: 1; margin: 0 auto 16px; border-radius: 24px; background: var(--pa-paper2); }
.pa-sheet h2 { font-size: clamp(36px, 8.5vw, 50px); }
.pa-sheet__tease { margin: 6px 0 0; font-size: 20px; line-height: 1.4; }
.pa-facts { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 12px 0 0; padding: 0; list-style: none; font-size: 16px; font-weight: 700; color: var(--pa-soft); }
.pa-facts li:not(:last-child)::after { content: "\00B7"; margin: 0 8px; }
.pa .pa-h3 { font-size: 28px; margin: 26px 0 10px; color: var(--deep); }
.pa-h3[tabindex]:focus { outline: none; }
.pa-need { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pa-need li { position: relative; padding-left: 22px; font-size: 18px; line-height: 1.45; }
.pa-need li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--deep); }
.pa-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.pa-steps li { counter-increment: s; position: relative; padding-left: 50px; min-height: 38px; font-size: 19px; line-height: 1.45; }
.pa-steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; display: grid; place-items: center; font: 400 23px/1 var(--display); background: var(--acc); border-radius: 50%; }
/* steps with an ink picture beside each one (2026-11-19): picture left with the number on its corner, words right */
.pa-steps--pics { gap: 16px; }
.pa-steps--pics li { display: grid; grid-template-columns: minmax(118px, 40%) 1fr; gap: 12px; align-items: center; padding: 6px; margin: 0 -6px; min-height: 0; border-radius: 18px; transition: background-color .25s; }
.pa-steps--pics li::before { left: -2px; top: -4px; z-index: 1; width: 34px; height: 34px; font-size: 21px; box-shadow: 0 0 0 3px var(--pa-box); }
.pa-step__pic { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 16px; background: #FFFAF0; box-shadow: inset 0 0 0 1px var(--pa-line); }
.pa-steps li.is-reading { background: var(--band); }
/* the one voice button: nothing plays until it is tapped */
.pa-hear { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; margin: 16px 0 0; padding: 0 22px 0 16px; font: 400 23px/1 var(--display); color: var(--pa-ink); background: var(--band); border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 0 rgba(43, 38, 32, .18); -webkit-tap-highlight-color: transparent; }
.pa-hear svg { width: 26px; height: 26px; flex: none; }
.pa-hear:hover { filter: brightness(1.04); }
.pa-hear[aria-pressed="true"] { background: #FFF1C9; }
.pa-twice { display: grid; gap: 14px; margin-top: 26px; }
.pa-twice > div { font-size: 18px; line-height: 1.45; }
.pa-twice b, .pa-safe b { display: block; font: 400 24px/1.15 var(--display); }
.pa-twice p, .pa-safe p { margin: 2px 0 0; }
.pa-safe { margin-top: 24px; padding: 14px 16px 16px; font-size: 18px; line-height: 1.45; background: #FBE4D6; border-radius: 18px; }
.pa-safe b { color: #7A2D0C; }
.pa-grown { margin-top: 22px; }
.pa-grown__btn { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 2px; text-align: left; font: 700 16px/1.25 var(--body); color: var(--pa-soft); background: none; border: 0; cursor: pointer; }
.pa-grown__btn:hover { color: var(--pa-ink); }
.pa-grown__btn svg { width: 22px; height: 22px; flex: none; }
.pa-grown__note { margin: 0 2px; font-size: 15px; color: var(--pa-soft); }
.pa .pa-grown h3 { font-size: 24px; margin-bottom: 6px; }
.pa-grown h3[tabindex]:focus { outline: none; }
.pa-grown p { margin: 6px 0; font-size: 16px; line-height: 1.45; }
.pa-grown ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pa-grown li a { display: block; padding: 10px 2px; min-height: 44px; box-sizing: border-box; font-size: 16px; line-height: 1.35; font-weight: 700; color: var(--pa-ink); text-underline-offset: 3px; }
.pa-another { appearance: none; display: block; width: 100%; min-height: 52px; margin-top: 18px; font: 400 22px/1 var(--display); color: var(--pa-ink); background: var(--pa-paper2); border: 0; border-radius: 999px; cursor: pointer; }
.pa-another:hover { background: #FFF1C9; }

/* on-screen games: one big Play button */
.pa-onscreen { margin: 0 0 2px; font: 800 14px/1.3 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--deep); }
.pa-howto { margin: 0; font-size: 19px; line-height: 1.5; }
.pa-play { display: flex; align-items: center; justify-content: center; min-height: 64px; margin: 18px 0 0; font: 400 34px/1 var(--display); text-decoration: none; color: #FFF8E8; background: var(--pa-moss); border-radius: 999px; box-shadow: 0 6px 0 #1D3019; -webkit-tap-highlight-color: transparent; transition: transform .15s, box-shadow .15s; }
.pa-play:hover { background: #3E5E33; }
.pa-play:active { transform: translateY(4px); box-shadow: 0 2px 0 #1D3019; }

/* how-to video: never autoplays */
.pa-video { margin: 20px 0 0; }
.pa-video video { display: block; width: min(100%, 520px, 68vh); aspect-ratio: 1 / 1; margin: 0 auto; background: var(--pa-paper2); border-radius: 20px; object-fit: contain; }
.pa-video figcaption { width: min(100%, 520px); margin: 6px auto 0; font-size: 15px; line-height: 1.4; color: var(--pa-soft); text-align: center; }
.pa-video__steps { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0 4px; min-height: 44px; font: inherit; font-weight: 800; color: var(--pa-focus); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (min-width: 700px) {
  body.pa { font-size: 19px; }
  .pa-cats { grid-template-columns: repeat(5, 1fr); }
  .pa-cats li:last-child { grid-column: auto; width: auto; }
  .pa-grid { gap: 18px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .pa-panel { align-items: center; padding: 20px; }
  .pa-sheet { border-radius: 30px; max-height: min(92dvh, 900px); padding: 0 32px 30px; }
  .pa-sheet__bar { margin: 0 -32px; padding: 10px 16px; }
  .pa-pic { width: min(100%, 420px, 52vh); }
  .pa-twice { grid-template-columns: 1fr 1fr; gap: 24px; }
  .pa-steps--pics li { grid-template-columns: 210px 1fr; gap: 18px; }
}
/* landscape phones: short screens. Keep the sheet usable. */
@media (max-height: 460px) {
  .pa-panel { align-items: stretch; padding: 0; }
  .pa-sheet { max-height: 100%; border-radius: 0; }
}
@media (max-width: 380px) { .pa-grid { gap: 10px; } .pa-card__title { font-size: 20px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pa-panel, .pa-sheet { animation: none !important; }
  .pa-card, .pa-cat, .pa-bigpick, .pa-play, .pa-steps--pics li { transition: none; }
  .pa-card:hover, .pa-card:focus-visible, .pa-cat:hover, .pa-cat:focus-visible, .pa-bigpick:hover, .pa-bigpick:focus-visible { transform: none; }
}
