.math-html5-game {
  max-width: 760px;
  margin: 10px auto 18px;
  font-family: Arial, Helvetica, sans-serif;
  color: #24313d;
}

.math-html5-game * {
  box-sizing: border-box;
}

.math-game-shell {
  border: 1px solid #98c45c;
  background: #f7ffe9;
  box-shadow: 0 2px 8px rgba(52, 86, 28, .16);
}

.math-game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: linear-gradient(#d9f789, #bde95a);
  border-bottom: 1px solid #95bf47;
}

.math-game-title {
  font-size: 19px;
  font-weight: bold;
  color: #244406;
  white-space: nowrap;
}

.math-game-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.math-game-stat {
  min-width: 74px;
  padding: 4px 8px;
  border: 1px solid #9fc65b;
  background: #ffffff;
  color: #31520c;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
}

.math-game-stat strong {
  display: block;
  font-size: 17px;
  line-height: 20px;
  color: #0b6a9a;
}

.math-game-board {
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.72), rgba(255,255,255,.38)),
    repeating-linear-gradient(0deg, transparent 0, transparent 28px, rgba(116, 162, 61, .08) 29px);
}

.addition-match-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #3d4d24;
  font-size: 13px;
  line-height: 18px;
}

.addition-match-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.addition-match-column {
  border: 1px solid #bdd57e;
  background: rgba(255, 255, 255, .72);
  padding: 10px;
  min-height: 270px;
}

.addition-match-heading {
  margin: 0 0 9px;
  font-size: 15px;
  line-height: 18px;
  color: #31520c;
  font-weight: bold;
  text-align: center;
}

.addition-match-card {
  width: 100%;
  min-height: 42px;
  margin: 7px 0;
  padding: 8px 10px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  font-size: 21px;
  font-weight: bold;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.addition-match-card:hover,
.addition-match-card:focus {
  border-color: #0b79bd;
  box-shadow: 0 1px 5px rgba(11, 121, 189, .25);
  outline: none;
}

.addition-match-card.is-selected {
  border-color: #e78900;
  background: #fff3d4;
  color: #6b4100;
  transform: translateY(-1px);
}

.addition-match-card.is-correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
  cursor: default;
}

.addition-match-card.is-wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.addition-match-card[disabled] {
  opacity: .72;
}

.math-game-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid #bdd57e;
  background: #ffffff;
}

.math-game-message {
  min-height: 20px;
  color: #35550e;
  font-size: 14px;
  font-weight: bold;
}

