html,
body {
  margin: 0;
  padding: 0;
  background: #f5faff;
  color: #20364a;
  font-family: Arial, Helvetica, sans-serif;
}

.addition-game {
  box-sizing: border-box;
  min-height: 570px;
  padding: 14px;
  background: linear-gradient(#f9fcff, #eef7ff);
}

.addition-shell {
  max-width: 900px;
  margin: 0 auto;
}

.addition-topbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.addition-stat {
  min-height: 48px;
  border: 1px solid #adc7dc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(32, 54, 74, 0.12);
  color: #60768b;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.addition-stat strong {
  margin-top: 2px;
  color: #173c5c;
  font-size: 21px;
}

.addition-stage {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.problem-card,
.blocks-card {
  border: 1px solid #b4cce0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(32, 54, 74, 0.13);
}

.problem-card {
  padding: 14px;
}

.problem-title {
  margin-bottom: 8px;
  color: #60768b;
  font-size: 14px;
  font-weight: bold;
}

.vertical-problem {
  width: 300px;
  margin: 0 auto 12px;
  color: #153a58;
  font-family: "Courier New", monospace;
  font-size: 46px;
  font-weight: bold;
  line-height: 1.08;
}

.carry-row,
.number-row,
.answer-row {
  display: grid;
  grid-template-columns: 38px 72px 72px 72px;
  align-items: center;
  column-gap: 4px;
}

.carry-row {
  min-height: 28px;
  color: #d3523f;
  font-size: 24px;
}

.operator {
  text-align: center;
}

.digit {
  text-align: center;
}

.rule {
  height: 4px;
  margin: 2px 0 7px;
  background: #153a58;
}

.digit-input {
  width: 58px;
  height: 54px;
  border: 2px solid #9eb7cd;
  border-radius: 6px;
  color: #153a58;
  font-family: "Courier New", monospace;
  font-size: 40px;
  font-weight: bold;
  text-align: center;
}

.digit-input:focus {
  border-color: #2573ad;
  outline: none;
  box-shadow: 0 0 0 3px #dcefff;
}

.feedback {
  min-height: 42px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  background: #f1f6fb;
  color: #24445f;
  font-weight: bold;
  text-align: center;
}

.feedback.correct {
  background: #e0f5dd;
  color: #23601d;
}

.feedback.wrong {
  background: #ffe8e2;
  color: #8f3b2f;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.addition-button,
.addition-select {
  height: 34px;
  border: 1px solid #829cb4;
  border-radius: 5px;
  background: #fff;
  color: #173c5c;
  font-weight: bold;
}

.addition-button {
  padding: 0 14px;
  cursor: pointer;
}

.addition-select {
  padding: 0 8px;
}

.addition-button:hover {
  background: #eaf6ff;
}

.blocks-card {
  padding: 12px;
}

.blocks-title {
  margin-bottom: 8px;
  color: #60768b;
  font-size: 14px;
  font-weight: bold;
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.place-column {
  min-height: 310px;
  border: 1px solid #c8d8e6;
  border-radius: 6px;
  background: #f8fbff;
  padding: 9px;
}

.place-column h3 {
  margin: 0 0 8px;
  color: #1d486a;
  font-size: 16px;
  text-align: center;
}

.block-area {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
}

.hundred-block {
  width: 72px;
  height: 72px;
  border: 1px solid #225f88;
  border-radius: 4px;
  background:
    repeating-linear-gradient(to right, rgba(255,255,255,0.6) 0, rgba(255,255,255,0.6) 6px, transparent 6px, transparent 7px),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.6) 0, rgba(255,255,255,0.6) 6px, transparent 6px, transparent 7px),
    #69b8eb;
}

.ten-block {
  width: 15px;
  height: 74px;
  border: 1px solid #326c99;
  border-radius: 3px;
  background: repeating-linear-gradient(to bottom, #7cc4f4 0, #7cc4f4 6px, #dff2ff 6px, #dff2ff 7px);
}

.one-block {
  width: 18px;
  height: 18px;
  border: 1px solid #b3721f;
  border-radius: 4px;
  background: #ffd179;
}

.hint {
  margin-top: 10px;
  color: #4e687f;
  font-size: 14px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .addition-topbar,
  .addition-stage {
    grid-template-columns: 1fr;
  }

  .addition-topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
