.pb-shell {
  --pb-night: #0b141c;
  --pb-deck: #16242f;
  --pb-rail: #8ea8b8;
  --pb-cyan: #3fe0d0;
  --pb-ember: #ff7a3c;
  --pb-gold: #ffcf5c;
  --pb-violet: #9b7bf0;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 14px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.pb-topbar,
.pb-statline,
.pb-actions,
.pb-below,
.pb-result-actions {
  display: flex;
  align-items: center;
}

.pb-topbar {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pb-statline,
.pb-actions {
  gap: 6px;
}

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

.pb-stat span {
  display: block;
  color: var(--cg-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pb-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pb-btn,
.pb-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: #fff;
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

.pb-btn:disabled,
.pb-seg-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.pb-icon {
  padding: 0;
  font-size: 19px;
}

.pb-primary {
  border-color: transparent;
  background: var(--pb-cyan);
  color: #06222a;
}

.pb-stage {
  position: relative;
  width: min(100%, 43vh, 424px);
  margin: 0 auto;
  border: 1px solid #22323f;
  border-radius: 16px;
  background: var(--pb-night);
  box-shadow: var(--cg-shadow), 0 0 0 5px rgba(14, 24, 32, 0.06);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pb-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 380 / 640;
}

.pb-pads {
  display: none;
}

.pb-pad {
  position: absolute;
  bottom: 10px;
  width: 84px;
  height: 84px;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(63, 224, 208, 0.55);
  border-radius: 22px;
  background: rgba(10, 22, 30, 0.5);
  color: transparent;
  cursor: pointer;
  touch-action: none;
}

.pb-pad:active {
  background: rgba(63, 224, 208, 0.3);
}

.pb-pad-left { left: 10px; }
.pb-pad-right { right: 10px; }

.pb-overlay {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 9px;
  width: min(84%, 330px);
  padding: 20px;
  border: 1px solid rgba(63, 224, 208, 0.4);
  border-radius: 16px;
  background: rgba(9, 18, 25, 0.93);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: translate(-50%, -50%);
}

.pb-overlay strong {
  color: #fff;
  font-size: 25px;
  line-height: 1.1;
}

.pb-overlay span,
.pb-overlay p {
  margin: 0;
  color: #9fb4c0;
  font-size: 13px;
  line-height: 1.45;
}

.pb-result-actions {
  justify-content: center;
  gap: 8px;
}

.pb-below {
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pb-plunge {
  position: relative;
  flex: 1 1 190px;
  min-width: 160px;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: #fff;
  color: var(--cg-ink);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  touch-action: none;
}

.pb-plunge.pb-armed {
  border-color: var(--cg-amber);
}

.pb-plunge-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(90deg, #ffd98a, var(--cg-amber));
  transition: width 60ms linear;
}

.pb-plunge-text {
  position: relative;
  display: block;
  padding: 12px 8px;
}

.pb-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.pb-seg-btn {
  min-width: 74px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cg-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.pb-seg-btn[aria-pressed="true"] {
  background: var(--cg-teal);
  color: #fff;
}

.pb-note {
  margin: 10px 2px 0;
  color: var(--cg-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.pb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.pb-modal-card {
  position: relative;
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(30, 37, 40, 0.28);
}

.pb-modal-card h2 {
  margin: 0 48px 12px 0;
}

.pb-modal-card p {
  color: var(--cg-muted);
  line-height: 1.5;
}

.pb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
}

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

@media (pointer: coarse) {
  .pb-pads {
    display: block;
  }
}

@media (max-width: 620px) {
  .pb-shell {
    padding: 0 6px 14px;
  }

  .pb-topbar {
    gap: 5px;
    margin-bottom: 8px;
  }

  .pb-statline {
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
  }

  .pb-actions {
    flex: 0 0 auto;
    gap: 3px;
  }

  .pb-actions .pb-btn {
    min-width: 44px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .pb-stat {
    min-width: 0;
    flex: 1 1 0;
    padding: 5px 2px;
    border-radius: 8px;
  }

  .pb-stat span {
    font-size: 8px;
  }

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

  .pb-stage {
    width: min(100%, 43vh, 424px);
    border-radius: 13px;
  }

  .pb-below {
    gap: 6px;
    margin-top: 9px;
  }

  .pb-plunge {
    min-height: 46px;
  }

  .pb-seg-btn {
    min-width: 62px;
    font-size: 12px;
  }

  .pb-overlay {
    width: min(88%, 320px);
    gap: 8px;
    padding: 16px;
  }

  .pb-overlay strong {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb-plunge-fill {
    transition-duration: 1ms;
  }
}

.cg-shell-game .cg-stage-main #game-root > .pb-shell {
  max-width: min(100%, 500px) !important;
}