.math-game-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.math-game-button {
  min-width: 96px;
  padding: 7px 11px;
  border: 1px solid #0a6fa8;
  background: #0783c7;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.math-game-button:hover,
.math-game-button:focus {
  background: #006ca8;
  outline: none;
}

.math-game-button.secondary {
  border-color: #82955f;
  background: #eef6d6;
  color: #31520c;
}

.math-game-button.secondary:hover,
.math-game-button.secondary:focus {
  background: #dceebb;
}

.exponent-game-panel {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.exponent-game-rule {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid #bdd57e;
  background: rgba(255, 255, 255, .82);
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
}

.exponent-game-expression {
  margin: 4px auto 14px;
  padding: 18px 16px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  font-size: 46px;
  font-weight: bold;
  line-height: 54px;
}

.exponent-game-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
}

.exponent-game-option {
  min-height: 56px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 25px;
  font-weight: bold;
}

.exponent-game-option:hover,
.exponent-game-option:focus {
  border-color: #0b79bd;
  box-shadow: 0 1px 5px rgba(11, 121, 189, .25);
  outline: none;
}

.exponent-game-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.exponent-game-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.exponent-game-option[disabled] {
  cursor: default;
}

.exponent-game-work {
  min-height: 44px;
  margin-top: 13px;
  color: #31460d;
  font-size: 14px;
  font-weight: bold;
  line-height: 20px;
}

.angle-game-panel {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.angle-game-stage {
  border: 2px solid #72a4c7;
  background: #ffffff;
}

.angle-game-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.angle-game-prompt {
  margin: 12px 0 10px;
  color: #31520c;
  font-size: 16px;
  font-weight: bold;
}

.angle-game-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 8px;
}

.angle-game-options.four {
  grid-template-columns: repeat(4, minmax(92px, 1fr));
}

.angle-game-option {
  min-height: 42px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.angle-game-option:hover,
.angle-game-option:focus {
  border-color: #0b79bd;
  box-shadow: 0 1px 5px rgba(11, 121, 189, .25);
  outline: none;
}

.angle-game-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.angle-game-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.angle-game-option[disabled] {
  cursor: default;
}

.angle-game-rule {
  min-height: 38px;
  margin-top: 12px;
  color: #31460d;
  font-size: 14px;
  font-weight: bold;
  line-height: 19px;
}

.complement-game-equation {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 22px;
  font-weight: bold;
  line-height: 28px;
}

.protractor-game-readout {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 18px;
  font-weight: bold;
  line-height: 24px;
}

.triangle-angle-equation {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 22px;
  font-weight: bold;
  line-height: 28px;
}

.ellipse-area-panel {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.ellipse-area-stage {
  border: 2px solid #72a4c7;
  background: #ffffff;
}

.ellipse-area-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.ellipse-area-problem {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 20px;
  font-weight: bold;
  line-height: 27px;
}

.ellipse-area-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  gap: 8px;
}

.ellipse-area-option {
  min-height: 46px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

.ellipse-area-option:hover,
.ellipse-area-option:focus {
  border-color: #0b79bd;
  box-shadow: 0 1px 5px rgba(11, 121, 189, .25);
  outline: none;
}

.ellipse-area-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.ellipse-area-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.ellipse-area-option[disabled] {
  cursor: default;
}

.ellipse-area-rule {
  min-height: 38px;
  margin-top: 12px;
  color: #31460d;
  font-size: 14px;
  font-weight: bold;
  line-height: 19px;
}

.ellipse-area-custom {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #bdd57e;
}

.ellipse-area-custom label {
  color: #31520c;
  font-size: 13px;
  font-weight: bold;
  text-align: left;
}

.ellipse-area-custom input {
  width: 100%;
  margin-top: 4px;
  padding: 7px;
  border: 1px solid #9fc0d2;
  color: #173b55;
  font-size: 15px;
}

.ellipse-area-result {
  align-self: end;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid #bdd57e;
  background: #ffffff;
  color: #0b6a9a;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.prism-area-custom {
  grid-template-columns: repeat(4, minmax(78px, 1fr));
}

.quadrant-game-panel {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.quadrant-game-stage {
  border: 2px solid #72a4c7;
  background: #ffffff;
}

.quadrant-game-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.quadrant-game-point {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 34px;
  font-weight: bold;
  line-height: 40px;
}

.quadrant-game-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px;
}

.quadrant-game-option {
  min-height: 44px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.quadrant-game-option:hover,
.quadrant-game-option:focus {
  border-color: #0b79bd;
  box-shadow: 0 1px 5px rgba(11, 121, 189, .25);
  outline: none;
}

.quadrant-game-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.quadrant-game-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.quadrant-game-option[disabled] {
  cursor: default;
}

.quadrant-game-rule {
  min-height: 38px;
  margin-top: 12px;
  color: #31460d;
  font-size: 14px;
  font-weight: bold;
  line-height: 19px;
}

.segment-game-equation {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 24px;
  font-weight: bold;
  line-height: 30px;
}

.polygon-game-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 8px;
  margin: 12px 0 10px;
}

.polygon-game-fact {
  border: 1px solid #bdd57e;
  background: #ffffff;
  color: #31520c;
  font-size: 13px;
  font-weight: bold;
  padding: 7px 8px;
}

.polygon-game-fact strong {
  display: block;
  color: #0b6a9a;
  font-size: 18px;
  line-height: 22px;
}

.area-shape-prompt {
  margin: 12px 0 10px;
  color: #173b55;
  font-size: 22px;
  font-weight: bold;
  line-height: 28px;
}

.symmetry-tool-panel {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.symmetry-stage {
  border: 2px solid #72a4c7;
  background: #ffffff;
  touch-action: none;
}

.symmetry-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.symmetry-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.symmetry-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.symmetry-color {
  width: 32px;
  height: 32px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #8aa9bb;
  cursor: pointer;
}

.symmetry-color.active {
  box-shadow: 0 0 0 3px #0b79bd;
}

.symmetry-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #31520c;
  font-size: 13px;
  font-weight: bold;
}

.symmetry-note {
  min-height: 36px;
  margin-top: 10px;
  color: #31460d;
  font-size: 14px;
  font-weight: bold;
  line-height: 18px;
}

.fishing-game-shell {
  max-width: 680px;
}

.fishing-game-stage {
  position: relative;
  width: 640px;
  max-width: 100%;
  margin: 0 auto;
  background: #d9f7ff;
}

.fishing-game-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid #8dc7d7;
  border-bottom: 1px solid #8dc7d7;
  background: #d9f7ff;
}

.fishing-game-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #bdd57e;
}

.fishing-answer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fishing-answer-row label {
  color: #244406;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
}

.fishing-answer-row input {
  width: 86px;
  height: 34px;
  border: 2px solid #72a4c7;
  padding: 4px 8px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.fishing-answer-row input:focus {
  border-color: #0b79bd;
  outline: none;
}

.fishing-message {
  min-height: 20px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
}

.fishing-instructions {
  padding: 8px 12px 0;
  color: #3d4d24;
  font-size: 13px;
  line-height: 18px;
  text-align: left;
}

.whack-game-shell {
  max-width: 680px;
}

.whack-game-stage {
  width: 600px;
  max-width: 100%;
  margin: 0 auto;
  background: #9bd86a;
}

.whack-game-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid #71a848;
  border-bottom: 1px solid #71a848;
  background: #9bd86a;
}

.whack-game-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #bdd57e;
}

