/* 講講樂 — play screens */

.play-page {
  width: min(100% - clamp(20px, 4vw, 48px), 1080px);
  margin-inline: auto;
  padding-block: var(--s-4) calc(96px + env(safe-area-inset-bottom));
  min-height: calc(100dvh - 76px);
  display: flex;
  flex-direction: column;
}

/* header */
.play-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding-bottom: var(--s-4);
}

.play-level {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.play-level .level-chip { width: 44px; height: 44px; font-size: 1.1rem; }
.play-level b { display: block; font-size: 1.05rem; line-height: 1.3; }
.play-level small { color: var(--ink-faint); font-size: var(--fs-tiny); }

.progress-dots {
  display: flex;
  gap: 7px;
  margin-left: auto;
}
.progress-dots i {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(35, 33, 30, .14);
  transition: background var(--base) var(--ease), transform var(--base) var(--ease);
}
.progress-dots i.done { background: var(--teal); transform: scale(1.12); }
.progress-dots i.now { background: var(--sun); transform: scale(1.2); }
.progress-text {
  font-size: var(--fs-small);
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- step guidance ---------- */

.step-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(35, 33, 30, .06);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .68);
  color: var(--ink-faint);
  font-size: .74rem;
  font-weight: 800;
}
.step b {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(35, 33, 30, .10);
  font-size: .68rem;
}
.step.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.active b { background: rgba(255, 255, 255, .25); color: #fff; }
.step.done { background: var(--teal-soft); border-color: transparent; color: var(--teal-deep); }
.step.done b { background: var(--teal); color: #fff; }
.step-arrow { color: var(--ink-faint); font-size: .7rem; }

/* ---------- comfort mechanism ---------- */

.comfort-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--nudge-soft);
  color: #6B4E0E;
  font-weight: 800;
  font-size: .9rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.comfort-toast.show { opacity: 1; transform: translate(-50%, 0); }
.comfort-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sun); flex: 0 0 auto; }

/* ---------- star-token twinkle ---------- */

.sparkle-burst {
  position: fixed;
  z-index: 84;
  width: 0; height: 0;
  pointer-events: none;
}
.sparkle-burst i {
  position: absolute;
  left: -4px; top: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 8px var(--sun);
  opacity: 0;
  animation: sparkleOut .85s var(--ease) forwards;
}

@keyframes sparkleOut {
  0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.4); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(1); }
}

/* adult prompt */
.adult-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 14px;
  margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .66);
  border: 1px solid rgba(35, 33, 30, .07);
  color: var(--ink-soft);
  font-size: var(--fs-small);
  line-height: 1.55;
}
.adult-hint b { color: var(--teal-deep); font-weight: 800; }
.adult-hint svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; }

