/* EmotiMate v4.1 — "Bright Meadow" layer: colourful, lively, modern — still soft and predictable.
   Same layout and places as before (predictability matters); colour, depth and gentle motion added.
   Motion: transform/opacity only; html.rm and prefers-reduced-motion get still versions. */
:root {
  --c-sun: #ffcf5c; --c-sun-l: #fff3cc;
  --c-peach: #ff9f6e; --c-peach-l: #ffe6d6;
  --c-coral: #ff7f9b; --c-coral-l: #ffe1e9;
  --c-sky: #5bb4f5; --c-sky-l: #dcefff;
  --c-mint: #46c99a; --c-mint-l: #d8f6e9;
  --c-grape: #8b7cf6; --c-grape-l: #e9e5ff;
  --grad-primary: linear-gradient(135deg, #8b7cf6 0%, #6f8cf7 55%, #5bb4f5 100%);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --bg: #fdf8f1;
}
body {
  background:
    radial-gradient(640px 420px at 108% -8%, rgba(255, 207, 92, .30) 0, rgba(255, 207, 92, 0) 70%),
    radial-gradient(620px 480px at -14% 18%, rgba(139, 124, 246, .20) 0, rgba(139, 124, 246, 0) 70%),
    radial-gradient(640px 520px at 112% 96%, rgba(70, 201, 154, .20) 0, rgba(70, 201, 154, 0) 70%),
    linear-gradient(180deg, #eaf5ff 0%, #fdf8f1 38%, #fff4ea 100%);
  background-attachment: fixed;
}
/* ---------- living background: slow clouds + a few drifting petals ---------- */
#bg-life { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#bg-life .cloud { position: absolute; left: 0; width: 150px; opacity: .85; will-change: transform; animation: cloud-drift linear infinite; }
#bg-life .cloud svg { width: 100%; height: auto; }
#bg-life .c1 { top: 6%; width: 160px; animation-duration: 95s; animation-delay: -20s; }
#bg-life .c2 { top: 30%; width: 110px; opacity: .6; animation-duration: 130s; animation-delay: -80s; }
#bg-life .c3 { top: 62%; width: 140px; opacity: .55; animation-duration: 115s; animation-delay: -50s; }
#bg-life .petal { position: absolute; top: -6%; width: 16px; height: 16px; opacity: .75; will-change: transform; animation: petal-fall linear infinite; }
#bg-life .petal svg { width: 100%; height: 100%; }
#bg-life .p1 { left: 12%; animation-duration: 26s; animation-delay: -4s; }
#bg-life .p2 { left: 48%; animation-duration: 34s; animation-delay: -18s; width: 12px; height: 12px; }
#bg-life .p3 { left: 80%; animation-duration: 30s; animation-delay: -11s; }
@keyframes cloud-drift { from { transform: translateX(-180px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes petal-fall { 0% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(18px, 28vh) rotate(70deg); } 50% { transform: translate(-10px, 56vh) rotate(150deg); } 75% { transform: translate(16px, 84vh) rotate(230deg); } 100% { transform: translate(0, 112vh) rotate(300deg); } }
.app { position: relative; z-index: 1; }

/* ---------- springy, colourful components ---------- */
.btn, .act, .pill, .hub-tile, .face-btn, .choice, .chip-btn, .snd, .int-btn, .opt, .nav-btn, .icon-btn, .seg-btn, .lp {
  transition: transform .45s var(--spring), box-shadow .3s ease, background-color .3s ease, filter .3s ease;
}
.btn:active, .act:active, .pill:active, .hub-tile:active, .face-btn:active, .choice:active, .chip-btn:active, .snd:active, .int-btn:active, .opt:active, .nav-btn:active, .icon-btn:active, .seg-btn:active, .lp:active {
  transform: scale(.93); transition-duration: .12s;
}
.btn-primary { background: var(--grad-primary); box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 12px 24px -10px rgba(111, 140, 247, .75); }
.btn-ghost { box-shadow: 0 0 0 1.5px #dcd6ff inset, 0 6px 14px -8px rgba(111, 104, 200, .35); }
.card { background: linear-gradient(160deg, #ffffff 0%, #fffaf5 100%); box-shadow: 0 0 0 1px rgba(139, 124, 246, .08), 0 14px 30px -16px rgba(111, 104, 200, .35); }
h1 { background: linear-gradient(90deg, #5b4fd6, #8b5cf6 45%, #e0607e); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 2px; }
.logo-word { background: linear-gradient(90deg, #6f62ee, #5bb4f5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-word span { background: linear-gradient(90deg, #ff7f9b, #ff9f6e); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* home: room with a sky, a sun and a meadow floor */
.room { background:
  radial-gradient(80% 50% at 50% 0%, rgba(255, 255, 255, .7) 0, rgba(255, 255, 255, 0) 70%),
  linear-gradient(180deg, #cfe9ff 0%, #e6f3ff 40%, #f3eefe 62%, #ffe9d6 63%, #ffdcc2 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset, 0 22px 44px -20px rgba(91, 120, 220, .45); }
.room.sky-dusk { background: linear-gradient(180deg, #ffd9c2 0%, #f9d3e6 40%, #ece4fb 62%, #ffe2cf 63%, #f9d2b8 100%); }
.room.sky-night { background: linear-gradient(180deg, #8f9ae6 0%, #b3b6ef 40%, #d7d2f6 62%, #e9dcf0 63%, #dccbe6 100%); }
.floor { background: linear-gradient(180deg, #ffe7d3, #ffd6bb); }
.room .floor::before { content: ''; position: absolute; left: 6%; right: 6%; top: 18%; height: 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); }
.room .rcloud { position: absolute; z-index: 0; top: 12%; width: 70px; opacity: .9; pointer-events: none; animation: room-cloud 46s linear infinite; }
.room .rcloud.r2 { top: 24%; width: 48px; opacity: .7; animation-duration: 64s; animation-delay: -30s; }
.room .rcloud svg { width: 100%; height: auto; }
@keyframes room-cloud { from { transform: translateX(-90px); } to { transform: translateX(520px); } }
[dir="rtl"] .room .rcloud { animation-direction: reverse; }
.stage::after { background: radial-gradient(closest-side, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0)) !important; }
.say { background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1.5px rgba(139, 124, 246, .18), 0 12px 26px -14px rgba(111, 104, 200, .5); }

/* care buttons: each its own soft colour */
.act { background: linear-gradient(165deg, #ffffff 0%, var(--tint, #f4f2ff) 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset, 0 10px 20px -12px var(--tint-d, rgba(111, 104, 200, .5)); }
.act .ai { background: #fff !important; box-shadow: 0 6px 14px -8px var(--tint-d, rgba(111, 104, 200, .6)); border-radius: 50%; }
.act .al { color: var(--ink); font-weight: 600; }
.act-feed { --tint: #ffe2cc; --tint-d: rgba(255, 140, 80, .55); }
.act-water { --tint: #d6ecff; --tint-d: rgba(70, 150, 240, .55); }
.act-pet { --tint: #ffdbe7; --tint-d: rgba(255, 110, 150, .55); }
.act-play { --tint: #fff0b8; --tint-d: rgba(240, 180, 40, .6); }
.act-rest { --tint: #e6defe; --tint-d: rgba(130, 110, 240, .55); }
.act.wanted { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--tint-d), 0 10px 20px -12px var(--tint-d); }
.act.wanted .ai { animation: want-bob 2.8s ease-in-out infinite; }
@keyframes want-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.pill-feel { background: linear-gradient(150deg, #fff6d6, #ffe39a); box-shadow: 0 10px 20px -14px rgba(240, 180, 40, .8); }
.pill-calm { background: linear-gradient(150deg, #e3fbf0, #b9eed6); box-shadow: 0 10px 20px -14px rgba(46, 170, 120, .7); }
.pill-more { background: linear-gradient(150deg, #efeaff, #d9d0ff); box-shadow: 0 10px 20px -14px rgba(130, 110, 240, .7); }
.nn-now { background: linear-gradient(150deg, #fff4e0, #ffe2c4) !important; }
.nn-now.free { background: linear-gradient(150deg, #e6fbf1, #c9f0dd) !important; }
.nn-next { background: linear-gradient(150deg, #eef6ff, #d9ebff); }
.timer { background: conic-gradient(#ff9f6e calc(var(--p) * 360deg), #fff1e6 0); }
.stars-pill { background: linear-gradient(150deg, #fff6d6, #ffe7a3); box-shadow: 0 8px 18px -12px rgba(240, 170, 30, .8); }

/* nav: the current tab gets a colour pill and its icon pops once */
.nav-btn.on { background: linear-gradient(150deg, #efeaff, #dcd3ff); color: #4b3fc4; }
.nav-btn.on .ni svg { animation: nav-pop .6s var(--spring) both; }
@keyframes nav-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.14) translateY(-2px); } 100% { transform: scale(1.06) translateY(-1px); } }

/* activities: colourful illustrated tiles */
.hub-tile { background: linear-gradient(160deg, #ffffff 0%, var(--tint, #f1edff) 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset, 0 12px 24px -14px var(--tint-d, rgba(111, 104, 200, .55)); font-weight: 600; }
.hub-tile .ht-i { background: #fff; border-radius: 50%; box-shadow: 0 8px 16px -10px var(--tint-d, rgba(111, 104, 200, .6)); }
.ht-garden { --tint: #d8f6e9; --tint-d: rgba(46, 170, 120, .55); } .ht-pairs { --tint: #ffe1e9; --tint-d: rgba(255, 110, 150, .5); }
.ht-blow { --tint: #dcefff; --tint-d: rgba(70, 150, 240, .5); } .ht-game { --tint: #fff3cc; --tint-d: rgba(240, 180, 40, .55); }
.ht-toolbox { --tint: #e9e5ff; --tint-d: rgba(130, 110, 240, .5); } .ht-stories { --tint: #ffe6d6; --tint-d: rgba(255, 140, 80, .5); }
.ht-firstthen { --tint: #d8f6e9; --tint-d: rgba(46, 170, 120, .5); } .ht-play { --tint: #ffe1e9; --tint-d: rgba(255, 110, 150, .5); }
.ht-book { --tint: #fff3cc; --tint-d: rgba(240, 180, 40, .55); } .ht-journal { --tint: #dcefff; --tint-d: rgba(70, 150, 240, .5); }

/* feelings: each face on its own colour */
.face-btn { background: linear-gradient(165deg, #ffffff 0%, var(--tint, #f4f2ff) 100%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset, 0 12px 22px -14px var(--tint-d, rgba(111, 104, 200, .5)); }
.f-happy { --tint: #fff1b8; --tint-d: rgba(240, 180, 40, .6); } .f-calm { --tint: #d6f5e7; --tint-d: rgba(46, 170, 120, .55); }
.f-sad { --tint: #dcecff; --tint-d: rgba(70, 150, 240, .55); } .f-worried { --tint: #ece6ff; --tint-d: rgba(130, 110, 240, .55); }
.f-angry { --tint: #ffe0e0; --tint-d: rgba(240, 110, 110, .5); } .f-tired { --tint: #eeeaf6; --tint-d: rgba(120, 110, 170, .45); }
.f-unknown { --tint: #f3f1f8; --tint-d: rgba(120, 110, 170, .4); }
.face-btn svg { transition: transform .5s var(--spring); }
.face-btn:active svg { transform: scale(1.08) rotate(-4deg); }
.snd.sel, .chip-btn.sel, .int-btn.sel, .choice.sel { box-shadow: 0 0 0 3px #8b7cf6, 0 12px 22px -12px rgba(111, 104, 200, .6); }

/* screen enter + celebration */
.celebrate { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.celebrate i { position: absolute; top: 40%; left: 50%; width: 12px; height: 12px; border-radius: 4px; will-change: transform, opacity; }
.celebrate i.round { border-radius: 50%; }
.celebrate .cel-heart { position: absolute; width: 26px; height: 26px; will-change: transform, opacity; }

/* reduce motion: everything still */
html.rm #bg-life .cloud, html.rm #bg-life .petal, html.rm .room .rcloud, html.rm .act.wanted .ai, html.rm .nav-btn.on .ni svg { animation: none !important; }
html.rm #bg-life .petal { display: none; }
html.rm .btn:active, html.rm .act:active, html.rm .pill:active, html.rm .hub-tile:active, html.rm .face-btn:active, html.rm .choice:active, html.rm .nav-btn:active { transform: none; }
@media (prefers-reduced-motion: reduce) {
  #bg-life .cloud, #bg-life .petal, .room .rcloud, .act.wanted .ai, .nav-btn.on .ni svg { animation: none !important; }
  #bg-life .petal { display: none; }
}

/* tablets: keep the room a calm size so the care buttons stay in view */
@media (min-width: 700px) { .home .room { flex: 0 0 auto; height: calc(40vh / var(--z, 1)); min-height: 300px; max-height: 560px; } }

/* bubbles game (v4.1): a big rabbit in the lower third, clear of the browser bar; bubbles across the whole field */
.play { --play-bottom: calc(max(18px, var(--safe-b)) + 54px); background: linear-gradient(180deg, #d9eeff 0%, #ece8ff 55%, #ffe9dc 100%); }
.play-char { bottom: var(--play-bottom); }
.play-char .charwrap.play-big { width: clamp(150px, 42vw, 250px); }
.play-char::before { content: ''; position: absolute; left: 8%; right: 8%; bottom: -4px; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(90, 80, 160, .18), rgba(90, 80, 160, 0)); }
.bub { animation: bub-in .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.bub > span { transform: none; }
@keyframes bub-in { from { opacity: 0; } to { opacity: 1; } }
html.rm .bub { animation: fadein .6s ease both; }
@media (min-width: 700px) { .play-char .charwrap.play-big { width: clamp(200px, 30vw, 300px); } }
