:root {
  --bg: #f6f4ff;
  --card: #fff;
  --ink: #3b3656;
  --ink-soft: #7c7799;
  --line: #e7e3f7;

  --lav: #b8a4ff;
  --lav-deep: #8f76f2;
  --no: #9d86f7;
  --sky: #a7d8ff;
  --sky-deep: #5eaee9;
  --pink: #ffc2dc;
  --pink-deep: #ff86b4;
  --cream: #fff8ea;

  --ok-deep: #2fb38c;
  --ng-deep: #ec5a72;

  --shadow: 0 10px 30px rgba(120, 100, 200, .14);
  --shadow-sm: 0 4px 14px rgba(120, 100, 200, .12);
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --font-pop: "Mochiy Pop One", var(--font);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--lav-deep); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* opening */
.opening { display: none; }
.is-opening,
.is-opening body { overflow: hidden; }
.is-opening .opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #f7f5ff;
  cursor: pointer;
  transition: opacity .35s ease;
}
.opening.is-leaving { opacity: 0; }
.opening-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.opening-loader {
  fill: var(--no);
  fill-opacity: 0;
  stroke: var(--no);
  stroke-linejoin: round;
  stroke-dasharray: 100;
  animation: trace 1.6s ease-in-out infinite;
}
@keyframes trace {
  0% { stroke-dashoffset: 100; fill-opacity: 0; }
  40% { stroke-dashoffset: 0; fill-opacity: 0; }
  55%, 78% { stroke-dashoffset: 0; fill-opacity: 1; }
  100% { stroke-dashoffset: -100; fill-opacity: 0; }
}
.opening-logo {
  position: relative;
  width: min(62vw, 360px);
  height: auto;
  opacity: 0;
}
.opening-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border: 6px solid var(--no);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}
.opening-tap {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 56px);
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  color: var(--lav-deep);
  animation: tapIn .5s ease-out both, tapPulse 1.8s .5s ease-in-out infinite;
}
.opening-tap small { display: block; font-size: 11.5px; font-weight: 700; color: #a39fbd; }
@keyframes tapIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes tapPulse { 50% { opacity: .5; } }
.opening-skip {
  position: absolute;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 8px 12px;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 700;
  color: #a39fbd;
  cursor: pointer;
}

/* background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(184, 164, 255, .22) 1.5px, transparent 0) 0 0 / 22px 22px,
    #f7f5ff;
}
.bg-floaters { position: absolute; inset: 0; }
.floater {
  position: absolute;
  bottom: -40px;
  font-size: var(--size, 20px);
  color: var(--c, var(--lav));
  opacity: 0;
  animation: floatUp var(--dur, 16s) linear var(--delay, 0s) infinite;
  will-change: transform, opacity;
  user-select: none;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--op, .6); }
  50%  { transform: translate(var(--sway, 30px), -55vh) rotate(calc(var(--rot, 40deg) / 2)); }
  90%  { opacity: var(--op, .6); }
  100% { transform: translate(0, -110vh) rotate(var(--rot, 40deg)); opacity: 0; }
}

/* header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 16px 0;
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 4px 6px;
  font-family: var(--font-pop);
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 12px;
}
.topbar-logo-mark {
  width: 22px;
  height: 20px;
  fill: var(--no);
  color: var(--no);
}
.sound-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .15s, border-color .2s;
}
.sound-toggle:active { transform: scale(.94); }
.sound-icon { width: 20px; height: 20px; }
.sound-waves { display: none; }
.sound-toggle[aria-pressed="true"] { border-color: var(--lav); color: var(--lav-deep); }
.sound-toggle[aria-pressed="true"] .sound-waves { display: inline; }
.sound-toggle[aria-pressed="true"] .sound-mute { display: none; }

main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}
.screen { display: none; }
.screen.is-active { display: block; animation: screenIn .4s ease-out both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* buttons */
.btn {
  --btn-shadow: #d9d1f5;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--btn-shadow), var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  user-select: none;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 7px 0 var(--btn-shadow), var(--shadow-sm); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-shadow), var(--shadow-sm); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }

.btn--primary {
  --btn-shadow: #7a62dc;
  color: #fff;
  background: var(--no);
}
.btn--sub {
  --btn-shadow: #e0dbf3;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
}
.btn--x {
  --btn-shadow: #000;
  color: #fff;
  background: #1a1a1a;
}
.btn-arrow { font-size: .8em; display: inline-block; transition: transform .2s; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* top */
.hero { text-align: center; padding: 8px 0 12px; }
.logo {
  margin: 14px 0 0;
  font-family: var(--font-pop);
  font-weight: 400;
  font-size: clamp(58px, 19vw, 104px);
  line-height: 1.15;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.logo-char {
  --c: var(--lav-deep);
  display: inline-block;
  color: var(--c);
  text-shadow:
    3px 3px 0 #fff, -3px 3px 0 #fff, 3px -3px 0 #fff, -3px -3px 0 #fff,
    0 3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 -3px 0 #fff,
    0 8px 0 rgba(143, 118, 242, .25);
  animation:
    logoIn .7s calc(var(--i) * .09s) both cubic-bezier(.2, 1.6, .4, 1),
    logoWave 2.6s calc(.9s + var(--i) * .14s) ease-in-out infinite;
}
.logo-char:nth-child(1) { --c: #9d86f7; }
.logo-char:nth-child(2) { --c: #6fb8ee; }
.logo-char:nth-child(3) { --c: #ff8fbd; }
.logo-char--kentei { --c: var(--ink); font-size: .8em; }

@keyframes logoIn {
  from { opacity: 0; transform: translateY(-60px) scale(.4) rotate(-20deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes logoWave {
  0%, 60%, 100% { transform: translateY(0) rotate(0); }
  20% { transform: translateY(-12px) rotate(-5deg); }
  40% { transform: translateY(2px) rotate(3deg) scaleY(.94); }
}

.mascot {
  position: relative;
  width: 160px;
  height: 140px;
  margin: 4px auto 0;
  animation: bob 3.2s ease-in-out infinite;
}
.mascot-svg { display: block; filter: drop-shadow(0 10px 14px rgba(143, 118, 242, .25)); overflow: visible; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.catch {
  margin: 8px 0 18px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.5;
  animation: pop .6s .5s both cubic-bezier(.2, 1.4, .4, 1);
}
.catch-em {
  font-size: 1.35em;
  background: linear-gradient(transparent 62%, #ffe08a 62%, #ffe08a 90%, transparent 90%);
  padding: 0 4px;
}

@keyframes pop {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: none; }
}

.mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto 18px;
}
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 2.5px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.mode-btn:active { transform: scale(.96); }
.mode-btn[aria-pressed="true"] {
  border-color: var(--lav);
  box-shadow: 0 0 0 4px rgba(184, 164, 255, .25);
}
.mode-title { font-weight: 800; font-size: 16px; }
.mode-sub { font-size: 12px; color: var(--ink-soft); }
.mode-btn[aria-pressed="true"] .mode-title { color: var(--lav-deep); }

.btn--start {
  min-width: 260px;
  min-height: 62px;
  font-size: 19px;
  animation: pop .6s 1s both cubic-bezier(.2, 1.4, .4, 1);
}

.best {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.best b { color: var(--lav-deep); }

.section-title {
  margin: 28px 0 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}
.section-title span { color: var(--lav); font-weight: 500; font-size: .8em; letter-spacing: -.05em; }

.lv-pill, .level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
}
.lv-1 { background: #6fbdf0; }
.lv-2 { background: #45c49d; }
.lv-3 { background: #9d86f7; }
.lv-4 { background: #ef6a86; }

/* quiz */
.screen--quiz { position: relative; }
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.q-count { font-family: var(--font-pop); font-size: 16px; color: var(--ink-soft); white-space: nowrap; }
.q-count b { font-size: 28px; color: var(--ink); margin: 0 2px; }
.q-count-label { color: var(--lav-deep); }
.level-badge {
  font-size: 14px;
  padding: 5px 14px;
  box-shadow: var(--shadow-sm);
  transition: background .3s;
}
.level-badge.is-changed { animation: badgeBoing .7s cubic-bezier(.2, 1.6, .4, 1); }
.level-notes { font-size: 11px; letter-spacing: -.1em; opacity: .9; }
@keyframes badgeBoing {
  0% { transform: scale(1); }
  30% { transform: scale(1.35) rotate(-6deg); }
  60% { transform: scale(.9) rotate(3deg); }
  100% { transform: scale(1); }
}
.score-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 4px 8px;
  background: var(--cream);
  border: 2px solid #f1ddb8;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
.score-pill b { font-family: var(--font-pop); font-size: 18px; font-weight: 400; color: #b56c31; }
.score-pill.is-bump { animation: bump .5s cubic-bezier(.2, 1.6, .4, 1); }
.chikuwa { width: 40px; height: auto; flex: none; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.progress { position: relative; margin: 14px 4px 10px; height: 26px; }
.progress-track {
  position: absolute;
  left: 0; right: 0; top: 9px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(120, 100, 200, .18);
  overflow: hidden;
}
.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--lav);
  transition: width .6s ease-out;
}
.progress-runner {
  position: absolute;
  top: -5px;
  left: 0%;
  font-family: var(--font-pop);
  font-size: 22px;
  line-height: 1;
  color: var(--no);
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff;
  transform: translateX(-50%);
  transition: left .6s ease-out;
  animation: roll 1.6s linear infinite;
}
@keyframes roll {
  to { transform: translateX(-50%) rotate(360deg); }
}

.level-toast {
  position: absolute;
  left: 50%;
  top: 58px;
  z-index: 5;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -10px) scale(.8);
}
.level-toast.is-show { animation: toast 1.8s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -10px) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  25% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(.9); }
}

.q-card {
  position: relative;
  margin: 6px 0 16px;
  padding: 22px 20px 24px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
}
.q-card.is-enter { animation: cardIn .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.q-card.is-shake { animation: shake .5s ease both; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.92) rotate(-1.5deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px) rotate(-1.5deg); }
  30% { transform: translateX(9px) rotate(1.5deg); }
  45% { transform: translateX(-7px); }
  60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
.q-cat {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--lav-deep);
  background: #f3efff;
  border-radius: 999px;
}
.q-trick {
  margin-left: 6px;
  color: #b56c31;
  background: var(--cream);
}
.q-text {
  position: relative;
  margin: 0;
  font-size: clamp(17px, 4.6vw, 20px);
  font-weight: 800;
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: anywhere;
}
.q-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 14px auto 0;
  border-radius: 14px;
  object-fit: contain;
}

.choices { display: grid; gap: 10px; }
.choice {
  --m: var(--lav);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 16px 10px 10px;
  text-align: left;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
  background: #fff;
  border: 2.5px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 0 #ebe7f8;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: transform .12s, box-shadow .12s, border-color .2s, background .2s, opacity .3s;
  animation: choiceIn .45s calc(.12s + var(--d, 0) * .07s) both cubic-bezier(.2, 1.3, .4, 1);
}
.choice:nth-child(1) { --m: #8fd0ff; }
.choice:nth-child(2) { --m: #8ee6c8; }
.choice:nth-child(3) { --m: #c6b5ff; }
.choice:nth-child(4) { --m: #ffb0cc; }
@keyframes choiceIn {
  from { opacity: 0; transform: translateX(-24px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@media (hover: hover) {
  .choice:not(:disabled):hover { transform: translateY(-2px); border-color: var(--m); box-shadow: 0 6px 0 #ebe7f8; }
}
.choice:not(:disabled):active { transform: translateY(3px) scale(.99); box-shadow: 0 1px 0 #ebe7f8; }
.choice:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.choice:disabled { cursor: default; }
.choice-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-family: var(--font-pop);
  font-size: 16px;
  color: #fff;
  background: var(--m);
  transition: transform .3s;
}
.choice-text { flex: 1; }
.choice-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 12px;
  background: #f8f7ff;
}
.choices--img { grid-template-columns: 1fr 1fr; }
.choices--img .choice {
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 8px 8px 10px;
  text-align: center;
}
.choices--img .choice-mark {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 1;
  width: 28px;
  height: 28px;
  font-size: 13px;
  border-radius: 9px;
}
.choices--img .choice-text { flex: none; font-size: 14px; }
.choices--img .choice--text { justify-content: center; }
.choices--img .choice--text .choice-text { font-size: 16px; }
.choices--img .choice-tag { position: absolute; right: 6px; top: 6px; z-index: 1; }
.choice-tag {
  flex: none;
  padding: 1px 9px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  animation: pop .35s .15s both cubic-bezier(.2, 1.6, .4, 1);
}
.choice-tag--ok { background: var(--ok-deep); }
.choice-tag--ng { background: var(--ng-deep); }
.choice.is-correct {
  border-color: var(--ok-deep);
  background: #eafaf4;
  box-shadow: 0 4px 0 #bfeedd;
  animation: none;
  transform: scale(1.02);
}
.choice.is-correct .choice-mark { background: var(--ok-deep); transform: rotate(-8deg) scale(1.1); }
.choice.is-wrong {
  border-color: var(--ng-deep);
  background: #fff0f3;
  box-shadow: 0 4px 0 #ffd3dc;
  animation: none;
}
.choice.is-wrong .choice-mark { background: var(--ng-deep); }
.choice.is-dim { opacity: .45; animation: none; }
.choice.is-reveal { animation: reveal 1s ease-in-out 2; }
@keyframes reveal {
  0%, 100% { box-shadow: 0 4px 0 #bfeedd, 0 0 0 0 rgba(47, 179, 140, .5); }
  50% { box-shadow: 0 4px 0 #bfeedd, 0 0 0 8px rgba(47, 179, 140, 0); }
}

.feedback {
  position: relative;
  margin-top: 56px;
  padding: 18px 18px 20px;
  text-align: center;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: slideUp .45s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
.feedback-mark {
  position: absolute;
  left: 50%;
  top: -44px;
  width: 76px;
  height: 76px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  animation: markIn .5s cubic-bezier(.2, 1.8, .4, 1) both;
}
.feedback-mark svg { width: 52px; height: 52px; overflow: visible; }
.feedback-mark .draw {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: draw .45s .1s ease-out forwards;
}
.feedback-mark .draw--2 { animation-delay: .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes markIn {
  from { transform: translateX(-50%) scale(0) rotate(-40deg); }
  to   { transform: translateX(-50%) scale(1) rotate(0); }
}
.feedback-title {
  margin: 30px 0 6px;
  font-family: var(--font-pop);
  font-size: 22px;
}
.feedback.is-ok .feedback-title { color: var(--ok-deep); }
.feedback.is-ng .feedback-title { color: var(--ng-deep); }
.feedback-title small { font-family: var(--font); font-weight: 800; font-size: 14px; margin-left: 6px; color: #b56c31; }
.feedback-time {
  margin: -2px 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.feedback-img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin: 0 auto 10px;
  border-radius: 14px;
}
.feedback-exp { margin: 0 0 6px; font-size: 14px; line-height: 1.7; text-wrap: pretty; word-break: auto-phrase; }
.feedback-src {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: underline dotted;
  overflow-wrap: anywhere;
}
.btn--next { min-width: 200px; }

.burst-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.particle {
  position: absolute;
  font-size: var(--s, 20px);
  color: var(--c, var(--pink-deep));
  line-height: 1;
  animation: particle var(--t, .9s) cubic-bezier(.1, .8, .3, 1) forwards;
  will-change: transform, opacity;
}
.particle--chikuwa { width: 44px; }
.particle--chikuwa img { display: block; width: 100%; height: auto; }
@keyframes particle {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--r)); opacity: 0; }
}

/* judging */
.judging {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
}
.eq { display: flex; align-items: flex-end; gap: 8px; height: 90px; }
.eq span {
  width: 14px;
  height: 100%;
  border-radius: 8px;
  background: var(--lav);
  transform-origin: bottom;
  animation: eq 1s ease-in-out infinite;
}
.eq span:nth-child(2) { background: var(--pink); animation-delay: -.2s; }
.eq span:nth-child(3) { background: var(--sky); animation-delay: -.5s; }
.eq span:nth-child(4) { animation-delay: -.1s; }
.eq span:nth-child(5) { background: var(--pink); animation-delay: -.7s; }
.eq span:nth-child(6) { background: var(--sky); animation-delay: -.3s; }
.eq span:nth-child(7) { animation-delay: -.6s; }
@keyframes eq {
  0%, 100% { transform: scaleY(.2); }
  50% { transform: scaleY(1); }
}
.judging-title { margin: 18px 0 0; font-family: var(--font-pop); font-size: 28px; }

/* result */
.result-card {
  position: relative;
  padding: 22px 18px 20px;
  text-align: center;
  background: #fff;
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.result-card.is-shake { animation: shake .45s ease both; }
.result-kicker { position: relative; margin: 0; font-weight: 800; font-size: 13px; letter-spacing: .1em; color: var(--lav-deep); }
.result-grade-wrap { position: relative; display: inline-block; margin: 4px 0 0; }
.result-grade {
  margin: 0;
  font-family: var(--font-pop);
  font-weight: 400;
  font-size: clamp(64px, 20vw, 96px);
  line-height: 1.2;
  color: var(--no);
  text-shadow: 0 5px 0 rgba(143, 118, 242, .2);
  animation: gradeIn .8s .1s both cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes gradeIn {
  from { opacity: 0; transform: scale(.3) rotate(-12deg); }
  to   { opacity: 1; transform: none; }
}
.stamp {
  position: absolute;
  right: -66px;
  top: -8px;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 4px solid #ec5a72;
  border-radius: 50%;
  color: #ec5a72;
  font-family: var(--font-pop);
  font-size: 18px;
  transform: rotate(-14deg);
  opacity: 0;
  mix-blend-mode: multiply;
}
.stamp::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px solid #ec5a72;
  border-radius: 50%;
}
.stamp.is-in { animation: stampIn .45s cubic-bezier(.5, 0, .7, 1.4) both; }
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-14deg) scale(3); }
  70% { opacity: 1; transform: rotate(-14deg) scale(.9); }
  100% { opacity: .92; transform: rotate(-14deg) scale(1); }
}
.result-title { margin: 0; font-size: 17px; font-weight: 800; }
.result-title .new-best {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  font-size: 11.5px;
  color: #fff;
  background: var(--pink-deep);
  border-radius: 999px;
  vertical-align: 2px;
}

.chikuwa-meter {
  margin: 16px 0 0;
  padding: 14px 12px 12px;
  background: var(--cream);
  border: 2px dashed #f1ddb8;
  border-radius: 22px;
}
.chikuwa-meter-label { margin: 0; font-size: 13px; font-weight: 700; color: #a2753f; }
.chikuwa-meter-value { margin: 0; font-weight: 800; color: #8a5a2b; }
.chikuwa-meter-value b {
  margin: 0 6px;
  font-family: var(--font-pop);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.2;
  color: #b56c31;
}
.nono-meter {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 2px 0 4px;
}
.meter-no {
  width: 52px;
  height: 52px;
  overflow: visible;
}
.meter-no-fill { fill: var(--no); }
.meter-no-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 30;
  stroke-linejoin: round;
}

.result-type {
  margin-top: 14px;
  padding: 14px 14px 12px;
  border-radius: 22px;
  background: #f3f0ff;
}
.result-type-label { margin: 0; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.result-type-name { margin: 2px 0 4px; font-family: var(--font-pop); font-size: 22px; line-height: 1.4; color: var(--lav-deep); }
.result-type-desc { margin: 0; font-size: 13.5px; line-height: 1.7; }

.result-stats { margin: 12px 0 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }

.panel {
  margin-top: 16px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, .92);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.ladder { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ladder li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #f8f7ff;
  font-size: 13.5px;
}
.ladder-grade { flex: none; width: 52px; font-family: var(--font-pop); font-size: 15px; color: var(--lav-deep); }
.ladder-title { flex: 1; font-weight: 700; }
.ladder-range { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.ladder-note { margin: 12px 4px 0; font-size: 11.5px; line-height: 1.7; color: var(--ink-soft); text-align: center; text-wrap: pretty; word-break: auto-phrase; }
.ladder li.is-you {
  background: #efe9ff;
  box-shadow: inset 0 0 0 2px var(--lav);
  animation: pop .5s .6s both cubic-bezier(.2, 1.6, .4, 1);
}
.you-pill {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--pink-deep);
}

.name-field { display: block; margin-bottom: 10px; }
.name-field span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.name-field input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}
.name-field input:focus { outline: none; border-color: var(--lav); box-shadow: 0 0 0 4px rgba(184, 164, 255, .25); }
.cert {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.share-btns { display: grid; gap: 10px; margin-top: 14px; }
.share-btns .btn { width: 100%; }
.share-status { margin: 12px 0 0; font-size: 13px; font-weight: 700; text-align: center; }
.share-status:empty { display: none; }

.cert-fields { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.cert-fields .name-field { flex: 1; min-width: 0; margin-bottom: 0; }
.icon-field { flex: none; display: grid; justify-items: center; gap: 2px; }
.icon-pick {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px dashed var(--lav);
  border-radius: 50%;
  background: #fff;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--lav-deep);
  cursor: pointer;
  overflow: hidden;
}
.icon-pick img { width: 100%; height: 100%; object-fit: cover; }
.icon-pick.is-set { border-style: solid; }
.icon-field:focus-within .icon-pick { outline: 3px solid var(--sky-deep); outline-offset: 2px; }
.icon-clear {
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.history { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.history li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #f8f7ff;
  font-size: 13px;
}
.history li.is-current { box-shadow: inset 0 0 0 2px var(--lav); }
.history time { flex: none; width: 78px; font-size: 12px; color: var(--ink-soft); }
.history-mode { flex: none; font-size: 12px; }
.history-grade { flex: none; font-family: var(--font-pop); font-weight: 400; color: var(--lav-deep); }
.history-score { flex: 1; }


.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 8px;
}
.result-actions .btn { padding-left: 12px; padding-right: 12px; }

/* review */
.review-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.review-item {
  position: relative;
  padding: 14px 16px 14px 56px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  animation: slideUp .4s calc(var(--i) * .04s) both cubic-bezier(.2, 1.2, .4, 1);
}
.review-mark {
  position: absolute;
  left: 12px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
}
.review-item.is-ok .review-mark { background: var(--ok-deep); }
.review-item.is-ng .review-mark { background: var(--ng-deep); }
.review-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.review-meta .lv-pill { font-size: 11px; padding: 1px 8px; }
.review-time { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.review-q { margin: 0 0 6px; font-weight: 800; font-size: 14.5px; line-height: 1.6; }
.review-img { display: block; max-width: 160px; max-height: 120px; margin: 0 0 6px; border-radius: 10px; }
.review-choice-img { width: 36px; height: 36px; margin-right: 4px; object-fit: cover; border-radius: 8px; vertical-align: middle; }
.review-a { margin: 0; font-size: 13px; }
.review-a b { color: var(--ok-deep); }
.review-a s { color: var(--ng-deep); }
.review-exp { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.review-src { font-size: 11.5px; color: var(--ink-soft); overflow-wrap: anywhere; }

/* footer */
body[data-screen="quiz"] .footer,
body[data-screen="judging"] .footer { display: none; }

.footer {
  max-width: 560px;
  margin: 12px auto 0;
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.footer p { margin: 0 0 8px; }
.footer-deco { color: var(--lav); letter-spacing: -.05em; overflow: hidden; white-space: nowrap; }
.footer a { color: var(--ink-soft); }
.footer-credit { margin-top: 14px; font-weight: 700; letter-spacing: .08em; color: #a39fbd; }

@media (max-width: 380px) {
  .q-count b { font-size: 22px; }
  .level-badge { padding: 4px 10px; font-size: 12.5px; }
  .score-pill { padding: 3px 10px 3px 6px; }
  .chikuwa { width: 32px; }
  .stamp { right: -54px; width: 56px; height: 56px; font-size: 15px; }
  .meter-no { width: 46px; height: 46px; }
}

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