:root {
  color-scheme: light;
  --cream-top: #f8e8c8;
  --cream-card: #fff0ca;
  --cream-pill: #fee5c3;
  --mint-bg: #e8f8f0;
  --mint-bg-2: #e8f0f0;
  --soft-gray: #e0e0d8;
  --soft-panel: #e8f0e8;
  --ink: #0b1513;
  --brown: #6b302c;
  --brown-soft: #9a5a50;
  --red: #c84830;
  --red-bright: #d84c35;
  --green: #35bd62;
  --app-store-blue: #0a84ff;
  --gold: #dfb95a;
  --blue-note: #12aeea;
  --pink-note: #f64a86;
  --line: #d4d2c8;
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(60, 80, 72, 0.12);
  --content-width: min(calc(100vw - 24px), clamp(340px, 62svh, 720px));
  font-family:
    "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 240, 202, 0.75), transparent 28%),
    linear-gradient(180deg, var(--mint-bg), var(--mint-bg-2));
  color: var(--ink);
}

html,
body {
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}

button,
a,
.question-card,
.answer-panel,
.stat-card,
.soft-card,
.note-card,
.unit-card {
  will-change: transform;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  justify-items: center;
}

.app-screen {
  width: var(--content-width);
  min-height: 100vh;
  padding-bottom: 104px;
}

.quiz-screen {
  width: min(100vw, 560px);
  height: 100svh;
  min-height: 100svh;
  padding-bottom: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

.quiz-screen .app-header,
.quiz-screen .tab-bar {
  display: none;
}

.quiz-screen .app-content {
  width: 100%;
  height: 100%;
  padding: clamp(8px, 1.8svh, 14px) clamp(10px, 3vw, 18px);
  overflow: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: var(--content-width);
  padding: 12px clamp(14px, 3svh, 26px);
  background: rgba(248, 232, 200, 0.9);
  border-bottom: 1px solid rgba(107, 48, 44, 0.12);
  backdrop-filter: blur(14px);
}

.brand-button {
  min-width: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brown);
  font-weight: 950;
  cursor: pointer;
}

.brand-button img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(107, 48, 44, 0.16);
}

.brand-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-content,
.home-page {
  width: var(--content-width);
  margin: 0 auto;
  padding: clamp(16px, 3.5svh, 32px);
}

.home-page {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: clamp(12px, 2.2svh, 20px);
}

.home-copy {
  padding: clamp(18px, 4.8svh, 38px) clamp(22px, 6vw, 48px);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 240, 202, 0.7)),
    var(--cream-card);
  box-shadow: var(--shadow);
  text-align: center;
  animation: card-rise 420ms cubic-bezier(0.2, 0.85, 0.28, 1.15) both;
}

.home-icon {
  width: clamp(88px, 18svh, 150px);
  height: clamp(88px, 18svh, 150px);
  border-radius: 26%;
  box-shadow: 0 18px 36px rgba(107, 48, 44, 0.18);
  animation: icon-pop 520ms cubic-bezier(0.18, 0.9, 0.2, 1.25) both 90ms,
    icon-float 3.8s ease-in-out infinite 900ms;
}

.eyebrow {
  margin: clamp(14px, 2.6svh, 20px) 0 8px;
  color: var(--blue-note);
  font-size: clamp(15px, 3vw, 18px);
  font-weight: 950;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5.2svh, 40px);
  line-height: 1.08;
  font-weight: 950;
}

.lead {
  max-width: 520px;
  margin: clamp(10px, 2svh, 16px) auto 0;
  color: var(--brown-soft);
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 800;
  line-height: 1.7;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  animation: soft-fade-up 420ms ease-out both 160ms;
}

.home-actions.single-action {
  grid-template-columns: 1fr;
}

.home-actions.single-action .primary {
  min-height: clamp(64px, 9svh, 78px);
  font-size: clamp(20px, 3.8vw, 26px);
}

