:root {
  --paper: #FFFFFF;
  --surface: #F2F3F1;
  --ink: #15171C;
  --muted: #5A606B;
  --line: #D5D8DC;
  --flap: #1F2228;
  --flap-ink: #F4F1E6;
  --signal: #FFC527;
  --ok: #17784A;
  --ok-soft: #E7F4EC;
  --ng: #C0322B;
  --ng-soft: #FBEAE8;

  --font-body: "Noto Sans JP", system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Noto Sans JP", sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, monospace;

  --r-s: 8px;
  --r-m: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
button { font: inherit; color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.lucide { width: 1.1em; height: 1.1em; stroke-width: 2; flex: none; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--signal);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 48px;
  min-height: 100dvh;
}

/* ---------- labels ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 32px 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.section-label .eyebrow { font-size: 14px; }

/* ---------- split-flap ---------- */
.flap {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.flap-tile {
  position: relative;
  width: clamp(72px, 24vw, 104px);
  aspect-ratio: 3 / 4;
  background: var(--flap);
  color: var(--flap-ink);
  border-radius: var(--r-s);
  display: grid;
  place-items: center;
  font-family: var(--font-code);
  font-weight: 700;
  font-size: clamp(52px, 17vw, 76px);
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35), 0 2px 6px rgba(21, 23, 28, .18);
  perspective: 300px;
  overflow: hidden;
}
/* the hinge line that makes it read as a split-flap */
.flap-tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  margin-top: -1px;
  background: rgba(0, 0, 0, .55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.flap-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, 0));
}
.flap-char { display: block; transform-origin: 50% 50%; }
.flap-char.tick { animation: tick 70ms linear; }
@keyframes tick {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(80deg); opacity: .4; }
  100% { transform: rotateX(0); }
}
.flap-tile.is-blank { color: rgba(244, 241, 230, .28); }
.flap.sm { gap: 4px; }
.flap.sm .flap-tile {
  width: 30px;
  font-size: 24px;
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .35);
}
.flap.sm .flap-tile::after { height: 1px; margin-top: 0; }

/* ---------- home ---------- */
.home-hero { padding: 24px 0 8px; text-align: center; }
.home-hero h1 {
  font-size: 28px;
  line-height: 1.4;
  margin: 8px 0 24px;
  letter-spacing: .02em;
}
.hero-caption {
  margin: 16px 0 0;
  min-height: 1.6em;
  color: var(--muted);
  font-size: 14px;
  transition: opacity .25s var(--ease);
}
.hero-caption b { color: var(--ink); font-weight: 700; }

