/* Playground (design v3, docs/redesign/playground/pg.html): a page head; the six games as cards (week · day, title,
   one line, badge, Play) beside the badge card; the 15 locked robot missions in a collapsed "Robot missions" section;
   then the open game with a one-line fact bar; then the Concept lab as week cards. The games' own frames live in
   css/games/shell.css and css/games/<id>.css and keep their own sizes. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* page head */
.pagehead.pg-intro .lede { max-width: 58ch; margin: 10px 0 0; font-size: var(--fs-lg); line-height: 1.55; color: var(--text-2); }
.pg-later { margin: 10px 0 0; max-width: 70ch; font-size: var(--fs-sm); color: var(--text-2); }
.pg-head { display: grid; gap: 6px; justify-items: start; margin: 0 0 20px; }
.pg-head h2 { margin: 0; font-size: var(--fs-xl); }
.pg-head .meta { margin: 0; max-width: 70ch; }

.pg-card { position: relative; align-self: start; padding: 16px 18px 14px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); }
.pg-card-head { position: relative; display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; }
.pg-card-head b { font-size: var(--fs-base); }
.pg-card-head span { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--ink-soft); }
.pg-slots { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; }
.pg-slot { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.pg-slot > svg, .pg-slot-empty { width: 66px; height: 66px; }
.pg-slot > svg { mix-blend-mode: multiply; opacity: .9; font-family: var(--font-head); }
.pg-slot-empty { display: grid; place-items: center; border: 1.5px dashed #C3CCD8; border-radius: 50%; color: #AEB8C6; }
.pg-slot-empty svg { width: 26px; height: 26px; }
.pg-slot-name { max-width: 100%; font-size: var(--fs-xs); line-height: 1.2; color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; }
.pg-slot.got .pg-slot-name { color: var(--ink); font-weight: 600; }
.pg-card-note { position: relative; margin: 8px 4px 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--ink-soft); }

/* the collection: game cards, then the robot missions */
.pg-shelf { padding-top: 40px; }
.pg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.pg-pick { position: static; display: block; max-height: none; overflow: visible; padding: 0; min-width: 0; }
.pg-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pg-row > li { min-width: 0; display: grid; }
.pg-tile { --g-ink: var(--navy); position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 4px 14px; align-items: start; min-width: 0; padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.pg-tile:hover { color: var(--text); background: #fff; border-color: var(--rule-2); box-shadow: 0 12px 24px -20px rgba(11, 37, 69, .45); }
.pg-tile:hover .pg-art svg { transform: translateY(-2px); }
.pg-tile:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.pg-tile.on { background: #fff; border-color: var(--g-ink); box-shadow: 0 0 0 1px var(--g-ink); }
.pg-art { grid-row: 1 / span 2; display: block; border-radius: 8px; background-color: var(--tint); background-image: linear-gradient(#E7ECF2 1px, transparent 1px), linear-gradient(90deg, #E7ECF2 1px, transparent 1px); background-size: 12px 12px; background-position: -1px -1px; overflow: hidden; }
.pg-tile.on .pg-art { background-color: color-mix(in srgb, var(--g-ink) 7%, #fff); }
.pg-art svg { display: block; width: 100%; height: auto; aspect-ratio: 160 / 96; transition: transform .2s ease; }
.pg-text { display: grid; gap: 2px; line-height: 1.35; min-width: 0; padding-right: 26px; }
.pg-text b { font-size: var(--fs-base); font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.pg-concept { font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
.pg-where { font-size: var(--fs-xs); color: var(--text-2); }
.pg-badge { margin-top: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.pg-play { grid-column: 2; justify-self: start; margin-top: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--link); }
.pg-tile:hover .pg-play { color: var(--navy); text-decoration: underline; }
.pg-tile.on .pg-where { color: var(--g-ink); font-weight: 600; }
.pg-row.locked .pg-tile { grid-template-columns: minmax(0, 1fr); background: var(--tint); }
.pg-row.locked .pg-text { padding-right: 0; }
.pg-row.locked .pg-lock { justify-self: start; margin-top: 8px; }
.pg-more { margin-top: 24px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 18px; }
.pg-more[open] { padding-bottom: 18px; }
.pg-more summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--navy); }
.pg-more summary .meta { font-weight: 400; }
.pg-more > p.meta { margin: 0 0 14px; }
/* a small round stamp in the corner once the badge is earned */
.pg-done { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--g-ink); border-radius: 50%; color: var(--g-ink); background: rgba(255, 255, 255, .85); transform: rotate(-12deg); }
.pg-done svg { width: 17px; height: 17px; }

/* the open game */
.pg-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 22px; }
.pg-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 0 2px; border: 0; background: none; }
.pg-meta:empty { display: none; }
.pg-facts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
.pg-facts > div { display: flex; gap: 6px; align-items: baseline; }
.pg-facts dt { font-size: var(--fs-sm); color: var(--ink-soft); }
.pg-facts dt::after { content: ":"; }
.pg-facts dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.pg-meta-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-meta-nav .btn { white-space: nowrap; }
.pg-stage { min-width: 0; }

/* Concept lab: one card per course week, the open animation below */
.pg-sec { margin: 0 auto; padding-top: 56px; padding-bottom: 16px; }
.pg-lab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; margin: 0; }
.lab-week { border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: 16px 18px; }
.lab-week h3 { margin: 0 0 8px; font-size: var(--fs-base); font-weight: 700; color: var(--navy); }
.lab-week ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lab-link { display: grid; gap: 0; padding: 6px 10px; border-left: 2px solid var(--rule); color: var(--text); text-decoration: none; line-height: 1.3; }
.lab-link b { font-size: var(--fs-sm); font-weight: 600; color: var(--link); }
.lab-link span { font-size: var(--fs-sm); color: var(--text-2); }
.lab-link:hover { border-left-color: var(--text-2); background: var(--tint); }
.lab-link:hover b { color: var(--navy); }
.lab-link.on { border-left: 3px solid var(--navy); padding-left: 9px; background: var(--tint); }
.lab-link.on b { color: var(--navy); }
.lab-link:focus-visible { outline: 3px solid var(--navy); outline-offset: 0; }

@media (max-width: 960px) { .pg-cols { grid-template-columns: minmax(0, 1fr); } .pg-card { max-width: 420px; } }
@media (max-width: 560px) {
  .pagehead.pg-intro .lede { font-size: var(--fs-base); }
  .pg-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pg-tile { grid-template-columns: 88px minmax(0, 1fr); padding: 14px; }
  .anim-grid { grid-template-columns: minmax(0, 1fr); }
  .pg-meta-nav { width: 100%; }
  .pg-meta-nav .btn { flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; }
  .pg-slot > svg, .pg-slot-empty { width: 58px; height: 58px; }
  .pg-done { width: 26px; height: 26px; right: 10px; top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pg-tile, .pg-art svg { transition: none; } .pg-tile:hover .pg-art svg { transform: none; } }
