/* Bunnimoo · in-care English learning (preview). Calm, large targets, reduced-motion safe. */
.bml-preview-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10020;
  background: #5b4b8a; color: #fff;
  font-size: 13px; line-height: 1.35; text-align: center;
  padding: 6px 12px;
  font-family: inherit;
}
.bml-badge {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 12px 0; padding: 8px 10px;
  background: #fff; border-radius: 18px;
  box-shadow: 0 2px 10px rgba(80, 50, 120, .08);
  border: 2px solid #e8dff8;
}
.bml-badge button {
  min-height: 44px; min-width: 44px;
  border: 0; border-radius: 14px; background: #f3eefe;
  font: inherit; cursor: pointer; padding: 6px 12px;
  color: #4a3a78;
}
.bml-badge button:focus-visible { outline: 3px solid #8b6cc9; outline-offset: 2px; }
.bml-badge .bml-stars { margin-inline-start: auto; font-size: 15px; color: #6a54a8; }
.bml-overlay {
  position: fixed; inset: 0; z-index: 10050;
  background: rgba(62, 42, 96, .45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.bml-card {
  width: min(440px, 100%);
  background: #fffaf6;
  border-radius: 28px 28px 20px 20px;
  box-shadow: 0 -8px 40px rgba(60, 30, 90, .18);
  padding: 18px 18px 22px;
  text-align: center;
  position: relative;
  max-height: min(92vh, 760px);
  overflow: auto;
}
.bml-card h2, .bml-card .bml-word {
  margin: 8px 0 4px; font-size: 28px; color: #3d2d68; font-weight: 700;
}
.bml-word { letter-spacing: .04em; font-size: 36px; }
.bml-hint { margin: 0 0 10px; color: #7a6a9a; font-size: 18px; }
.bml-pic {
  width: 180px; height: 180px; margin: 8px auto 14px;
  border-radius: 32px; background: #f3eefe;
  display: flex; align-items: center; justify-content: center;
  font-size: 96px; line-height: 1;
  overflow: hidden;
  animation: bml-pop .6s ease;
}
.bml-pic img { width: 100%; height: 100%; object-fit: contain; }
.bml-pic.bml-color { font-size: 0; }
.bml-swatch {
  width: 120px; height: 120px; border-radius: 50%;
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.08), 0 8px 20px rgba(0,0,0,.08);
}
@keyframes bml-pop {
  0% { transform: scale(.7); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.bml-pic.bml-bounce { animation: bml-bounce 1.2s ease-in-out 0s 2; }
@keyframes bml-bounce {
  0%,100% { transform: translateY(0); }
  40% { transform: translateY(-12px) scale(1.04); }
  70% { transform: translateY(3px); }
}
.bml-bubbles .bml-pic { animation: bml-float 2.4s ease-in-out infinite; }
@keyframes bml-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.bml-actions, .bml-choices {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.bml-choices { margin-top: 8px; }
.bml-choice, .bml-speak, .bml-next, .bml-skip, .bml-close {
  min-width: 72px; min-height: 72px;
  border: 3px solid #e8dff8; border-radius: 20px;
  background: #fff; cursor: pointer; font: inherit;
  padding: 8px; color: #3d2d68;
}
.bml-speak, .bml-next, .bml-skip, .bml-close { min-height: 48px; padding: 10px 16px; font-size: 16px; }
.bml-choice { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bml-choice .bml-c-pic {
  width: 72px; height: 72px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; background: #f7f2ff; overflow: hidden;
}
.bml-choice .bml-c-pic img { width: 100%; height: 100%; object-fit: contain; }
.bml-choice:focus-visible, .bml-speak:focus-visible, .bml-next:focus-visible {
  outline: 3px solid #8b6cc9; outline-offset: 2px;
}
.bml-choice.is-right { border-color: #5bb56a; background: #eefbef; transform: scale(1.06); }
.bml-choice.is-soft { border-color: #f0c44c; }
.bml-praise {
  font-size: 22px; color: #3d7a4a; margin: 10px 0 0; font-weight: 700;
}
.bml-sticker {
  display: inline-block; margin-top: 8px; font-size: 28px;
  animation: bml-pop .5s ease;
}
.bml-skip { background: transparent; border-color: transparent; color: #8a7aa8; min-height: 40px; }
.bml-gate, .bml-settings { text-align: start; }
.bml-settings h2, .bml-gate h2 { text-align: center; }
.bml-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.bml-langs { display: flex; flex-wrap: wrap; gap: 8px; }
.bml-langs button[disabled] { opacity: .5; cursor: default; }
.bml-langs button.is-on, .bml-choice-lang.is-on { background: #5b4b8a; color: #fff; border-color: #5b4b8a; }
.bml-math { font-size: 28px; text-align: center; margin: 12px 0; }
.bml-math input {
  width: 80px; min-height: 52px; font-size: 28px; text-align: center;
  border: 2px solid #d8ccee; border-radius: 12px;
}
.bml-hold {
  width: 100%; min-height: 64px; border-radius: 18px;
  border: 0; background: #efe7ff; color: #3d2d68; font: inherit; font-size: 18px;
  position: relative; overflow: hidden; cursor: pointer;
}
.bml-hold span.bml-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; background: #cbb8f0;
  transition: none;
}
.bml-hold.is-holding span.bml-fill { width: 100%; transition: width 3s linear; }
.bml-hold > em { position: relative; font-style: normal; }
.bml-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 12px; }
.bml-cats button { min-height: 48px; border-radius: 16px; border: 2px solid #e8dff8; background: #fff; font: inherit; padding: 6px 12px; cursor: pointer; }
html.rm .bml-pic, html.rm .bml-pic.bml-bounce, html.rm .bml-bubbles .bml-pic, html.rm .bml-sticker,
.bml-pic, .bml-sticker { }
@media (prefers-reduced-motion: reduce) {
  .bml-pic, .bml-pic.bml-bounce, .bml-bubbles .bml-pic, .bml-sticker { animation: none !important; }
  .bml-hold.is-holding span.bml-fill { transition: none; width: 100%; }
}
html.rm .bml-pic, html.rm .bml-pic.bml-bounce, html.rm .bml-bubbles .bml-pic, html.rm .bml-sticker {
  animation: none !important;
}
@media (min-width: 800px) {
  .bml-overlay { align-items: center; }
  .bml-card { border-radius: 28px; }
}

body:has(.bml-preview-banner) { padding-top: 32px; }

/* v2 preview polish: in-care word bubble, tactile choosers, reduced-motion-safe motion */
.bml-card { animation: bml-up .42s ease both; }
@keyframes bml-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.bml-care-bubble {
  position: fixed; left: 50%; bottom: 26%; z-index: 10040;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px;
  background: #fffaf6; color: #3d2d68;
  border: 3px solid #e8dff8; border-radius: 999px;
  box-shadow: 0 10px 28px rgba(60, 30, 90, .18);
  font-size: 22px; font-weight: 700; letter-spacing: .02em;
  animation: bml-pop .45s ease;
  pointer-events: none;
}
.bml-bub-pic { font-size: 28px; line-height: 1; }
.bml-bub-word { dir: ltr; }

.bml-is-chooser .bml-choices { gap: 12px; margin: 10px 0 14px; }
.bml-choice {
  width: calc((100% - 24px) / 3);
  max-width: 128px;
  min-width: 96px;
  min-height: 112px;
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .15s;
}
.bml-choice .bml-c-pic { width: 80px; height: 80px; font-size: 48px; border-radius: 20px; }
.bml-choice:nth-child(1) { animation: bml-pop .45s ease both; }
.bml-choice:nth-child(2) { animation: bml-pop .45s .08s ease both; }
.bml-choice:nth-child(3) { animation: bml-pop .45s .16s ease both; }
.bml-choice:active { transform: scale(.94); }
.bml-choice.is-right { box-shadow: 0 0 0 3px rgba(91, 181, 106, .25); }
.bml-praise.is-soft { color: #5b4b8a; font-weight: 600; }
.bml-speak, .bml-next, .bml-close { transition: transform .12s ease; }
.bml-speak:active, .bml-next:active, .bml-close:active { transform: scale(.96); }

@media (max-width: 430px) {
  .bml-choice { min-width: 92px; min-height: 108px; }
  .bml-choice .bml-c-pic { width: 72px; height: 72px; font-size: 42px; }
  .bml-pic { width: 160px; height: 160px; font-size: 86px; }
  .bml-word { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .bml-card, .bml-care-bubble, .bml-choice, .bml-choice:nth-child(1),
  .bml-choice:nth-child(2), .bml-choice:nth-child(3) { animation: none !important; }
  .bml-choice, .bml-speak, .bml-next, .bml-close { transition: none; }
}
html.rm .bml-card, html.rm .bml-care-bubble,
html.rm .bml-choice, html.rm .bml-choice:nth-child(1),
html.rm .bml-choice:nth-child(2), html.rm .bml-choice:nth-child(3) {
  animation: none !important;
}