.whack-message {
  min-height: 20px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
}

.whack-instructions {
  padding: 8px 12px 0;
  color: #3d4d24;
  font-size: 13px;
  line-height: 18px;
  text-align: left;
}

.math-lines-shell {
  max-width: 700px;
}

.math-lines-stage {
  width: 620px;
  max-width: 100%;
  margin: 0 auto;
  background: #102236;
}

.math-lines-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid #2b5878;
  border-bottom: 1px solid #2b5878;
  background: #102236;
}

.math-lines-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #bdd57e;
}

.math-lines-message {
  min-height: 20px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
}

.math-lines-instructions {
  padding: 8px 12px 0;
  color: #3d4d24;
  font-size: 13px;
  line-height: 18px;
  text-align: left;
}

.math-man-shell {
  max-width: 700px;
}

.math-man-stage {
  width: 620px;
  max-width: 100%;
  margin: 0 auto;
  background: #07111f;
}

.math-man-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  border-top: 1px solid #204f8c;
  border-bottom: 1px solid #204f8c;
  background: #07111f;
}

.math-man-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #bdd57e;
}

.math-man-message {
  min-height: 20px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
}

.math-man-instructions {
  padding: 8px 12px 0;
  color: #3d4d24;
  font-size: 13px;
  line-height: 18px;
  text-align: left;
}

.subtraction-game-shell {
  max-width: 680px;
}

.subtraction-game-board {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 260px);
  gap: 18px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.82), rgba(255,255,255,.48)),
    #e8f8ff;
}

.subtraction-problem-panel,
.subtraction-pad-panel {
  border: 1px solid #9cc7db;
  background: #ffffff;
  padding: 14px;
}

.subtraction-prompt {
  margin: 0 0 12px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.subtraction-problem {
  width: 190px;
  margin: 0 auto 14px;
  padding: 12px 16px;
  border: 2px solid #77a8c8;
  background: #f8fdff;
  color: #152d3f;
  font-family: "Courier New", monospace;
  font-size: 42px;
  font-weight: bold;
  line-height: 48px;
  text-align: right;
}

.subtraction-problem-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.subtraction-problem-row.operator-row {
  border-bottom: 3px solid #152d3f;
  padding-bottom: 4px;
}

.subtraction-answer-display {
  min-height: 48px;
  padding-top: 7px;
  color: #0b6a9a;
}

.subtraction-hint {
  min-height: 38px;
  color: #455a28;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.subtraction-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.subtraction-key {
  min-height: 42px;
  border: 1px solid #72a4c7;
  background: #f5fbff;
  color: #173b55;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.subtraction-key:hover,
.subtraction-key:focus {
  border-color: #0b79bd;
  background: #e0f3ff;
  outline: none;
}

.subtraction-key.action {
  background: #0783c7;
  color: #ffffff;
}

.subtraction-key.action:hover,
.subtraction-key.action:focus {
  background: #006ca8;
}

.subtraction-key.secondary {
  background: #eef6d6;
  color: #31520c;
  border-color: #82955f;
}

.subtraction-entry {
  margin-bottom: 10px;
  color: #244406;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}

.subtraction-entry strong {
  display: block;
  min-height: 30px;
  color: #0b6a9a;
  font-size: 26px;
  line-height: 30px;
}

.number-line-subtraction-shell {
  max-width: 760px;
}

.number-line-subtraction-board {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.7)),
    #f5f8ec;
}

.number-line-problem {
  margin: 2px 0 10px;
  color: #244406;
  font-size: 30px;
  font-weight: bold;
  line-height: 38px;
  text-align: center;
}

.number-line-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #9fc0d2;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.number-line-feedback {
  min-height: 24px;
  margin-top: 10px;
  color: #31520c;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.mixed-fraction-shell {
  max-width: 720px;
}

