* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #f3f6f6;
  --panel: #ffffff;
  --ink: #1c3038;
  --muted: #5c6e75;
  --line: #d7e1e3;
  --accent: #176b80;
  --accent-strong: #124e60;
  --accent-soft: #eaf4f5;
  --orange: #a63b14;
  --focus: #d37a1b;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
a { color: var(--accent-strong); }
button:focus-visible, a:focus-visible, .segmented input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  z-index: 5;
  left: 16px;
  top: -100px;
  padding: 12px 18px;
  background: #fff;
  border-radius: 4px;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.brand-bar { background: var(--accent-strong); color: #fff; }
.brand-inner {
  width: min(100%, 1000px);
  min-height: 48px;
  margin: auto;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-name { font-size: 12px; font-weight: 700; letter-spacing: .035em; }
.brand-context { color: #cce3e9; font-size: 10px; letter-spacing: .2em; white-space: nowrap; }
.app-shell { width: min(100%, 1000px); margin: 0 auto; padding: 28px; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--accent-strong); font-size: 14px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.35; letter-spacing: .035em; }
.intro-copy { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.intro-copy strong { color: var(--ink); }
.demo-badge {
  flex-shrink: 0;
  min-width: 174px;
  padding: 15px 24px 13px;
  background: #fff0dd;
  border: 2px solid #e3a059;
  border-radius: 10px;
  color: var(--orange);
  text-align: center;
}
.demo-badge strong { display: block; font-size: 36px; font-weight: 800; line-height: 1.25; letter-spacing: .06em; }
.demo-badge span { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; }
.guide { margin: 23px 0 20px; }
.guide p { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.guide strong { color: var(--ink); font-weight: 600; }
.guide-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; background: #e3eeef; color: var(--accent); border-radius: 50%; font-size: 21px; font-weight: 700; }
.mobile-break { display: none; }
.topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.topics li { background: #e8eeef; color: #4e646c; border: 1px solid #dde5e7; padding: 2px 11px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 7px; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: #f1f5f6; border: 1px solid var(--line); border-radius: 6px; }
.segmented label { position: relative; min-width: 0; cursor: pointer; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented span { min-height: 42px; padding: 10px 8px; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.4; border-radius: 5px; }
.segmented input:checked + span { background: var(--accent); color: #fff; font-weight: 700; }
button.primary, button.secondary {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s ease, border-color .15s ease;
}
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-strong); }
button.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
button.secondary:hover:enabled { background: var(--accent-soft); border-color: #acc5cc; }
button:disabled { opacity: .38; cursor: not-allowed; }
button.restart-button { font-size: 12px; min-height: 44px; padding: 8px 12px; }
.restart-button span { margin-right: 3px; font-size: 19px; vertical-align: -1px; }
.practice { margin-top: 22px; scroll-margin-top: 12px; }
.practice:focus { outline: none; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 10px; font-size: 11px; color: var(--muted); }
.position { letter-spacing: .12em; color: var(--accent-strong); font-size: 10px; }
.position strong { margin-left: 8px; font-size: 16px; letter-spacing: .04em; }
.card-stage { display: grid; }
.flashcard {
  width: 100%;
  min-height: 322px;
  padding: 20px 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  border: 1px solid #c9dadf;
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(22, 65, 77, .055);
  transition: background .18s ease, border-color .18s ease;
}
.flashcard:hover { border-color: #83aab5; border-top-color: var(--accent); }
.flashcard.is-back { background: #edf7f7; border-top-color: #2a807f; }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; }
.category-label { display: inline-block; border-radius: 4px; padding: 3px 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 700; }
.is-back .category-label { background: #dceeed; }
.card-demo { flex-shrink: 0; color: #6d7e84; font-size: 10px; font-weight: 600; letter-spacing: .09em; }
.card-demo span { margin-left: 8px; color: #536c76; }
.card-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; width: 100%; padding: 4px 6px; }
.side-label { color: #52727d; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.card-text { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(23px, 3.4vw, 32px); line-height: 1.65; font-weight: 700; letter-spacing: .025em; }
.is-definition .card-text { width: min(100%, 740px); font-size: clamp(18px, 2.2vw, 22px); text-align: left; line-height: 1.9; font-weight: 600; letter-spacing: .01em; }
.flip-hint { display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 400; }
.flip-symbol { font-size: 21px; color: var(--accent); line-height: 1; }
.nav-controls { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 12px; margin-top: 12px; }
.review-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 13px; color: var(--muted); font-size: 11px; }
.progress-bar { width: 110px; height: 5px; overflow: hidden; border-radius: 10px; background: #dce7e9; }
#progress-fill { width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .18s ease; }
.keyboard-hint { margin-left: auto; color: #6b7a80; font-size: 10px; }
.completion-panel { display: flex; align-items: center; gap: 14px; margin-top: 20px; border: 1px solid #b7d4ca; background: #e9f4ee; padding: 15px 20px; border-radius: 9px; }
.completion-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #2a6d52; color: #fff; font-size: 20px; }
.completion-panel h2 { margin: 0 0 3px; color: #255c46; font-size: 15px; }
.completion-panel p { margin: 0; color: #49675a; font-size: 12px; }
.course-panel { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-top: 29px; padding: 23px 25px; border-radius: 10px; background: #e6eff1; }
.course-eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.course-panel h2 { margin: 0; font-size: 17px; color: var(--accent-strong); }
.course-panel p:not(.course-eyebrow) { margin: 5px 0 0; font-size: 11px; color: #597079; }
.course-link { display: inline-flex; justify-content: center; align-items: center; gap: 15px; flex-shrink: 0; padding: 12px 20px; border: 1px solid var(--accent-strong); border-radius: 6px; background: #fff; color: var(--accent-strong); font-size: 13px; font-weight: 700; text-decoration: none; }
.course-link:hover { background: var(--accent-strong); color: #fff; }
.footer { padding: 23px 2px 2px; color: #687b82; font-size: 10px; }
.footer p { margin: 0 0 4px; }
.footer .copyright { margin-top: 13px; color: #6d7e84; }
.noscript { padding: 20px; color: #8a3213; background: #fff0dd; }
@media (max-width: 760px) {
  .app-shell { padding: 22px 18px; }
  .brand-inner { padding: 10px 18px; }
  .brand-context { display: none; }
  .intro { gap: 16px; align-items: flex-start; }
  .eyebrow { font-size: 11px; }
  h1 { font-size: clamp(22px, 4.7vw, 30px); }
  .intro-copy { font-size: 12px; }
  .demo-badge { min-width: 125px; padding: 12px 13px; }
  .demo-badge strong { font-size: 27px; }
  .demo-badge span { font-size: 10px; }
  .guide p { font-size: 12px; align-items: flex-start; }
  .mobile-break { display: inline; }
  .controls { grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
  .restart-button { grid-column: 1 / -1; justify-self: end; }
  .card-text { font-size: 26px; }
  .is-definition .card-text { font-size: 20px; }
  .keyboard-hint { display: none; }
  .course-panel { padding: 20px; }
  .course-panel h2 { font-size: 15px; }
}
@media (max-width: 480px) {
  .app-shell { padding: 20px 14px; }
  .brand-inner { min-height: 42px; padding: 9px 14px; }
  .brand-name { font-size: 10px; }
  .intro { flex-direction: column-reverse; gap: 15px; }
  .demo-badge { width: 100%; min-width: 0; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; }
  .demo-badge strong { font-size: 30px; }
  .demo-badge span { margin: 0; font-size: 11px; }
  h1 { font-size: 29px; }
  .eyebrow { font-size: 12px; }
  .intro-copy { margin-top: 8px; font-size: 12px; }
  .guide { margin-top: 17px; margin-bottom: 17px; }
  .guide-icon { display: none; }
  .topics { gap: 5px; }
  .topics li { padding: 2px 7px; font-size: 10px; }
  .controls { grid-template-columns: 1fr; gap: 13px; }
  .segmented span { font-size: 13px; }
  .restart-button { justify-self: stretch; }
  .practice { margin-top: 18px; }
  .flashcard { min-height: 300px; padding: 16px; gap: 14px; }
  .card-content { padding: 7px 0; gap: 15px; }
  .card-text { font-size: 23px; line-height: 1.7; }
  .is-definition .card-text { font-size: 18px; }
  .card-demo { font-size: 9px; }
  .card-demo span { margin-left: 4px; }
  .category-label { font-size: 10px; padding: 3px 8px; }
  .progress-meta { font-size: 10px; }
  .nav-controls { gap: 8px; grid-template-columns: 1fr 1.15fr 1fr; }
  .nav-controls button { padding: 10px 8px; font-size: 13px; }
  .course-panel { flex-direction: column; align-items: stretch; gap: 15px; margin-top: 23px; padding: 20px; }
  .course-link { min-height: 46px; }
  .completion-panel { padding: 14px; gap: 10px; }
  .completion-panel h2 { font-size: 14px; }
  .completion-panel p { font-size: 11px; }
  .footer { font-size: 10px; line-height: 1.8; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
