/* ============================================================================
   Play-Along on-screen games: shared styles for the six games in games/play-along/screen/.
   Restyled 2026-11-18 to match the painted Play-Along front screen: warm paper, one painted scene per screen, soft edges, no ink boxes.
   A child's screen is a picture, a few words and one main button. Sits on shared/world.css (fonts, menu, PIN gate).
   Touch first: every button is 44 px or bigger. Nothing here blinks fast; reduced motion switches movement off.
   ========================================================================== */
:root {
  --og-paper: #FBF1DC; --og-paper2: #F5E6C6; --og-box: #FFF9EA; --og-raise: #FFFBEF;
  --og-ink: #3A2C1E; --og-soft: #5C4A36; --og-line: rgba(90, 64, 36, .28);
  --og-moss: #4B6B3A; --og-moss2: #3A5530; --og-gold: #F2B531;
  --og-shadow: 0 3px 0 rgba(122, 86, 44, .32), 0 10px 18px -10px rgba(74, 48, 20, .55);
  --og-glass: rgba(255, 249, 234, .92);
}

html { background: var(--og-paper); }
body.og { margin: 0; padding: 70px 0 0; min-height: 100vh; min-height: 100svh; color: var(--og-ink); background: var(--og-paper); font-family: var(--body); font-size: 18px; line-height: 1.5; overflow-x: hidden; }
.og .wnav { position: absolute; background: rgba(58, 44, 30, .94); }
.og .wnav__music { display: none !important; }   /* one sound control per screen: the game's own switch in the top bar */
.og h1, .og h2, .og h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: .01em; color: var(--og-ink); }
.og button { font-family: var(--display); }
.og :focus-visible { outline: 3px solid var(--og-ink); outline-offset: 2px; box-shadow: 0 0 0 7px rgba(255, 249, 234, .9); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar: back to the Play-Along shelf, the game name, the one sound switch ---------- */
.og-top { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px max(12px, calc((100% - 1040px) / 2)); background: var(--og-paper); }
.og-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px; text-decoration: none; font: 400 20px/1 var(--display); color: var(--og-ink); background: var(--og-raise); box-shadow: var(--og-shadow); -webkit-tap-highlight-color: transparent; flex: none; }
.og-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='%233A2C1E' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.og-back:hover, .og-snd:hover { background: #FFF1C9; }
.og-top__title { flex: 1 1 auto; min-width: 0; margin: 0; text-align: center; font: 400 22px/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:has(#intro:not([hidden])) .og-top__title { visibility: hidden; }   /* the start screen already says the name */
.og-snd { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; font: 400 17px/1 var(--display); color: var(--og-ink); background: var(--og-raise); border: 0; border-radius: 999px; box-shadow: var(--og-shadow); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.og-snd__i { 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='M4 9v6h4l5 4V5L8 9z' fill='%23F5D060' stroke='%233A2C1E' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M16 9a4 4 0 0 1 0 6M18.5 6.5a8 8 0 0 1 0 11' fill='none' stroke='%233A2C1E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.og-snd[aria-pressed="false"] .og-snd__i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z' fill='%23E6DDC8' stroke='%233A2C1E' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M16.5 9.5l5 5M21.5 9.5l-5 5' fill='none' stroke='%233A2C1E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
@media (max-width: 440px) { .og-snd__t { display: none; } .og-snd { padding: 0 9px; } .og-top__title { font-size: 18px; } .og-back { padding: 0 10px 0 6px; font-size: 18px; } }

/* ---------- the page: no box, the painting is the page ---------- */
.og-main { width: min(100%, 1040px); margin: 0 auto; position: relative; z-index: 1; }
.og-box { position: relative; color: var(--og-ink); }
.og-say { margin: 6px 0; font-size: 19px; line-height: 1.4; max-width: 46ch; }
.og-soft { color: var(--og-soft); font-size: 15px; }

/* ---------- start screen: a full-width painted scene, the name, one short line, the level buttons ---------- */
.og-intro { display: grid; justify-items: center; text-align: center; padding-bottom: 8px; }
.og-hero { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; -webkit-mask-image: linear-gradient(#000 90%, transparent); mask-image: linear-gradient(#000 90%, transparent); }
.og-intro__txt { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 2px 16px 10px; box-sizing: border-box; }
.og-intro h1 { font-size: clamp(36px, 10vw, 58px); }
.og-intro .og-say { margin: 0 auto 6px; }
.og-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 460px); }
.og-lv { appearance: none; -webkit-appearance: none; display: grid; place-items: center; min-height: 68px; padding: 6px; font: 400 23px/1.05 var(--display); color: var(--og-ink); border: 0; border-radius: 24px 28px 22px 26px / 26px 22px 28px 24px; cursor: pointer; background: #F9E3A1 url("art/paint.webp") center / cover; background-blend-mode: multiply; box-shadow: var(--og-shadow); transition: transform .15s, box-shadow .15s, filter .15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.og-lv:nth-child(1) { background-color: #CFE6B8; } .og-lv:nth-child(3) { background-color: #F9C8A8; }
.og-lv:hover { filter: brightness(1.05); }
.og-lv:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(122, 86, 44, .4); }
@media (min-width: 860px), (max-height: 520px) and (orientation: landscape) {
  .og-intro { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: center; gap: 8px; padding: 10px 12px 12px; box-sizing: border-box; }
  .og-hero { border-radius: 30px 36px 28px 38px / 36px 28px 38px 30px; -webkit-mask-image: none; mask-image: none; box-shadow: 0 16px 30px -22px rgba(74, 48, 20, .7); }
  .og-levels { grid-template-columns: 1fr; width: min(100%, 280px); }
  .og-lv { min-height: 58px; }
}

/* ---------- the play area: one calm painted scene (each game's css names its own picture) ---------- */
#play { position: relative; box-sizing: border-box; padding: 10px 12px 18px; min-height: calc(100svh - 126px); background-position: center; background-size: cover; scroll-margin-top: 58px; }
@media (min-width: 760px) { #play { width: min(100%, 760px); margin: 8px auto 0; padding: 14px 22px 22px; min-height: 0; border-radius: 30px 36px 28px 38px / 36px 28px 38px 30px; box-shadow: 0 16px 30px -22px rgba(74, 48, 20, .7); } }

/* ---------- buttons ---------- */
.og-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 20px; font: 400 20px/1.1 var(--display); letter-spacing: .015em; color: #FFF8E8; background: var(--og-moss); border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 var(--og-moss2), 0 10px 18px -10px rgba(74, 48, 20, .6); transition: transform .15s, box-shadow .15s, background .15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.og-btn:hover { background: #587C45; }
.og-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--og-moss2); }
.og-btn--soft { color: var(--og-ink); background: var(--og-glass); box-shadow: var(--og-shadow); }
.og-btn--soft:hover { background: #FFF1C9; }
.og-btn--soft:active { box-shadow: 0 1px 0 rgba(122, 86, 44, .4); }
.og-btn[disabled] { opacity: .55; cursor: default; }
.og-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- play bar: the level and little progress dots ---------- */
.og-hud { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 10px; }
.og-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 2px 14px; font: 400 20px/1.15 var(--display); color: var(--og-ink); background: var(--og-glass); border-radius: 999px; box-shadow: var(--og-shadow); }
.og-dots { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 0; padding: 6px 10px; list-style: none; background: var(--og-glass); border-radius: 999px; box-shadow: var(--og-shadow); }
.og-dots:empty { display: none; }
.og-dots li { width: 14px; height: 14px; border-radius: 50%; background: #E9D9B8; transition: background .2s, transform .2s; }
.og-dots li.is-on { background: var(--og-gold); transform: scale(1.12); }
.og-dots li.is-now { box-shadow: 0 0 0 3px rgba(90, 64, 36, .35); }

/* ---------- speech bubble ---------- */
.og-bubble { position: relative; display: inline-block; max-width: 100%; box-sizing: border-box; padding: 9px 16px 8px; font: 400 21px/1.2 var(--display); color: var(--og-ink); background: var(--og-glass); border-radius: 18px 22px 17px 21px; box-shadow: var(--og-shadow); text-align: left; }
.og-bubble::after { content: ""; position: absolute; left: -7px; bottom: 12px; width: 14px; height: 14px; background: var(--og-glass); transform: rotate(45deg); }
.og-bubble--plain::after { display: none; }

/* ---------- the end card: fills the screen with the game's scene, softened ---------- */
.og-end { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; box-sizing: border-box; padding: 16px; overflow-y: auto; background-color: var(--og-paper); background-position: center; background-size: cover; animation: ogIn .35s ease-out both; }
.og-end__in { display: grid; justify-items: center; gap: 10px; text-align: center; width: min(100%, 440px); box-sizing: border-box; padding: 18px 16px 20px; background: var(--og-glass); border-radius: 30px 36px 28px 38px / 36px 28px 38px 30px; box-shadow: 0 18px 34px -20px rgba(74, 48, 20, .7); }
.og-end h2 { font-size: clamp(34px, 9vw, 48px); }
.og-end img { height: clamp(120px, 24vh, 190px); width: auto; max-width: 80%; object-fit: contain; }
.og-end .og-say { margin: 0; }
@keyframes ogIn { from { opacity: 0; } }

/* ---------- message when something cannot load (no 3D on this device) ---------- */
.og-msg { display: grid; justify-items: center; gap: 12px; padding: 22px 12px; text-align: center; }
.og-msg h2 { font-size: 32px; }

/* ---------- footer ---------- */
.og-foot { width: min(100% - 24px, 980px); margin: 6px auto 0; padding: 14px 0 calc(26px + env(safe-area-inset-bottom)); font-size: 14px; line-height: 1.5; color: var(--og-soft); text-align: center; }
.og-foot p { margin: 4px auto; }
.og-foot a { color: inherit; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }

/* short, wide screens (a phone held sideways): the menu bar scrolls away, the page tightens */
@media (max-height: 520px) and (orientation: landscape) {
  body.og { padding-top: 58px; }
  .og-top { padding-top: 3px; padding-bottom: 3px; }
  .og-intro h1 { font-size: 32px; }
  .og-hero { max-height: calc(100svh - 128px); }
  .og-levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .og-lv { min-height: 50px; font-size: 20px; }
  #play { min-height: 0; padding: 8px 12px 10px; }
  .og-hud { margin-bottom: 6px; }
  .og-end img { height: 84px; }
  .og-end__in { padding: 10px 14px 12px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
