@font-face { font-family: "Andika"; src: url(fonts/andika-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url(fonts/andika-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --sky1: #bfe3ff;
  --sky2: #eef8ff;
  --cloud: #ffffff;
  --ink: #23324d;
  --ink-soft: #46597a;
  --teal: #19a89b;
  --teal-dark: #0f6f67;
  --pink: #ff9ec7;
  --pink-soft: #ffe3ef;
  --gold: #ffc93c;
  --glow: #ffe680;
  --shadow: 0 6px 0 rgba(35, 50, 77, .12), 0 10px 24px rgba(35, 50, 77, .10);
  --r: 28px;
  --gutter: max(16px, env(safe-area-inset-left));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Andika", system-ui, sans-serif;
  color: var(--ink);
  background: #e6f5ff url(img/sky.svg) center bottom / cover no-repeat;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
:focus-visible { outline: 4px solid var(--teal-dark); outline-offset: 3px; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.loading { margin: auto; font-size: 1.5rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shared bits ---------- */
.icon-btn {
  min-width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--cloud); box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 0;
}
.icon-btn svg { width: 30px; height: 30px; }
.big-play {
  width: clamp(118px, 30vw, 170px); aspect-ratio: 1; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 34% 28%, #ffc2dc 0, #ff7eb6 46%, #f2559a 100%);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .6), 0 8px 0 #c93d7c, 0 16px 30px rgba(201, 61, 124, .3);
  display: grid; place-items: center; transition: transform .12s, box-shadow .12s;
}
.big-play:active { transform: translateY(5px); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .6), 0 3px 0 #c93d7c; }
.big-play svg { width: 46%; height: 46%; margin-left: 8%; }
.emo { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- home ---------- */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px var(--gutter) 28px; }
.home-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.home-top h1 { font-size: 1.25rem; margin: 0; color: var(--ink); }
.nuvi { width: min(56vw, 280px, 26dvh); height: auto; }
.float { animation: float 4s ease-in-out infinite; will-change: transform; }
@keyframes float { 50% { transform: translateY(-8px); } }
.worlds { display: flex; justify-content: center; gap: 10px; width: 100%; max-width: 620px; }
.world {
  flex: 1 1 0; min-width: 0; max-width: 210px; border: 0; border-radius: var(--r);
  background: var(--cloud); box-shadow: var(--shadow); padding: 7px 7px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .12s;
}
.world:active { transform: scale(.96); }
.wpic { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; background: #e6f5ff; margin-bottom: 4px; }
.world b { font-size: clamp(1rem, 4.4vw, 1.15rem); }
.world small { font-size: 1rem; color: var(--ink-soft); }
.home-row { display: flex; gap: 14px; align-items: center; }
.pill {
  border: 0; border-radius: 999px; background: var(--cloud); box-shadow: var(--shadow);
  min-height: 56px; padding: 6px 20px 6px 8px; display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 700;
}
.pill img { width: 44px; height: 44px; }
.setup { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

/* ---------- the companion who asks ---------- */
.buddy { flex: none; width: clamp(78px, 24vw, 150px); aspect-ratio: 1; display: grid; place-items: center; will-change: transform; }
.buddy .miku { width: 100%; height: 100%; object-fit: contain; }
.buddy.photo { border-radius: 50%; overflow: hidden; border: 5px solid #fff; box-shadow: var(--shadow); background: #fff; }
.buddy.photo img { width: 100%; height: 100%; object-fit: cover; }
.buddy.big { width: 100%; }
.buddy.talking { animation: talkbob .42s ease-in-out infinite alternate; }
.buddy.cheer, .home-buddy.cheer { animation: cheer .7s cubic-bezier(.3, 1.6, .5, 1); }
.buddy.tilt { animation: tilt 1s ease-in-out; }
@keyframes talkbob { to { transform: translateY(-5px) rotate(-3deg); } }
@keyframes cheer { 30% { transform: translateY(-24px) scale(1.1) rotate(-6deg); } 65% { transform: translateY(0) scale(.97); } }
@keyframes tilt { 30%, 70% { transform: rotate(-9deg); } }
.home-buddy { position: relative; border: 0; background: none; padding: 0; width: min(52vw, 250px, 29dvh); }
.home-buddy::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -5%; height: 16%; border-radius: 50%; background: #fff; box-shadow: 0 6px 0 rgba(35, 50, 77, .08); z-index: -1; }
.ask { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 100%; animation: fadein .3s ease-out backwards; }
.ask.small { gap: 12px; }
.ask.small .buddy { width: clamp(60px, 17vw, 100px); }
.bubble { position: relative; min-width: 0; background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 14px 20px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.bubble::before { content: ""; position: absolute; left: -9px; top: 50%; width: 22px; height: 22px; background: #fff; border-radius: 4px; transform: translateY(-50%) rotate(45deg); }
.bubble > * { position: relative; }
.bubble .word, .bubble .sentence { background: none; box-shadow: none; padding: 0 4px; }
.bubble .mic { width: clamp(56px, 16vw, 84px); height: auto; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }
.pick-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pick { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; border: 4px solid #fff; box-shadow: var(--shadow); padding: 0; background: #fff; position: relative; }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick .miku { object-fit: contain; }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 4px #ff6fae, var(--shadow); transform: scale(1.12); }
.pick[aria-pressed="true"]::after { content: "✓"; position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: #ff6fae; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.hold-btn { position: relative; }
.hold-btn .ring { position: absolute; inset: -4px; border-radius: 50%; border: 4px solid transparent; }
.hold-btn.holding .ring { border-color: var(--teal); animation: ring 1s linear forwards; clip-path: inset(0 0 0 0); }
@keyframes ring { from { opacity: .3; transform: scale(1.25); } to { opacity: 1; transform: scale(1); } }
.hold-hint { font-size: 1rem; color: var(--ink-soft); min-height: 1.4em; margin: 0; }

/* ---------- play ---------- */
.play { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; padding: 10px var(--gutter) 16px; height: 100dvh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tokens { display: flex; gap: 6px; align-items: center; justify-content: center; flex: 1 1 auto; min-width: 0; }
.tokens > span { flex: 0 1 clamp(28px, 10vw, 58px); min-width: 0; }
.tokens svg { width: 100%; height: auto; display: block; transition: transform .3s; }
.tokens .now svg { transform: scale(1.14); filter: drop-shadow(0 0 6px rgba(25,168,155,.55)); }
.tokens .pop { animation: pop .5s ease-out; }
@keyframes breathe { 50% { transform: scale(1.12); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.topbar .spacer { width: 56px; }
.prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 0; }
.speak {
  width: clamp(96px, 26vw, 140px); aspect-ratio: 1; border-radius: 50%; border: 0;
  background: var(--teal); box-shadow: 0 7px 0 var(--teal-dark); display: grid; place-items: center;
}
.speak svg { width: 52%; }
.speak.talking { animation: talk .5s ease-in-out infinite alternate; }
@keyframes talk { to { transform: scale(1.07); } }
.speak.small { width: 64px; box-shadow: 0 5px 0 var(--teal-dark); }
.word-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.word {
  font-size: clamp(2rem, min(13vw, calc(150vw / (var(--n, 4) + 3))), 6rem); overflow-wrap: anywhere; font-weight: 700; line-height: 1.1; letter-spacing: .02em;
  background: var(--cloud); border-radius: 40px; padding: 10px 34px 16px; box-shadow: var(--shadow); text-align: center;
}
.word-row > * { min-width: 0; }
.sentence {
  max-width: min(100%, 900px);
  font-size: clamp(1.5rem, 6vw, 2.6rem); line-height: 1.35; text-align: center; margin: 0;
  background: var(--cloud); border-radius: 30px; padding: 10px 22px 14px; box-shadow: var(--shadow); overflow-wrap: anywhere;
}
.sentence span { display: block; }
.sentence mark { background: none; color: var(--teal-dark); font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 14px; }
.card {
  --size: min(43vw, 34dvh, 300px);
  width: var(--size); aspect-ratio: 1; border: 5px solid #fff; padding: 0; border-radius: var(--r);
  background: var(--cloud); box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .18s, opacity .35s, filter .35s;
}
.choices.n1 .card { --size: min(72vw, 46dvh, 360px); }
.choices.n2 .card { --size: min(62vw, 30dvh, 300px); }
.choices.n3 .card { --size: min(43vw, 25dvh, 260px); }
.choices.n4 .card { --size: min(43vw, 24dvh, 240px); }
@media (min-aspect-ratio: 1/1) {
  .choices.n2 .card { --size: min(40vw, 46dvh, 320px); }
  .choices.n3 .card { --size: min(29vw, 40dvh, 270px); }
  .choices.n4 .card { --size: min(22vw, 40dvh, 250px); }
}
.card:active { transform: scale(.96); }
.choices > * { animation: cardin .4s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.choices > :nth-child(2) { animation-delay: .07s; }
.choices > :nth-child(3) { animation-delay: .14s; }
.choices > :nth-child(4) { animation-delay: .21s; }
@keyframes cardin { from { opacity: 0; transform: scale(.7) translateY(14px); } }
.dim { opacity: .35; transform: scale(.94); transition: opacity .3s, transform .3s; }
.play.leaving .prompt, .play.leaving .choices, .play.leaving .parent-row, .play.leaving .yesno { opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .22s, transform .22s; }
.card.right { animation: yay .6s ease-out; box-shadow: 0 0 0 8px var(--gold), var(--shadow); }
.card.glow { box-shadow: 0 0 0 8px var(--glow), 0 0 36px 10px var(--glow); animation: nudge 1.2s ease-in-out infinite; }
.card.off { opacity: .25; filter: grayscale(1); transform: scale(.9); pointer-events: none; }
@keyframes yay { 30% { transform: scale(1.12) rotate(-3deg); } 60% { transform: scale(.97) rotate(2deg); } }
@keyframes nudge { 50% { transform: scale(1.06); } }
.card .label { position: absolute; left: 0; right: 0; bottom: 6px; font-size: clamp(1.2rem, 5vw, 1.8rem); font-weight: 700; text-align: center; }
.yesno { display: flex; gap: 22px; justify-content: center; align-items: center; align-self: center; }
.yn {
  width: clamp(120px, 34vw, 190px); border: 0; border-radius: var(--r); background: var(--cloud); box-shadow: var(--shadow);
  padding: 12px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: clamp(1.6rem, 7vw, 2.4rem); font-weight: 700;
  transition: transform .18s, opacity .35s;
}
.yn img { width: 60%; }
.yn.right { box-shadow: 0 0 0 8px var(--gold), var(--shadow); animation: yay .6s; }
.yn.glow { box-shadow: 0 0 0 8px var(--glow), 0 0 36px 10px var(--glow); animation: nudge 1.2s infinite; }
.yn.off { opacity: .25; filter: grayscale(1); pointer-events: none; }
.scene { width: min(70vw, 34dvh, 340px); aspect-ratio: 1; border-radius: var(--r); background: var(--cloud); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.parent-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.say-btn {
  min-height: 64px; border: 0; border-radius: 999px; padding: 8px 28px; font-size: 1.3rem; font-weight: 700;
  background: var(--cloud); box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px;
}
.say-btn.ok { background: #2f9e5b; color: #fff; box-shadow: 0 6px 0 #1f6e3e; }
.say-btn svg { width: 30px; height: 30px; }
.sparkle { position: fixed; width: 44px; height: 44px; pointer-events: none; z-index: 30; animation: spark .9s ease-out forwards; }
@keyframes spark { from { transform: translate(0, 0) scale(.4); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }

/* ---------- pictures ---------- */
.pic { position: absolute; inset: 0; }
.pic.e { padding: 12%; }
.shop { position: absolute; inset: 8% 8% 6%; display: flex; flex-direction: column; }
.shop .awn { height: 22%; border-radius: 14px 14px 6px 6px; background: repeating-linear-gradient(90deg, var(--c) 0 16%, #fff 16% 32%); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08); }
.shop .wall { flex: 1; background: #fff6e6; border: 4px solid var(--c); border-top: 0; border-radius: 0 0 10px 10px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 8% 0 10%; gap: 6%; }
.shop .win { flex: 1.5; aspect-ratio: 1; margin-bottom: 14%; background: #dff1ff; border: 4px solid var(--c); border-radius: 10px; padding: 6%; }
.shop .door { flex: 1; height: 62%; background: var(--c); border-radius: 10px 10px 0 0; filter: brightness(.85); }
.place svg { width: 100%; height: 100%; display: block; }
.who { position: absolute; }
.who img { width: 100%; height: 100%; object-fit: contain; }
.posbox { position: absolute; inset: 0; background: linear-gradient(180deg, #e7f6ff 0 78%, #bfe8a8 78%); }
.posbox > div { position: absolute; }
.posbox .shop { inset: 0; }

/* actions */
.act { position: absolute; inset: 0; overflow: hidden; }
.act .who { width: 52%; height: 52%; left: 24%; bottom: 14%; will-change: transform; }
.act .fx { position: absolute; width: 22%; height: 22%; }
.act-swimming { background: linear-gradient(180deg, #e3f4ff 0 52%, #78c4f0 52%); }
.act-swimming .who { bottom: 26%; animation: bob 1.8s ease-in-out infinite; }
.act-swimming .water { position: absolute; left: 0; right: 0; bottom: 0; height: 48%; background: rgba(96,182,236,.6) repeating-radial-gradient(circle at 50% -40%, transparent 0 18px, rgba(255,255,255,.35) 18px 22px); z-index: 2; }
.act-swimming .water2 { position: absolute; left: -10%; right: -10%; top: 50%; height: 14px; background: radial-gradient(circle at 10px 0, #78c4f0 10px, transparent 11px) 0 0 / 28px 14px repeat-x; z-index: 3; animation: drift 3s linear infinite; }
@keyframes bob { 50% { transform: translateY(6%) rotate(-5deg); } }
@keyframes drift { to { transform: translateX(28px); } }
.act-sleeping { background: linear-gradient(180deg, #b9b2ea 0%, #e6e2ff 70%, #d7f0c4 70%); }
.act-sleeping .who { animation: breath 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.act-sleeping .z { right: 10%; top: 12%; animation: zz 2.6s ease-in infinite; }
.act-sleeping .moon { left: 8%; top: 8%; width: 18%; height: 18%; }
@keyframes breath { 50% { transform: scale(1.04, .95); } }
@keyframes zz { 0% { transform: translate(0, 20%) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(15%, -30%) scale(1.1); opacity: 0; } }
.act-eating { background: linear-gradient(180deg, #e6f6ff 0 66%, #a9de8c 66%); }
.act-eating .who { left: 34%; animation: nibble 1.1s ease-in-out infinite; transform-origin: 70% 90%; }
.act-eating .food { left: 8%; bottom: 10%; width: 28%; height: 28%; animation: munch 1.1s ease-in-out infinite; }
@keyframes nibble { 50% { transform: translate(-8%, 6%) rotate(-12deg); } }
@keyframes munch { 50% { transform: scale(.85); } }
.act-running { background: linear-gradient(180deg, #e6f6ff 0 72%, #d9c39a 72%); }
.act-running .who { animation: run 1.5s linear infinite; }
.act-running .dust { width: 20%; height: 20%; bottom: 14%; left: 70%; animation: run 1.5s linear infinite, puff .3s ease-in-out infinite alternate; }
@keyframes run { from { transform: translateX(55%); } to { transform: translateX(-70%); } }
@keyframes puff { to { opacity: .4; } }
.act-jumping { background: linear-gradient(180deg, #e6f6ff 0 74%, #a9de8c 74%); }
.act-jumping .who { bottom: 16%; animation: jump 1.1s cubic-bezier(.3, 0, .7, 1) infinite; }
.act-jumping .shadow { position: absolute; left: 34%; width: 32%; bottom: 13%; height: 6%; border-radius: 50%; background: rgba(0,0,0,.15); animation: shadow 1.1s cubic-bezier(.3, 0, .7, 1) infinite; }
@keyframes jump { 0%, 100% { transform: translateY(0) scale(1.06, .92); } 50% { transform: translateY(-48%) scale(.96, 1.05); } }
@keyframes shadow { 50% { transform: scale(.5); opacity: .5; } }
.act-flying { background: linear-gradient(180deg, #8fd0ff 0%, #d9f0ff 100%); }
.act-flying .who { top: 18%; bottom: auto; animation: fly 1s ease-in-out infinite; }
.act-flying .cl { width: 30%; height: 30%; animation: clouds 4s linear infinite; }
.act-flying .cl.a { top: 62%; left: 0; }
.act-flying .cl.b { top: 70%; left: 55%; animation-delay: -2s; }
@keyframes fly { 50% { transform: translateY(-10%) rotate(8deg); } }
@keyframes clouds { from { transform: translateX(120%); } to { transform: translateX(-200%); } }
.act-dancing { background: radial-gradient(circle at 50% 120%, #ffd1e6 0 45%, #fff0f7 46%); }
.act-dancing .who { animation: dance .9s ease-in-out infinite; transform-origin: 50% 100%; }
.act-dancing .n1 { left: 6%; top: 10%; animation: note 1.8s ease-in-out infinite; }
.act-dancing .n2 { right: 6%; top: 18%; animation: note 1.8s ease-in-out infinite -.9s; }
@keyframes dance { 25% { transform: rotate(-12deg) translateY(-4%); } 75% { transform: rotate(12deg) translateY(-4%); } }
@keyframes note { 50% { transform: translateY(-20%) rotate(12deg); } }

/* ---------- reward ---------- */
.reward { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px var(--gutter); text-align: center; }
.reward .sticker { width: min(46vw, 36dvh, 260px); animation: arrive .9s cubic-bezier(.2, 1.6, .4, 1) both; }
.reward .sticker.small { width: min(28vw, 18dvh, 140px); }
.stage { display: grid; place-items: center; }
.dancefloor { position: relative; width: min(64vw, 40dvh, 320px); aspect-ratio: 1; display: grid; place-items: center; animation: arrive .8s .5s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.dancefloor .buddy.big, .dancefloor .nuvi { width: 86%; }
.fav-img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; border: 7px solid #fff; box-shadow: var(--shadow); }
.fx-note { position: absolute; width: 18%; }
.fx-note.a { left: -4%; top: 6%; animation: note 1.6s ease-in-out infinite; }
.fx-note.b { right: -4%; top: 22%; animation: note 1.6s ease-in-out infinite -.8s; }
@keyframes arrive { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
.reward .nuvi { width: min(44vw, 200px, 24dvh); }
.dancing { animation: dance .8s ease-in-out infinite; transform-origin: 50% 100%; will-change: transform; }
.reward-btns { display: flex; gap: 22px; align-items: center; opacity: 0; transition: opacity .4s; pointer-events: none; }
.reward-btns.show { opacity: 1; pointer-events: auto; }
.reward-btns .big-play { width: clamp(110px, 28vw, 150px); }
.media { position: fixed; inset: 0; z-index: 40; background: rgba(20, 30, 50, .92); display: grid; place-items: center; padding: 16px; }
.media img, .media video { max-width: 100%; max-height: 82dvh; border-radius: 24px; pointer-events: auto; }
.media .icon-btn { position: absolute; top: 14px; right: 14px; }

/* ---------- album ---------- */
.album { flex: 1; padding: 12px var(--gutter) 24px; display: flex; flex-direction: column; gap: 14px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(26vw, 110px), 1fr)); gap: 12px; }
.slot { aspect-ratio: 1; border-radius: 24px; background: var(--cloud); box-shadow: var(--shadow); padding: 14%; border: 0; }
.slot.new { box-shadow: 0 0 0 4px #ff6fae, var(--shadow); }
.slot.wiggle { animation: yay .6s ease-out; }
.slot.empty { background: rgba(255,255,255,.45); box-shadow: inset 0 0 0 3px rgba(35, 50, 77, .14); }

/* ---------- parent ---------- */
.parent { padding: 12px var(--gutter) 40px; max-width: 760px; margin: 0 auto; width: 100%; line-height: 1.5; font-size: 1.05rem; }
.parent h1 { font-size: 1.6rem; margin: 6px 0 4px; }
.parent h2 { font-size: 1.25rem; margin: 26px 0 8px; }
.parent h3 { font-size: 1.1rem; margin: 16px 0 6px; }
.parent p { margin: 6px 0; }
.panel { background: var(--cloud); border-radius: 22px; padding: 14px 16px; box-shadow: var(--shadow); }
.seg { display: inline-flex; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--teal-dark); }
.seg button { border: 0; background: transparent; min-height: 48px; min-width: 56px; padding: 0 16px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--teal-dark); color: #fff; }
.seg button[aria-pressed="true"]::before { content: "✓ "; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.btn { min-height: 48px; border-radius: 999px; border: 2px solid var(--teal-dark); background: #fff; padding: 0 20px; font-weight: 700; color: var(--teal-dark); }
.btn.solid { background: var(--teal-dark); color: #fff; }
.btn.danger { border-color: #a33a3a; color: #a33a3a; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 16px; overflow: hidden; background: #eee; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 1.1rem; line-height: 1; }
.wlist { list-style: none; padding: 0; margin: 0; }
.wlist li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #e6edf5; }
.wlist img { width: 36px; height: 36px; }
.wlist .pt { color: var(--ink-soft); }
.dots { display: flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #dbe4ee; }
.dots i.on { background: var(--teal-dark); }
.state { font-size: .95rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.state.s0 { background: #eef1f5; color: #4b5b73; }
.state.s1 { background: #fff1c9; color: #6b4e00; }
.state.s2 { background: #d6f3e2; color: #1d6b3d; }
.tips li { margin: 4px 0; }
.small { font-size: .95rem; color: var(--ink-soft); }

/* phone held sideways: prompt left, answers right */
@media (orientation: landscape) and (max-height: 560px) {
  .play { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); grid-template-rows: auto minmax(0, 1fr); }
  .play .topbar { grid-column: 1 / -1; }
  .play .choices .card { --size: min(26vw, 62dvh, 240px); }
  .play .choices.n1 .card { --size: min(40vw, 64dvh, 260px); }
  .play .choices.n3 .card { --size: min(17.5vw, 56dvh, 200px); }
  .play .choices.n4 .card { --size: min(17vw, 36dvh, 180px); }
  .play .speak { width: clamp(80px, 22dvh, 120px); }
  .play .scene { width: min(30vw, 40dvh); }
  .play .word { font-size: clamp(2rem, min(7vw, calc(80vw / (var(--n, 4) + 3))), 4rem); }
  .play .sentence { font-size: clamp(1.1rem, 3.2vw, 1.7rem); }
  .play .yn { width: clamp(100px, 20vw, 160px); }
  .home { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: center; gap: 12px 20px; }
  .home-top { flex-basis: 100%; }
  .home-buddy { width: 120px; }
  .home .big-play { width: 104px; }
  .worlds { flex-basis: 100%; }
  .wpic { aspect-ratio: 2 / 1; }
}
/* tablets: use the room */
@media (min-width: 700px) and (min-height: 900px) {
  .home { justify-content: center; gap: 24px; }
  .world { max-width: 250px; }
  .world b { font-size: 1.4rem; }
  .home-buddy { width: min(40vw, 320px, 28dvh); }
  .choices.n2 .card { --size: min(42vw, 30dvh, 380px); }
  .choices.n3 .card { --size: min(42vw, 26dvh, 330px); }
  .choices.n4 .card { --size: min(42vw, 25dvh, 320px); }
  .speak { width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
