:root {
  font-family: "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  color: #241f35;
  background: #fff;
  font-synthesis: none;
  --ink: #241f35;
  --purple: #6040a9;
  --soft-purple: #ede5ff;
  --accent: #e4dbff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow-x: clip; }
button, select { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .35; }
a { color: inherit; }
:focus-visible { outline: 3px solid #885df3; outline-offset: 4px; }
.top {
  width: min(100%, 640px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(13px, env(safe-area-inset-top)) 22px 0;
  height: max(53px, calc(env(safe-area-inset-top) + 35px));
}
.wordmark {
  color: var(--purple);
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: -.08em;
  text-decoration: none;
}
.settings { display: flex; gap: 8px; align-items: center; }
.settings select { font-size: 12px; border: 0; background: white; padding: 4px; }
.icon {
  border: 0; border-radius: 999px;
  width: 38px; height: 38px; background: #f5f3fa;
  font-size: 20px; line-height: 1; display: grid; place-items: center;
}
#sound[aria-pressed=false] { color: #726d7d; background: #f1f1f3; }
#play { max-width: 640px; margin-inline: auto; }
.stage {
  width: min(calc(100vw - 32px), 475px, calc(100svh - 200px));
  min-width: min(200px, calc(100vw - 30px));
  margin: 82px auto 0;
  position: relative;
}
.lesson {
  position: absolute;
  bottom: calc(100% + 15px);
  width: 100%;
  text-align: center;
}
.lesson p {
  margin: 0 0 4px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}
.lesson h1 {
  margin: 0;
  font-size: clamp(15px, 4.5vw, 21px);
  line-height: 1.3;
  font-weight: 950;
  text-wrap: balance;
}
.holder { position: relative; }
.scene {
  position: relative;
  width: 84%;
  margin-inline: auto;
  background: #f5efff;
  border: 1px solid #291f3e0e;
  border-radius: 23%;
  overflow: hidden;
  box-shadow: 0 12px 34px #34204e25, 0 3px 8px #34204e0f;
  transform: translate3d(0,0,0);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.scene:active { cursor: grabbing; }
.scene.moving { will-change: transform; }
.scene-art, .proof-art {
  aspect-ratio: 1;
  background-repeat: no-repeat;
  background-size: 400% 600%;
}
.scene-art { width: 100%; background-color: #e8ddff; }
.practice-art {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 22%, #fff6f9, #ffdbe9 72%);
}
.practice-art svg { width: 53%; filter: drop-shadow(0 6px 0 #a2496920); }
@media (prefers-reduced-motion: no-preference) {
  .practicing .scene:not(.moving) .practice-art svg { animation: hint-swipe 2.8s ease-in-out infinite; }
  @keyframes hint-swipe {
    0%, 18%, 54%, 89%, 100% { transform: translateX(0) rotate(0); }
    34% { transform: translateX(-18%) rotate(-13deg); }
    72% { transform: translateX(18%) rotate(13deg); }
  }
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.stamp {
  position: absolute; top: 16px;
  width: 62px; height: 62px; border: 2px solid currentColor; border-radius: 50%;
  display: grid; place-items: center; font-size: 35px; line-height: 1; font-weight: 900;
  opacity: 0; pointer-events: none;
}
.like { left: 16px; color: #206e55; background: #ddffea; transform: rotate(-13deg); }
.pass { right: 16px; color: #a33048; background: #ffe4ea; transform: rotate(13deg); }
.actions { display: flex; justify-content: space-between; margin-top: 17px; }
.answer {
  display: flex; gap: 7px; align-items: center; justify-content: center;
  min-width: 68px; min-height: 44px; border: 0; border-radius: 30px;
  font-weight: 800; font-size: 17px; background: #f5f3fa;
}
.answer.yes { color: #236a51; background: #e9f7ed; }
.answer.no { color: #9b3851; background: #fff1f3; }
.answer { transition: transform .13s ease-out, background-color .13s, opacity .13s; }
.actions[data-side="yes"] .yes, .actions[data-side="no"] .no { opacity: 1; }
.actions[data-side="yes"] .yes { transform: translateX(5px) scale(1.12); background: #c0f6d3; }
.actions[data-side="no"] .no { transform: translateX(-5px) scale(1.12); background: #ffd0de; }
.practice-word { display: none; }
.practicing .practice-word { display: inline; font-size: 13px; }
.practicing .answer { padding-inline: 14px; }
@media (prefers-reduced-motion: reduce) {
  .answer { transition: none; }
  .actions[data-side] .answer { transform: none; }
}
.foot { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.undo { background: transparent; flex-shrink: 0; }
progress { flex: 1; height: 5px; border: none; appearance: none; border-radius: 5px; }
progress::-webkit-progress-bar { background: #f0edf4; border-radius: 6px; }
progress::-webkit-progress-value { background: #9c76e9; border-radius: 6px; }
progress::-moz-progress-bar { background: #9c76e9; border-radius: 6px; }
#count { font-size: 11px; color: #685f77; font-variant-numeric: tabular-nums; }
.error { font-size: 13px; text-align: center; }
#result { max-width: 510px; padding: 10px 22px 32px; margin: 0 auto; }
.verdict {
  background: var(--accent); border-radius: 27px;
  text-align: center; padding: 19px 17px 22px; border: 1px solid #30204715;
}
.result-eyebrow { margin: 0; font-size: 11px; letter-spacing: .11em; font-weight: 850; }
#type-name {
  margin: 9px 0 0; font-size: clamp(24px, 6.6vw, 42px);
  font-weight: 950; letter-spacing: -.055em; line-height: 1.15; text-wrap: balance;
}
.portrait { position: relative; margin: 5px auto 0; width: min(100%, 355px); }
@media (prefers-reduced-motion: no-preference) {
  #result:not([hidden]) .portrait { animation: stamp-in 290ms cubic-bezier(.14,.84,.32,1.06) both; }
  @keyframes stamp-in {
    from { transform: scale(.91) rotate(-4deg); opacity: .3; }
    to { transform: scale(1) rotate(0); opacity: 1; }
  }
}
#portrait { display: block; width: 100%; height: auto; }
.orbit { position: absolute; z-index: 1; color: #6e43aa; font-size: 27px; }
.orbit.first { top: 25%; left: 1%; }
.orbit.second { bottom: 20%; right: 1%; }
.quote {
  position: relative; margin: -1px auto 0; padding: 13px 10px; border-radius: 15px;
  background: #fff; border: 1px solid #221a3f33;
  font-weight: 900; font-size: clamp(16px, 4.7vw, 23px); text-wrap: balance; line-height: 1.42;
  box-shadow: 0 3px 0 #25164919;
}
.quote::before {
  content: ""; position: absolute; left: 48%; top: -7px; width: 12px; height: 12px;
  background: white; border-left: 1px solid #221a3f33; border-top: 1px solid #221a3f33; transform: rotate(45deg);
}
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.primary, .secondary {
  min-height: 46px; padding: 10px 17px; font-weight: 850; border-radius: 24px; border: 0;
}
.primary { flex: 1; color: white; background: #302446; }
.secondary { background: #f2eef9; }
#attach { font-size: 12px; }
.proof { margin-top: 23px; }
.proof h2 { font-size: 13px; margin: 0 0 9px; }
#evidence { display: flex; flex-wrap: wrap; gap: 8px; }
.proof-chip {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: #f7f5fa; border-radius: 12px; padding: 5px 10px 5px 5px; font-size: 12px; font-weight: 700;
}
.proof-art { flex-shrink: 0; width: 41px; border-radius: 8px; }
.proof-sign { color: #257455; }
.proof-sign.no-sign { color: #ab3657; }
.memo { margin: 16px 0 18px; padding: 12px 15px; border-left: 3px solid var(--accent); }
.memo strong { font-size: 11px; }
.memo p { font-size: 14px; margin: 4px 0 0; line-height: 1.55; }
.result-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.result-footer a { font-size: 12px; }
.result-footer small { flex-basis: 100%; color: #716b7e; font-size: 11px; margin-top: 6px; }
dialog { width: min(calc(100vw - 22px), 435px); max-height: 93svh; border: 0; border-radius: 24px; padding: 15px; color: inherit; }
dialog::backdrop { background: #1a13269c; }
dialog p { margin: 10px 0; font-size: 12px; }
.dialog-close { float: right; margin: -4px -2px 0 6px; }
dialog img { width: 100%; max-height: 72svh; object-fit: contain; display: block; border-radius: 10px; }
#download { display: inline-block; margin: 10px 4px 1px; font-size: 12px; }
.incoming {
  position: absolute; bottom: calc(100% + 12px); width: 100%;
  text-align: center; margin: 0; color: var(--purple); font-size: 12px; font-weight: 850;
}
.practicing .incoming { bottom: calc(100% + 61px); font-size: 10px; }
.comparison { margin-top: 13px; padding: 16px; background: #f4efff; border-radius: 20px; }
.comparison h2, .comparison h3 { margin: 0 0 7px; font-size: 13px; }
.comparison h3 { margin-top: 12px; }
.compare-score { margin: 0; color: #52369a; font-size: 29px; font-weight: 950; }
.compare-row { display: flex; flex-wrap: wrap; gap: 6px; }
.compare-row > p { margin: 0; font-size: 13px; }
#invite-dialog h2 { margin: 8px 0 16px; font-size: 17px; }
#invite-url { display: block; width: 100%; padding: 10px; margin-bottom: 9px; border: 1px solid #d4c9e7; border-radius: 10px; font: inherit; }
#copy-invite { width: 100%; }
#invite-status:empty { display: none; }
@media (max-height: 610px) {
  .stage { margin-top: 67px; }
  #play:not(.practicing) .stage { margin-top: 25px; }
  #play.challenged .stage { margin-top: 79px; }
  .actions { margin-top: 8px; }
}