.seo-content {
  padding: clamp(18px, 4svh, 28px) clamp(18px, 5vw, 34px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 28px rgba(60, 80, 72, 0.08);
  animation: soft-fade-up 420ms ease-out both 220ms;
}

.seo-content h2 {
  margin: 0 0 10px;
  color: var(--brown);
  font-size: clamp(20px, 3.8vw, 28px);
  line-height: 1.28;
}

.seo-content p,
.seo-content li {
  color: var(--brown-soft);
  font-size: clamp(15px, 2.5vw, 17px);
  font-weight: 800;
  line-height: 1.72;
}

.seo-content p {
  margin: 0;
}

.seo-content ul {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding-left: 1.25em;
}

.result-page .home-copy {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(232, 248, 240, 0.78)),
    var(--white);
}

.home-store-cta {
  grid-column: 1 / -1;
  min-height: clamp(58px, 8svh, 70px);
  border: 3px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 18px 34px rgba(10, 132, 255, 0.28),
    0 6px 14px rgba(24, 80, 145, 0.14);
  animation: cta-scale-pulse 1.7s ease-in-out infinite;
}

.home-store-cta::before {
  content: "iOS";
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 28px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--app-store-blue);
  font-size: 14px;
  font-weight: 950;
}

.quiz-page,
.report-page {
  display: grid;
  gap: 18px;
}

.report-page {
  padding-bottom: 188px;
}

.report-page .soft-card,
.report-page .note-card,
.report-page .section-heading,
.report-page .section-lead,
.report-page .unit-card {
  display: none;
}

.quiz-screen .quiz-page {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(6px, 1.35svh, 12px);
  overflow: hidden;
}

.quiz-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.round-close,
.back-button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 240, 202, 0.9);
  color: var(--brown);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(60, 80, 72, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.round-close:active,
.back-button:active {
  transform: scale(0.92);
}

.quiz-screen .round-close {
  width: clamp(32px, 5.8svh, 44px);
  height: clamp(32px, 5.8svh, 44px);
  font-size: clamp(20px, 3.8svh, 28px);
  box-shadow: 0 6px 14px rgba(60, 80, 72, 0.08);
}

.back-button {
  margin-top: 4px;
  font-size: 42px;
}

.quiz-head strong {
  justify-self: end;
  color: var(--brown-soft);
  font-size: 18px;
}

.lesson-progress {
  height: 13px;
  border-radius: 999px;
  background: var(--soft-gray);
  overflow: hidden;
}

.quiz-screen .lesson-progress {
  height: clamp(6px, 1.25svh, 10px);
}

.lesson-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red-bright);
  transform-origin: left center;
  animation: progress-grow 520ms cubic-bezier(0.2, 0.75, 0.18, 1) both;
}

.question-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 5vw, 36px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  text-align: center;
  animation: card-rise 360ms cubic-bezier(0.2, 0.85, 0.28, 1.15) both;
}

.quiz-screen .question-card {
  min-height: 0;
  padding: clamp(10px, 2.1svh, 20px);
  border-radius: clamp(16px, 3.6vw, 22px);
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
}

.question-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 28%;
  width: min(380px, 82vw);
  height: min(380px, 82vw);
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center bottom, rgba(83, 186, 105, 0.2) 0 28%, transparent 30%),
    linear-gradient(75deg, transparent 35%, rgba(90, 190, 130, 0.1) 36% 58%, transparent 59%);
  opacity: 0.72;
  pointer-events: none;
  animation: soft-orbit 8s ease-in-out infinite;
}

.question-card h2 {
  position: relative;
  z-index: 1;
  margin: 0 auto 16px;
  color: var(--brown);
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.45;
}

