.bo-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 14px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.bo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bo-statline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bo-stat {
  min-width: 72px;
  padding: 7px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  text-align: center;
}

.bo-stat span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-transform: uppercase;
}

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

.bo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bo-btn,
.bo-close {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

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

.bo-btn:hover,
.bo-close:hover {
  transform: translateY(-1px);
  border-color: rgba(18, 122, 137, 0.55);
}

.bo-btn:focus-visible,
.bo-close:focus-visible,
.bo-seg-btn:focus-visible,
.bo-canvas:focus-visible {
  outline: 3px solid rgba(63, 168, 196, 0.55);
  outline-offset: 3px;
}

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

.bo-icon-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 19px;
}

.bo-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bo-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #10263f;
  border-radius: 14px;
  background: #0b1730;
  box-shadow: 0 18px 46px rgba(8, 17, 31, 0.34);
  touch-action: none;
  user-select: none;
}

.bo-canvas {
  display: block;
  width: 100%;
  height: min(66vh, 560px);
  min-height: 400px;
  cursor: pointer;
}

.bo-start,
.bo-result {
  position: absolute;
  left: 50%;
  display: grid;
  gap: 6px;
  width: min(86%, 320px);
  padding: 16px;
  border: 1px solid rgba(140, 200, 230, 0.28);
  border-radius: 14px;
  background: rgba(9, 21, 38, 0.88);
  color: #eaf6fb;
  text-align: center;
  box-shadow: 0 22px 60px rgba(4, 10, 20, 0.55);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.bo-start {
  bottom: 16%;
  pointer-events: none;
}

.bo-start strong,
.bo-result strong {
  font-size: 22px;
  line-height: 1.15;
}

.bo-start span,
.bo-result span,
.bo-result p {
  margin: 0;
  color: #9fc9dd;
  font-size: 13.5px;
  line-height: 1.35;
}

.bo-result {
  top: 50%;
  transform: translate(-50%, -50%);
}

.bo-result strong {
  font-size: 28px;
}

.bo-result-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.bo-result-row .bo-btn {
  flex: 1 1 0;
  border-color: rgba(140, 200, 230, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #eaf6fb;
  box-shadow: none;
}

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

.bo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.bo-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.bo-seg-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--cg-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.bo-seg-btn:hover {
  background: rgba(18, 122, 137, 0.1);
  color: var(--cg-ink);
}

.bo-seg-btn[aria-pressed='true'] {
  background: var(--cg-teal);
  color: #fff;
  box-shadow: 0 6px 14px rgba(18, 122, 137, 0.28);
}

.bo-legend {
  margin: 10px 0 0;
  color: var(--cg-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.bo-shell[data-state='over'] .bo-canvas,
.bo-shell[data-state='won'] .bo-canvas {
  filter: saturate(0.72) brightness(0.86);
}

.bo-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11, 23, 48, 0.45);
}

.bo-modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 14px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  box-shadow: 0 26px 76px rgba(11, 23, 48, 0.32);
}

.bo-modal-card h2 {
  margin: 0 48px 12px 0;
  font-size: 23px;
  line-height: 1.1;
}

.bo-modal-card p {
  margin: 9px 0 0;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.bo-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.bo-is-hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .bo-shell {
    padding: 0 8px 18px;
  }

  .bo-topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .bo-statline {
    justify-content: space-between;
    gap: 6px;
  }

  .bo-stat {
    min-width: 0;
    flex: 1 1 0;
    padding: 6px 4px;
  }

  .bo-stat strong {
    font-size: 17px;
  }

  .bo-actions {
    justify-content: center;
  }

  .bo-canvas {
    height: min(62vh, 540px);
    min-height: 380px;
  }

  .bo-controls {
    justify-content: center;
    gap: 8px;
  }

  .bo-seg {
    flex: 1 1 auto;
    justify-content: center;
  }

  .bo-seg-btn {
    flex: 1 1 auto;
    padding: 0 10px;
    font-size: 13px;
  }

  .bo-legend {
    font-size: 12.5px;
  }
}