.mixed-fraction-board {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(230px, 270px);
  gap: 16px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.78), rgba(255,255,255,.48)),
    #fff7df;
}

.mixed-fraction-panel,
.mixed-fraction-options {
  border: 1px solid #d6b866;
  background: #ffffff;
  padding: 14px;
}

.mixed-fraction-question {
  min-height: 54px;
  color: #24313d;
  font-size: 21px;
  font-weight: bold;
  line-height: 27px;
  text-align: center;
}

.mixed-fraction-visual {
  min-height: 126px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #ead391;
  background: #fffdf4;
}

.mixed-fraction-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  margin: 0 auto;
}

.mixed-fraction-bar {
  display: grid;
  height: 28px;
  border: 2px solid #47627a;
  background: #ffffff;
}

.mixed-fraction-piece {
  border-right: 1px solid #47627a;
  background: #ffffff;
}

.mixed-fraction-piece:last-child {
  border-right: 0;
}

.mixed-fraction-piece.filled {
  background: #62b6dc;
}

.mixed-fraction-note {
  min-height: 36px;
  color: #5a4b16;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.mixed-fraction-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mixed-fraction-option {
  min-height: 45px;
  border: 2px solid #72a4c7;
  background: #f8fdff;
  color: #173b55;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
}

.mixed-fraction-option:hover,
.mixed-fraction-option:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
}

.mixed-fraction-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.mixed-fraction-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.fraction-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 24px;
  vertical-align: middle;
  line-height: 1;
}

.fraction-text .top {
  border-bottom: 2px solid currentColor;
  padding: 0 3px 2px;
}

.fraction-text .bottom {
  padding-top: 2px;
}

.number-order-shell {
  max-width: 720px;
}

.number-order-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.82), rgba(255,255,255,.5)),
    #edf9ff;
}

.number-order-prompt {
  margin: 0 0 12px;
  color: #244406;
  font-size: 15px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
}

.number-order-slots,
.number-order-tiles {
  display: grid;
  grid-template-columns: repeat(10, minmax(42px, 1fr));
  gap: 8px;
  max-width: 620px;
  margin: 0 auto 14px;
}

.number-order-slot,
.number-order-tile {
  min-height: 44px;
  border: 2px solid #72a4c7;
  background: #ffffff;
  color: #173b55;
  font-size: 22px;
  font-weight: bold;
  line-height: 38px;
  text-align: center;
  user-select: none;
}

.number-order-slot {
  border-style: dashed;
  background: #f9fdff;
  color: #93a3ad;
}

.number-order-slot.filled {
  border-style: solid;
  border-color: #319a4a;
  background: #e8f8e9;
  color: #1d6330;
}

.number-order-slot.selected {
  border-color: #e78900;
  background: #fff3d4;
  color: #6b4100;
}

.number-order-tile {
  cursor: pointer;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
}

.number-order-tile:hover,
.number-order-tile:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
}

.number-order-tile.selected {
  border-color: #e78900;
  background: #fff3d4;
  color: #6b4100;
  transform: translateY(-1px);
}

.number-order-tile.used {
  visibility: hidden;
}

.number-order-message {
  min-height: 22px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.number-pattern-shell {
  max-width: 720px;
}

.number-pattern-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.54)),
    #f0fbf0;
}

.number-pattern-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 14px;
  color: #244406;
  font-size: 17px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.number-pattern-swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0,0,0,.25);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.number-pattern-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  gap: 10px;
  max-width: 460px;
  margin: 0 auto 14px;
}

.number-pattern-cell {
  min-height: 58px;
  border: 2px solid #7ab05a;
  border-radius: 6px;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 27px;
  font-weight: bold;
  line-height: 52px;
  text-align: center;
  transition: transform .08s ease, border-color .12s ease, background .12s ease, color .12s ease;
  user-select: none;
}

