#paywall {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(ellipse at center, rgba(0,255,0,0.85) 0%, rgba(0,200,0,0.98) 100%),
    #00ff00;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}
.paywalled #paywall { display: flex; }
.paywalled #stage,
.paywalled #toolbar,
.paywalled #edgeControls,
.paywalled #hud { display: none !important; }

.pw-card {
  background: #fdfaf0;
  border: 2.5px solid #1a1a1a;
  border-radius: 24px;
  padding: 40px 36px 32px;
  box-shadow: 8px 8px 0 #1a1a1a;
  text-align: center;
  max-width: 440px;
  width: 100%;
  transform: rotate(-1deg);
}
.pw-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  background: #00ff00;
  border: 3px solid #1a1a1a;
  border-radius: 12px;
  box-shadow: 4px 4px 0 #1a1a1a;
  transform: rotate(-4deg);
}
.pw-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}
.pw-price {
  font-size: 92px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 8px 0 4px;
  color: #1a1a1a;
}
.pw-line {
  font-size: 16px;
  color: rgba(26,26,26,0.65);
  margin: 0 0 26px;
  font-style: italic;
}
.pw-btn {
  display: inline-block;
  background: #00ff00;
  color: #1a1a1a;
  border: 2.5px solid #1a1a1a;
  border-radius: 999px;
  padding: 15px 36px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.pw-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #1a1a1a;
}
.pw-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a1a1a;
}
.pw-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.pw-err {
  color: #c33;
  font-size: 13px;
  margin: 14px 0 0;
  min-height: 18px;
  line-height: 1.4;
}
.pw-note {
  font-size: 14px;
  color: #1a1a1a;
  margin: 22px 0 6px;
  font-style: italic;
}
.pw-heart {
  display: inline-block;
  animation: pwHeart 1.6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes pwHeart {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}
.pw-back {
  display: inline-block;
  color: rgba(26,26,26,0.55);
  text-decoration: none;
  font-size: 13px;
  margin-top: 4px;
}
.pw-back:hover { color: #1a1a1a; }

/* Restore link + form on the paywall */
.pw-restore-line {
  font-size: 14px;
  color: rgba(26,26,26,0.7);
  margin: 18px 0 6px;
}
.pw-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #00aa00;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.pw-link:hover { color: #008800; }

.pw-restore-form {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}
.pw-restore-form[hidden] { display: none; }
.pw-restore-form input {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}
.pw-restore-form input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,255,0,0.45);
}
.pw-btn-small {
  padding: 10px 16px;
  font-size: 14px;
}

.pw-lost-line {
  font-size: 13px;
  color: rgba(26,26,26,0.6);
  margin: 4px 0 12px;
}
.pw-success {
  background: rgba(0,255,0,0.18);
  border: 2px dashed rgba(0,170,0,0.5);
  border-radius: 10px;
  padding: 12px;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 8px;
}

/* Welcome / save-your-license modal */
#pwWelcome {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}
.pw-welcome {
  max-width: 460px;
}
.pw-welcome .pw-mark { transform: rotate(6deg); }
.pw-kicker {
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #00aa00;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.pw-key {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  background: rgba(0,255,0,0.18);
  border: 2px dashed rgba(26,26,26,0.4);
  border-radius: 12px;
  padding: 14px 12px;
  margin: 16px 0 14px;
  letter-spacing: 0.04em;
  word-break: break-all;
  user-select: all;
}
.pw-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.pw-btn-secondary {
  background: #fdfaf0;
}
.pw-got-it {
  margin-top: 4px;
}
.pw-tip {
  font-size: 12.5px;
  color: rgba(26,26,26,0.55);
  margin: 16px 0 0;
  line-height: 1.4;
}
