.mb-shell {
  --mb-moss: #789276;
  --mb-moss-deep: #29483e;
  --mb-amber: #e4ad49;
  --mb-blue: #101e2d;
  --mb-ice: #b9ceca;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 28px;
  color: #20352f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mb-shell,
.mb-shell * {
  box-sizing: border-box;
}

.mb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
}

.mb-stats,
.mb-actions,
.mb-console,
.mb-puzzle-card,
.mb-touch-controls,
.mb-result-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.mb-stats {
  min-width: 0;
  flex-wrap: wrap;
}

.mb-stat,
.mb-card-head,
.mb-panel-card,
.mb-mech {
  border: 1px solid var(--cg-line);
  background: var(--cg-panel);
  box-shadow: 0 8px 22px rgba(19, 33, 30, 0.1);
}

.mb-stat {
  min-width: 76px;
  padding: 8px 11px;
  border-radius: 9px;
}

.mb-stat span,
.mb-card-head span,
.mb-kicker,
.mb-symbol-key {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
}

.mb-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mb-actions {
  flex: 0 0 auto;
}

.mb-btn,
.mb-close,
.mb-mech,
.mb-touch {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 9px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(19, 33, 30, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.mb-btn {
  padding: 0 14px;
}

.mb-btn:hover:not(:disabled),
.mb-close:hover,
.mb-mech:hover:not(:disabled),
.mb-touch:hover {
  transform: translateY(-1px);
  border-color: var(--cg-teal);
}

.mb-mech.mb-gamepad-selected,
.mb-touch-mech.mb-gamepad-selected {
  border-color: #2b8494;
  box-shadow: 0 0 0 3px rgba(43, 132, 148, 0.22), 0 8px 22px rgba(19, 33, 30, 0.1);
}

.mb-btn:focus-visible,
.mb-close:focus-visible,
.mb-mech:focus-visible,
.mb-touch:focus-visible,
.mb-canvas:focus-visible {
  outline: 3px solid rgba(49, 119, 145, 0.42);
  outline-offset: 3px;
}

.mb-btn:disabled,
.mb-mech:disabled,
.mb-lock:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.mb-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  padding: 0;
  font-size: 20px;
}

.mb-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

 .mb-stage-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(320px, 54vw, 540px);
  max-height: 64vh;
  overflow: hidden;
  border: 1px solid #30483f;
  border-radius: 12px;
  background: var(--mb-blue);
  box-shadow: 0 18px 44px rgba(9, 22, 35, 0.24), inset 0 0 0 1px rgba(185, 206, 202, 0.08);
  touch-action: none;
}

.mb-stage-wrap::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  background: radial-gradient(circle at 50% 43%, transparent 28%, rgba(4, 15, 18, 0.12) 66%, rgba(3, 12, 17, 0.48) 100%), linear-gradient(180deg, rgba(246, 205, 122, 0.05), transparent 24%, rgba(3, 12, 17, 0.14));
  box-shadow: inset 0 0 54px rgba(2, 11, 15, 0.28);
  content: "";
  pointer-events: none;
}
.mb-stage-wrap::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgba(255, 239, 184, 0.34);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.mb-stage-wrap.mb-impact::before {
  animation: mb-impact-flash 340ms ease-out both;
}

@keyframes mb-impact-flash {
  0% { opacity: 0; }
  18% { opacity: 0.18; }
  100% { opacity: 0; }
}


.mb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.mb-canvas:active {
  cursor: grabbing;
}

.mb-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.85;
}

.mb-reticle::before,
.mb-reticle::after,
.mb-reticle i,
.mb-reticle b {
  position: absolute;
  display: block;
  content: "";
  background: rgba(243, 199, 102, 0.96);
}

.mb-reticle::before,
.mb-reticle::after {
  top: 11px;
  width: 8px;
  height: 2px;
}

.mb-reticle::before { left: 0; }
.mb-reticle::after { right: 0; }
.mb-reticle i,
.mb-reticle b {
  left: 11px;
  width: 2px;
  height: 8px;
}

