:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --surface: rgba(255, 255, 255, .78);
  --ink: #21362d;
  --muted: #6c776f;
  --accent: #ed6848;
  --accent-dark: #c84e32;
  --green: #39775e;
  --line: #dcd8ce;
  --shadow: 0 24px 60px rgba(40, 54, 46, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(237, 104, 72, .16), transparent 30%),
    radial-gradient(circle at 88% 78%, rgba(57, 119, 94, .18), transparent 28%),
    var(--bg);
  transition: color .25s, background .25s;
}

body.dark {
  color-scheme: dark;
  --bg: #14241e;
  --surface: rgba(28, 49, 41, .82);
  --ink: #f7f2e8;
  --muted: #aebdb4;
  --line: #40564c;
  --shadow: 0 24px 60px rgba(0, 0, 0, .24);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(2.6rem, 7vw, 4.7rem); line-height: .95; letter-spacing: -.06em; }
h1 span { color: var(--green); font-style: italic; }
.lead { margin: 18px 0 0; color: var(--muted); }
.icon-button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stats article { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); backdrop-filter: blur(12px); }
.stats span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .78rem; }
.stats strong { font-family: Georgia, serif; font-size: 2rem; }
.stats small { margin-left: 4px; color: var(--muted); font-size: .7rem; }

.practice-card, .result { border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.practice-card { padding: clamp(24px, 5vw, 46px); }
.card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .84rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(57, 119, 94, .12); }
select { margin-left: 8px; padding: 8px 30px 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
.prompt { min-height: 96px; margin: 42px 0 28px; font-family: "Yu Mincho", serif; font-size: clamp(1.35rem, 4vw, 2rem); line-height: 1.75; letter-spacing: .04em; }
.prompt .done { color: var(--green); }
.prompt .current { border-bottom: 3px solid var(--accent); }
.prompt .wrong { color: #d84444; background: rgba(216, 68, 68, .1); }
input { width: 100%; padding: 17px 18px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: transparent; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(237, 104, 72, .12); }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.primary, .secondary { padding: 13px 20px; border-radius: 13px; font-weight: 700; }
.primary { border: 0; color: white; background: var(--accent); box-shadow: 0 8px 20px rgba(237, 104, 72, .25); }
.primary:hover { background: var(--accent-dark); }
.secondary { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.hint { margin: 20px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); }
.result { margin-top: 16px; padding: 36px; text-align: center; }
.result p, .result span { display: block; color: var(--muted); }
.result strong { display: block; margin: 8px 0; font-family: Georgia, serif; font-size: 3rem; }
.result button { margin-top: 22px; }

@media (max-width: 650px) {
  .app-shell { padding-top: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card-top { align-items: flex-start; gap: 18px; flex-direction: column; }
  .actions { flex-direction: column; }
  .actions button { width: 100%; }
}
