/* ===============================
   SUPPORTER / RESET POPUP
   =============================== */
.supporter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overscroll-behavior: contain;
  padding: 18px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.supporter-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.supporter-popup {
  background: linear-gradient(145deg, #0f172a, #020617);
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 26px 22px;
  width: min(100%, 430px);
  max-width: 430px;
  color: #fff;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 80, 80, 0.25);
  animation: popupIn 0.25s ease-out;
  box-sizing: border-box;
  margin: auto;
}

.supporter-popup input:focus {
  outline: none;
  box-shadow: none;
}

.reset-popup {
  border-color: rgba(255, 120, 120, 0.5);
  box-shadow: 0 0 30px rgba(255, 90, 90, 0.20);
}

.reset-popup-box {
  margin: 14px 0 10px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 120, 120, 0.12);
}

.reset-popup-label {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #ffd3d3;
}

.reset-popup-list {
  margin: 0;
  padding-left: 18px;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.6;
}

.supporter-btn.danger {
  background: linear-gradient(180deg, #ff6b6b, #d62828);
  color: #fff;
}

@keyframes popupIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.supporter-popup h2 {
  margin: 0 0 10px;
}

.supporter-desc {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 14px;
  line-height: 1.5;
}

.supporter-popup input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  margin-bottom: 10px;
  font-size: 15px;
  text-align: center;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}

/* ===============================
   SUPPORTER PLAN SELECT
   =============================== */
.supporter-plan-box {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.supporter-plan-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.supporter-plan-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.supporter-plan-option + .supporter-plan-option {
  margin-top: 10px;
}

.supporter-plan-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 74, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.supporter-plan-option input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #ffd54a;
  cursor: pointer;
}

.supporter-plan-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.supporter-plan-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.supporter-plan-meta {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}

.supporter-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe27a, #ffbf3c);
  color: #3b2200;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.supporter-plan-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 213, 74, 0.88);
  line-height: 1.3;
}

.supporter-plan-price {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  color: #ffd54a;
  white-space: nowrap;
}

/* Piano 30 giorni evidenziato */
.supporter-plan-option--best {
  position: relative;
  border-color: rgba(255, 213, 74, 0.28);
  background: linear-gradient(
    180deg,
    rgba(255, 213, 74, 0.08),
    rgba(255, 179, 0, 0.04)
  );
  box-shadow: 0 0 14px rgba(255, 213, 74, 0.08);
}

.supporter-plan-option--best .supporter-plan-price {
  color: #ffe27a;
  font-size: 15px;
  text-shadow: 0 0 10px rgba(255, 213, 74, 0.18);
}

.supporter-plan-option:has(input[type="radio"]:checked) {
  border-color: rgba(255, 213, 74, 0.9);
  background: linear-gradient(
    180deg,
    rgba(255, 213, 74, 0.12),
    rgba(255, 179, 0, 0.08)
  );
  box-shadow: 0 0 0 1px rgba(255, 213, 74, 0.18);
}

.supporter-plan-option--best:has(input[type="radio"]:checked) {
  border-color: rgba(255, 213, 74, 1);
  background: linear-gradient(
    180deg,
    rgba(255, 213, 74, 0.20),
    rgba(255, 179, 0, 0.10)
  );
  box-shadow:
    0 0 0 1px rgba(255, 213, 74, 0.25),
    0 0 18px rgba(255, 213, 74, 0.18);
  transform: translateY(-1px);
}

.supporter-warning {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 16px;
  line-height: 1.5;
}

.supporter-actions {
  display: flex;
  gap: 10px;
}

.supporter-btn {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.18s ease, opacity 0.18s ease;
  box-sizing: border-box;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.supporter-btn:hover {
  transform: translateY(-1px);
}

.supporter-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.supporter-btn.cancel {
  background: #1e293b;
  color: #fff;
}

.supporter-btn.confirm {
  background: var(--primary);
  color: #000;
}

.supporter-error {
  color: #ff4d4f;
  background-color: #fff1f0;
  border: 1px solid #ffa39e;
  padding: 6px 10px;
  margin-top: 8px;
  font-size: 14px;
  border-radius: 6px;
  display: none;
  text-align: center;
  font-weight: 500;
}

.supporter-error:not(.hidden) {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.supporter-error:not(.hidden) {
  display: block;
  animation: shake 0.3s ease;
}

/* ===============================
   CHALLENGE POPUP
   =============================== */
.challenge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.challenge-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.challenge-popup {
  width: min(92vw, 430px);
  padding: 26px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 170, 0, 0.28);
  background: linear-gradient(180deg, rgba(10, 16, 30, 0.98), rgba(3, 7, 16, 0.98));
  box-shadow:
    0 0 28px rgba(255, 166, 0, 0.12),
    0 0 60px rgba(249, 115, 22, 0.08);
  color: #fff;
  text-align: center;
  animation: popupIn 0.22s ease-out;
}

.challenge-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 8px;
}

.challenge-title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 1.35rem;
}

.challenge-body {
  margin-bottom: 18px;
}

.challenge-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #dbe4f0;
}

.challenge-highlight {
  color: #ffd54a;
  font-weight: 700;
}

.challenge-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}