.mb-reticle i { top: 0; }
.mb-reticle b { bottom: 0; }

.mb-reticle {
  transition: transform 120ms ease, filter 120ms ease;
}

.mb-reticle-near {
  filter: drop-shadow(0 0 7px rgba(243, 199, 102, 0.9));
  transform: translate(-50%, -50%) scale(1.22);
}


.mb-reticle-label {
  position: absolute;
  z-index: 4;
  top: calc(50% + 20px);
  left: 50%;
  max-width: min(80%, 320px);
  padding: 5px 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(243, 199, 102, 0.42);
  border-radius: 6px;
  background: rgba(12, 27, 39, 0.88);
  color: #f5e6bd;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}
.mb-feedback {
  position: absolute;
  z-index: 7;
  top: 24%;
  left: 50%;
  max-width: min(86%, 360px);
  padding: 7px 12px 8px;
  transform: translate(-50%, 10px) scale(0.92);
  border: 1px solid rgba(243, 199, 102, 0.58);
  border-radius: 7px;
  background: rgba(13, 29, 36, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #ffe8a6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.mb-feedback-active {
  animation: mb-feedback-pop 1050ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mb-feedback-collect,
.mb-feedback-solve {
  border-color: rgba(224, 181, 82, 0.82);
  color: #fff0b0;
}

.mb-feedback-reject {
  border-color: rgba(207, 111, 83, 0.76);
  color: #ffd0b2;
}

.mb-feedback-win {
  border-color: rgba(222, 237, 185, 0.86);
  color: #eff6c9;
}

@keyframes mb-feedback-pop {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.9); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1.04); }
  72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -8px) scale(0.98); }
}
.mb-stage-label {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(185, 206, 202, 0.25);
  border-radius: 7px;
  background: rgba(12, 27, 39, 0.84);
  color: var(--mb-ice);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.mb-objective {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 14px;
  width: min(280px, 42%);
  padding: 7px 10px 8px;
  border: 1px solid rgba(185, 206, 202, 0.22);
  border-radius: 7px;
  background: rgba(12, 27, 39, 0.84);
  color: var(--mb-ice);
  pointer-events: none;
}

.mb-objective span,
.mb-player small {
  display: block;
  color: #8fa9a2;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.mb-objective strong {
  display: block;
  margin-top: 3px;
  color: #f0e7c8;
  font-size: 12px;
  line-height: 1.15;
}

.mb-objective-near {
  border-color: rgba(228, 173, 73, 0.72);
  box-shadow: 0 0 0 1px rgba(228, 173, 73, 0.12), 0 8px 24px rgba(0, 0, 0, 0.24);
}

.mb-objective-near strong { color: #ffd98a; }

.mb-player {
  position: absolute;
  z-index: 3;
  top: 66px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(120, 146, 118, 0.38);
  border-radius: 8px;
  background: rgba(18, 43, 38, 0.82);
  color: var(--mb-moss);
  pointer-events: none;
}

.mb-player svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  stroke: rgba(228, 236, 220, 0.72);
  stroke-width: 1;
}

.mb-player .mb-player-mark {
  fill: none;
  stroke: var(--mb-amber);
  stroke-width: 2;
}

.mb-player strong {
  display: block;
  margin-top: 2px;
  color: #e5eee5;
  font-size: 11px;
  line-height: 1;
}

.mb-player-near {
  border-color: rgba(228, 173, 73, 0.66);
  color: #d9b15e;
}

.mb-overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 19, 31, 0.76);
}

 .mb-start {
  background: linear-gradient(145deg, rgba(20, 48, 43, 0.64), rgba(5, 19, 28, 0.78));
  backdrop-filter: blur(2px);
}