/* question line */
.question-line {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}
.question-text {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: .03em;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 800;
  font-size: var(--fs-small);
  cursor: pointer;
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
.speak-btn:hover { background: #CBE4E1; transform: translateY(-1px); }
.speak-btn svg { width: 20px; height: 20px; }

/* card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
}
.card-grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.word-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 16px;
  border: 2px solid transparent;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: center;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              border-color var(--fast) var(--ease), background var(--fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.word-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.word-card:active { transform: scale(.985); }

.word-card .card-art {
  position: relative;
  width: 100%;
  height: clamp(104px, 15vh, 168px);
  border-radius: var(--r-md);
  background:
    radial-gradient(ellipse at 30% 22%, rgba(255, 255, 255, .8), transparent 58%),
    linear-gradient(155deg, #FFFDF8 0%, var(--cat-soft, var(--cream-deep)) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(75, 58, 46, .10),
    inset 0 0 18px rgba(75, 58, 46, .07);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* soft watercolour bloom behind the drawing */
.word-card .card-art::before {
  content: "";
  position: absolute;
  inset: 12% 14%;
  z-index: 0;
  border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%;
  background: var(--cat, var(--teal));
  opacity: .09;
  filter: blur(10px);
  pointer-events: none;
}

.word-card .card-art > * { position: relative; z-index: 1; }

.word-card .card-art svg {
  width: 88%;
  height: 88%;
  filter:
    drop-shadow(0.7px 0 0 rgba(75, 58, 46, .35))
    drop-shadow(-0.7px 0 0 rgba(75, 58, 46, .35))
    drop-shadow(0 0.7px 0 rgba(75, 58, 46, .35))
    drop-shadow(0 -0.7px 0 rgba(75, 58, 46, .35))
    drop-shadow(0 4px 4px rgba(75, 58, 46, .12));
}

.word-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: saturate(.94) contrast(.97) sepia(.04);
  -webkit-mask-image: radial-gradient(ellipse 88% 88% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 88% 88% at 50% 50%, #000 72%, transparent 100%);
}

/* Kept scene JPGs get a small paper mat so their card border disappears. */
.word-img[src$=".jpg"] {
  border: 4px solid #FFFDF8;
  border-radius: 10px;
  background: #FFFDF8;
}

/* Cutout PNGs: transparent object on the paper wash, with an ink edge. */
.word-img[src$=".png"] {
  mix-blend-mode: normal;
  -webkit-mask-image: none;
  mask-image: none;
  filter:
    saturate(.96) contrast(.98) sepia(.02)
    drop-shadow(0.8px 0 0 rgba(75, 58, 46, .34))
    drop-shadow(-0.8px 0 0 rgba(75, 58, 46, .34))
    drop-shadow(0 0.8px 0 rgba(75, 58, 46, .34))
    drop-shadow(0 -0.8px 0 rgba(75, 58, 46, .34))
    drop-shadow(0 5px 5px rgba(75, 58, 46, .14));
}

/* The painted character is the illustration; don't repeat it underneath. */
.word-card[data-kind="char"] .card-yue { display: none; }
.word-emoji {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  filter: saturate(.92) sepia(.03) drop-shadow(0 3px 4px rgba(75, 58, 46, .16));
}
.word-char {
  font-family: "Kaiti TC", "BiauKai", "STKaiti", "KaiTi", "DFKai-SB", "Noto Serif TC", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .02em;
  text-align: center;
  color: #3A2E26;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 2px 5px rgba(75, 58, 46, .16);
  transform: rotate(-1.2deg);
}
.word-char::after {
  content: "";
  display: block;
  width: 55%;
  height: 2px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: var(--cat, var(--teal));
  opacity: .3;
  transform: rotate(-1deg);
}
.word-char[data-len="3"] { font-size: clamp(1.4rem, 3vw, 2rem); }
.word-char[data-len="4"] { font-size: clamp(1.15rem, 2.5vw, 1.65rem); }
.word-char[data-len="5"] { font-size: clamp(0.95rem, 2vw, 1.3rem); }
.word-card[data-kind="img"] .card-art {
  background:
    radial-gradient(ellipse at 34% 24%, rgba(255, 255, 255, .85), transparent 58%),
    linear-gradient(155deg, #FFFDF8 0%, var(--cat-soft, var(--cream-deep)) 100%);
  height: clamp(140px, 20vh, 210px);
}
.pool .word-card[data-kind="img"] .card-art { height: clamp(120px, 18vh, 190px); }
.word-bank-grid .word-card[data-kind="img"] .card-art { height: 150px; }

.card-grid[data-cols="2"] .word-card .card-art { height: clamp(150px, 24vh, 240px); }
.card-grid[data-cols="3"] .word-card .card-art { height: clamp(110px, 16vh, 180px); }
.pool .word-card .card-art { height: clamp(96px, 13vh, 140px); }
.pool[data-cols="4"] .word-card .card-art { height: clamp(120px, 18vh, 190px); }

.word-card .card-yue {
  font-size: var(--fs-word);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.25;
}
.word-card .card-jp {
  font-size: var(--fs-jp);
  color: var(--ink-faint);
  letter-spacing: .02em;
  line-height: 1.3;
}
.word-card .card-en {
  font-size: var(--fs-small);
  color: var(--ink-soft);
}

.word-card.is-correct {
  border-color: var(--correct);
  background: var(--correct-soft);
  box-shadow: 0 0 0 5px rgba(46, 125, 91, .16), var(--shadow-md);
  animation: pop var(--base) var(--ease);
}
.word-card.is-nudge {
  border-color: var(--nudge);
  background: var(--nudge-soft);
}
.word-card.is-wrong { animation: wobble 380ms var(--ease); }
.word-card.is-faded { opacity: .45; }
.word-card[disabled] { cursor: default; }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px) rotate(-1deg); }
  55% { transform: translateX(6px) rotate(1deg); }
  80% { transform: translateX(-3px); }
}

