.balance-page {
  background: #faf8f3;
  color: #17243b;
}

.balance-page .game-main {
  max-width: 820px;
}

.balance-page .game-heading h1 {
  letter-spacing: -0.065em;
}

.b-shell {
  padding: 22px;
  border: 1px solid #dedfdc;
  border-top: 5px solid #7866cf;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.b-shell [hidden] {
  display: none !important;
}

.b-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #516077;
  font-size: .78rem;
  font-weight: 750;
}

.b-topline > span {
  color: #6754bb;
  letter-spacing: .1em;
}

.b-topline #b-date { margin-right: auto; color: #516077; letter-spacing: 0; }
.b-topline .b-clock { color: #17243b; letter-spacing: 0; white-space: nowrap; }
.b-topline button {
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #bfc4d1;
  border-radius: 9px;
  background: #fff;
  color: #17243b;
  cursor: pointer;
  font: inherit;
}
.b-topline button:disabled { opacity: .5; cursor: default; }
.b-topline button:focus-visible { outline: 3px solid #6754bb; outline-offset: 3px; }
.b-paused { min-height: 205px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.b-paused .b-primary { margin-top: 4px; }
#b-status:empty { display: none; }
#b-status { margin: 12px 0 0; color: #516077; text-align: center; font-size: .88rem; }
#b-share-text:not([hidden]) { display: block; width: 100%; min-height: 105px; margin-top: 14px; }

.b-intro {
  max-width: 540px;
  margin: 10px auto 16px;
  padding: 24px 22px;
  border: 1px solid #dce0e9;
  border-radius: 18px;
  background: #f7f7fc;
  text-align: center;
}

.b-intro-icon {
  width: 120px;
  margin: 0 auto 8px;
  color: #7866cf;
}

.b-intro-icon svg {
  display: block;
  width: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.b-intro h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  letter-spacing: -.04em;
}

.b-intro p {
  max-width: 430px;
  margin: 0 auto 22px;
  color: #516077;
  font-size: .94rem;
  line-height: 1.5;
}

.b-primary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid #17243b;
  border-radius: 11px;
  background: #17243b;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
}

.b-primary:hover:not(:disabled) {
  background: #31436a;
}

.b-primary:disabled {
  cursor: default;
  opacity: .45;
}

.b-primary:focus-visible,
.b-option:focus-visible {
  outline: 3px solid #6754bb;
  outline-offset: 3px;
}

.b-lead {
  margin: 2px 0 16px;
  color: #516077;
  font-size: .92rem;
  font-weight: 650;
  text-align: center;
}

.b-clues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.b-scale-card,
.b-final {
  min-width: 0;
  padding: 10px 8px 4px;
  border: 1px solid #e1e3e8;
  border-radius: 15px;
  background: #fbfaf8;
}

.b-clue-caption {
  margin: 0 0 2px;
  color: #516077;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.b-scale-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.b-scale-svg .b-support {
  fill: #e8eaf0;
  stroke: #71809a;
  stroke-width: 2.5;
}

.b-scale-svg .b-beam,
.b-scale-svg .b-cable,
.b-scale-svg .b-pan {
  fill: none;
  stroke: #344867;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.b-scale-svg .b-pivot {
  fill: #7866cf;
  stroke: #fff;
  stroke-width: 2;
}

.balance-page .b-shape-a { fill: #7866cf; stroke: #49398e; }
.balance-page .b-shape-b { fill: #e48460; stroke: #a95737; }
.balance-page .b-shape-c { fill: #3d9d8c; stroke: #216a62; }
.balance-page .b-object { stroke-width: 1.7; }
.b-scale-svg .b-question { fill: #6754bb; font-size: 40px; font-weight: 800; text-anchor: middle; }

.b-final-wrap {
  max-width: 530px;
  margin: 16px auto 0;
}

.b-final-wrap h2 {
  margin: 0 0 7px;
  font-size: .95rem;
  letter-spacing: -.02em;
  text-align: center;
}

.b-final {
  border-color: #c9c1ec;
  background: #f8f7ff;
}

.b-answers {
  min-width: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.b-answers legend {
  margin: 0 0 10px;
  font-size: .95rem;
  font-weight: 750;
  text-align: center;
}

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

.b-option {
  position: relative;
  min-width: 0;
  min-height: 88px;
  padding: 7px 8px 9px;
  border: 2px solid #d8dbe2;
  border-radius: 12px;
  background: #fff;
  color: #17243b;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.b-option:hover:not(:disabled) {
  border-color: #7866cf;
}

.b-option.is-selected {
  border-color: #6754bb;
  background: #f3f0ff;
  box-shadow: inset 0 0 0 1px #6754bb;
}

.b-option.is-correct {
  border-color: #268263;
  background: #eefaf4;
}

.b-option.is-wrong {
  border-color: #bc5e42;
  background: #fff3ef;
}

.b-option-label {
  display: block;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.b-option-icon {
  display: block;
  width: 100%;
  height: 48px;
}

.b-option::after {
  position: absolute;
  top: 6px;
  right: 9px;
  font-size: 1rem;
  font-weight: 800;
}

.b-option.is-correct::after { content: '✓'; color: #176b4d; }
.b-option.is-wrong::after { content: '×'; color: #a84831; }

.b-lock {
  display: flex;
  width: min(100%, 250px);
  margin: 17px auto 0;
}

.b-result {
  max-width: 620px;
  margin: 20px auto 2px;
  padding: 20px;
  border: 1px solid #b6dccd;
  border-radius: 14px;
  background: #f2faf5;
  text-align: center;
}

.b-result.is-wrong {
  border-color: #f0c8b9;
  background: #fff7f2;
}

.b-result h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.b-result p {
  margin: 8px auto 0;
  color: #43536b;
  line-height: 1.5;
}

.b-result #b-explanation {
  max-width: 560px;
  margin-bottom: 18px;
  color: #24364d;
}

.b-error {
  padding: 20px;
  color: #8d402b;
  text-align: center;
}

.b-scale-svg.is-settling .b-moving {
  transform-origin: 180px 38px;
  animation: b-settle 650ms ease-out both;
}

@keyframes b-settle {
  0% { transform: rotate(-4deg); }
  55% { transform: rotate(1.5deg); }
  100% { transform: rotate(0); }
}

@media (max-width: 640px) {
  .balance-page .game-main { width: calc(100% - 24px); }
  .b-shell { padding: 14px; border-radius: 20px; }
  .b-topline { flex-wrap: wrap; row-gap: 4px; }
  .b-topline #b-date { margin-right: 0; flex-basis: calc(100% - 80px); }
  .b-topline .b-clock { margin-left: auto; }
  .b-clues { grid-template-columns: 1fr; gap: 9px; }
  .b-scale-card, .b-final { padding: 4px 5px 0; }
  .b-final-wrap { margin-top: 10px; }
  .b-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .b-option { min-height: 80px; }
  .b-intro { padding: 22px 16px; }
}

@media (max-width: 350px) {
  .balance-page .game-main { width: calc(100% - 16px); }
  .b-shell { padding: 10px; }
  .b-topline { gap: 5px; font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .b-scale-svg.is-settling .b-moving { animation: none; }
}
