/* “Play in my place” (version 1.4): the picture fills the page; the controls float over it. Every control is 44 px or more; sizes follow --k (the age group). */
.pm, .pm * { text-shadow: none; box-sizing: border-box; }
.pm { position: relative; height: 100%; min-height: calc(260px * var(--k, 1)); overflow: hidden; color: var(--text); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 0; background: linear-gradient(180deg, #9cc8f0, #d8ecfb); }
/* the picture fills the whole page: a child's page normally keeps air at the bottom, and a page with a favorite backdrop keeps air at the sides */
body[data-page="place-play"] #app.kid #view.full { padding: 0; }
.pm-stage { position: absolute; inset: 0; }
.pm-canvas, .pm-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.pm-canvas:focus-visible { outline: 3px solid #ffb020; outline-offset: -3px; }
.pm-fx { pointer-events: none; }
.pm-veil { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 12px; background: linear-gradient(180deg, #9cc8f0, #e6f3fd); font-size: calc(18px * var(--k, 1)); color: #17324d; }
.pm-veil[hidden] { display: none; }

/* round floating buttons */
.pm-b { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(20, 40, 80, .18); background: rgba(255, 255, 255, .94); color: #17324d; font: inherit; font-size: 22px; font-weight: 800; line-height: 1; cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 rgba(20, 40, 80, .22); padding: 0; -webkit-tap-highlight-color: transparent; }
.pm-b svg { width: 22px; height: 22px; } .pm-b.big { width: calc(52px * var(--k, 1)); height: calc(52px * var(--k, 1)); min-width: 48px; min-height: 48px; font-size: calc(25px * var(--k, 1)); }
.pm-b:active { transform: translateY(2px); box-shadow: none; } .pm-b[aria-pressed="true"], .pm-b[aria-expanded="true"] { background: #ffe9a8; border-color: #f5a800; } .pm-b[disabled] { opacity: .5; }
.pm-b:focus-visible, .pm-act:focus-visible, .pm-call:focus-visible, .pm-ideas:focus-visible, .pm-show:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

.pm-top { position: absolute; z-index: 4; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 8px calc(10px + var(--safe-r, 0px)) 0 calc(10px + var(--safe-l, 0px)); pointer-events: none; min-width: 0; }
.pm-top > * { pointer-events: auto; } .pm-gap { flex: 1 1 0; pointer-events: none; }
.pm-title { min-width: 0; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #17324d; font-size: calc(15px * var(--k, 1)); box-shadow: 0 2px 0 rgba(20, 40, 80, .16); pointer-events: none; }
.pm-side { position: absolute; z-index: 4; right: calc(10px + var(--safe-r, 0px)); top: 66px; bottom: calc(96px * var(--k, 1)); display: flex; flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; gap: 8px; pointer-events: none; }
.pm-side > * { pointer-events: auto; }

/* the big button, the caption, “Call” */
.pm-bottom { position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(10px + var(--safe-b, 0px)); display: grid; justify-items: center; gap: 8px; padding: 0 10px; pointer-events: none; }
.pm-bottom > * { pointer-events: auto; }
.pm-cap { max-width: min(92%, 520px); padding: 8px 16px; border-radius: 18px; background: rgba(255, 255, 255, .95); color: #17324d; font-weight: 700; font-size: calc(16px * var(--k, 1)); line-height: 1.25; text-align: center; box-shadow: 0 3px 0 rgba(20, 40, 80, .18); pointer-events: none; }
.pm-cap[hidden] { display: none; }
.pm-acts { display: flex; align-items: flex-end; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 0; }
.pm-act { display: inline-flex; align-items: center; gap: 10px; min-height: calc(60px * var(--k, 1)); min-width: 132px; max-width: 78vw; padding: 8px 22px 8px 14px; border-radius: 999px; border: 3px solid #b96d00; background: linear-gradient(180deg, #ffd45a, #ffb020); color: #3a2200; font: inherit; font-weight: 800; font-size: calc(19px * var(--k, 1)); line-height: 1.1; cursor: pointer; box-shadow: 0 5px 0 #b96d00, 0 10px 18px rgba(0, 0, 0, .18); -webkit-tap-highlight-color: transparent; }
.pm-act .e { font-size: calc(30px * var(--k, 1)); line-height: 1; } .pm-act:active { transform: translateY(4px); box-shadow: 0 1px 0 #b96d00; }
.pm-act.two { min-height: 48px; min-width: 0; padding: 6px 16px 6px 10px; font-size: calc(15px * var(--k, 1)); border-color: #2563eb; background: linear-gradient(180deg, #e3efff, #bcd7ff); color: #0f2a5c; box-shadow: 0 4px 0 #2563eb; } .pm-act.two .e { font-size: calc(22px * var(--k, 1)); }
.pm-act[hidden], .pm-call[hidden] { display: none; }
.pm-call { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 2px solid #15803d; background: linear-gradient(180deg, #d9f7df, #a9eab6); color: #0b3d1e; font: inherit; font-weight: 800; font-size: calc(15px * var(--k, 1)); cursor: pointer; box-shadow: 0 4px 0 #15803d; }
.pm-call > span:first-child { font-size: calc(22px * var(--k, 1)); } .pm-call:active { transform: translateY(3px); box-shadow: 0 1px 0 #15803d; }
body:not(.calm) .pm-act:not([hidden]) { animation: pm-pop .22s ease-out; }
@keyframes pm-pop { from { transform: scale(.86); opacity: .4; } to { transform: none; opacity: 1; } }

/* the stick */
.pm-stick { position: absolute; z-index: 4; left: calc(14px + var(--safe-l, 0px)); bottom: calc(14px + var(--safe-b, 0px)); width: calc(104px * var(--k, 1)); height: calc(104px * var(--k, 1)); min-width: 96px; min-height: 96px; border-radius: 50%; background: rgba(255, 255, 255, .42); border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); touch-action: none; cursor: grab; }
.pm-stick[hidden] { display: none; }
.pm-stick i { position: absolute; left: 27%; top: 27%; width: 46%; height: 46%; border-radius: 50%; background: #ffffff; border: 2px solid rgba(20, 40, 80, .25); box-shadow: 0 3px 0 rgba(20, 40, 80, .25); pointer-events: none; }

/* weather and the “more” list */
.pm-wx { position: absolute; z-index: 5; right: calc(70px * var(--k, 1) + var(--safe-r, 0px)); top: 120px; display: flex; gap: 8px; padding: 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.pm-menu { position: absolute; z-index: 5; right: calc(10px + var(--safe-r, 0px)); top: 62px; display: grid; gap: 6px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, .97); box-shadow: 0 6px 18px rgba(0, 0, 0, .22); max-width: min(92vw, 340px); max-height: calc(100% - 76px); overflow: auto; }
.pm-menu .kbtn { justify-content: flex-start; text-align: left; min-height: 44px; white-space: normal; } .pm-wx[hidden], .pm-menu[hidden] { display: none; }

/* things to try */
.pm-ideas { position: absolute; z-index: 4; left: calc(10px + var(--safe-l, 0px)); top: 66px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 2px solid rgba(20, 40, 80, .18); background: rgba(255, 255, 255, .94); color: #17324d; font: inherit; font-weight: 700; font-size: calc(14px * var(--k, 1)); cursor: pointer; box-shadow: 0 3px 0 rgba(20, 40, 80, .2); }
.pm-ideas[hidden], .pm-ideacard[hidden] { display: none; } .pm-ideas.ping { border-color: #16a34a; background: #eafbee; }
.pm-ideacard { position: absolute; z-index: 5; left: calc(10px + var(--safe-l, 0px)); top: 118px; width: min(300px, calc(100% - 20px)); padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .97); color: #17324d; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); font-size: calc(15px * var(--k, 1)); }
.pm-ideacard ul { list-style: none; margin: 8px 0 6px; padding: 0; display: grid; gap: 8px; } .pm-ideacard li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.25; } .pm-ideacard .tick { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #9db2c8; color: transparent; font-size: 13px; font-weight: 900; }
.pm-ideacard li.done .tick { background: #22c55e; border-color: #15803d; color: #ffffff; } .pm-ideacard li.done { color: #3d5a73; } .pm-ideacard p { margin: 0; }
.pm .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the clean view: nothing but the picture, and one small way back to the buttons */
.pm.clean [data-ui], .pm.clean .pm-ideas, .pm.clean .pm-ideacard { display: none; }
.pm-show { position: absolute; z-index: 4; right: calc(10px + var(--safe-r, 0px)); bottom: calc(10px + var(--safe-b, 0px)); min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .7); background: rgba(20, 30, 60, .45); color: #ffffff; font: inherit; font-weight: 700; cursor: pointer; } .pm-show[hidden] { display: none; }
.pm.flash::after { content: ''; position: absolute; inset: 0; z-index: 7; background: #ffffff; opacity: .7; pointer-events: none; animation: pm-flash .35s ease-out forwards; } body.calm .pm.flash::after { display: none; }
@keyframes pm-flash { to { opacity: 0; } }

/* the telescope: a round look at the night sky */
.pm-lens { position: absolute; z-index: 6; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(8, 12, 40, .55); } .pm-lens[hidden] { display: none; }
.pm-lens .sky { position: relative; width: min(62vmin, 340px); height: min(62vmin, 340px); border-radius: 50%; overflow: hidden; border: 10px solid #2b2f55; box-shadow: 0 0 0 4px #f5b301, 0 14px 40px rgba(0, 0, 0, .45); background: radial-gradient(circle at 30% 30%, #27307e, #0b0f38 70%); }
.pm-lens .s { position: absolute; width: calc(3px * var(--z, 1)); height: calc(3px * var(--z, 1)); border-radius: 50%; background: #fff7d1; animation: pm-twinkle 2.4s ease-in-out infinite; }
.pm-lens .moon { position: absolute; right: 16%; top: 14%; width: 22%; height: 22%; border-radius: 50%; background: #fff3c4; box-shadow: inset -10px -6px 0 #e8d48a, 0 0 24px rgba(255, 243, 196, .6); }
.pm-lens .shoot { position: absolute; left: 12%; top: 22%; width: 70px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff); transform: rotate(18deg); opacity: 0; animation: pm-shoot 5s ease-in 1.2s infinite; }
@keyframes pm-twinkle { 50% { opacity: .35; transform: scale(.7); } } @keyframes pm-shoot { 0% { opacity: 0; transform: translate(0, 0) rotate(18deg); } 6% { opacity: 1; } 16% { opacity: 0; transform: translate(160px, 52px) rotate(18deg); } 100% { opacity: 0; } }
body.calm .pm-lens .s, body.calm .pm-lens .shoot { animation: none; }
@media (prefers-reduced-motion: reduce) { .pm-lens .s, .pm-lens .shoot, .pm-act { animation: none !important; } }
.pm-book { position: absolute; z-index: 6; left: 50%; bottom: calc(96px * var(--k, 1)); transform: translateX(-50%); width: min(340px, calc(100% - 24px)); display: grid; justify-items: center; gap: 6px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .98); color: #17324d; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); } .pm-book[hidden] { display: none; }
.pm-book .e { font-size: 40px; line-height: 1; } .pm-book p { margin: 0; } .pm-book b { font-size: calc(18px * var(--k, 1)); } .pm-book .row { justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* the kind cards: no place named, a place that is not there */
.pm-plain { background: none; overflow: auto; } .pm-plain .pm-top { position: static; padding-bottom: 8px; } .pm-plain .pm-title { max-width: none; }
.pm-mid { display: grid; place-items: start center; padding: 12px; }
.pm-card { width: min(520px, 100%); display: grid; justify-items: center; gap: 8px; text-align: center; padding: calc(20px * var(--k, 1)); } .pm > .pm-card { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 24px)); background: var(--panel, #ffffff); }
.pm-card .e { font-size: calc(54px * var(--k, 1)); line-height: 1; } .pm-card h2 { margin: 0; font-size: calc(22px * var(--k, 1)); } .pm-card p { margin: 0 0 6px; } .pm-card .row { justify-content: center; flex-wrap: wrap; gap: 8px; }
.pm-pick { display: grid; gap: 8px; width: 100%; } .pm-pickrow { justify-content: flex-start; min-height: 52px; text-align: left; } .pm-pickrow .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* small and low screens: a phone on its side */
@media (max-height: 520px) { .pm-side { top: 60px; bottom: 8px; } .pm-act { min-height: 52px; font-size: calc(17px * var(--k, 1)); } .pm-stick { width: 96px; height: 96px; } .pm-ideacard { top: 112px; max-height: calc(100% - 120px); overflow: auto; } .pm-book { bottom: 76px; } .pm-wx { top: 62px; } }
@media (max-width: 520px) { /* on a narrow phone the big buttons need the whole bottom edge, so the walking stick sits above them at the left, where a thumb rests */ .pm-stick { bottom: calc(158px + var(--safe-b, 0px)); } .pm-side { bottom: calc(134px + var(--safe-b, 0px)); } .pm-title { max-width: 38%; font-size: calc(13.5px * var(--k, 1)); padding: 7px 11px; } .pm-act { max-width: 62vw; } .pm-wx { right: 66px; flex-wrap: wrap; border-radius: 22px; max-width: calc(100% - 80px); } }
/* strong contrast */
:root[data-contrast="high"] .pm-b, :root[data-contrast="high"] .pm-title, :root[data-contrast="high"] .pm-cap, :root[data-contrast="high"] .pm-ideas { background: #ffffff; color: #000000; border-color: #000000; }
:root[data-contrast="high"] .pm-act { background: #ffd000; color: #000000; border-color: #000000; box-shadow: 0 5px 0 #000000; } :root[data-contrast="high"] .pm-call { background: #ffffff; color: #000000; border-color: #000000; box-shadow: 0 4px 0 #000000; }

/* while a child plays in their place the side menu steps back to its pictures, as it does in the studio: the place needs the width (a laptop, a tablet on its side).
   Every part of the Lab is still one tap away, and the menu button at the top opens the names. */
@media (min-width: 1024px) {
  body[data-page="place-play"] #app.kid { grid-template-columns: calc(76px + var(--safe-l)) minmax(0, 1fr); }
  body[data-page="place-play"] #app.kid:not(.sidebar-open) #sidebar { padding: 8px 6px calc(10px + var(--safe-b)) calc(6px + var(--safe-l)); scrollbar-width: none; }
  body[data-page="place-play"] #app.kid:not(.sidebar-open) #sidebar::-webkit-scrollbar { display: none; }
  body[data-page="place-play"] #app.kid:not(.sidebar-open) #sidebar .knav { justify-content: center; gap: 0; padding: 4px; margin: 3px 0; min-height: 52px; }
  body[data-page="place-play"] #app.kid:not(.sidebar-open) #sidebar .knav span:not(.ico) { display: none; }
  body[data-page="place-play"] #app.kid:not(.sidebar-open) #sidebar .knav .ico { width: 44px; height: 44px; font-size: 23px; }
  body[data-page="place-play"] #app.kid.sidebar-open #sidebar { position: fixed; z-index: 70; top: calc(var(--topbar) + var(--safe-t)); bottom: 0; left: 0; width: calc(240px * var(--k)); box-shadow: 8px 0 30px rgba(20, 40, 110, .3); background: var(--bg2); }
  body[data-page="place-play"] #app.kid #menuBtn { display: inline-grid; color: var(--bar-ink, #fff); }
}
