:root {
  color-scheme: only light;
  --background: #ffffff;
  --card: #ffffff;
  --text: #222524;
  --muted: #707673;
  --line: #e2e5e3;
  --primary: #343837;
  --primary-hover: #252827;
  --correct: #23815b;
  --correct-soft: #e9f7f0;
  --wrong: #bc4b51;
  --wrong-soft: #fff0f0;
  --result-red: #e6002d;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic",
    Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 16px 12px 24px;
  background: #fff;
}

.app-card {
  position: relative;
  width: min(100%, 600px);
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.app-card.is-fading-out,
.app-card.is-fading-in {
  pointer-events: none;
}

.app-card.is-fading-out {
  animation: app-fade-out 180ms ease-in both;
}

.app-card.is-fading-in {
  animation: app-fade-in 240ms ease-out both;
}

.screen {
  width: 100%;
  padding: 22px 18px 24px;
  animation: screen-in 240ms ease-out both;
}

.start-screen,
.result-screen {
  display: flex;
  min-height: min(520px, calc(100svh - 32px));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.start-screen {
  position: relative;
  isolation: isolate;
  min-height: min(680px, calc(100svh - 32px));
  gap: 18px;
  overflow: hidden;
}

.start-screen h1,
.result-screen h1,
.explanation-screen h1 {
  margin: 0 0 28px;
  font-size: clamp(1.8rem, 8vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.start-screen h1 {
  margin-bottom: 9px;
  color: #303433;
  font-size: clamp(2rem, 9vw, 2.7rem);
  letter-spacing: 0.04em;
}

.start-copy {
  position: relative;
  z-index: 1;
}

.start-lead {
  margin: 0;
  color: #444b48;
  font-size: clamp(0.92rem, 4vw, 1.05rem);
  font-weight: 650;
  line-height: 1.65;
}

.start-lead span {
  display: block;
}

.start-game-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.start-question-count {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  padding: 7px 14px;
  color: #444b48;
  background: #f5f7f6;
  border: 1px solid #dfe4e1;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1;
}

.start-question-count strong {
  color: var(--text);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.start-play-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #444b48;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sound-toggle--start {
  min-height: 36px;
  padding: 5px 7px 5px 12px;
  background: #f5f6f5;
  border: 1px solid #dfe2e0;
  border-radius: 999px;
}

.sound-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sound-toggle-control {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  background: #aeb3b0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(34, 37, 36, 0.08);
  transition: background-color 140ms ease;
}

.sound-toggle-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(34, 37, 36, 0.28);
  content: "";
  transition: transform 140ms ease;
}

.sound-toggle-input:checked + .sound-toggle-control {
  background: var(--correct);
}

.sound-toggle-input:checked + .sound-toggle-control::after {
  transform: translateX(18px);
}

.sound-toggle-input:focus-visible + .sound-toggle-control {
  outline: 3px solid rgba(52, 56, 55, 0.25);
  outline-offset: 3px;
}

.sound-toggle--compact {
  flex: 0 0 auto;
  gap: 6px;
}

.sound-toggle--compact .sound-toggle-control {
  width: 38px;
  height: 22px;
}

.sound-toggle--compact .sound-toggle-control::after {
  width: 16px;
  height: 16px;
}

.sound-toggle--compact .sound-toggle-input:checked + .sound-toggle-control::after {
  transform: translateX(16px);
}

.start-showcase {
  position: relative;
  width: calc(100% + 36px);
  margin-inline: -18px;
}

.start-marquee {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 7%,
    #000 93%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 7%,
    #000 93%,
    transparent
  );
}

.start-marquee-track {
  --start-marquee-gap: 14px;
  display: flex;
  width: max-content;
  gap: var(--start-marquee-gap);
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.start-marquee-track.is-ready {
  will-change: transform;
}

.start-marquee-track.is-ready.is-css-fallback {
  animation: start-marquee-scroll 28s linear infinite;
}

.start-marquee-hint {
  display: none;
}

.start-marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--start-marquee-gap);
  padding: 12px 0 16px;
}

.start-marquee-card {
  width: clamp(128px, 38vw, 172px);
  aspect-ratio: 1191 / 1684;
  flex: 0 0 auto;
  margin: 0;
  padding: 5px;
  background: #fff;
  border: 1px solid #e2e5e3;
  border-radius: 9px;
  box-shadow: 0 7px 18px rgba(31, 48, 40, 0.11);
  transform: rotate(-0.8deg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.start-marquee-card:nth-child(even) {
  transform: rotate(0.7deg);
}

.start-marquee-card:nth-child(3n) {
  transform: rotate(-0.25deg);
}

.start-marquee-card img {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 5px;
  object-fit: contain;
}

.start-screen .button--primary {
  position: relative;
  max-width: 340px;
  background: var(--primary);
  box-shadow: 0 5px 0 #222524;
  font-size: 1.03rem;
}

.start-screen .button--primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.start-screen .button--primary:active:not(:disabled) {
  box-shadow: 0 2px 0 #222524;
  transform: translateY(3px);
}

.start-screen .button--primary:disabled {
  box-shadow: none;
}

.button {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.35;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:focus-visible,
.choice-button:focus-visible {
  outline: 3px solid rgba(52, 56, 55, 0.25);
  outline-offset: 3px;
}

.button:disabled,
.choice-button:disabled {
  cursor: default;
}

.button--primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 12px rgba(34, 37, 36, 0.19);
}

.button--primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button--primary:disabled {
  background: #707673;
  box-shadow: none;
}

.button--secondary {
  color: var(--primary);
  background: #fff;
  border-color: #b9bdbb;
}

.button--secondary:hover:not(:disabled) {
  background: #f4f5f4;
}

.load-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.load-status.is-error {
  color: var(--wrong);
}

.quiz-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-meta {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-meta p {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
}

.quiz-meta strong {
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.meta-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 4px;
  margin: 10px 0 16px;
  overflow: hidden;
  background: #eaedeb;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 240ms ease;
}

.image-frame {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 12px 5%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cfd5d2;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px #f4f5f4;
}

.image-frame--question {
  height: clamp(225px, 38svh, 390px);
}

.image-frame--small {
  height: clamp(160px, 25svh, 230px);
  margin: 18px 0 22px;
}

.image-frame img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #eef0ef;
  border-radius: 8px;
  object-fit: contain;
}

.image-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  text-align: center;
}

.image-fallback span {
  font-size: 2.4rem;
  line-height: 1;
}

.image-fallback p {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.question-prompt {
  margin: 20px 0 14px;
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  text-align: center;
}

.question-screen {
  position: relative;
}

.question-screen::before {
  position: absolute;
  z-index: 5;
  inset: 0;
  background: transparent;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.question-screen.is-correct-effect::before {
  animation: correct-wash 720ms ease-out both;
}

.question-screen.is-wrong-effect::before {
  animation: wrong-wash 480ms ease-out both;
}

.question-screen.is-correct-effect .image-frame--question {
  animation: correct-frame-pulse 650ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.question-screen.is-wrong-effect .image-frame--question {
  animation: wrong-frame-nudge 420ms ease-out both;
}

.question-screen.is-correct-effect .choice-button.is-correct {
  animation: correct-choice-slide 560ms cubic-bezier(0.2, 0.85, 0.25, 1.15) both;
}

.choice-stage {
  position: relative;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-button {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px 12px 51px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfd5d2;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: left;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.choice-button::before {
  position: absolute;
  top: 50%;
  left: 14px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  background: #f3f5f4;
  border-radius: 50%;
  content: attr(data-label);
  font-size: 0.72rem;
  font-weight: 800;
  transform: translateY(-50%);
}

.choice-button:hover:not(:disabled) {
  border-color: #8c928f;
  box-shadow: 0 3px 9px rgba(30, 46, 39, 0.07);
  transform: translateY(-1px);
}

.choice-button.is-selected {
  color: #303433;
  background: #f1f2f1;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(52, 56, 55, 0.16);
}

.choice-button.is-selected::before {
  color: #fff;
  background: var(--primary);
}

.question-actions {
  margin-top: 16px;
}

.choice-stage.is-correct-result .choice-button:not(.is-correct) {
  opacity: 0.18;
}

.choice-button:disabled:not(.is-correct, .is-wrong) {
  color: #848a87;
  background: #fafbfa;
}

.choice-button.is-correct {
  color: #126542;
  background: var(--correct-soft);
  border-color: var(--correct);
  box-shadow: 0 0 0 1px var(--correct);
}

.choice-button.is-correct::before {
  color: #fff;
  background: var(--correct);
  content: "✓";
}

.choice-button.is-wrong {
  color: #9c343a;
  background: var(--wrong-soft);
  border-color: var(--wrong);
}

.choice-button.is-wrong::before {
  color: #fff;
  background: var(--wrong);
  content: "×";
}

.correct-feedback {
  position: absolute;
  z-index: 3;
  top: var(--correct-feedback-top, 66px);
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 17px 16px;
  overflow: hidden;
  color: #164f38;
  background: rgba(233, 247, 240, 0.98);
  border: 1px solid #9cd4ba;
  border-radius: 14px;
  text-align: center;
  animation: correct-pop 360ms 220ms cubic-bezier(0.2, 0.85, 0.25, 1.25) both;
}

.feedback-check {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 7px;
  place-items: center;
  color: #fff;
  background: var(--correct);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(35, 129, 91, 0.11);
  font-size: 1.45rem;
  font-weight: 900;
  animation: check-bounce 520ms cubic-bezier(0.2, 0.9, 0.25, 1.35) both;
}

.feedback-title {
  margin: 0;
  color: var(--correct);
  font-size: 1.5rem;
  font-weight: 850;
}

.answer-english {
  overflow-wrap: anywhere;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.55;
}

.sparkles i {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #6fbd91;
  border-radius: 50%;
  animation: sparkle 700ms ease-out both;
}

.sparkles i:nth-child(1) { top: 14%; left: 8%; }
.sparkles i:nth-child(2) { top: 55%; left: 4%; animation-delay: 80ms; }
.sparkles i:nth-child(3) { right: 8%; bottom: 18%; animation-delay: 40ms; }
.sparkles i:nth-child(4) { top: 18%; right: 5%; animation-delay: 130ms; }
.sparkles i:nth-child(5) { top: 8%; left: 25%; animation-delay: 160ms; }
.sparkles i:nth-child(6) { right: 26%; bottom: 7%; animation-delay: 200ms; }
.sparkles i:nth-child(7) { bottom: 9%; left: 18%; animation-delay: 110ms; }
.sparkles i:nth-child(8) { top: 10%; right: 34%; animation-delay: 230ms; }

.wrong-feedback {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: 50%;
  min-width: 150px;
  padding: 20px 28px;
  color: #fff;
  background: rgba(160, 50, 57, 0.94);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(90, 22, 27, 0.25);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: wrong-shake 380ms ease-out both;
}

.explanation-screen {
  padding-top: 28px;
}

.explanation-screen > h1 {
  margin-bottom: 8px;
  color: #753b3e;
}

.explanation-copy {
  display: grid;
  gap: 16px;
  margin: 0;
}

.explanation-copy div {
  padding-left: 14px;
  border-left: 3px solid #d8ddda;
}

.explanation-copy dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.explanation-copy dd {
  margin: 0;
  line-height: 1.65;
}

.explanation-copy .answer-english {
  color: #243f34;
}

.explanation-actions {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.speech-note {
  margin: -2px 0 2px;
  color: var(--wrong);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.result-screen {
  justify-content: flex-start;
  padding-top: 28px;
}

.result-screen > h1 {
  margin-bottom: 18px;
}

.result-highlight {
  width: 100%;
  padding: 48px 14px 16px;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(145deg, #f3f4f3 0%, #fafafa 100%);
  border: 1px solid #e0e3e1;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(34, 37, 36, 0.07);
}

.result-highlight-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: clamp(6px, 2.2vw, 10px);
  row-gap: 44px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-highlight-item {
  --highlight-delay: 0ms;
  position: relative;
  min-width: 0;
  aspect-ratio: 360 / 509;
  overflow: visible;
  background: #fff;
  border: 1px solid rgba(52, 56, 55, 0.16);
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(34, 37, 36, 0.1);
  animation: result-highlight-reveal 300ms cubic-bezier(0.2, 0.85, 0.3, 1) both;
  animation-delay: var(--highlight-delay);
  animation-play-state: paused;
}

.result-highlight-image {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 9px;
  object-fit: contain;
}

.result-highlight-mark {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  display: grid;
  width: clamp(24px, 7vw, 34px);
  height: clamp(24px, 7vw, 34px);
  place-items: center;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(26, 38, 34, 0.26);
  transform: translateX(-50%);
  animation: result-mark-pop 230ms cubic-bezier(0.2, 0.85, 0.25, 1.3) both;
  animation-delay: calc(var(--highlight-delay) + 70ms);
  animation-play-state: paused;
}

.has-answer-highlight.is-result-ready .result-highlight-item,
.has-answer-highlight.is-result-ready .result-highlight-mark {
  animation-play-state: running;
}

.result-highlight-mark svg {
  display: block;
  width: 68%;
  height: 68%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-highlight-mark.is-correct {
  background: rgba(28, 139, 91, 0.94);
}

.result-highlight-mark.is-wrong {
  background: var(--result-red);
}

.result-paper {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  aspect-ratio: 297 / 210;
  margin-top: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #bbb2a4;
  border-radius: 4px;
  box-shadow:
    0 2px 3px rgba(62, 52, 31, 0.07),
    0 10px 20px rgba(62, 52, 31, 0.12);
}

.has-answer-highlight .result-paper {
  animation: result-paper-reveal 360ms cubic-bezier(0.2, 0.85, 0.3, 1) 3000ms both;
  animation-play-state: paused;
}

.result-paper-heading {
  display: grid;
  min-height: 37px;
  padding: 8px 16px 7px;
  place-items: center;
  background: #fff;
  border-bottom: 1px solid #c8c1b6;
}

.result-paper-heading h2 {
  margin: 0;
  color: #343837;
  font-size: clamp(0.78rem, 3.5vw, 0.98rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

.result-paper-main {
  display: flex;
  min-height: 0;
  padding: 15px 18px 22px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-verdict {
  display: flex;
  min-width: 0;
  margin-top: 28px;
  flex-direction: column;
  align-items: center;
}

.has-answer-highlight .result-verdict {
  animation: result-title-reveal 420ms cubic-bezier(0.2, 0.85, 0.3, 1) 4700ms both;
  animation-play-state: paused;
}

.result-count {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  color: var(--result-red);
  font-size: clamp(2.6rem, 13vw, 4rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.has-answer-highlight .result-count {
  animation: result-score-reveal 340ms cubic-bezier(0.2, 0.85, 0.25, 1.2) 3400ms both;
  animation-play-state: paused;
}

.result-count::before,
.result-count::after {
  position: absolute;
  height: 4px;
  content: "";
  --underline-angle: -1deg;
  right: 1%;
  left: 1%;
  background: var(--result-red);
  border-radius: 999px;
  transform: rotate(var(--underline-angle)) scaleX(1);
  transform-origin: left center;
}

.result-count::before {
  bottom: -8px;
}

.result-count::after {
  bottom: -15px;
}

.has-answer-highlight .result-count::before {
  animation: result-score-underline 420ms cubic-bezier(0.25, 0.8, 0.3, 1) 3780ms both;
  animation-play-state: paused;
}

.has-answer-highlight .result-count::after {
  animation: result-score-underline 420ms cubic-bezier(0.25, 0.8, 0.3, 1) 4095ms both;
  animation-play-state: paused;
}

.result-verdict-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.result-verdict-label {
  color: #505654;
}

.result-verdict-title {
  margin: 3px 0 0;
  color: #303433;
  font-size: clamp(1rem, 4.8vw, 1.5rem);
  font-weight: 900;
  line-height: 1.22;
}

.result-review {
  width: 100%;
  margin-top: 34px;
  text-align: left;
}

.result-section-heading {
  margin-bottom: 14px;
}

.has-answer-highlight .result-section-heading {
  animation: result-title-reveal 380ms cubic-bezier(0.2, 0.85, 0.3, 1) 5180ms both;
  animation-play-state: paused;
}

.result-section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
}

.review-list {
  display: grid;
  gap: 12px;
}

.has-answer-highlight .review-list {
  animation: result-title-reveal 420ms cubic-bezier(0.2, 0.85, 0.3, 1) 5600ms both;
  animation-play-state: paused;
}

.has-answer-highlight.is-result-ready .result-paper,
.has-answer-highlight.is-result-ready .result-count,
.has-answer-highlight.is-result-ready .result-verdict,
.has-answer-highlight.is-result-ready .result-section-heading,
.has-answer-highlight.is-result-ready .review-list,
.has-answer-highlight.is-result-ready .result-count::before,
.has-answer-highlight.is-result-ready .result-count::after {
  animation-play-state: running;
}

.review-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 13px;
  padding: 12px;
  background: #fff;
  border: 1px solid #dde2df;
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(34, 37, 36, 0.05);
}

.review-card-image {
  display: block;
  width: 92px;
  height: 92px;
  align-self: center;
  padding: 5px;
  background: #fff;
  border: 1px solid #dfe3e1;
  border-radius: 9px;
  object-fit: contain;
}

.review-card-copy {
  min-width: 0;
}

.review-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.review-card dl > div {
  min-width: 0;
}

.review-card dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.review-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.48;
}

.review-card .is-correct dd {
  color: #176641;
}

.review-card .is-wrong dd {
  color: #9c3d43;
}

.start-screen .button,
.result-screen .button {
  max-width: 340px;
}

.result-actions {
  display: grid;
  width: 100%;
  max-width: 340px;
  margin-top: 32px;
  gap: 10px;
}

.share-status {
  min-height: 1.4em;
  margin: 0;
  color: #315e49;
  font-size: 0.78rem;
  font-weight: 700;
}

.clipboard-helper {
  position: fixed;
  top: -1000px;
  left: -1000px;
}

.ad-container {
  width: 100%;
  min-height: 100px;
  margin-top: 28px;
}

.text-link {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  width: min(100%, 600px);
  margin: 8px auto 0;
  padding: 12px 18px 4px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.policy-card {
  overflow: visible;
}

.policy-page {
  padding: 32px 18px 36px;
}

.policy-page h1 {
  margin: 0 0 28px;
  font-size: clamp(1.65rem, 7vw, 2.1rem);
  line-height: 1.35;
}

.policy-page h2 {
  margin: 30px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 1.08rem;
  line-height: 1.5;
}

.policy-page p {
  margin: 0 0 12px;
  color: #444b48;
  font-size: 0.9rem;
  line-height: 1.9;
}

.policy-page a {
  color: #315e49;
  text-underline-offset: 0.18em;
}

.policy-page .policy-intro {
  color: var(--text);
}

.policy-page .policy-date {
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.policy-page .policy-back-link {
  display: block;
  width: fit-content;
  margin: 30px auto 0;
  color: var(--muted);
}

@keyframes result-highlight-reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes result-mark-pop {
  from { opacity: 0; transform: translateX(-50%) scale(0.35) rotate(-8deg); }
  to { opacity: 1; transform: translateX(-50%) scale(1) rotate(0); }
}

@keyframes result-paper-reveal {
  from { visibility: hidden; opacity: 0; transform: translateY(14px) scale(0.97); }
  to { visibility: visible; opacity: 1; transform: translateY(0); }
}

@keyframes result-score-reveal {
  from { visibility: hidden; opacity: 0; transform: translateY(8px) scale(0.92); }
  to { visibility: visible; opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes result-title-reveal {
  from { visibility: hidden; opacity: 0; transform: translateY(8px); }
  to { visibility: visible; opacity: 1; transform: translateY(0); }
}

@keyframes result-score-underline {
  from { opacity: 0; transform: rotate(var(--underline-angle)) scaleX(0); }
  to { opacity: 1; transform: rotate(var(--underline-angle)) scaleX(1); }
}

.noscript-message {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  margin: 0;
  padding: 14px;
  color: #fff;
  background: #7a3337;
  border-radius: 10px;
  text-align: center;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes app-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-4px); }
}

@keyframes app-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes start-marquee-scroll {
  from {
    /* Safariで暗黙のtransform:noneから始めると再描画されない場合がある。 */
    transform: translate3d(0, 0, 0);
  }

  to {
    /* 14pxのグループ間隔の半分。Safari 18.2未満向けにcalc()内の割り算を使わない。 */
    transform: translate3d(calc(-50% - 7px), 0, 0);
  }
}

@keyframes correct-pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes correct-wash {
  0% { opacity: 0; background: rgba(35, 129, 91, 0); }
  24% { opacity: 1; background: rgba(35, 129, 91, 0.1); }
  100% { opacity: 0; background: rgba(35, 129, 91, 0); }
}

@keyframes wrong-wash {
  0% { opacity: 0; background: rgba(188, 75, 81, 0); }
  32% { opacity: 1; background: rgba(188, 75, 81, 0.09); }
  100% { opacity: 0; background: rgba(188, 75, 81, 0); }
}

@keyframes correct-frame-pulse {
  0% { border-color: #cfd5d2; box-shadow: inset 0 0 0 1px #f4f5f4; transform: scale(1); }
  45% { border-color: #4aa67d; box-shadow: 0 0 0 7px rgba(35, 129, 91, 0.11); transform: scale(1.012); }
  100% { border-color: #cfd5d2; box-shadow: inset 0 0 0 1px #f4f5f4; transform: scale(1); }
}

@keyframes wrong-frame-nudge {
  0%, 100% { border-color: #cfd5d2; transform: translateX(0); }
  22% { border-color: #d77b80; transform: translateX(-5px); }
  44% { transform: translateX(4px); }
  66% { transform: translateX(-2px); }
  82% { transform: translateX(1px); }
}

@keyframes correct-choice-slide {
  0% { transform: translateY(var(--correct-slide-distance, 0)) scale(1); }
  55% { transform: translateY(0) scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes check-bounce {
  from { opacity: 0; transform: scale(0.35) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes sparkle {
  from { opacity: 1; transform: scale(0) translateY(4px); }
  60% { opacity: 1; transform: scale(1.3) translateY(-3px); }
  to { opacity: 0; transform: scale(0.6) translateY(-9px); }
}

@keyframes wrong-shake {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  40% { opacity: 1; transform: translate(calc(-50% - 5px), -50%) scale(1); }
  65% { transform: translate(calc(-50% + 4px), -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (min-width: 560px) {
  .app-shell {
    padding-top: 24px;
  }

  .screen {
    padding-right: 30px;
    padding-left: 30px;
  }

  .start-showcase {
    width: calc(100% + 60px);
    margin-inline: -30px;
  }

  .choice-button {
    font-size: 1rem;
  }

  .policy-page {
    padding-right: 30px;
    padding-left: 30px;
  }
}

@media (max-height: 700px) {
  .image-frame--question {
    height: 212px;
  }

  .question-prompt {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .start-marquee {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none;
    mask-image: none;
    scrollbar-width: none;
  }

  .start-marquee::-webkit-scrollbar {
    display: none;
  }

  .start-marquee-track {
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
  }

  .start-marquee-card {
    scroll-snap-align: start;
  }

  .start-marquee-hint {
    display: block;
    margin: -5px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
  }

  .result-highlight-item,
  .result-highlight-mark,
  .has-answer-highlight .result-paper,
  .has-answer-highlight .result-count,
  .has-answer-highlight .result-verdict,
  .has-answer-highlight .result-section-heading,
  .has-answer-highlight .review-list,
  .has-answer-highlight .result-count::before,
  .has-answer-highlight .result-count::after {
    visibility: visible !important;
    opacity: 1 !important;
    animation: none !important;
  }

  .result-highlight-item,
  .has-answer-highlight .result-paper,
  .has-answer-highlight .result-count,
  .has-answer-highlight .result-verdict,
  .has-answer-highlight .result-section-heading,
  .has-answer-highlight .review-list {
    transform: none !important;
  }

  .result-highlight-mark {
    transform: translateX(-50%) !important;
  }

  .has-answer-highlight .result-count::before,
  .has-answer-highlight .result-count::after {
    transform: rotate(var(--underline-angle)) scaleX(1) !important;
  }

  .start-marquee-group[aria-hidden="true"] {
    display: none;
  }
}
