/* Rosie (June's coach) v2: decluttered stage + new face (1325-declutter) */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: "Avenir Next", "Nunito", system-ui, -apple-system, sans-serif; background: radial-gradient(120% 90% at 50% 30%, #3d2470 0%, #241341 55%, #140a28 100%); color: #f7f1ff; overflow: hidden; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 0; }
#brand { font-weight: 700; font-size: 18px; letter-spacing: 3px; text-transform: uppercase; opacity: .75; }
#clock { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 16px; opacity: .8; margin-left: 10px; }
#topBtns { display: flex; gap: 8px; }
#topBtns button { background: rgba(255,255,255,.08); border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 18px; }
#btnMute.off { background: #ff6f86 !important; }
#btnMute.live { background: rgba(61,220,151,.22) !important; box-shadow: 0 0 0 calc(2px + var(--lvl, 0) * 12px) rgba(61,220,151,.5); transition: box-shadow .12s linear; }
#btnMute.nomic { background: #ffb86b !important; }
#micPill { margin-top: 6px; border: 0; border-radius: 18px; padding: 12px 20px; font-weight: 800; font-size: 16px; background: #ff6f86; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#micPill.warn { background: #ffb86b; color: #2a1450; }
#volPop { position: fixed; top: 62px; right: 18px; background: #3a2266; border-radius: 16px; padding: 10px; display: flex; gap: 8px; align-items: center; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
#volPop button { background: rgba(255,255,255,.15); border: 0; border-radius: 10px; padding: 6px 10px; }

/* stage: big, free face */
#stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px; gap: 4px; }
#rosie { width: min(92vw, 78vh); height: auto; max-height: min(64vh, calc(100vh - 330px)); overflow: visible; filter: drop-shadow(0 18px 40px rgba(170,120,255,.32)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
#caption { font-size: 22px; line-height: 1.35; text-align: center; min-height: 2.8em; max-width: 680px; font-weight: 600; }
#heard { font-size: 15px; opacity: .6; min-height: 1.2em; text-align: center; font-style: italic; }
#hint { font-size: 14px; opacity: .7; min-height: 1em; }
#errLine { font-size: 13px; color: #ffb3c1; }
#nowCard { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 10px 12px 10px 16px; max-width: 560px; width: 100%; margin-top: 6px; backdrop-filter: blur(6px); }
#nowCard .em { font-size: 24px; }
#nowCard .lab { flex: 1; font-size: 16px; font-weight: 600; }
#nowCard .lab small { display: block; font-weight: 500; font-size: 12px; opacity: .65; letter-spacing: .3px; }
#nowCard button { border: 0; border-radius: 14px; padding: 10px 14px; background: linear-gradient(135deg, #ff9a8b, #ff6f91); color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; }
#nowCard button.cam { background: rgba(255,255,255,.14); padding: 10px 12px; }
#nowCard .chip { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 12px; background: #ffb86b; color: #2a1450; }

/* dock: 3 buttons */
#dock { display: flex; gap: 14px; padding: 10px 20px 16px; justify-content: center; }
#dock button { position: relative; flex: 0 1 200px; border: 0; border-radius: 22px; padding: 12px 8px; background: rgba(255,255,255,.1); font-size: 24px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#dock button span { font-size: 13px; font-weight: 700; letter-spacing: .3px; }
#dock button.on { background: linear-gradient(135deg, #ff9a8b, #c58bff); }
#menuDot { position: absolute; top: 8px; right: calc(50% - 26px); width: 12px; height: 12px; border-radius: 50%; background: #ffb86b; box-shadow: 0 0 0 3px #2b1750; }

/* sheets (menu, my day) */
.sheet { position: fixed; inset: 0; z-index: 35; background: rgba(12,5,26,.55); backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .18s ease-out; }
.sheetCard { width: min(100%, 860px); max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #2c1852; border-radius: 28px 28px 0 0; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.45); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fadeIn { from { opacity: 0; } }
.sheetTop { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.back { border: 0; border-radius: 16px; padding: 12px 18px; background: rgba(255,255,255,.12); font-weight: 800; font-size: 16px; }
.sheetH { margin: 4px 2px 6px; font-size: 22px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { border: 0; border-radius: 20px; padding: 16px 10px; background: rgba(255,255,255,.08); font-size: 30px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-height: 118px; justify-content: center; }
.tile b { font-size: 15px; }
.tile small { font-size: 12px; opacity: .65; }
.tile.dim { opacity: .45; }
.tile.soft { background: rgba(255,255,255,.04); }
.grown { margin-top: 16px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; display: flex; align-items: center; gap: 14px; }
.grown > span { font-size: 13px; font-weight: 700; opacity: .6; letter-spacing: 1px; text-transform: uppercase; }
.tile.parent { flex-direction: row; min-height: 0; padding: 10px 16px; font-size: 22px; gap: 10px; }
.tile.parent.hot { background: #ffb86b; color: #2a1450; }
#progress { font-size: 14px; opacity: .8; }
.block { margin: 10px 0 4px; }
.block h3 { margin: 6px 0; font-size: 16px; opacity: .9; display: flex; justify-content: space-between; }
.block h3 em { font-style: normal; font-weight: 500; font-size: 13px; opacity: .75; }
.block.later { opacity: .55; }
.step { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.07); border-radius: 14px; padding: 10px 12px; margin: 6px 0; }
.step .em { font-size: 22px; width: 28px; text-align: center; }
.step .lab { flex: 1; font-size: 16px; }
.step .lab small { display: block; opacity: .7; font-size: 12px; }
.step .chip { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 10px; background: rgba(255,255,255,.15); white-space: nowrap; }
.step.ready .chip { background: #ffb86b; color: #2a1450; }
.step.done .chip { background: #3ddc97; color: #10301f; }
.step.notneeded .chip { background: #8a7fb0; }
.step.done .lab, .step.notneeded .lab { opacity: .6; text-decoration: line-through; }
.step.cur { outline: 2px solid #ff9a8b; }
.step .acts { display: flex; gap: 6px; }
.step .acts button { border: 0; border-radius: 12px; padding: 8px 10px; background: linear-gradient(135deg, #ff9a8b, #ff6f91); color: #fff; font-weight: 800; font-size: 14px; }
.step .acts button.cam { background: rgba(255,255,255,.18); }
#breakLine { font-size: 14px; opacity: .8; margin: 10px 2px; }

/* face expressions */
#rosie * { transition: opacity .35s ease, transform .35s ease; }
#rosie .eOpen { transform-box: fill-box; transform-origin: center; animation: blink 5.2s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
#rosie .eHappy, #rosie .eSleep, #rings, #sparkles, #thinkDots, #zzz { opacity: 0; }
#star { transform-box: fill-box; transform-origin: center; animation: twinkle 3.4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.12) rotate(8deg); opacity: .85; } }
#bow { transition: none; }
body.talking #rBody { animation: bob 1.3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 90%; }
@keyframes bob { 25% { transform: rotate(-1.2deg) translateY(-2px); } 75% { transform: rotate(1.2deg) translateY(-2px); } }
body.listening #rings { opacity: .9; animation: ring 1.2s ease-in-out infinite; }
@keyframes ring { 50% { opacity: .35; } }
body.listening #eyes { transform: translateY(-3px); }
body.listening #rBody { transform: rotate(-3deg); transform-box: fill-box; transform-origin: 50% 90%; }
body.thinking #eyes { transform: translate(8px, -8px); }
body.thinking #thinkDots { opacity: 1; }
body.thinking #thinkDots circle { animation: dot 1.2s ease-in-out infinite; }
body.thinking #thinkDots circle:nth-child(2) { animation-delay: .2s; } body.thinking #thinkDots circle:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 50% { opacity: .3; } }
body.happy #rosie .eOpen { opacity: 0; } body.happy #rosie .eHappy { opacity: 1; }
body.happy #sparkles { opacity: 1; animation: sparkle .9s ease-in-out 2; }
@keyframes sparkle { 50% { opacity: .2; } }
body.happy #star { animation: pop .5s ease-in-out 3; }
@keyframes pop { 50% { transform: scale(1.35) rotate(-12deg); } }
body.happy .blush { opacity: 1; }
.blush { opacity: .6; }
body[data-phase="sleep"] #rosie .eOpen, body.sleepy #rosie .eOpen { opacity: 0; animation: none; }
body[data-phase="sleep"] #rosie .eSleep, body.sleepy #rosie .eSleep { opacity: 1; }
body[data-phase="sleep"] #zzz, body.sleepy #zzz { opacity: 1; animation: zz 3s ease-in-out infinite; }
@keyframes zz { 50% { transform: translateY(-6px); opacity: .5; } }
body[data-phase="sleep"] #rosie { animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.985); } }
body[data-phase="sleep"] #star { animation: none; opacity: .6; }
body[data-phase="sleep"] #top, body[data-phase="sleep"] #dock, body[data-phase="sleep"] #nowCard, body[data-phase="sleep"] #heard { visibility: hidden; }

/* wake: sleeping Rosie stays visible above the card */
#wake { position: fixed; inset: 0; background: linear-gradient(180deg, rgba(20,10,40,0) 40%, rgba(20,10,40,.85) 80%); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
.wakeCard { text-align: center; }
#timerPill { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #ff9a8b, #ff6f91); color: #fff; font-weight: 800; padding: 8px 16px; border-radius: 20px; font-size: 18px; z-index: 34; }
.wakeT { font-size: 30px; font-weight: 800; margin: 0 0 14px; letter-spacing: .5px; }
#btnWake { border: 0; border-radius: 22px; padding: 18px 30px; font-size: 22px; font-weight: 800; background: linear-gradient(135deg, #ff9a8b, #c58bff); color: #fff; }
.wakeSub { margin-top: 14px; opacity: .7; font-size: 14px; }
#modal { position: fixed; inset: 0; background: rgba(10,4,24,.7); display: flex; align-items: center; justify-content: center; z-index: 40; }
#modalCard { background: #2c1852; border-radius: 24px; padding: 18px; width: min(94vw, 640px); max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#modalCard h2 { margin: 0 0 10px; font-size: 22px; display: flex; justify-content: space-between; align-items: center; }
#modalCard .x { border: 0; background: rgba(255,255,255,.15); border-radius: 12px; padding: 6px 12px; font-size: 18px; }
#modalCard .row { display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.08); border-radius: 14px; padding: 10px; margin: 8px 0; }
#modalCard .row .lab { flex: 1; }
#modalCard .row button, #modalCard .big { border: 0; border-radius: 12px; padding: 10px 12px; font-weight: 800; background: #ff6fb5; color: #fff; }
#modalCard .row button.ok { background: #3ddc97; color: #10301f; }
#modalCard .row button.nn { background: #8a7fb0; }
#modalCard .row img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
#modalCard .big { display: block; width: 100%; margin-top: 12px; font-size: 18px; padding: 14px; }
#modalCard .muted { opacity: .7; font-size: 14px; }
#modalCard textarea, #modalCard input[type=text] { width: 100%; border-radius: 12px; border: 0; padding: 10px; font: inherit; font-size: 16px; margin: 4px 0 10px; background: #f6f0ff; color: #2a1450; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px auto; max-width: 320px; }
.keypad button { border: 0; border-radius: 16px; padding: 16px; font-size: 24px; font-weight: 800; background: rgba(255,255,255,.14); }
.dots { text-align: center; font-size: 28px; letter-spacing: 8px; min-height: 36px; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ideas button { border: 0; border-radius: 14px; padding: 14px 8px; background: rgba(255,255,255,.12); font-weight: 700; font-size: 15px; }
.script { white-space: pre-wrap; font-size: 17px; line-height: 1.55; background: rgba(255,255,255,.06); border-radius: 14px; padding: 12px; max-height: 46vh; overflow-y: auto; }
.faces { display: flex; gap: 8px; justify-content: space-around; font-size: 34px; }
.faces button { background: transparent; border: 3px solid transparent; border-radius: 14px; padding: 2px 8px; }
.faces button.on { border-color: #ff6fb5; }
.calm { text-align: center; }
.calm .ball { width: 140px; height: 140px; border-radius: 50%; margin: 20px auto; background: radial-gradient(circle, #ffd1ea, #ff6fb5); transition: transform 4s ease-in-out; }
.calm .ball.big { transform: scale(1.6); }
@media (orientation: portrait) {
  #rosie { width: min(88vw, 640px); max-height: 52vh; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) { .tiles { grid-template-columns: repeat(2, 1fr); } #caption { font-size: 19px; } }

/* 1640-mute: unmissable MUTED banner (only while muted and awake) + mute button that can't be double-fired by zoom taps */
#btnMute { touch-action: manipulation; }
#btnMute.off { box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(255,111,134,.8); }
#muteBanner { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 14px; width: min(92vw, 640px); border: 3px solid #fff; border-radius: 22px; padding: 16px 22px; background: #e8455f; color: #fff; font-size: 20px; font-weight: 700; text-align: left; box-shadow: 0 10px 34px rgba(0,0,0,.4); animation: mbPulse 1.6s ease-in-out infinite; touch-action: manipulation; }
#muteBanner .mbIco { font-size: 38px; line-height: 1; }
#muteBanner b { display: block; font-size: 26px; font-weight: 900; letter-spacing: 3px; }
@keyframes mbPulse { 50% { box-shadow: 0 10px 34px rgba(0,0,0,.4), 0 0 0 10px rgba(232,69,95,.35); } }
body.muted #rosie { opacity: .55; filter: grayscale(.5) drop-shadow(0 18px 40px rgba(170,120,255,.2)); }
body.muted #phones { opacity: .35; }