.mb-panel-card {
  width: min(100%, 440px);
  padding: 24px;
  border-radius: 12px;
  background: rgba(248, 246, 232, 0.97);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
}

 .mb-start-card {
  width: min(100%, 420px);
  padding: 25px 28px 23px;
  border: 1px solid rgba(223, 185, 101, 0.48);
  border-top-color: rgba(247, 218, 143, 0.82);
  background: linear-gradient(145deg, rgba(25, 57, 50, 0.97), rgba(7, 24, 32, 0.98)), repeating-linear-gradient(115deg, transparent 0 22px, rgba(221, 187, 111, 0.035) 23px 24px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 240, 194, 0.08);
  text-align: center;
}

.mb-start-card .mb-kicker {
  color: #d8b96f;
}

.mb-start-card h1 {
  margin: 5px 0 8px;
  color: #f5e8c7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.42);
}

.mb-start-card.mb-start-card p {
  margin: 0 0 16px;
  color: #c6d2c7;
  font-size: 14px;
  line-height: 1.45;
}

.mb-start-card small {
  display: block;
  margin-top: 12px;
  color: #9eb2a6;
  font-size: 11px;
  line-height: 1.35;
}

.mb-start-card .mb-primary {
  background: #d7a84b;
  color: #142b25;
  box-shadow: 0 10px 24px rgba(4, 14, 17, 0.28), 0 0 0 1px rgba(255, 231, 166, 0.18) inset;
}

.mb-start-card .mb-start-state {
  color: #b6c7ba;
}

.mb-panel-card h2,
.mb-puzzle-head h2 {
  margin: 5px 0 8px;
  color: #213733;
  line-height: 1.05;
}


.mb-panel-card p {
  margin: 0 0 16px;
  color: #53645c;
  font-size: 14px;
  line-height: 1.45;
}


.mb-large {
  min-height: 50px;
  padding: 0 24px;
}

.mb-hidden {
  display: none !important;
}

.mb-console {
  align-items: stretch;
  margin-top: 12px;
}

.mb-map-card,
.mb-journal-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 22px rgba(19, 33, 30, 0.08);
}

.mb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
}