.choice-list { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--paper);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--signal); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice-gate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  width: 96px;
  text-align: center;
}
.choice:has(input:checked) .choice-gate { background: var(--signal); }
.choice-title { font-weight: 700; display: block; }
.choice-sub { font-size: 14px; color: var(--muted); display: block; }
.choice-check { opacity: 0; transition: opacity .15s; }
.choice:has(input:checked) .choice-check { opacity: 1; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--r-m);
  margin: 0;
  border: 0;
}
.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px;
  border-radius: var(--r-s);
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(21, 23, 28, .16);
}
.segmented label:has(input:focus-visible) { outline: 3px solid var(--ink); box-shadow: 0 0 0 6px var(--signal); }
.segmented .mono { font-family: var(--font-code); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: var(--r-m);
  border: 1px solid var(--ink);
  background: var(--paper);
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s var(--ease), background-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { border-color: transparent; background: transparent; min-height: 44px; padding: 8px 12px; }
.btn-block { width: 100%; }
.start { margin-top: 40px; }
.kbd-hint { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
kbd {
  font-family: var(--font-code);
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper);
}

/* ---------- quiz ---------- */
.quiz-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -12px;
}
.quiz-bar .btn { white-space: nowrap; }
.quiz-meta { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.quiz-count { font-family: var(--font-code); font-weight: 700; font-size: 15px; padding-right: 12px; }
.progress {
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  margin: 8px 0 32px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width .4s var(--ease);
}
.question { text-align: center; margin-bottom: 32px; }
.question-prompt { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.question-name {
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.4;
  font-weight: 700;
  margin: 8px 0 4px;
}
.question-place { color: var(--muted); margin: 0 0 20px; }

.options { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.option {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px 10px 12px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .1s var(--ease);
  animation: rise .35s var(--ease) both;
}
.options li:nth-child(2) .option { animation-delay: 40ms; }
.options li:nth-child(3) .option { animation-delay: 80ms; }
.options li:nth-child(4) .option { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.option:not(:disabled):active { transform: scale(.99); }
.option:disabled { cursor: default; }
.option-key {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 14px;
}
.option-name { display: block; font-weight: 700; line-height: 1.45; }
.option-place { display: block; font-size: 14px; color: var(--muted); }
.option-mark { width: 24px; display: grid; place-items: center; }
.option.is-dim { opacity: .45; }
.option.is-correct { border-color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); opacity: 1; }
.option.is-correct .option-key { background: var(--ok); color: #fff; }
.option.is-correct .option-mark { color: var(--ok); }
.option.is-wrong { border-color: var(--ng); background: var(--ng-soft); box-shadow: inset 0 0 0 1px var(--ng); opacity: 1; }
.option.is-wrong .option-key { background: var(--ng); color: #fff; }
.option.is-wrong .option-mark { color: var(--ng); }
.option.is-wrong { animation: shake .3s var(--ease); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.feedback {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: rise .3s var(--ease) both;
}
.feedback-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0; }
.feedback-verdict.ok { color: var(--ok); }
.feedback-verdict.ng { color: var(--ng); }
.feedback .btn { flex: none; }

/* 空港→コードの4択：答え合わせのあとに各コードの正体を添える */
.option-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.option-code {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--flap);
  color: var(--flap-ink);
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  vertical-align: 1px;
}
.option-note { font-size: 13px; line-height: 1.4; color: var(--muted); }
.option-note.is-fake { font-weight: 700; color: var(--ng); }
.option.is-dim .option-note { opacity: 1; }

/* ---------- keyboard ---------- */
.keyboard {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
}
.key-row { display: flex; justify-content: center; gap: 6px; }
.key {
  flex: 1 1 0;
  max-width: 52px;
  min-width: 0;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-s);
  background: var(--paper);
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: background-color .1s, transform .08s var(--ease);
}
.key:active:not(:disabled) { background: var(--surface); transform: translateY(1px); }
.key-wide { flex-grow: 1.6; max-width: 84px; font-family: var(--font-body); font-size: 15px; }
.key-enter { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.key-enter:active:not(:disabled) { background: #2B2F37; }
.key-enter:disabled { background: var(--surface); border-color: var(--line); color: var(--muted); cursor: default; }
@media (hover: hover) {
  .key:hover:not(:disabled) { border-color: var(--ink); }
}
.flap.is-correct .flap-tile { box-shadow: 0 0 0 3px var(--ok); }
.typed-yours {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  color: var(--muted);
}
.typed-yours s { font-family: var(--font-code); font-weight: 700; font-size: 20px; color: var(--ng); }
.typed-yours span { font-size: 14px; }
.typed-yours .is-fake { font-weight: 700; color: var(--ng); }

/* ---------- code origin ---------- */
.explain {
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--r-m);
  background: var(--surface);
  animation: rise .3s var(--ease) both;
}
.explain-head { display: flex; align-items: center; gap: 16px; }
.explain-head .flap { flex: none; }
.explain-head .eyebrow { font-size: 13px; }
.explain-spell, .review-spell {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.explain-spell b, .review-spell b {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline 3px var(--signal);
  text-underline-offset: 3px;
}
.explain-note { margin: 12px 0 0; font-size: 15px; line-height: 1.7; }
.review-spell { display: block; font-size: 15px; }

/* ---------- review / endless / ranking ---------- */
[hidden] { display: none !important; }
.srs-stat { margin: 8px 0 0; min-height: 1.6em; font-size: 13px; color: var(--muted); }
.endless-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.ranking-link { margin-top: 8px; }
.progress.is-endless { background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px); opacity: .25; }

.entry { margin-top: 32px; }
.entry-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.entry-form input {
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.entry-form input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--signal); }
.entry-msg { margin: 8px 0 0; min-height: 1.6em; font-size: 14px; color: var(--muted); }

.board { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.board li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 64px;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.board li.is-me { background: #FFF6D6; }
.board-rank { font-family: var(--font-code); font-weight: 700; color: var(--muted); text-align: right; }
.board li:nth-child(-n+3) .board-rank { color: var(--ink); }
.board-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-score { font-family: var(--font-code); font-weight: 700; font-size: 18px; }
.board-score small { font-family: var(--font-body); font-size: 12px; font-weight: 400; margin-left: 2px; }
.board-time { font-size: 13px; color: var(--muted); text-align: right; }

.ranking { max-width: 640px; margin: 0 auto; }
.ranking .quiz-bar { justify-content: flex-start; }
.ranking-title { font-size: 28px; margin: 16px 0 4px; }
#ranking-tabs { display: grid; gap: 8px; margin: 24px 0; }

/* ---------- language / study ---------- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 16px; border-radius: 999px; background: var(--surface); }
.lang-switch button {
  border: 0; background: transparent; padding: 4px 12px; min-height: 32px;
  border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(21, 23, 28, .16); }

.study { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-m); }
.study-toggle { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; cursor: pointer; }
.study-title { display: block; font-weight: 700; }
.study-sub { display: block; font-size: 13px; line-height: 1.6; color: var(--muted); }
.study-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--line); transition: background-color .15s; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); box-shadow: 0 1px 3px rgba(21, 23, 28, .3); transition: transform .15s var(--ease);
}
.study-toggle input:checked + .switch { background: var(--ink); }
.study-toggle input:checked + .switch::after { transform: translateX(20px); }
.study-toggle input:focus-visible + .switch { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--signal); }
.study-info { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.study-info .srs-stat { margin: 0; color: var(--ink); font-size: 14px; }
.study-account { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.link { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; font-size: 13px; cursor: pointer; }
.mono { font-family: var(--font-code); }

.login { max-width: 560px; margin: 0 auto; }
.login .quiz-bar { justify-content: flex-start; }
.login-card { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-m); }
.login-card h2 { margin: 0; font-size: 16px; }
.login-card p { margin: 4px 0 12px; font-size: 14px; color: var(--muted); }
.login-card input { text-transform: uppercase; letter-spacing: .05em; }
.issued-id {
  margin: 24px 0 8px; padding: 20px 12px; border-radius: var(--r-m);
  background: var(--flap); color: var(--flap-ink); text-align: center;
  font-size: clamp(20px, 6.4vw, 30px); font-weight: 700; letter-spacing: .06em; user-select: all;
}

/* ---------- result ---------- */
.result-head { text-align: center; padding: 24px 0 8px; }
.result-head h1 { font-size: 22px; margin: 16px 0 4px; }
.result-sub { color: var(--muted); margin: 0; }
.result { display: flex; flex-direction: column; }
/* スマホでは見直しリストの後にボタンを置く（PCでは左カラムに固定） */
.result-main { display: contents; }
.result-actions { order: 1; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 32px; }

.review { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.review li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.review-name { font-weight: 700; display: block; line-height: 1.45; }
.review-name .option-place { font-weight: 400; }
.review-yours { font-size: 14px; color: var(--muted); display: block; }
.review-yours s { color: var(--ng); text-decoration-thickness: 1px; }
.perfect { text-align: center; color: var(--muted); padding: 24px 0; margin: 0; border-top: 1px solid var(--line); }

/* ---------- skeleton ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: #E8EAED;
  border-radius: var(--r-s);
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-flap .flap-tile { background: #E8EAED; box-shadow: none; }
.skel-flap .flap-tile::after { background: rgba(21, 23, 28, .06); }
.skel-line { height: 14px; margin: 16px auto 0; width: 40%; }
.skel-option {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}
.skel-option .skel:first-child { width: 28px; height: 28px; border-radius: 6px; }
.skel-option .skel-text { display: grid; gap: 8px; }
.skel-option .skel-text .skel { height: 12px; }

.screen-enter { animation: fade .25s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }

/* ---------- hover は本物のポインタがある端末だけ（タッチで色が残らないように） ---------- */
@media (hover: hover) {
  .choice:hover { border-color: var(--ink); }
  .btn-primary:hover { background: #2B2F37; }
  .btn-ghost:hover { background: var(--surface); }
  .option:not(:disabled):hover { border-color: var(--ink); }
}
/* キーボード操作の案内はタッチ端末では出さない */
.quiz-hint { display: none; }
@media (hover: none), (pointer: coarse) {
  .kbd-hint { display: none; }
}

/* ---------- スマホ ---------- */
@media (max-width: 719px) {
  /* 開始ボタンは画面下に貼りつけ、設定をスクロールしても親指で届く */
  .start {
    position: sticky;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 5;
    box-shadow: 0 0 0 12px var(--paper);
  }
  /* 回答後の「次の問題」は画面下の固定バーに出す */
  .quiz { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .feedback {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 10;
    margin: 0;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .feedback .btn { flex: 1; max-width: 240px; }
  /* スマホの文字キーは端末のキーボードと同じくらいの間隔に */
  .key-row { gap: 4px; }
  .keyboard { gap: 6px; }
  .key { font-size: 17px; }
}
/* 背の低いスマホ（iPhone SE など）でも出題と4択がひと画面に収まるように詰める */
@media (max-width: 719px) and (max-height: 740px) {
  .app { padding-bottom: 32px; }
  .home-hero { padding-top: 8px; }
  .home-hero h1 { font-size: 24px; margin-bottom: 16px; }
  .section-label { margin-top: 24px; }
  .progress { margin-bottom: 20px; }
  .question { margin-bottom: 20px; }
  .question .flap-tile { width: clamp(60px, 19vw, 80px); font-size: clamp(42px, 13vw, 58px); }
  .question-prompt { margin-top: 10px; }
  .question-name { font-size: 22px; margin-top: 4px; }
  .question-place { margin-bottom: 12px; }
  .option { min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
  .skel-option { min-height: 56px; }
  .key { height: 46px; }
}

/* ---------- タブレット以上：4択を2列に ---------- */
@media (min-width: 720px) {
  .app { max-width: 720px; padding-top: 32px; }
  .options { grid-template-columns: 1fr 1fr; gap: 12px; }
  .option, .skel-option { min-height: 76px; }
  .feedback { min-height: 52px; }
}
@media (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .quiz-hint { display: block; margin-top: 32px; }
}

/* ---------- PC：設定と結果は2カラム ---------- */
@media (min-width: 1024px) {
  .app { max-width: 1080px; padding: 56px 40px 64px; }

  .home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 80px;
    align-items: start;
  }
  .home-hero { position: sticky; top: 56px; padding: 40px 0 0; text-align: left; }
  .home-hero h1 { font-size: 44px; margin: 12px 0 40px; }
  .home-hero .flap { justify-content: flex-start; gap: 10px; }
  .home-hero .flap-tile { width: 132px; font-size: 96px; border-radius: 10px; }
  .hero-caption { font-size: 16px; margin-top: 20px; }
  #setup > .section-label:first-child { margin-top: 0; }

  .quiz { max-width: 880px; margin: 0 auto; }
  .question .flap-tile { width: 112px; font-size: 82px; }

  .result {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    column-gap: 80px;
    align-items: start;
  }
  .result-main { display: block; position: sticky; top: 56px; }
  .result-head { text-align: left; padding-top: 0; }
  .result-head .flap { justify-content: flex-start; }
  .result-head h1 { font-size: 28px; }
  .result-review .section-label { margin-top: 0; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

.period-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.level-badge { display: flex; align-items: center; justify-content: center; gap: 3px; margin: 0 0 12px; font-family: var(--font-code); font-size: 12px; color: var(--muted); }
.level-badge span { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.level-badge span.is-on { background: var(--ink); }
.level-badge b { margin-left: 6px; font-weight: 700; color: var(--ink); }
