/* ================================================================ LITTLE GIGGLERS (ages 2–4)
   Its own look: big, round, bright, soft. Sizes are in vmin so phones and tablets, portrait and landscape all work.
   The whole zone is one full-screen layer above the rest of Giggleland (z-index max). */
.tots { position: fixed; inset: 0; z-index: 2147483000; display: none; overflow: hidden; font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; color: #3a2a6b;
  background: linear-gradient(180deg, #8fd8ff 0%, #c9f0ff 55%, #fff4c9 100%); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.tots.on { display: block; }
.tots * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html.tots-lock, html.tots-lock body { overflow: hidden !important; overscroll-behavior: none; touch-action: none; height: 100%; }
html.tots-lock body > *:not(.tots) { visibility: hidden; }
.tots button { font-family: inherit; color: inherit; cursor: pointer; border: 0; }
.tots-stage { position: absolute; inset: 0; }

/* soft sky decorations */
.tots-cloud { position: absolute; width: 26vmin; height: 9vmin; background: #fff; border-radius: 9vmin; opacity: .85; animation: totsDrift 38s linear infinite; pointer-events: none; }
.tots-cloud::before, .tots-cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.tots-cloud::before { width: 11vmin; height: 11vmin; left: 4vmin; top: -5vmin; }
.tots-cloud::after { width: 14vmin; height: 14vmin; left: 10vmin; top: -7vmin; }
@keyframes totsDrift { from { transform: translateX(-35vmin); } to { transform: translateX(120vw); } }
.tots-hill { position: absolute; left: -10%; right: -10%; bottom: -24vmin; height: 44vmin; border-radius: 50% 50% 0 0; background: #8fe388; pointer-events: none; }
.tots-hill.b { left: 35%; right: -30%; bottom: -28vmin; background: #6fd27a; }

/* the mascot: Gigi, the Giggleland smiley */
.tots-gigi { width: 22vmin; height: 22vmin; flex: none; animation: totsBob 2.6s ease-in-out infinite; filter: drop-shadow(0 1.2vmin 1.2vmin rgba(80, 40, 140, .22)); }
.tots-gigi .eye { transform-box: fill-box; transform-origin: center; animation: totsBlink 4.5s infinite; }
.tots-gigi .mouth { transform-box: fill-box; transform-origin: center top; }
.tots.talking .tots-gigi .mouth { animation: totsTalk .22s ease-in-out infinite alternate; }
.tots-gigi.sleep .eye { transform: scaleY(.12); animation: none; }
@keyframes totsBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-1.6vmin) rotate(2deg); } }
@keyframes totsBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes totsTalk { from { transform: scaleY(.55); } to { transform: scaleY(1.1); } }

/* ---------- toddler home: big picture tiles, no reading needed, no scrolling */
.tots-home { position: absolute; inset: 0; display: flex; flex-direction: column; padding: max(2vmin, env(safe-area-inset-top)) 3vmin 3vmin; gap: 2vmin; }
.tots-hello { display: flex; align-items: center; gap: 2vmin; min-height: 18vmin; z-index: 1; }
.tots-hello .tots-gigi { width: 17vmin; height: 17vmin; }
.tots-bubble { background: #fff; border-radius: 4vmin 4vmin 4vmin 1vmin; padding: 1.6vmin 3vmin; font: 800 clamp(16px, 4.2vmin, 34px)/1.15 'Baloo 2', sans-serif; box-shadow: 0 1vmin 2.4vmin rgba(60, 40, 140, .15); animation: totsPop .35s cubic-bezier(.2, 1.6, .4, 1); }
.tots-tiles { flex: 1; display: grid; gap: 2.4vmin; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; z-index: 1; min-height: 0; }
@media (orientation: portrait) { .tots-tiles { grid-template-columns: repeat(2, 1fr); } }
.tots-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 6vmin; min-height: 0; overflow: hidden;
  background: linear-gradient(160deg, var(--a), var(--b)); box-shadow: 0 1.4vmin 0 var(--d), 0 2.4vmin 4vmin rgba(60, 40, 140, .2); transition: transform .12s; animation: totsIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.tots-tile:active { transform: translateY(1vmin) scale(.97); box-shadow: 0 .4vmin 0 var(--d); }
.tots-tile .art { font-size: min(15vmin, 14vh); line-height: 1; filter: drop-shadow(0 .8vmin .6vmin rgba(0, 0, 0, .18)); display: flex; align-items: center; justify-content: center; gap: .5vmin; }
.tots-tile .art small { font-size: .55em; }
.tots-tile .lbl { margin-top: .6vmin; font: 800 clamp(15px, 3.6vmin, 30px)/1 'Baloo 2', sans-serif; color: #fff; text-shadow: 0 .4vmin 0 rgba(0, 0, 0, .18); }
.tots-tile .dots { display: flex; gap: 1vmin; } .tots-tile .dots i { width: 7vmin; height: 7vmin; border-radius: 50%; background: var(--c); box-shadow: inset -.8vmin -.8vmin 0 rgba(0, 0, 0, .15), 0 .6vmin 0 rgba(0, 0, 0, .12); }
@keyframes totsIn { from { transform: scale(.4); opacity: 0; } }
@keyframes totsPop { from { transform: scale(.6); opacity: 0; } }

/* ---------- in-game furniture */
.tots-game { position: absolute; inset: 0; }
.tots-home-btn { position: absolute; left: max(2vmin, env(safe-area-inset-left)); top: max(2vmin, env(safe-area-inset-top)); width: 15vmin; height: 15vmin; max-width: 96px; max-height: 96px; border-radius: 50%; z-index: 20;
  background: #fff; box-shadow: 0 .8vmin 0 #d9d2ff; font-size: min(8vmin, 48px); display: grid; place-items: center; }
.tots-ring { position: absolute; inset: -6px; border-radius: 50%; pointer-events: none; background: conic-gradient(#7b5cff calc(var(--p, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%); mask: radial-gradient(circle, transparent 62%, #000 63%); }
.tots-say { position: absolute; left: 50%; top: max(2vmin, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 1.5vmin; pointer-events: none; max-width: 92vw; }
.tots-say .tots-gigi { width: 13vmin; height: 13vmin; }
.tots-say .tots-bubble { font-size: clamp(16px, 4.6vmin, 36px); white-space: nowrap; }
.tots-say .tots-bubble:empty { display: none; }
.tots-label { position: absolute; left: 50%; bottom: 4vmin; transform: translateX(-50%); z-index: 15; padding: 1vmin 5vmin; border-radius: 6vmin; background: #fff; font: 800 clamp(26px, 9vmin, 72px)/1.1 'Baloo 2', sans-serif; color: var(--c, #7b5cff);
  box-shadow: 0 1.2vmin 3vmin rgba(60, 40, 140, .22); animation: totsPop .3s cubic-bezier(.2, 1.6, .4, 1); pointer-events: none; white-space: nowrap; }

/* big tappable things */
.tots-row { position: absolute; left: 0; right: 0; top: 20vmin; bottom: 4vmin; display: flex; align-items: center; justify-content: space-evenly; flex-wrap: wrap; gap: 3vmin; padding: 0 3vmin; }
.tots-thing { position: relative; display: grid; place-items: center; width: var(--s, 30vmin); height: var(--s, 30vmin); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--bg, #fff1b8)); box-shadow: 0 1.6vmin 0 rgba(0, 0, 0, .08), 0 2vmin 4vmin rgba(60, 40, 140, .16);
  font-size: calc(var(--s, 30vmin) * .62); line-height: 1; animation: totsIn .45s cubic-bezier(.2, 1.5, .4, 1) both; touch-action: none; }
.tots-thing svg { width: 82%; height: 82%; overflow: visible; }
.tots-thing.plain { background: none; box-shadow: none; }
.tots-thing.boing { animation: totsBoing .6s cubic-bezier(.2, 1.6, .4, 1); }
.tots-thing.wiggle { animation: totsWiggle .9s ease-in-out infinite; }
.tots-thing.yay { animation: totsYay .8s cubic-bezier(.2, 1.6, .4, 1); z-index: 5; }
@keyframes totsBoing { 0% { transform: scale(1); } 30% { transform: scale(1.22, .82); } 55% { transform: scale(.9, 1.14) translateY(-3vmin); } 100% { transform: scale(1); } }
@keyframes totsWiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg) scale(1.05); } 40% { transform: rotate(9deg) scale(1.08); } 60% { transform: rotate(-6deg); } }
@keyframes totsYay { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-8deg); } 70% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(1); } }

/* celebration particles */
.tots-fx { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.tots-fx i { position: absolute; font-style: normal; font-size: 7vmin; transition: transform 1s cubic-bezier(.15, .7, .3, 1), opacity 1s ease-in; will-change: transform, opacity; }

/* ---------- shapes & puzzles (drag) */
.tots-hole, .tots-piece { position: absolute; display: grid; place-items: center; touch-action: none; }
.tots-hole svg, .tots-piece svg { width: 100%; height: 100%; overflow: visible; }
.tots-piece { z-index: 4; transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), left .35s cubic-bezier(.2, 1.2, .4, 1), top .35s cubic-bezier(.2, 1.2, .4, 1); filter: drop-shadow(0 1.2vmin .8vmin rgba(60, 40, 140, .25)); }
.tots-piece.drag { transition: none; z-index: 10; filter: drop-shadow(0 3vmin 2vmin rgba(60, 40, 140, .3)); }
.tots-piece.done { filter: none; pointer-events: none; }
.tots-board { position: absolute; border-radius: 3vmin; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 .8vmin rgba(255, 255, 255, .9); overflow: hidden; }
.tots-board canvas { width: 100%; height: 100%; opacity: .22; }
.tots-board .grid { position: absolute; inset: 0; }
.tots-piece canvas { width: 100%; height: 100%; border-radius: 1.6vmin; box-shadow: 0 0 0 .5vmin #fff; }

/* ---------- first words */
.tots-cats { position: absolute; left: 0; right: 0; top: max(2vmin, env(safe-area-inset-top)); display: flex; justify-content: center; gap: 2vmin; padding-left: 18vmin; padding-right: 12vmin; z-index: 10; }
.tots-cat { width: min(13vmin, 84px); height: min(13vmin, 84px); border-radius: 50%; background: #fff; font-size: min(8vmin, 50px); display: grid; place-items: center; box-shadow: 0 .8vmin 0 #d9d2ff; opacity: .75; transition: transform .15s; }
.tots-cat.on { opacity: 1; transform: scale(1.15); box-shadow: 0 0 0 1vmin #ffd23f, 0 .8vmin 0 #d9d2ff; }
.tots-words { position: absolute; left: 3vmin; right: 3vmin; top: calc(min(13vmin, 84px) + 7vmin); bottom: 4vmin; display: grid; gap: 2.4vmin; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
@media (orientation: portrait) { .tots-words { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); } }
.tots-word { display: grid; place-items: center; border-radius: 5vmin; background: #fff; font-size: min(17vmin, 13vh); box-shadow: 0 1.2vmin 0 #e3dcff; animation: totsIn .4s cubic-bezier(.2, 1.5, .4, 1) both; touch-action: none; }
.tots-word.more { background: linear-gradient(160deg, #ffd23f, #ff9f1c); box-shadow: 0 1.2vmin 0 #d9822b; font-size: min(12vmin, 10vh); }
.tots-word.boing { animation: totsBoing .6s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- colouring */
.tots-paint { position: absolute; display: block; touch-action: none; }
.tots-page { position: absolute; background: #fff; border-radius: 3vmin; box-shadow: 0 1.4vmin 4vmin rgba(60, 40, 140, .18); }
.tots-pal { position: absolute; display: flex; gap: 1.6vmin; justify-content: center; align-items: center; flex-wrap: wrap; z-index: 10; }
.tots-pal button { width: min(13vmin, 84px); height: min(13vmin, 84px); border-radius: 50%; box-shadow: inset 0 -1vmin 0 rgba(0, 0, 0, .15), 0 .6vmin 1.2vmin rgba(0, 0, 0, .15); font-size: min(7vmin, 44px); display: grid; place-items: center; transition: transform .15s; }
.tots-pal button.on { transform: scale(1.18); box-shadow: 0 0 0 1vmin #fff, 0 0 0 1.8vmin #7b5cff; }
.tots-pal .tool { background: #fff; }

/* ---------- time for a break */
.tots-break { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vmin; background: linear-gradient(180deg, #2b2470, #6b4fc9); color: #fff; text-align: center; }
.tots-break h2 { margin: 0; font: 800 clamp(26px, 8vmin, 64px)/1 'Baloo 2', sans-serif; }
.tots-break p { margin: 0; font: 700 clamp(15px, 3.6vmin, 26px)/1.3 'Nunito', sans-serif; opacity: .9; }
.tots-star { position: absolute; color: #fff7b0; animation: totsTwinkle 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes totsTwinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.2); } }

/* ---------- the grown-up corner + check */
.tots-corner { position: absolute; right: 0; top: 0; width: 76px; height: 76px; z-index: 40; touch-action: none; display: grid; place-items: center; }
.tots-corner::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 2px rgba(123, 92, 255, .25); }
.tots-corner .tots-ring { inset: 10px; opacity: 0; transition: opacity .2s; }
.tots-corner.hold .tots-ring { opacity: 1; }
.tots-gate { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(30, 20, 70, .72); backdrop-filter: blur(6px); }
.tots-gate-card { width: min(420px, 92vw); max-height: 96vh; overflow: auto; background: #fff; border-radius: 26px; padding: 22px; text-align: center; font-family: 'Nunito', system-ui, sans-serif; color: #2a1f5c; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.tots-gate-card h3 { margin: 0 0 4px; font: 800 24px 'Baloo 2', sans-serif; }
.tots-gate-card p { margin: 0 0 12px; font-weight: 700; color: #6b6698; }
.tots-q { font: 800 34px 'Baloo 2', sans-serif; margin: 6px 0; }
.tots-ans { height: 52px; margin: 0 auto 12px; width: 140px; border-radius: 14px; background: #f1edff; font: 800 34px/52px 'Baloo 2', sans-serif; letter-spacing: 4px; }
.tots-ans.bad { animation: totsShake .4s; background: #ffe3e3; }
@keyframes totsShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.tots-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tots-keys button, .tots-gate-card .tots-btn { height: 54px; border-radius: 14px; background: #f1edff; font: 800 24px 'Baloo 2', sans-serif; color: #2a1f5c; }
.tots-keys button:active { background: #ddd3ff; }
.tots-gate-card .tots-btn { width: 100%; margin-top: 10px; font-size: 18px; }

/* ---------- grown-up set-up page (a normal, readable page) */
.tots-setup { position: absolute; inset: 0; overflow: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: max(16px, env(safe-area-inset-top)) 16px 30px; font-family: 'Nunito', system-ui, sans-serif; color: #2a1f5c; user-select: none; }
.tots-setup-in { max-width: 860px; margin: 0 auto; }
.tots-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.tots-head .tots-gigi { width: 92px; height: 92px; }
.tots-head h1 { margin: 0; font: 800 clamp(28px, 6vw, 44px)/1 'Baloo 2', sans-serif; color: #5b3fd6; }
.tots-head h1 span { color: #ff6f9e; }
.tots-head p { margin: 4px 0 0; font-weight: 800; color: #6b6698; }
.tots-card { background: rgba(255, 255, 255, .92); border-radius: 22px; padding: 16px; margin: 12px 0; box-shadow: 0 8px 26px rgba(60, 40, 140, .12); }
.tots-card h2 { margin: 0 0 10px; font: 800 20px 'Baloo 2', sans-serif; color: #3d2b8f; }
.tots-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tots-pick button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 18px; background: #f4f1ff; font: 800 15px 'Nunito', sans-serif; box-shadow: inset 0 0 0 3px transparent; }
.tots-pick button b { font-size: 36px; line-height: 1.1; }
.tots-pick button.on { background: #fff6d6; box-shadow: inset 0 0 0 3px #ffb020; }
.tots-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.tots-opts button { padding: 10px 16px; border-radius: 999px; background: #f4f1ff; font: 800 16px 'Nunito', sans-serif; }
.tots-opts button.on { background: #7b5cff; color: #fff; }
.tots-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #efeaff; font-weight: 800; }
.tots-set:last-child { border-bottom: 0; }
.tots-start { display: block; width: 100%; margin: 14px 0 8px; padding: 18px; border-radius: 22px; background: linear-gradient(180deg, #4cd964, #22b04b); color: #fff !important; font: 800 26px 'Baloo 2', sans-serif; box-shadow: 0 7px 0 #178a39, 0 12px 24px rgba(20, 120, 50, .3); }
.tots-start:active { transform: translateY(4px); box-shadow: 0 3px 0 #178a39; }
.tots-link { display: block; margin: 6px auto; padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .8); font: 800 16px 'Nunito', sans-serif; }
.tots-link.red { background: #ffe3e3; color: #c92a2a !important; }
.tots-info { font-weight: 700; color: #4c4580; line-height: 1.45; font-size: 15px; }
.tots-info b { color: #2a1f5c; }
.tots-info details { margin-top: 8px; background: #f7f5ff; border-radius: 14px; padding: 10px 12px; }
.tots-info summary { font-weight: 800; cursor: pointer; color: #5b3fd6; }
.tots-info ol { margin: 6px 0 0 18px; padding: 0; }

/* entry points elsewhere in Giggleland */
.tp-tots-banner { display: flex; align-items: center; gap: 14px; width: 100%; margin: 14px 0 4px; padding: 14px 18px; border: 0; border-radius: 22px; cursor: pointer; text-align: left; color: #2a1f5c;
  background: linear-gradient(120deg, #fff2a8, #ffd1ea 50%, #b9ecff); box-shadow: 0 6px 0 rgba(123, 92, 255, .25), 0 10px 26px rgba(60, 40, 140, .15); font-family: 'Nunito', sans-serif; }
.tp-tots-banner .e { font-size: 46px; line-height: 1; }
.tp-tots-banner b { display: block; font: 800 22px/1.1 'Baloo 2', sans-serif; color: #5b3fd6; }
.tp-tots-banner small { font-weight: 800; color: #6b6698; font-size: 14px; }
.tp-tots-banner .go { margin-left: auto; padding: 10px 16px; border-radius: 999px; background: #7b5cff; color: #fff; font-weight: 900; white-space: nowrap; }
.w-tots { display: block; width: 100%; margin-top: 10px; padding: 10px; border-radius: 14px; background: #fff6d6; font-weight: 800; color: #5b3fd6; }
.tots-hole.wiggle, .tots-piece.wiggle { animation: totsWiggle .9s ease-in-out 2; }
.tots-thing { --s: var(--sl, 30vmin); }
@media (orientation: portrait) {
  .tots-thing { --s: var(--sp, var(--sl, 30vmin)); }
  .tots-row:not(.flat):not(.quad) { flex-direction: column; flex-wrap: nowrap; }
  .tots-row.quad { align-content: center; }
  .tots-row.flat .tots-thing { --s: min(27vmin, 28vw); }
}
