:root {
  --blue: #4a90d9;
  --blue-dark: #1e3a8a;
  --blue-soft: #eef5fb;
  --ink: #222;
  --muted: #6f7f8f;
  --line: #dbe6ef;
  --red: #d84f4f;
  --green: #2f9d5c;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px 14px 38px;
  background: #fff;
  color: var(--ink);
  font-family: 'Segoe UI', Arial, sans-serif;
}

button { font: inherit; }

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.page-header {
  margin: 4px 46px 22px;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.level-section { margin: 26px 0; }

.level-title {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.strategy-list {
  display: grid;
  gap: 10px;
}

.strategy-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.strategy-card:hover,
.strategy-card:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 6px 18px rgba(74, 144, 217, .16);
  outline: none;
  transform: translateY(-1px);
}

.strategy-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: #315f8d;
  font-weight: 800;
}

.strategy-copy strong { display: block; font-size: 1rem; }
.strategy-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.strategy-count { color: #8a99a7; font-size: .75rem; white-space: nowrap; }

.training {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.training-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 42px 8px;
}

.badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #315f8d;
  font-size: .75rem;
  font-weight: 800;
}

.training h1 {
  margin: 0 36px 5px;
  color: var(--blue-dark);
  font-size: 1.35rem;
}

.strategy-summary {
  min-height: 42px;
  margin: 0 auto 13px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 500px;
  margin: 0 auto 24px;
}

.progress-dot {
  width: 18px;
  height: 7px;
  border-radius: 5px;
  background: #e6ebef;
}

.progress-dot.correct { background: var(--blue); }
.progress-dot.wrong { background: var(--red); }

.question-label {
  color: #8b98a5;
  font-size: .8rem;
}

.question {
  margin: 8px 0 20px;
  color: #152f6a;
  font-size: clamp(2.35rem, 10vw, 4rem);
  font-weight: 800;
  letter-spacing: .02em;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.number-key {
  min-height: 48px;
  border: 2px solid #e7edf2;
  border-radius: 12px;
  background: #fafcfd;
  color: #23313e;
  cursor: pointer;
  font-size: 1.16rem;
  font-weight: 750;
  user-select: none;
}

.number-key:hover,
.number-key:focus-visible { border-color: var(--blue); outline: none; }
.number-key:active { transform: scale(.96); background: var(--blue-soft); }
.number-key:disabled { cursor: default; opacity: .5; }
.number-key[data-value="0"] { grid-column: 5; }

.feedback {
  min-height: 128px;
  margin: 20px auto 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  text-align: left;
}

.feedback.hidden { visibility: hidden; }
.feedback-title { margin: 0 0 8px; color: var(--green); font-weight: 800; }
.feedback.wrong .feedback-title { color: var(--red); }
.feedback-detail { margin: 0; font-size: 1.03rem; font-weight: 700; line-height: 1.55; }

.next-button,
.primary-link {
  display: block;
  width: 100%;
  max-width: 330px;
  margin: 14px auto 0;
  padding: 13px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.voice-button {
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #52677b;
  cursor: pointer;
  font-size: .8rem;
}

.end-panel {
  margin-top: 70px;
  text-align: center;
}

.end-panel h1 { color: var(--blue-dark); }
.end-panel p { color: var(--muted); line-height: 1.5; }
.end-actions { display: grid; gap: 10px; max-width: 330px; margin: 24px auto 0; }
.end-actions .primary-link { margin: 0; }
.end-actions .secondary { background: var(--blue-soft); color: #48647d; }

.hidden-screen { display: none !important; }

@media (max-width: 440px) {
  body { padding-left: 9px; padding-right: 9px; }
  .strategy-card { grid-template-columns: 40px minmax(0, 1fr); }
  .strategy-count { grid-column: 2; }
  .number-pad { gap: 5px; }
  .number-key { min-height: 45px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