.quiz-screen .question-card h2 {
  margin-bottom: clamp(6px, 1.2svh, 10px);
  font-size: clamp(18px, 3.25svh, 28px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hint {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 20px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--cream-card);
  color: var(--brown-soft);
  font-weight: 900;
}

.quiz-screen .hint {
  margin-bottom: clamp(7px, 1.2svh, 12px);
  padding: clamp(5px, 1svh, 8px) clamp(9px, 2.4vw, 14px);
  font-size: clamp(11px, 1.85svh, 14px);
  line-height: 1.18;
}

.choices {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.quiz-screen .choices {
  min-height: 0;
  align-content: start;
  grid-auto-rows: clamp(46px, 7.2svh, 64px);
  gap: clamp(6px, 1.15svh, 10px);
}

.choice {
  min-height: 64px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--cream-card);
  color: var(--brown);
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 950;
  cursor: pointer;
  position: relative;
  transform: translateZ(0);
  transition:
    transform 150ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.choice:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(107, 48, 44, 0.1);
}

.choice:not(:disabled):active {
  transform: scale(0.97);
}

.quiz-screen .choice {
  min-height: 0;
  height: 100%;
  border-radius: clamp(12px, 3vw, 16px);
  font-size: clamp(16px, 2.75svh, 23px);
  line-height: 1.08;
  padding: 6px 10px;
  overflow-wrap: anywhere;
}

.choice.is-selected,
.choice.is-wrong {
  border-color: var(--red-bright);
  background: rgba(255, 255, 255, 0.74);
}

.choice.is-selected {
  animation: select-bounce 240ms cubic-bezier(0.2, 0.85, 0.32, 1.25) both;
  box-shadow: 0 12px 22px rgba(200, 72, 48, 0.12);
}

.choice.is-correct {
  border-color: var(--green);
  background: #c9efd9;
  animation: correct-pop 360ms cubic-bezier(0.2, 0.85, 0.32, 1.25) both;
}

.choice.is-wrong {
  animation: wrong-shake 300ms ease both;
}

.choice span {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--green);
  color: white;
}

.answer-panel,
.stat-card,
.soft-card,
.note-card,
.unit-card {
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(60, 80, 72, 0.08);
}

.primary,
.secondary,
.store-cta {
  min-height: 62px;
  border-radius: 18px;
  padding: 15px 20px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-size: clamp(17px, 3vw, 20px);
  font-weight: 950;
  cursor: pointer;
  transform-origin: center center;
  transition:
    transform 160ms ease,
    scale 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    background-color 160ms ease;
}

.primary:not(:disabled):hover,
.secondary:not(:disabled):hover,
.store-cta:hover {
  transform: translateY(-2px);
}

.primary:not(:disabled):active,
.secondary:not(:disabled):active,
.store-cta:active {
  transform: scale(0.98);
}

.quiz-screen .primary {
  min-height: clamp(44px, 7.2svh, 58px);
  border-radius: clamp(12px, 3vw, 16px);
  padding: 8px 12px;
  font-size: clamp(15px, 2.45svh, 18px);
}

.primary {
  background: var(--red);
  color: white;
  box-shadow: 0 12px 24px rgba(200, 72, 48, 0.18);
}

.primary.green,
.store-cta {
  background: var(--app-store-blue);
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.2);
}

.primary:disabled {
  opacity: 0.45;
  cursor: default;
}

.secondary {
  background: var(--cream-card);
  color: var(--brown);
  border: 2px solid var(--line);
}

.sticky-answer,
.store-cta {
  width: 100%;
}

.report-page .store-cta {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 12;
  width: min(calc(var(--content-width) - 32px), calc(100vw - 28px));
  min-height: 66px;
  transform: translateX(-50%);
  border: 3px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 18px 34px rgba(10, 132, 255, 0.28),
    0 6px 14px rgba(24, 80, 145, 0.14);
  animation: report-cta-fade-in 240ms ease-out both 220ms;
}

.report-page .store-cta::before {
  content: "iOS";
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 28px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--app-store-blue);
  font-size: 14px;
  font-weight: 950;
}

.report-page .store-cta:hover {
  transform: translateX(-50%) translateY(-2px);
}

.report-page .store-cta:active {
  transform: translateX(-50%) scale(0.98);
}

.answer-panel {
  position: relative;
  padding: clamp(20px, 5vw, 28px);
  background: #d9e8b7;
  color: var(--brown);
  animation: feedback-rise 360ms cubic-bezier(0.2, 0.85, 0.28, 1.15) both 80ms;
}

.feedback-screen .quiz-page {
  overflow: hidden;
  grid-template-rows: auto auto minmax(80px, 0.7fr) minmax(0, 1fr) auto;
}

.feedback-screen .question-card {
  padding: clamp(8px, 1.5svh, 14px);
}