/* single focus card */
.focus-card {
  display: grid;
  place-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  flex: 1;
}
.focus-card .focus-art {
  width: min(58vw, 340px);
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  background: var(--cat-soft);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.focus-card .focus-art svg { width: 86%; height: 86%; }
.focus-word {
  text-align: center;
}
.focus-word .yue { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; letter-spacing: .04em; }
.focus-word .jp { font-size: 1.05rem; color: var(--ink-faint); margin-top: 2px; }

/* slots */
.slot-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}

.slot {
  flex: 0 1 168px;
  min-height: 132px;
  padding: 10px;
  border: 3px dashed rgba(35, 33, 30, .16);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color var(--base) var(--ease), background var(--base) var(--ease);
}
.slot .slot-role {
  font-size: var(--fs-tiny);
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.slot .slot-art { width: 62px; height: 62px; opacity: .22; }
.slot .slot-art svg { width: 100%; height: 100%; }
.slot .slot-word { font-size: 1.45rem; font-weight: 900; opacity: .28; }

.slot[data-cat] { border-color: color-mix(in srgb, var(--cat) 38%, transparent); }
.slot[data-cat] .slot-role { color: var(--cat); }

.slot.filled {
  border-style: solid;
  border-color: var(--cat);
  background: var(--cat-soft);
}
.slot.filled .slot-art { opacity: 1; }
.slot.filled .slot-word { opacity: 1; }
.slot.filled .slot-role { color: var(--cat); }

.slot.just-filled { animation: pop var(--base) var(--ease); }

.slot.is-complete {
  border-color: var(--correct);
  box-shadow: 0 0 0 4px rgba(46, 125, 91, .14);
}

/* pool */
.pool {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.8vw, 18px);
}
.pool[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pool .word-card { padding: 10px 8px 12px; }
.pool .word-card .card-yue { font-size: 1.3rem; }
.pool .word-card .card-jp { font-size: .78rem; }

/* action row */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: center;
  margin-top: var(--s-5);
}
.action-row .btn { min-height: 58px; }

/* sentence strip display */
.sentence-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px;
  margin-bottom: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-height: 84px;
}
.sentence-strip .strip-word {
  padding: 6px 14px;
  border-radius: var(--r-md);
  background: var(--cat-soft);
  font-size: 1.4rem;
  font-weight: 900;
}
.sentence-strip .strip-empty { color: var(--ink-faint); font-size: var(--fs-small); }

/* feedback banner */
.feedback {
  margin-top: var(--s-4);
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: var(--correct-soft);
  color: var(--correct);
  font-weight: 800;
  text-align: center;
  animation: rise var(--base) var(--ease) both;
}
.feedback[hidden] { display: none; }

/* completion screen */
.done-card {
  max-width: 620px;
  margin: clamp(20px, 8vh, 80px) auto;
  padding: clamp(26px, 5vw, 48px);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: var(--s-4);
}
.done-mascot { width: 150px; }
.done-card h1 { font-size: var(--fs-h1); font-weight: 900; }
.done-card p { color: var(--ink-soft); max-width: 40ch; }

.star-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.star-row svg { width: 46px; height: 46px; }
.star-row .star-off { opacity: .22; }
.star-row .star-on { animation: starPop 480ms var(--ease) both; }
.star-row .star-on:nth-child(2) { animation-delay: 90ms; }
.star-row .star-on:nth-child(3) { animation-delay: 180ms; }

