/* NDED Spot the Mistake: Multi-Digit Multiplication — practice page.
   Loaded after css/word-problems.css, which provides the hero, stage, buttons and content cards. */

.sm-topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .5rem 1rem; margin: 0 0 1rem; color: #4e5d70; font-size: .9rem;
}
.sm-topbar .label { font-weight: 800; color: #3b4f69; }
.sm-levels { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.sm-level {
  min-height: 38px; padding: 0 .85rem; border: 1px solid #b7c9e2; border-radius: 999px;
  background: #fff; color: #3d638f; font: inherit; font-weight: 800; cursor: pointer;
}
.sm-level small { font-weight: 700; opacity: .8; margin-left: .25rem; }
.sm-level[aria-pressed="true"] { background: #3f73c9; border-color: #3f73c9; color: #fff; }
.sm-streak { padding: .35rem .8rem; border-radius: 999px; background: #fff7e9; border: 1px solid #efd8ad; color: #7a4f00; font-weight: 800; }
.sm-big-btn { min-height: 38px; padding: 0 .85rem; border: 1px solid #b7c9e2; border-radius: 10px; background: #fff; color: #46617f; font: inherit; font-weight: 800; cursor: pointer; }
.sm-big-btn:hover { background: #f7faff; }

.sm-problem { margin: 0 0 4px; text-align: center; color: #22324a; font-size: 1.9rem; font-weight: 900; letter-spacing: .01em; }
.sm-case { display: block; color: #6d86ad; font-size: .72rem; font-weight: 900; letter-spacing: .11em; }

.sm-steps { display: flex; justify-content: center; gap: 6px; margin: 8px 0 6px; padding: 0; list-style: none; }
.sm-steps li { padding: 4px 10px; border-radius: 999px; background: #eef3fa; color: #7a8ca5; font-size: .74rem; font-weight: 900; letter-spacing: .04em; }
.sm-steps li.current { background: #3f73c9; color: #fff; }
.sm-steps li.done { background: #eef9f3; color: #3d7b5d; }

.sm-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sm-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  padding: 34px 12px 12px; border: 2px solid #dbe4f0; border-radius: 16px; background: #fff;
  font: inherit; color: #22324a; text-align: right; transition: border-color .15s, transform .15s, background .15s, box-shadow .15s;
}
button.sm-card { cursor: pointer; }
button.sm-card:hover { border-color: #8fb0e0; transform: translateY(-1px); }
.sm-card .letter {
  position: absolute; top: 9px; left: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: #eef3fa; color: #46617f; font-size: .86rem; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.sm-card .badge {
  position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 999px;
  font-size: .68rem; font-weight: 900; letter-spacing: .04em; text-align: center;
}
.sm-card.is-correct { border-color: #7cc29f; background: #eef9f3; box-shadow: 0 0 0 3px rgba(124, 194, 159, .25); }
.sm-card.is-correct .badge { background: #3d7b5d; color: #fff; }
.sm-card.has-mistake .badge { background: #fff1e6; color: #b45309; }
.sm-card.tried { opacity: .55; }
.sm-card.target { border-color: #f2b544; box-shadow: 0 0 0 3px rgba(242, 181, 68, .25); }

.sm-work { display: grid; justify-items: end; font-variant-numeric: tabular-nums; font-size: 1.45rem; font-weight: 800; line-height: 1.25; margin: 0 auto; }
.sm-work .row { display: flex; justify-content: flex-end; align-items: baseline; gap: .3em; min-width: 6.2em; padding: 1px 6px; border-radius: 8px; border: 2px solid transparent; }
.sm-work .op { color: #6b7c93; font-weight: 800; }
.sm-work .rule { width: 100%; height: 0; border-top: 2.5px solid #22324a; margin: 2px 0; }
.sm-work button.row { font: inherit; color: inherit; background: #f7faff; border-color: #dbe6f4; cursor: pointer; margin: 2px 0; }
.sm-work button.row:hover { border-color: #8fb0e0; background: #edf5ff; }
.sm-work .row.found { border-color: #f59e0b; background: #fff4df; color: #9a3412; }
.sm-work .row.checked { color: #7a8ca5; }
.sm-work .row.hint { border-color: #f2b544; border-style: dashed; }
.sm-note { margin: 8px 0 0; color: #9a3412; font-size: .78rem; font-weight: 800; line-height: 1.35; text-align: left; }
.sm-card.is-correct .sm-note { color: #3d7b5d; }

.sm-explain { display: grid; gap: 8px; margin-top: 14px; }
.sm-tool .sm-problem, .sm-tool .wp-question { max-width: none; margin-left: auto; margin-right: auto; }
.sm-steps .short { display: none; }
.sm-explain { text-align: left; }
.sm-explain-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: #fff8ef; border: 1px solid #f3dcc0; color: #4e3b25; font-size: .95rem; font-weight: 650; line-height: 1.5; }
.sm-explain-item.ok { background: #eef9f3; border-color: #bfe3cf; color: #2f5d47; }
.sm-explain-item .letter { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #46617f; }
.sm-explain-item b { color: inherit; }

.sm-tool .wp-solved .praise { margin-bottom: .2rem; }

/* Big screen for whole-class warm-ups */
.sm-tool:fullscreen, .sm-tool.sm-big { max-width: none; overflow: auto; padding: 2vh 3vw; background: #f4f7fb; }
.sm-tool.sm-big:not(:fullscreen) { position: fixed; inset: 0; z-index: 1000; }
.sm-tool:fullscreen .wp-stage, .sm-tool.sm-big .wp-stage { max-width: 1500px; margin: 0 auto; }
.sm-tool:fullscreen .sm-problem, .sm-tool.sm-big .sm-problem { font-size: 3rem; }
.sm-tool:fullscreen .sm-work, .sm-tool.sm-big .sm-work { font-size: 2.3rem; }
.sm-tool:fullscreen .wp-question, .sm-tool.sm-big .wp-question { font-size: 1.5rem; }
.sm-tool:fullscreen .sm-explain-item, .sm-tool.sm-big .sm-explain-item { font-size: 1.2rem; }

.sm-example { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0; }
.sm-example .sm-card { min-width: 150px; }

@media (max-width: 860px) {
  .sm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .sm-problem { font-size: 1.5rem; }
  .sm-work { font-size: 1.2rem; }
  .sm-work .row { min-width: 5.6em; padding: 1px 4px; }
  .sm-card { padding: 32px 8px 10px; }
  .sm-cards { gap: 8px; }
  .sm-steps .long { display: none; }
  .sm-steps .short { display: inline; }
  .sm-steps li { white-space: nowrap; }
}
