/* Onboarding Service — shared flow styles (v1).
   Palette grounded in the Play Portal's own CSS: cream #fff8ec,
   sand #fdf0d5, ink indigo #2b1d4e, teal #04785d / #0ea37e,
   marigold #f59e0b, coral #f4533f. Kids-friendly, never the adult
   Brain Logic Lounge palette. */
:root {
  --cream: #fff8ec;
  --sand: #fdf0d5;
  --card: #fffdf7;
  --ink: #2b1d4e;
  --ink-soft: #6f6196;
  --teal: #04785d;
  --teal-bright: #0ea37e;
  --amber: #f59e0b;
  --amber-soft: #ffe9a8;
  --coral: #f4533f;
  --line: #e7dcc4;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.brand { font-weight: 800; font-size: 15px; letter-spacing: .02em; color: var(--teal); }
.close-x {
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  width: 40px; height: 40px; border-radius: 999px; font-size: 18px; cursor: pointer;
  display: none;
}
body.embed .close-x { display: inline-block; }
h1 { font-size: 30px; line-height: 1.15; margin: 8px 0 6px; }
.sub { color: var(--ink-soft); font-size: 16px; margin: 0 0 18px; }
body.kids h1 { font-size: 36px; }
body.kids .sub { font-size: 19px; color: var(--ink); }

.step { display: none; }
.step.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cine-stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden;
  background: var(--sand); box-shadow: 0 10px 30px rgba(43, 29, 78, .25);
}
.cine-scene {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .45s ease;
}
.cine-scene.on { opacity: 1; animation: kb 9s ease-out forwards; }
.cine-scene.on.alt { animation-name: kb-alt; }
@keyframes kb { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.09) translate(-1.6%, -1.2%); } }
@keyframes kb-alt { from { transform: scale(1.09) translate(-1.6%, -1.2%); } to { transform: scale(1) translate(0, 0); } }
.cine-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--marigold); color: var(--ink); border: none; cursor: pointer;
  font: 800 19px/1.2 inherit; padding: 16px 26px; border-radius: 999px;
  box-shadow: 0 10px 26px rgba(43, 29, 78, .35); white-space: nowrap;
}
.cine-play:hover { filter: brightness(1.05); }
body.kids .cine-play { font-size: 24px; padding: 20px 32px; }
.cine-replay {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(255, 248, 236, .94); color: var(--ink); border: 2px solid var(--line);
  font: 700 14px inherit; padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.cine-cap { min-height: 3.1em; margin: 12px 2px 8px; font-weight: 600; font-size: 16.5px; }
body.kids .cine-cap { font-size: 19px; font-weight: 700; }
.cine-track { height: 7px; border-radius: 99px; background: var(--sand); overflow: hidden; }
.cine-track span { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 99px; transition: width .25s linear; }
.video-note { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

.card {
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
  padding: 18px; box-shadow: 0 6px 20px rgba(43, 29, 78, .08);
}
.card img.art {
  width: 100%; border-radius: 14px; display: block; aspect-ratio: 16 / 9; object-fit: cover;
  background: var(--sand);
}
.card .art-map {
  height: 0; padding-top: 56.25%; border-radius: 14px; margin-bottom: 14px;
  background-image: url('assets/img/p-map.jpg'); background-repeat: no-repeat;
  background-size: 275% auto; background-color: var(--sand);
}
.art-map.map-math     { background-position: 19% 46%; }
.art-map.map-languages{ background-position: 46% 51%; }
.art-map.map-gaming   { background-position: 67% 46%; }
.art-map.map-culture  { background-position: 86% 54%; }
.card .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card .duo img.art { aspect-ratio: 4 / 3; }
.card h2 { font-size: 24px; margin: 14px 0 6px; }
.card p { font-size: 16px; line-height: 1.5; margin: 0; }
body.kids .card h2 { font-size: 30px; }
body.kids .card p { font-size: 21px; line-height: 1.45; }

.listen {
  margin-top: 12px; border: none; cursor: pointer; border-radius: 999px;
  background: var(--amber-soft); color: var(--ink); font-weight: 700;
  padding: 12px 20px; font-size: 18px; min-height: 52px;
}
.listen:active { transform: scale(.97); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 20px;
}
.btn {
  border: none; cursor: pointer; border-radius: 999px; font-weight: 800;
  padding: 14px 26px; font-size: 17px; min-height: 54px;
  background: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(4, 120, 93, .35);
}
.btn:hover { background: var(--teal-bright); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink-soft); box-shadow: none; border: 2px solid var(--line); }
.btn.amber { background: var(--amber); color: var(--ink); box-shadow: 0 4px 14px rgba(245, 158, 11, .4); }
body.kids .btn { font-size: 20px; padding: 16px 30px; min-height: 60px; }
.dots { display: flex; gap: 7px; align-items: center; }
.dots span { width: 10px; height: 10px; border-radius: 999px; background: var(--line); }
.dots span.on { background: var(--amber); width: 26px; }
.skip-link {
  display: inline-block; margin-top: 14px; color: var(--ink-soft);
  font-size: 14px; background: none; border: none; cursor: pointer; text-decoration: underline;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips span {
  background: var(--card); border: 2px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight: 700; color: var(--teal);
}
.screen-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); min-width: 74px; }
body.kids .screen-label { font-size: 15px; }
.stars { display: flex; gap: 14px; justify-content: center; margin: 16px 0 6px; }
.star-btn {
  font-size: 52px; line-height: 1; background: none; border: none; cursor: pointer;
  filter: grayscale(1) opacity(.45); transition: transform .15s ease, filter .15s ease;
  padding: 6px; -webkit-tap-highlight-color: transparent;
}
.star-btn.popped { filter: none; transform: scale(1.25) rotate(8deg); }
.stars-msg { text-align: center; font-weight: 800; font-size: 20px; color: var(--teal); min-height: 28px; margin: 4px 0 0; }
.done-badge { font-size: 54px; text-align: center; margin: 10px 0; }
.center { text-align: center; }
.again { margin-top: 10px; }