.challenge-meta-row {
  font-size: 14px;
  color: #e5e7eb;
}

.challenge-meta-row strong {
  color: #fff;
}

.challenge-actions {
  display: flex;
  gap: 10px;
}

.challenge-btn {
  flex: 1;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.challenge-btn:hover {
  transform: translateY(-1px);
}

.challenge-btn.confirm {
  background: linear-gradient(180deg, #ffd54a, #ffb300);
  color: #111827;
}

.challenge-btn.cancel {
  background: #1e293b;
  color: #fff;
}

.challenge-btn.hidden {
  display: none;
}

.challenge-popup.is-error {
  border-color: rgba(255, 120, 120, 0.30);
  box-shadow:
    0 0 28px rgba(255, 80, 80, 0.10),
    0 0 60px rgba(255, 80, 80, 0.06);
}

.challenge-popup.is-error .challenge-kicker {
  color: #fca5a5;
}

.challenge-popup.is-error .challenge-title {
  color: #fff;
}

@media (max-width: 600px) {
  .supporter-overlay {
    align-items: flex-start;
    justify-content: center;
    padding: 72px 10px 18px;
  }

  .supporter-popup {
    width: 100%;
    max-width: 100%;
    padding: 18px 14px 16px;
    border-radius: 16px;
    margin: 0;
  }

  .supporter-popup h2 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .supporter-desc {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .supporter-plan-box {
    padding: 12px;
    margin-bottom: 12px;
  }

  .supporter-plan-title {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .supporter-plan-option {
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .supporter-plan-content {
    gap: 2px;
  }

  .supporter-plan-name {
    font-size: 13px;
    line-height: 1.25;
  }

  .supporter-plan-meta {
    font-size: 11px;
    line-height: 1.35;
  }

  .supporter-plan-price {
    font-size: 12px;
  }

  .supporter-plan-option--best .supporter-plan-price {
    font-size: 13px;
  }

  .supporter-plan-badge {
    font-size: 9px;
    padding: 3px 7px;
  }

  .supporter-plan-note {
    font-size: 9px;
  }

  .supporter-popup input[type="text"] {
    font-size: 14px;
    padding: 11px 10px;
    margin-bottom: 10px;
  }

  .supporter-warning {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .supporter-actions {
    flex-direction: column;
    gap: 8px;
  }

  .supporter-btn {
    width: 100%;
    padding: 12px 10px;
    font-size: 14px;
    border-radius: 10px;
    white-space: normal;
  }

  .challenge-popup {
    padding: 22px 16px;
    width: min(94vw, 420px);
  }

  .challenge-title {
    font-size: 1.18rem;
  }

  .challenge-text,
  .challenge-meta-row {
    font-size: 13px;
  }

  .challenge-actions {
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .supporter-overlay {
    padding: 68px 8px 14px;
  }

  .supporter-popup {
    padding: 16px 12px 14px;
  }

  .supporter-popup h2 {
    font-size: 1.12rem;
  }

  .supporter-desc {
    font-size: 12px;
  }

  .supporter-plan-box {
    padding: 10px;
  }

  .supporter-plan-option {
    padding: 9px;
    gap: 8px;
  }

  .supporter-plan-name {
    font-size: 12px;
  }

  .supporter-plan-meta {
    font-size: 10px;
  }

  .supporter-plan-price {
    font-size: 11px;
  }

  .supporter-plan-option--best .supporter-plan-price {
    font-size: 12px;
  }

  .supporter-plan-note {
    font-size: 8.5px;
  }

  .supporter-popup input[type="text"] {
    font-size: 13px;
  }

  .supporter-warning {
    font-size: 10px;
  }

  .supporter-btn {
    font-size: 13px;
    padding: 11px 10px;
  }
}

/* ===============================
   SUPPORTER MESSAGE MODAL
   =============================== */

.supporter-message-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 8, 15, 0.88);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.supporter-message-popup {
  width: min(100%, 420px);
  padding: 26px 22px;
  border-radius: 18px;
  text-align: center;
  color: #fff;
  background: linear-gradient(145deg, #0f172a, #020617);
  border: 2px solid var(--primary);
  box-shadow: 0 0 34px rgba(255, 213, 74, 0.18);
  animation: popupIn 0.25s ease-out;
  box-sizing: border-box;
}

.supporter-message-overlay--error .supporter-message-popup {
  border-color: rgba(255, 120, 120, 0.55);
  box-shadow: 0 0 34px rgba(255, 80, 80, 0.18);
}

.supporter-message-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 30px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.supporter-message-popup h2 {
  margin: 0 0 10px;
  color: #ffd54a;
  font-size: 1.25rem;
}

.supporter-message-overlay--error .supporter-message-popup h2 {
  color: #fca5a5;
}

.supporter-message-popup p {
  margin: 0 0 18px;
  color: #dbe4f0;
  font-size: 14px;
  line-height: 1.6;
}

.supporter-message-confirm {
  width: 100%;
}

@media (max-width: 600px) {
  .supporter-message-popup {
    padding: 22px 16px;
    border-radius: 16px;
  }

  .supporter-message-popup h2 {
    font-size: 1.12rem;
  }

  .supporter-message-popup p {
    font-size: 12px;
  }
}