.feedback-screen .question-card h2,
.feedback-screen .hint {
  display: none;
}

.feedback-screen .answer-panel {
  min-height: 0;
  padding: clamp(10px, 2svh, 18px);
  overflow: auto;
}

.feedback-screen .answer-panel h3 {
  margin-bottom: 4px;
  font-size: clamp(18px, 2.8svh, 24px);
}

.feedback-screen .answer-panel p {
  margin-bottom: clamp(8px, 1.4svh, 12px);
  font-size: clamp(13px, 2.05svh, 16px);
  line-height: 1.35;
}

.feedback-screen .point-box {
  padding: clamp(8px, 1.5svh, 12px);
  font-size: clamp(12px, 1.9svh, 15px);
}

.feedback-screen .flag {
  right: clamp(12px, 3vw, 18px);
  top: clamp(10px, 2svh, 16px);
  width: clamp(34px, 5.6svh, 44px);
  height: clamp(34px, 5.6svh, 44px);
  font-size: clamp(18px, 3svh, 24px);
}

.answer-panel.wrong {
  background: #f2dfca;
}

.answer-panel h3 {
  margin: 0 0 8px;
  font-size: 26px;
}

.answer-panel p {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
}

.flag {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream-card);
  color: var(--red-bright);
  font-size: 26px;
  animation: flag-pop 440ms cubic-bezier(0.2, 0.85, 0.28, 1.25) both 180ms;
}

.point-box {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--brown-soft);
  animation: soft-fade-up 280ms ease-out both 180ms;
}

.point-box strong {
  color: var(--green);
}

.report-page h2 {
  margin: 0;
  font-size: clamp(34px, 7vw, 48px);
}

.stat-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
  background: var(--cream-card);
  text-align: center;
  animation: card-rise 360ms cubic-bezier(0.2, 0.85, 0.28, 1.15) both;
}

.stat-card div {
  display: grid;
  gap: 6px;
  min-width: 0;
  animation: soft-fade-up 320ms ease-out both;
}

.stat-card div:nth-child(2) {
  animation-delay: 80ms;
}

.stat-card div:nth-child(3) {
  animation-delay: 160ms;
}

.stat-card div:nth-child(4) {
  animation-delay: 240ms;
}

.stat-icon,
.mini-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(224, 185, 90, 0.22);
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
}

.stat-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(20px, 4vw, 28px);
}

.stat-card small {
  color: var(--brown-soft);
  font-size: 14px;
  font-weight: 900;
}

.soft-card,
.note-card,
.unit-card {
  padding: 22px;
  animation: soft-fade-up 340ms ease-out both;
}

.soft-card {
  background: var(--soft-panel);
  color: var(--brown-soft);
}

.note-card,
.unit-card {
  background: var(--cream-card);
}

.note-card {
  animation-delay: 80ms;
}

.unit-card {
  animation-delay: 160ms;
}

.mini-icon {
  float: left;
  margin: 0 14px 8px 0;
  border-radius: 14px;
  color: var(--red);
  background: #f2d9d2;
}

.mini-icon.green {
  color: white;
  background: var(--green);
}

.soft-card h3,
.note-card h3 {
  margin: 0 0 10px;
  color: var(--brown);
  font-size: 24px;
}

.soft-card p,
.note-card p,
.section-lead {
  margin: 0;
  color: var(--brown-soft);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
}

.section-heading {
  margin: 12px 0 0;
  font-size: 28px;
}

.unit-card {
  border: 3px solid #99dfb6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.unit-card strong {
  color: var(--brown);
  font-size: 24px;
}

.unit-card span {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-weight: 950;
}

.tab-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  width: min(var(--content-width), calc(100% - 20px));
  height: 76px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 34px rgba(42, 77, 67, 0.14);
  backdrop-filter: blur(14px);
}