.number-pattern-cell:hover,
.number-pattern-cell:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
}

.number-pattern-cell.selected {
  border-color: var(--pattern-color, #1f9cd7);
  background: var(--pattern-color, #1f9cd7);
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
  transform: translateY(-1px);
}

.number-pattern-cell.correct {
  border-color: #287c3b;
  background: #dff5e4;
  color: #1d6330;
}

.number-pattern-cell.missed {
  border-color: var(--pattern-color, #1f9cd7);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 8px, rgba(255,255,255,.2) 8px 16px),
    var(--pattern-color, #1f9cd7);
  color: #ffffff;
}

.number-pattern-cell.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.number-pattern-message {
  min-height: 22px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.find-sum-shell {
  max-width: 720px;
}

.find-sum-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.55)),
    #fff6df;
}

.find-sum-target {
  width: min(440px, 100%);
  margin: 0 auto 14px;
  padding: 12px;
  border: 2px solid #e1a43c;
  border-radius: 8px;
  background: #fffdf8;
  color: #6b4100;
  font-size: 22px;
  font-weight: bold;
  line-height: 30px;
  text-align: center;
}

.find-sum-target strong {
  display: inline-block;
  min-width: 90px;
  color: #0b5d89;
  font-size: 30px;
  vertical-align: middle;
}

.find-sum-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  max-width: 440px;
  margin: 0 auto 16px;
  border: 2px dashed #7ab05a;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.find-sum-placeholder {
  color: #597070;
  font-size: 14px;
  font-weight: bold;
}

.find-sum-selected {
  min-width: 88px;
  padding: 8px 12px;
  border: 2px solid #0b79bd;
  border-radius: 7px;
  background: #e7f6ff;
  color: #173b55;
  font-size: 23px;
  font-weight: bold;
  line-height: 30px;
  text-align: center;
}

.find-sum-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 10px;
  max-width: 540px;
  margin: 0 auto 14px;
}

.find-sum-tile {
  min-height: 62px;
  border: 2px solid #72a4c7;
  border-radius: 8px;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  line-height: 56px;
  text-align: center;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
  user-select: none;
}

.find-sum-tile:hover,
.find-sum-tile:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
}

.find-sum-tile.selected {
  border-color: #e78900;
  background: #fff0c8;
  color: #6b4100;
  transform: translateY(-1px);
}

.find-sum-tile.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.find-sum-feedback {
  min-height: 24px;
  color: #31520c;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.algebra-tiles-shell {
  max-width: 760px;
}

.algebra-tiles-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.56)),
    #eef8ff;
}

.algebra-tiles-target,
.algebra-tiles-summary {
  max-width: 620px;
  margin: 0 auto 10px;
  color: #173b55;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
}

.algebra-tiles-target {
  padding: 10px 12px;
  border: 2px solid #72a4c7;
  border-radius: 8px;
  background: #ffffff;
  font-size: 20px;
  font-weight: bold;
}

.algebra-tiles-target strong,
.algebra-tiles-summary strong {
  color: #6b4100;
  font-size: 22px;
}

.algebra-tiles-workspace {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 178px;
  max-width: 620px;
  margin: 0 auto 14px;
  padding: 12px;
  border: 2px dashed #9fc0d2;
  border-radius: 8px;
  background: rgba(255,255,255,.78);
}

.algebra-tiles-empty {
  width: 100%;
  color: #597070;
  font-size: 14px;
  font-weight: bold;
  line-height: 150px;
  text-align: center;
}

.algebra-tiles-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 8px;
  max-width: 620px;
  margin: 0 auto 12px;
}

.algebra-tile,
.algebra-tile-palette {
  border: 2px solid rgba(0,0,0,.2);
  border-radius: 6px;
  color: #173b55;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.algebra-tile {
  min-width: 44px;
  min-height: 44px;
  font-size: 16px;
  line-height: 38px;
}

.algebra-tile.x2p,
.algebra-tile.x2n {
  width: 82px;
  height: 82px;
  line-height: 76px;
}

.algebra-tile.xp,
.algebra-tile.xn {
  width: 92px;
  height: 36px;
  line-height: 30px;
}

.algebra-tile.up,
.algebra-tile.un {
  width: 36px;
  height: 36px;
  line-height: 30px;
}

