.worm .seg { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin: 10px auto 4px; }
.worm .seg button {
  font: inherit; cursor: pointer; min-height: 40px; padding: 0 16px; background: #fffc; color: inherit;
  border: 1px solid #888; margin-left: -1px;
}
.worm .seg button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.worm .seg button:last-child { border-radius: 0 8px 8px 0; }
.worm .seg button[aria-checked="true"] { background: #2d3a4a; color: #fff; border-color: #2d3a4a; position: relative; z-index: 1; }
.worm .seg button:focus-visible { outline: 3px solid #4EA7FC; outline-offset: 1px; z-index: 2; position: relative; }
.worm #mode-help { min-height: 2.6em; margin: 4px auto 8px; max-width: 560px; }
.worm .options { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: center; margin: 6px 0; }
.worm .options select { font: inherit; min-height: 34px; }
.worm .options label { font-size: 15px; }
.worm .options .action-button-small { font: inherit; font-size: 15px; padding: 6px 14px; cursor: pointer; }
#status { min-height: 1.6em; margin: 6px 0; }
#status.bad { color: #c0392b; }
#worm[hidden], #verdict[hidden], #model-line[hidden] { display: none; }
#worm-board-wrap {
  width: min(560px, calc(100vw - 32px));
  height: min(560px, calc(100vw - 32px));
  margin: 0 auto;
}
.worm .verdict {
  max-width: 560px; margin: 14px auto 0; padding: 12px 16px; text-align: left; line-height: 1.5;
  background: #fff8; border-radius: 8px; border-left: 4px solid #c0392b;
}
.worm .verdict.done { border-left-color: #1a7f37; }
.worm .verdict h2 { font-size: 18px; margin: 0 0 6px; }
.worm .verdict p { margin: 4px 0; }
.worm .verdict .buttons { text-align: center; }
.worm .verdict .buttons .action-button-small { font: inherit; cursor: pointer; margin: 10px 4px 0; }
.worm button:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 600px) {
  .worm .seg button { flex: 1 1 45%; min-height: 44px; padding: 0 8px; }
  .worm .seg button:first-child, .worm .seg button:last-child { border-radius: 0; }
  .worm .verdict .buttons .action-button-small { min-height: 44px; }
}
