.equation-mode-buttons button { min-width: 72px; }

.game-result-screen .result-detail,
.game-result-screen .result-best { margin: 6px 0 0; }

.game-result-screen .result-best { font-weight: 800; }

.equation-skeleton {
  width: 100%;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.equation-progress-row {
  width: min(100%, 36rem);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.equation-progress { margin: 0; font-weight: 800; }

.equation-hint {
  min-width: 7.4rem;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #d5dce2;
  border-radius: 9px;
  background: #f5f7f8;
  color: var(--muted);
  font-weight: 700;
}

.equation-hint:not(:disabled) {
  border-color: #bd6d19;
  background: #fff7e8;
  color: #8b4d19;
  cursor: pointer;
}

.equation-hint-placeholder { visibility: hidden; }

.equation-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1.5vw, 10px);
  width: 100%;
  white-space: nowrap;
  font-size: clamp(1.25rem, 5.7vw, 2.2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.equation-slot {
  box-sizing: border-box;
  width: clamp(34px, 9vw, 52px);
  min-width: 32px;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid var(--green);
  border-radius: 9px;
  background: #fff;
  color: var(--green);
  font: inherit;
  line-height: 1;
}

.equation-slot.is-active {
  border-color: #1769aa;
  background: #eef7ff;
  color: #12588f;
  outline: 3px solid color-mix(in srgb, #1769aa 28%, transparent);
  outline-offset: 1px;
}

.equation-slot.is-hint-locked,
.equation-slot.is-hint-locked:disabled {
  border-color: #d77716;
  background: #fff3df;
  color: #9a510d;
  outline: 3px solid color-mix(in srgb, #e88a28 26%, transparent);
  outline-offset: 1px;
  opacity: 1;
}

.equation-slot:focus-visible { outline-color: #1769aa; }

.operator-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 64px));
  gap: 8px;
}

.operator-buttons button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
}

.equation-current,
.equation-error { min-height: 1.5em; margin: 0; }
.equation-current { font-size: 1.08rem; font-weight: 800; }
.equation-current-value.is-incorrect { color: #8b4d19; }
.equation-current-value.is-correct { color: var(--green); }
.equation-current-value.is-error { color: #a3362b; }
.equation-error { color: #a3362b; }

.equation-rules {
  max-width: 36rem;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
}

.equation-rules p { margin: 0; }
.equation-rules p + p { margin-top: 2px; }

#game-play-stack > .game-feedback {
  margin: 10px 0 0;
  min-height: 1.35rem;
  line-height: 1.35rem;
}

.equation-skeleton.is-correct .equation-line {
  animation: equation-correct-pulse 400ms ease-out;
}

@keyframes equation-correct-pulse {
  45% { transform: scale(1.025); color: var(--green); }
}

@media (prefers-reduced-motion: reduce) {
  .equation-skeleton.is-correct .equation-line { animation: none; }
}

@media (max-width: 360px) {
  .equation-skeleton { gap: 12px; }
  .equation-progress-row { gap: 8px; }
  .equation-hint { min-width: 6.7rem; padding-inline: 7px; font-size: 0.82rem; }
  .equation-line { font-size: clamp(1.08rem, 5.35vw, 1.45rem); }
  .equation-slot { width: 42px; min-width: 42px; border-width: 1px; }
  .operator-buttons { grid-template-columns: repeat(4, minmax(44px, 1fr)); width: 100%; }
  .equation-current { font-size: 1rem; }
  .equation-rules { font-size: 0.7rem; line-height: 1.35; }
  #game-play-stack > .game-feedback { margin-top: 8px; }
}
