:root {
  color-scheme: light;
  --page: #f8f7f3; --ink: #3f443e; --muted: #7e827a;
  --green: #447761; --green-dark: #34604d; --line: #e7e9e2;
  --tile: #fffdfa; --cream: #fdf8e9; --soft: #eff4ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { background: var(--page); color: var(--ink); margin: 0; min-height:100vh; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { text-decoration: none; }
.site { width: min(100% - 24px, 590px); margin: 0 auto; padding: 23px 0 44px; }
.tabs { display:flex; gap:9px; justify-content: center; flex-wrap:wrap; margin: 0 0 22px; }
.tab { color:#63756a; background:#fff; border:1px solid #dce7de; font-size:14px; font-weight:700; padding:11px 21px; border-radius:12px; box-shadow:0 1px 2px rgba(31,66,50,.03); }
.tab[aria-current="page"] { color:#fff; border-color:var(--green); background:var(--green); }
.tab:hover:not([aria-current="page"]) { border-color:var(--green); }
.langbar { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0 auto 19px; }
.lang-select { display:flex; align-items:center; justify-content:center; gap:5px; padding:11px 5px; color:#48514b; background:white; border:1px solid #dde5df; border-radius:12px; font-size:12px; font-weight:700; min-height:49px; }
.lang-select .flag { width:23px; height:21px; font-size:21px; line-height:21px; }
.lang-select[aria-pressed="true"] { background:#edf5ef; border-color:#80ad91; box-shadow:inset 0 0 0 1px #80ad91; }
.lang-select[aria-pressed="false"] { opacity:.58; }
.lang-select:focus-visible, .tab:focus-visible, .action:focus-visible { outline:3px solid #e5ac62; outline-offset:2px; }
.flashcard { border:1px solid #eae9e2; background:#fff; border-radius:23px; box-shadow:0 8px 28px rgba(61,64,51,.055); overflow:hidden; }
.progress-head { display:flex; justify-content:space-between; align-items:center; color:#8a8e85; font-size:12px; letter-spacing:.04em; font-weight:650; padding:20px 24px 12px; }
.progress { background:#edf0eb; height:4px; margin:0 24px 16px; border-radius:5px; overflow:hidden; }
.progress > span { display:block; width:0; height:100%; background:#78a588; border-radius:inherit; transition:width .24s ease; }
.picture { display:flex; justify-content:center; align-items:center; padding:0 26px; }
.picture img { display:block; width: min(100%, 365px); max-height:380px; aspect-ratio:1/1; object-fit:contain; border-radius:8px; background:var(--cream); }
.prompt { text-align:center; padding:13px 19px 22px; }
.japanese { font-size: clamp(23px, 5vw, 29px); margin:0 0 10px; font-weight:700; line-height:1.5; color:#3c493f; overflow-wrap:anywhere; }
.hint { font-size:14px; line-height:1.6; color:#a0a49c; margin:0; }
.answers { border-top:1px solid #eff0eb; margin:0 24px 22px; padding:18px 0 0; }
.answers[hidden], .hint[hidden] { display:none !important; }
.answer-row { display:grid; grid-template-columns: minmax(120px,152px) minmax(0,1fr); align-items:start; gap:11px; padding:11px 0; border-bottom:1px solid #f0f1ec; }
.answer-row:last-child {border-bottom:none;}
.answer-language { display:flex; align-items:center; gap:7px; color:#587b65; font-size:12px; line-height:1.5; font-weight:750; padding-top:1px; }
.answer-language .flag { font-size:19px; line-height:1.1; }
.answer-word { font-size:15px; line-height:1.75; overflow-wrap:anywhere; word-break:normal; color:#3c453b; }
.answer-word .reading { color:#80857b; font-size:13px; }
.note { margin-top:12px; font-size:12px; line-height:1.7; color:#8c8e86; }
.controls { display:flex; gap:12px; margin:16px 0 0; }
.action { min-height:54px; border-radius:12px; font-weight:700; font-size:15px; padding:13px 13px; }
.restart { width:40%; border:1px solid #d6ded7; background:#fff; color:#5f796a; }
.advance { width:60%; border:1px solid var(--green); background:var(--green); color:#fff; }
.advance:hover { background:var(--green-dark); }
.restart:hover { background:var(--soft); }
.foot { text-align:center; font-size:12px; color:#9b9f98; margin-top:17px; }
@media(max-width:480px) {
 .site { width: min(100% - 20px, 450px); padding-top:14px; }
 .tabs { gap:6px; margin-bottom:14px; }
 .tab { font-size:13px; padding:10px 14px; }
 .langbar { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-bottom:13px; }
 .lang-select { font-size:13px; min-height:42px; padding:7px 6px; }
 .flashcard { border-radius:18px; }
 .progress-head { padding:13px 16px 8px; }
 .progress { margin:0 16px 12px; }
 .picture { padding:0 18px; }
 .picture img { width:min(100%,280px); max-height:36vh; }
 .prompt { padding:8px 12px 17px; }
 .japanese { margin-bottom:6px; }
 .answers { margin:0 15px 18px; padding-top:9px; }
 .answer-row { grid-template-columns:1fr; gap:3px; padding:8px 0; }
 .answer-language { font-size:11px; }
 .answer-word { font-size:14px; }
 .controls { gap:8px; margin-top:11px; }
 .action { font-size:14px; min-height:51px; padding:10px 9px; }
}
@media(prefers-reduced-motion:reduce) {*, *::before, *::after { transition:none!important; }}
