/* Math Practice — clean, high-contrast, large-print, mobile-first. No frameworks. */
:root {
  --bg: #f3f6fa; --panel: #fffdf7; --ink: #18345c; --line: #2b2f3a;
  --thin: #b9c0cc; --accent: #2563eb; --ok: #15803d; --bad: #dc2626; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.4; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 40px; }

header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
header h1 { font-size: 1.5rem; margin: 0; letter-spacing: .5px; }
header .sub { flex: 1 1 100%; color: #6b7280; font-size: .92rem; margin: 2px 0 8px; }
.spacer { flex: 1; }
.iconbtn { border: 1px solid var(--thin); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: .95rem; cursor: pointer; min-height: 40px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; flex-wrap: wrap; }
.toolbar select { min-height: 44px; border-radius: 10px; border: 1px solid var(--thin);
  background: var(--panel); color: var(--ink); font-size: 1rem; padding: 0 14px; cursor: pointer; }
.meta { margin-left: auto; display: flex; gap: 16px; font-variant-numeric: tabular-nums; }
.meta b { font-weight: 700; }
.hintbar { color: #6b7280; font-size: .88rem; margin: 0 0 10px; text-align: center; }

.card { background: var(--panel); border: 2px solid var(--thin); border-radius: var(--radius);
  padding: 36px 20px; margin: 8px 0; text-align: center; }
.problem { font: 700 3rem/1.1 "Consolas", "Segoe UI", monospace; color: var(--ink); margin-bottom: 18px; }
.answer { width: 200px; max-width: 80%; height: 64px; font: 700 2.2rem/1 "Consolas", monospace;
  text-align: center; border: none; border-bottom: 3px solid var(--accent); background: transparent;
  color: var(--accent); }
.answer:focus { outline: none; }
.status { min-height: 30px; margin-top: 14px; font-weight: 700; font-size: 1.2rem; }
.status.ok { color: var(--ok); } .status.bad { color: var(--bad); }

body.large .problem { font-size: 4rem; } body.large .answer { font-size: 3rem; height: 80px; }
body.large .wrap { max-width: 1000px; }

.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.actions button { min-height: 48px; border-radius: 10px; border: 1px solid var(--thin);
  background: var(--panel); color: var(--ink); font-size: 1rem; cursor: pointer; padding: 0 20px; }
#checkBtn { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.book { background: var(--panel); border: 1px solid var(--thin); border-radius: var(--radius);
  padding: 16px; margin: 22px 0 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.book h3 { margin: 0 0 4px; font-size: 1.05rem; } .book p { margin: 0; color: #555; font-size: .92rem; }
.book .math-ico { width: 54px; height: 54px; flex: none; border: 2px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font: 700 1.2rem Arial; color: var(--accent); letter-spacing: 1px; }

.crosslinks { text-align: center; margin: 8px 0 0; font-size: .9rem; }
.crosslinks a { color: #6b7280; text-decoration: none; margin: 0 4px; }
.crosslinks a:hover { text-decoration: underline; }
footer { text-align: center; color: #8a8f9a; font-size: .82rem; margin-top: 16px; }
footer .links a { color: #6b7280; text-decoration: none; margin: 0 6px; }
.privacy { margin-top: 6px; }

@media print {
  body { background: #fff; }
  .toolbar, .actions, .book, .crosslinks, footer, header .sub, .hintbar, #langBtn, #largeBtn, .meta { display: none !important; }
}
@media (max-width: 420px) { header h1 { font-size: 1.3rem; } .problem { font-size: 2.4rem; } }