.algebra-tile-palette {
  min-height: 44px;
  font-size: 16px;
  line-height: 38px;
}

.algebra-tile:hover,
.algebra-tile:focus,
.algebra-tile-palette:hover,
.algebra-tile-palette:focus {
  outline: none;
  transform: translateY(-1px);
}

.algebra-tile.x2p,
.algebra-tile.xp,
.algebra-tile.up,
.algebra-tile-palette.x2p,
.algebra-tile-palette.xp,
.algebra-tile-palette.up {
  border-color: #2c8b47;
  background: #dff5e4;
  color: #1d6330;
}

.algebra-tile.x2n,
.algebra-tile.xn,
.algebra-tile.un,
.algebra-tile-palette.x2n,
.algebra-tile-palette.xn,
.algebra-tile-palette.un {
  border-color: #c84a4a;
  background: #ffe7e7;
  color: #8a1616;
}

.algebra-tiles-feedback {
  min-height: 24px;
  color: #31520c;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.inequality-match-shell {
  max-width: 780px;
}

.inequality-match-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.58)),
    #f5f8ec;
}

.inequality-match-help {
  max-width: 650px;
  margin: 0 auto 12px;
  color: #244406;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.inequality-match-columns {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  max-width: 690px;
  margin: 0 auto;
}

.inequality-match-column {
  border: 1px solid #d4e4bc;
  border-radius: 8px;
  background: rgba(255,255,255,.75);
  padding: 10px;
}

.inequality-match-column p {
  margin: 0 0 8px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
}

.inequality-match-card {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 0 0 8px;
  border: 2px solid #9fc0d2;
  border-radius: 7px;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  line-height: 18px;
  padding: 8px 10px;
  text-align: left;
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
}

.inequality-match-card.example {
  font-weight: normal;
}

.inequality-match-card.set-symbol-card {
  font-size: 28px;
  line-height: 34px;
  text-align: center;
}

.inequality-match-card:hover,
.inequality-match-card:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
}

.inequality-match-card.selected {
  border-color: #e78900;
  background: #fff3d4;
  color: #6b4100;
  transform: translateY(-1px);
}

.inequality-match-card.matched {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.inequality-match-card.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.inequality-match-card.hint {
  box-shadow: 0 0 0 3px rgba(231,137,0,.2);
}

.inequality-match-card:disabled {
  cursor: default;
  opacity: .85;
}

.algebra-functions-shell {
  max-width: 740px;
}

.algebra-functions-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.58)),
    #edf7ff;
}

.algebra-functions-prompt {
  max-width: 620px;
  margin: 0 auto 12px;
  color: #244406;
  font-size: 17px;
  font-weight: bold;
  line-height: 24px;
  text-align: center;
}

.algebra-functions-equation {
  max-width: 480px;
  min-height: 56px;
  margin: 0 auto 14px;
  border: 2px solid #72a4c7;
  border-radius: 8px;
  background: #ffffff;
  color: #173b55;
  font-size: 28px;
  font-weight: bold;
  line-height: 52px;
  text-align: center;
}

.algebra-functions-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 14px;
}

.algebra-functions-option {
  min-height: 48px;
  border: 2px solid #9fc0d2;
  border-radius: 7px;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  line-height: 24px;
  padding: 8px 12px;
  text-align: center;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
}

.algebra-functions-option:hover,
.algebra-functions-option:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
}

.algebra-functions-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.algebra-functions-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.algebra-functions-option:disabled {
  cursor: default;
}

.algebra-functions-feedback {
  min-height: 24px;
  color: #31520c;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.log-quiz-shell {
  max-width: 740px;
}

.log-quiz-board {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(238,249,255,.72)),
    #f0f8ff;
}

.log-quiz-prompt {
  max-width: 620px;
  margin: 0 auto 12px;
  color: #244406;
  font-size: 17px;
  font-weight: bold;
  line-height: 24px;
  text-align: center;
}

.log-quiz-equation {
  max-width: 520px;
  min-height: 66px;
  margin: 0 auto 16px;
  border: 2px solid #73a7c7;
  border-radius: 8px;
  background: #ffffff;
  color: #153b56;
  font-size: 31px;
  font-weight: bold;
  line-height: 62px;
  text-align: center;
}

.log-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 0 auto 14px;
}