.mb-card-head b {
  color: var(--cg-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mb-map {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.mb-map-node {
  display: grid;
  min-width: 0;
  flex: 1 1 0;
  place-items: center;
  gap: 2px;
}
.mb-map-node b {
  max-width: 100%;
  color: inherit;
  font-size: 10px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.mb-map-node em {
  display: block;
  color: inherit;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.mb-map-node span {
  position: relative;
}

.mb-map-node span::after {
  position: absolute;
  right: -4px;
  bottom: -2px;
  display: grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--cg-panel);
  content: "?";
  font-size: 8px;
}

.mb-map-node.mb-map-active span::after { content: "•"; }
.mb-map-node.mb-map-done span::after { content: "✓"; }

.mb-map-node.mb-map-active {
  color: var(--cg-ink);
}

.mb-map-node.mb-map-active span {
  border-color: var(--cg-teal);
  background: rgba(49, 145, 145, 0.16);
}

.mb-map-node.mb-map-done span {
  border-color: var(--cg-amber);
  background: rgba(194, 142, 48, 0.18);
}

.mb-map-node.mb-map-locked {
  color: var(--cg-muted);
}

.mb-map-node.mb-map-locked span {
  border-style: dashed;
}

.mb-order-plaque {
  margin-top: 10px;
  padding: 7px 9px;
  border-left: 3px solid var(--cg-amber);
  background: rgba(194, 142, 48, 0.1);
  color: var(--cg-muted);
  font-size: 11px;
}

.mb-order-plaque b { color: var(--cg-ink); }


.mb-map-link {
  width: 14px;
  height: 2px;
  flex: 0 0 auto;
  background: var(--cg-line);
}

.mb-notes {
  display: grid;
  gap: 5px;
  min-height: 51px;
  margin: 10px 0 0;
  padding: 0 0 0 16px;
  color: #465b52;
  font-size: 12px;
  line-height: 1.3;
}

.mb-notes li::marker {
  color: var(--cg-teal);
}

.mb-prompt {
  min-height: 34px;
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--cg-line);
  color: #314a41;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.mb-puzzle-card {
  display: block;
  align-items: stretch;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;

  background: var(--cg-panel);
  box-shadow: 0 8px 22px rgba(19, 33, 30, 0.08);
}
.mb-mech.mb-solved,
.mb-lock.mb-solved {
  border-style: double;
  border-width: 3px;
}

.mb-mech.mb-solved::after,
.mb-lock.mb-solved::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 7px;
  color: #426c54;
  font-size: 13px;
  font-weight: 900;
}

.mb-mech:disabled,
.mb-btn:disabled {
  opacity: 0.58;
}

.mb-result-summary,
.mb-result-best {
  margin: 3px 0;
  color: #314a41;
  font-size: 13px;
  font-weight: 800;
}

.mb-result-new-best {
  margin: 4px 0;
  color: #7c5a16;
  font-size: 13px;
  font-weight: 900;
}

.mb-start-state {
  min-height: 18px;
  margin: 10px 0 0;
  color: #53645c;
  font-size: 12px;
}

.mb-new-run {
  display: block;
  margin: 8px auto 0;
}

.mb-puzzle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mb-puzzle-head h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.mb-symbol-key {
  color: #64756c;
  font-size: 9px;
  text-align: right;
}

.mb-ring-controls,
.mb-shadow-controls,
.mb-final-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.mb-mech {
  position: relative;
  display: grid;
  min-width: 0;
  flex: 1 1 0;
  align-content: center;
  gap: 2px;
  padding: 8px 10px 7px;
  text-align: left;
}

.mb-mech span {
  color: #a27a35;
  font-size: 21px;
  line-height: 1;
}

.mb-mech b {
  color: var(--cg-ink);
  font-size: 12px;
}

.mb-mech em {
  color: var(--cg-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.mb-light-on {
  border-color: #c4933c;
  background: rgba(244, 221, 153, 0.35);
}

.mb-light-on em::after {
  content: " · visible";
  color: #98691e;
  font-weight: 900;
}

.mb-light-off em::after {
  content: " · hidden";
  color: #69756e;
  font-weight: 900;
}

.mb-final-controls {
  align-items: center;
}

.mb-lock-readout {
  min-width: 94px;
  color: #5e6c62;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.mb-lock-readout b {
  color: #a16e22;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.mb-console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mb-action {
  border-color: #b37a32;
  background: #f3dfae;
  color: #61461d;
}

.mb-travel {
  flex: 1 1 160px;
}

.mb-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 25, 24, 0.68);
}

.mb-modal-card {
  position: relative;
  max-height: min(84vh, 620px);
  overflow: auto;
}

.mb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

.mb-result-score {
  display: block;
  margin: 4px 0 6px;
  color: #956822;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.mb-result-actions {
  flex-wrap: wrap;
}

.mb-result-actions .mb-btn {
  flex: 1 1 150px;
}

.mb-result .mb-panel-card {
  border-color: rgba(228, 173, 73, 0.5);
}

.mb-result {
  position: relative;
  inset: auto;
  display: block;
  padding: 12px 0 0;
  background: transparent;
}

.mb-result .mb-panel-card {
  margin: 0 auto;
  max-height: none;
}

.mb-shell[data-state="won"] .mb-touch-controls,
.mb-shell[data-state="won"] .mb-player,
.mb-shell[data-state="won"] .mb-objective,
.mb-shell[data-state="won"] .mb-stage-label {
  visibility: hidden;
  pointer-events: none;
}

.mb-shell[data-state="idle"] .mb-touch-controls,
.mb-shell[data-state="error"] .mb-touch-controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.mb-touch-controls {
  position: absolute;
  z-index: 6;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  display: none;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(185, 206, 202, 0.28);
  border-radius: 10px;
  background: rgba(10, 24, 35, 0.88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
  transition: opacity 120ms ease, visibility 120ms ease;
}

.mb-dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 4px;
}

.mb-dpad #mb-up { grid-column: 2; }
.mb-dpad #mb-left { grid-column: 1; grid-row: 2; }
.mb-dpad #mb-down { grid-column: 2; grid-row: 2; }
.mb-dpad #mb-right { grid-column: 3; grid-row: 2; }

.mb-touch {
  padding: 0;
  font-size: 19px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.mb-touch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mb-touch-wide {
  min-width: 88px;
  padding: 0 12px;
  font-size: 12px;
}

.mb-touch-mechanisms,
.mb-touch-ring-controls {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  gap: 4px;
}

.mb-touch-mechanisms { margin-top: 2px; }
.mb-touch-ring-controls { width: 100%; }
.mb-touch-mech { min-width: 44px; padding: 0 4px; font-size: 10px; }

@media (pointer: coarse) {
  .mb-touch-controls { display: grid; }
  .mb-touch-mechanisms.mb-hidden,
  .mb-touch-ring-controls.mb-hidden { display: none; }
}

@media (max-width: 680px) {
  .mb-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .mb-topbar {
    align-items: flex-start;
  }

  .mb-stat {
    min-width: 64px;
    padding: 7px 8px;
  }

  .mb-stat strong {
    font-size: 16px;
  }

  .mb-actions {
    gap: 5px;
  }

  .mb-actions .mb-btn:not(.mb-icon) {
    padding: 0 9px;
  }

  .mb-stage-wrap {
    height: clamp(420px, 112vw, 500px);
    max-height: 62vh;
  }

  .mb-start-card {
    width: min(100%, 350px);
    padding: 19px 18px 18px;
  }

  .mb-start-card h1 {
    font-size: 42px;
  }

  .mb-start-card p {
    margin-bottom: 14px;
    font-size: 13px;
  }

  .mb-start-card small {
    display: none;
  }

  .mb-large {
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
  }

  .mb-console {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mb-map-card,
  .mb-journal-card {
    width: 100%;
  }

  .mb-puzzle-head {
    align-items: flex-start;
  }

  .mb-symbol-key {
    max-width: 92px;
  }

  .mb-ring-controls,
  .mb-shadow-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .mb-mech {
    padding-right: 7px;
    padding-left: 7px;
  }

  .mb-mech b {
    font-size: 11px;
  }

  .mb-mech em {
    font-size: 10px;
  }

  .mb-final-controls {
    flex-wrap: wrap;
  }

  .mb-final-controls .mb-btn {
    flex: 1 1 130px;
  }
}

@media (max-width: 420px) {
  .mb-stats {
    gap: 4px;
  }

  .mb-stat {
    min-width: 58px;
  }

  .mb-stat span {
    font-size: 9px;
  }

  .mb-stat strong {
    font-size: 15px;
  }

  .mb-actions .mb-btn:not(.mb-icon) {
    min-width: 44px;
    padding: 0 7px;
    font-size: 11px;
  }

  .mb-stage-label {
    top: 8px;
    left: 8px;
    font-size: 10px;
  }

  .mb-objective {
    top: 8px;
    right: 8px;
    width: min(196px, 56%);
    padding: 6px 8px 7px;
  }

  .mb-objective strong { font-size: 11px; }

  .mb-player {
    top: 61px;
    right: 8px;
  }

  .mb-player svg {
    width: 26px;
    height: 26px;
  }

  .mb-panel-card {
    padding: 18px;
  }


  .mb-start-card h1 {
    font-size: 38px;
  }
  .mb-result .mb-panel-card { padding: 16px; }

  .mb-result-score { font-size: 27px; }

  .mb-touch-controls { gap: 5px; }

  .mb-dpad {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
  }

  .mb-puzzle-head h2 {
    font-size: 16px;
  }

  .mb-symbol-key {
    max-width: 74px;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mb-shell,
  .mb-shell * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .mb-shell[data-reduced-motion="true"] .mb-feedback-active {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
