/* PWA how-to + release notes modals (reward-modal pattern) */
.bpo-xp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(14px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.bpo-xp-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bpo-xp-card {
  background: #0a0a0a;
  border: 2px solid #2a2a2a;
  border-radius: 16px;
  width: min(520px, 94vw);
  max-height: 88vh;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(230, 0, 0, 0.2);
  transform: scale(0.82) skewX(-2deg);
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bpo-xp-overlay.open .bpo-xp-card {
  transform: scale(1) skewX(-2deg);
}

.bpo-xp-overlay.release-mode .bpo-xp-card {
  border-color: #ffd700;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.15), 0 24px 60px rgba(0, 0, 0, 0.6);
}

.bpo-xp-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease 0.15s, transform 0.4s ease 0.15s;
}

.bpo-xp-overlay.open .bpo-xp-badge {
  opacity: 1;
  transform: translateY(0);
}

.bpo-xp-title {
  font-family: 'Insani', Impact, sans-serif;
  font-size: 1.65rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 1px;
}

.bpo-xp-subtitle {
  color: #8a96a3;
  font-size: 0.95rem;
  margin: 0 0 16px;
  line-height: 1.45;
}

.bpo-xp-steps {
  text-align: left;
  background: #111820;
  border: 1px solid #2a3545;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 14px;
  color: #cde;
  font-size: 0.92rem;
  line-height: 1.5;
}

.bpo-xp-steps ol {
  margin: 0;
  padding-left: 1.2em;
}

.bpo-xp-steps li {
  margin-bottom: 8px;
}

.bpo-xp-steps li:last-child {
  margin-bottom: 0;
}

.bpo-xp-hint {
  font-size: 0.8rem;
  color: #9aa8b8;
  margin: 0 0 16px;
  line-height: 1.4;
  font-style: italic;
}

.bpo-xp-release-body {
  text-align: left;
  background: #111820;
  border: 1px solid #2a3545;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 14px;
  color: #e8eef5;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 42vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.35s, transform 0.5s ease 0.35s;
}

.bpo-xp-overlay.open .bpo-xp-release-body {
  opacity: 1;
  transform: translateY(0);
}

.bpo-xp-release-body h3 {
  color: #ffd700;
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.bpo-xp-release-body p {
  margin: 0 0 10px;
}

.bpo-xp-release-body ul {
  margin: 0 0 10px;
  padding-left: 1.2em;
}

.bpo-xp-btn {
  background: #e00;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s;
  align-self: center;
}

.bpo-xp-overlay.open .bpo-xp-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.bpo-xp-btn:hover {
  background: #ff1a1a;
}

.bpo-xp-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 16px;
}

.bpo-xp-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd700;
  opacity: 0;
  animation: bpoXpSpark 1.2s ease-out forwards;
}

@keyframes bpoXpSpark {
  0% {
    opacity: 1;
    transform: scale(0) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.4) translateY(-40px);
  }
}

.bpo-xp-card-inner {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .bpo-xp-title {
    font-size: 1.35rem;
  }
  .bpo-xp-card {
    padding: 22px 16px 16px;
  }
}

/* Debug CLI replay buttons — sibling row, don't crush close X */
.bpo-debug-replay-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px 6px;
  max-width: 100%;
  box-sizing: border-box;
}

.bpo-debug-replay-bar button {
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  background: #e00;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 700;
}

#debugcli .debug-close,
#debugcli a[title="Close"] {
  flex-shrink: 0;
}

/* PWA in-place update banner */
.bpo-update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1a1505 0%, #2a1010 100%);
  border: 2px solid #ffd700;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.bpo-update-banner__text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.bpo-update-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.bpo-update-banner__btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 0.85rem;
}

.bpo-update-banner__btn--apply {
  background: #ffd700;
  color: #1a1505;
}

.bpo-update-banner__btn--dismiss {
  background: transparent;
  color: #ccc;
  border: 1px solid #555;
}