.log-quiz-option {
  min-height: 54px;
  border: 2px solid #9fc0d2;
  border-radius: 7px;
  background: #ffffff;
  color: #173b55;
  cursor: pointer;
  font-size: 19px;
  font-weight: bold;
  line-height: 25px;
  padding: 9px 12px;
  text-align: center;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
}

.log-quiz-option:hover,
.log-quiz-option:focus {
  border-color: #0b79bd;
  background: #e7f6ff;
  outline: none;
  transform: translateY(-1px);
}

.log-quiz-option.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.log-quiz-option.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.log-quiz-option:disabled {
  cursor: default;
}

.log-quiz-feedback {
  min-height: 44px;
  max-width: 650px;
  margin: 0 auto;
  color: #31520c;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

.matrix-add-shell {
  max-width: 760px;
}

.matrix-add-board {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(245,255,235,.78)),
    #f4fbeb;
}

.matrix-add-prompt {
  max-width: 650px;
  margin: 0 auto 14px;
  color: #244406;
  font-size: 16px;
  font-weight: bold;
  line-height: 23px;
  text-align: center;
}

.matrix-add-equation {
  display: grid;
  grid-template-columns: minmax(135px, 1fr) 32px minmax(135px, 1fr) 32px minmax(150px, 1.08fr);
  gap: 10px;
  align-items: center;
  max-width: 710px;
  margin: 0 auto 14px;
}

.matrix-multiply-equation {
  max-width: 730px;
}

.matrix-add-block {
  border: 1px solid #cfe2b4;
  border-radius: 8px;
  background: rgba(255,255,255,.86);
  padding: 9px;
}

.matrix-add-block.answer {
  border-color: #9fc0d2;
  background: #f7fcff;
}

.matrix-add-label {
  margin-bottom: 6px;
  color: #31520c;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.matrix-add-sign {
  color: #31520c;
  font-size: 28px;
  font-weight: bold;
  text-align: center;
}

.matrix-add-table {
  border-collapse: separate;
  border-spacing: 5px;
  margin: 0 auto;
}

.matrix-add-table td {
  min-width: 42px;
  height: 38px;
  border: 1px solid #bfd6e3;
  border-radius: 6px;
  background: #ffffff;
  color: #173b55;
  font-size: 20px;
  font-weight: bold;
  line-height: 36px;
  text-align: center;
}

.matrix-add-inputs td {
  padding: 0;
}

.matrix-add-inputs input {
  width: 45px;
  height: 38px;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: #173b55;
  font-size: 19px;
  font-weight: bold;
  line-height: 34px;
  text-align: center;
}

.matrix-add-inputs input:focus {
  border-color: #0b79bd;
  outline: none;
}

.matrix-add-inputs input.correct {
  border-color: #319a4a;
  background: #e5f8e9;
  color: #1d6330;
}

.matrix-add-inputs input.wrong {
  border-color: #c82d2d;
  background: #ffe7e7;
  color: #8a1616;
}

.matrix-add-feedback {
  min-height: 24px;
  color: #31520c;
  font-size: 15px;
  font-weight: bold;
  line-height: 22px;
  text-align: center;
}

@media (max-width: 640px) {
  .math-game-topbar,
  .addition-match-help,
  .math-game-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .math-game-title {
    white-space: normal;
    text-align: center;
  }

  .math-game-stats,
  .math-game-buttons {
    justify-content: center;
  }

  .addition-match-grid {
    grid-template-columns: 1fr;
  }

  .fishing-game-controls {
    grid-template-columns: 1fr;
  }

  .fishing-answer-row {
    justify-content: center;
    flex-wrap: wrap;
  }

  .whack-game-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .math-lines-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .math-man-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .subtraction-game-board {
    grid-template-columns: 1fr;
  }

  .mixed-fraction-board {
    grid-template-columns: 1fr;
  }

  .number-order-slots,
  .number-order-tiles {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

  .number-pattern-grid {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
  }

  .find-sum-tiles {
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }

  .find-sum-selected {
    min-width: 76px;
  }

  .algebra-tiles-palette {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

  .inequality-match-columns {
    grid-template-columns: 1fr;
  }

  .algebra-functions-options {
    grid-template-columns: 1fr;
  }

  .log-quiz-options {
    grid-template-columns: 1fr;
  }

  .log-quiz-equation {
    font-size: 25px;
  }

  .matrix-add-equation {
    grid-template-columns: 1fr;
  }

  .matrix-add-sign {
    line-height: 18px;
  }
}
