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

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

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

.bd-stat,
.bd-card {
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.bd-stat span,
.bd-card span {
  display: block;
  color: var(--cg-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.bd-stat strong,
.bd-card strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 19px;
  line-height: 1;
}

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

.bd-btn,
.bd-close,
.bd-pad {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  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;
}

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

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

.bd-btn:focus-visible,
.bd-close:focus-visible,
.bd-pad:focus-visible,
.bd-canvas:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.35);
  outline-offset: 3px;
}

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

.bd-icon-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

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

.bd-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.bd-boardwrap {
  position: relative;
  flex: 0 1 300px;
  min-width: 0;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--cg-panel);
  box-shadow: var(--cg-shadow);
  touch-action: manipulation;
}

.bd-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 2;
  cursor: pointer;
}

.bd-side {
  display: flex;
  flex: 0 0 118px;
  flex-direction: column;
  gap: 8px;
}

.bd-next-card canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-top: 4px;
}

.bd-veil {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(86%, 250px);
  padding: 18px 14px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--cg-ink);
  text-align: center;
  box-shadow: var(--cg-shadow);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
}

.bd-veil strong {
  font-size: 22px;
  line-height: 1.1;
}

.bd-veil span,
.bd-veil p {
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.35;
}

.bd-pads {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 430px;
  margin: 12px auto 0;
}

.bd-pad {
  min-height: 52px;
  font-size: 19px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.bd-pad-drop {
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-color: transparent;
  background: var(--cg-green);
  color: #fff;
}

.bd-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 37, 40, 0.32);
}

.bd-modal-card {
  position: relative;
  width: min(100%, 430px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  box-shadow: 0 24px 70px rgba(30, 37, 40, 0.22);
}

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

.bd-modal-card p {
  margin: 10px 0 0;
  color: var(--cg-muted);
  line-height: 1.45;
}

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

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

@media (max-width: 560px) {
  .bd-shell {
    padding: 0 10px 18px;
  }

  .bd-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .bd-statline,
  .bd-actions {
    justify-content: center;
  }

  .bd-stat {
    flex: 1 1 72px;
    text-align: center;
  }

  .bd-stage {
    gap: 8px;
  }

  .bd-boardwrap {
    flex: 1 1 auto;
    max-width: 258px;
  }

  .bd-side {
    flex: 0 0 100px;
  }

  .bd-stat strong,
  .bd-card strong {
    font-size: 16px;
  }

  .bd-card {
    min-width: 0;
    padding: 7px 9px;
  }

  .bd-pads {
    gap: 6px;
    max-width: none;
  }

  .bd-pad {
    min-height: 56px;
  }

  .bd-veil strong {
    font-size: 18px;
  }

  .bd-veil span,
  .bd-veil p {
    font-size: 12.5px;
  }
}