.tab-item {
  height: 62px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.tab-item:active {
  transform: scale(0.94);
}

.tab-item.is-active {
  background: rgba(205, 218, 214, 0.72);
  color: var(--red);
  animation: tab-pop 220ms cubic-bezier(0.2, 0.85, 0.32, 1.25) both;
}

.tab-icon {
  position: relative;
  font-size: 24px;
  line-height: 1;
}

.tab-icon em {
  position: absolute;
  right: -14px;
  top: -12px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff3b48;
  color: white;
  font-style: normal;
  font-size: 14px;
  animation: badge-pulse 1.8s ease-in-out infinite;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes icon-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.82) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes icon-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes progress-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes soft-orbit {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg) scale(1);
  }
  50% {
    transform: translateX(-50%) rotate(4deg) scale(1.03);
  }
}

@keyframes select-bounce {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes correct-pop {
  0% {
    transform: scale(1);
  }
  48% {
    transform: scale(1.045);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  22% {
    transform: translateX(-5px);
  }
  44% {
    transform: translateX(5px);
  }
  66% {
    transform: translateX(-3px);
  }
}

@keyframes feedback-rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes flag-pop {
  from {
    opacity: 0;
    transform: scale(0.65) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes tab-pop {
  from {
    transform: scale(0.92);
  }
  to {
    transform: scale(1);
  }
}

@keyframes badge-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes cta-float-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes report-cta-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cta-scale-pulse {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.055;
  }
}

@media (max-width: 640px) {
  :root {
    --content-width: 100vw;
  }

  .app-screen {
    min-height: 100svh;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-actions,
  .stat-card {
    grid-template-columns: 1fr;
  }

  .quiz-head {
    grid-template-columns: auto 1fr;
  }

  .tab-bar {
    bottom: 12px;
    width: calc(100% - 20px);
  }

  .report-page {
    padding-bottom: 178px;
  }

  .report-page .store-cta {
    bottom: 94px;
  }
}

@media (max-width: 420px), (max-height: 760px) {
  .quiz-screen .app-content {
    padding: 7px 9px;
  }

  .quiz-head {
    gap: 6px;
  }

  .quiz-head strong {
    font-size: 14px;
  }

  .quiz-screen .question-card {
    padding: 10px;
  }

  .quiz-screen .question-card h2 {
    font-size: clamp(17px, 3.15svh, 23px);
  }

  .quiz-screen .hint {
    font-size: 11px;
  }

  .quiz-screen .choice {
    border-width: 1.5px;
  }
}

@media (max-height: 650px) {
  .home-page {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .home-copy {
    padding: 16px 18px;
  }

  .home-icon {
    width: 82px;
    height: 82px;
  }

  .eyebrow {
    margin: 10px 0 6px;
    font-size: 14px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.06;
  }

  .lead {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.45;
  }

  .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .home-actions .primary,
  .home-actions .secondary,
  .home-actions .store-cta {
    min-height: 50px;
    padding: 9px 10px;
    font-size: 15px;
  }

  .home-store-cta {
    grid-column: 1 / -1;
  }

  .quiz-screen .app-content {
    padding: 6px 8px;
  }

  .quiz-screen .quiz-page {
    gap: 6px;
  }

  .quiz-screen .round-close {
    width: 30px;
    height: 30px;
    font-size: 19px;
  }

  .quiz-screen .hint {
    display: none;
  }

  .quiz-screen .choice {
    font-size: clamp(16px, 3svh, 21px);
    padding: 6px 8px;
  }

  .quiz-screen .primary {
    min-height: 42px;
    font-size: 15px;
  }

  .feedback-screen .answer-panel p {
    font-size: 13px;
    line-height: 1.3;
  }
}

@media (max-height: 560px) {
  .quiz-screen .app-content {
    padding: 5px 7px;
  }

  .quiz-screen .quiz-page {
    gap: 5px;
  }

  .quiz-screen .lesson-progress {
    height: 5px;
  }

  .quiz-screen .question-card h2 {
    font-size: 16px;
    line-height: 1.15;
    margin-bottom: 5px;
  }

  .quiz-screen .choices {
    grid-auto-rows: clamp(42px, 7svh, 58px);
    gap: 5px;
  }

  .quiz-screen .choice {
    font-size: 15px;
    padding: 4px 8px;
  }

  .quiz-screen .primary {
    min-height: 38px;
    padding: 6px 10px;
  }
}

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