@keyframes starPop {
  0% { transform: scale(.4) rotate(-18deg); opacity: 0; }
  70% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.done-stats {
  display: flex;
  gap: var(--s-5);
  flex-wrap: wrap;
  justify-content: center;
  padding: 14px 20px;
  border-radius: var(--r-md);
  background: var(--cream);
}
.done-stats div { text-align: center; }
.done-stats b { display: block; font-size: 1.5rem; line-height: 1.2; }
.done-stats span { font-size: var(--fs-tiny); color: var(--ink-soft); }

/* ---------- AAC board ---------- */

.aac-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.aac-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.aac-word:hover { transform: translateY(-2px); border-color: var(--cat); }
.aac-word:active { transform: scale(.97); }
.aac-word .aac-art { width: 46px; height: 46px; }
.aac-word .aac-art svg { width: 100%; height: 100%; }
.aac-word b { font-size: 1.1rem; font-weight: 900; }
.aac-word small { font-size: .7rem; color: var(--ink-faint); }

.aac-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  padding: 10px;
  margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 2px dashed rgba(35, 33, 30, .14);
  align-items: center;
}
.aac-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 800;
  cursor: pointer;
  border: 0;
}
.aac-chip small { font-size: .7rem; opacity: .7; }
.aac-strip .placeholder { color: var(--ink-faint); font-size: var(--fs-small); }

.aac-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-4); }
.aac-actions .btn { flex: 0 0 auto; white-space: nowrap; }

/* mic indicator */
.rec-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--coral-soft);
  color: #9A3324;
  font-weight: 800;
  font-size: var(--fs-small);
}
.rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pool { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .card-grid[data-cols="2"], .card-grid[data-cols="3"], .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool, .pool[data-cols="3"], .pool[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-row { gap: 8px; }
  .slot { flex: 1 1 96px; min-height: 108px; padding: 8px; }
  .slot .slot-art { width: 46px; height: 46px; }
  .slot .slot-word { font-size: 1.15rem; }
  .aac-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .play-head { gap: 8px; }
  .progress-dots { margin-left: 0; }
  .done-stats { gap: var(--s-4); }
}

@media (max-width: 1100px) {
  .aac-fab {
    width: 58px; height: 58px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .aac-fab span { display: none; }
  .aac-fab-art { width: 38px; height: 38px; }
}

@media (max-width: 400px) {
  .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .word-card .card-yue { font-size: 1.28rem; }
  .slot-row { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }
  .slot { flex: 0 0 92px; }
}

/* ---------- scene, story and conversation ---------- */

.scene-box {
  width: min(100%, 400px);
  margin: 0 auto var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  overflow: hidden;
}
.scene-box svg { width: 100%; height: auto; display: block; }

.story-lead {
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  margin-bottom: var(--s-4);
}

.story-recap {
  max-width: 420px;
  margin: 12px auto 0;
  padding-left: 1.4em;
  color: var(--ink-soft);
  font-size: var(--fs-small);
}
.story-recap li { margin-bottom: 6px; }
.story-recap small { color: var(--ink-faint); }

.sparrow-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  justify-content: center;
  margin-bottom: var(--s-5);
}
.sparrow-art {
  width: 110px;
  height: 110px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sun-soft);
  display: grid;
  place-items: center;
}
.sparrow-art svg { width: 88%; height: 88%; }

.bubble {
  position: relative;
  max-width: 460px;
  padding: 16px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
}
.bubble::before {
  content: "";
  position: absolute;
  left: -9px; top: 50%;
  width: 18px; height: 18px;
  background: var(--surface);
  transform: translateY(-50%) rotate(45deg);
  border-radius: 3px;
}

/* correct-order hint after repeated tries */
.word-card.show-order::after {
  content: attr(data-order);
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: .9rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

/* slot family feedback */
.slot-row.is-wrong .slot { animation: wobble 380ms var(--ease); border-color: var(--nudge); }
.slot .slot-art svg { width: 100%; height: 100%; }

/* ---------- floating AAC button ---------- */

.aac-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 20px 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .04em;
  box-shadow: 0 10px 28px rgba(31, 111, 107, .32);
  cursor: pointer;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.aac-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(31, 111, 107, .38); }
.aac-fab[hidden] { display: none; }
.aac-fab-art { width: 34px; height: 34px; flex: 0 0 auto; }
.aac-fab-art svg { width: 100%; height: 100%; }

@media (max-width: 480px) {
  .aac-fab { min-height: 52px; padding: 0 14px; }
  .aac-fab span { font-size: .82rem; }
  .sparrow-art { width: 84px; height: 84px; }
  .bubble { font-size: 1.05rem; padding: 12px 16px; }
}

/* reduced motion */
body[data-motion="off"] *,
body[data-motion="off"] *::before,
body[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

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