/* Radiant Neverlose - uses the Radiant theme tokens, with fallbacks for any theme */
.rnl {
  --nl-bg: var(--bg-1, #0a0c0a);
  --nl-surface: var(--surface, #111511);
  --nl-line: var(--line, rgba(214, 255, 222, 0.075));
  --nl-line-2: var(--line-2, rgba(214, 255, 222, 0.14));
  --nl-text: var(--text, #e8ede6);
  --nl-muted: var(--muted, #98a395);
  --nl-dim: var(--dim, #646e61);
  --nl-acid: var(--acid, #39ff88);
  --nl-ink: var(--acid-ink, #031208);
  --nl-gold: var(--gold, #f2b33d);
  --nl-warn: var(--warn, #ffb020);
  --nl-down: var(--down, #ff5252);
  --nl-mono: var(--mono, "JetBrains Mono", ui-monospace, monospace);
  --nl-display: var(--display, "Space Grotesk", system-ui, sans-serif);
  --nl-r: var(--r, 6px);
  --nl-r-lg: var(--r-lg, 10px);
  color: var(--nl-text);
}
.rnl a { color: var(--nl-acid); }
.rnl-kicker { margin: 0; font: 500 11px/1.4 var(--nl-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--nl-muted); }
.rnl-kicker::before { content: "// "; color: var(--nl-acid); }
.rnl-acid { color: var(--nl-acid); }

/* hero */
.rnl-hero { display: flex; gap: 20px; align-items: center; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--nl-line); }
.rnl-hero__mark {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(57, 255, 136, 0.35), transparent 60%), #050605;
  border: 1px solid rgba(57, 255, 136, 0.35); box-shadow: 0 0 30px rgba(57, 255, 136, 0.15), inset 0 0 20px rgba(57, 255, 136, 0.08);
}
.rnl-hero__mark span { font: 700 22px/1 var(--nl-display); letter-spacing: -0.04em; color: var(--nl-acid); text-shadow: 0 0 14px rgba(57, 255, 136, 0.6); }
.rnl-hero h1 { margin: 8px 0 6px; font: 600 clamp(1.6rem, 3vw, 2.2rem)/1.1 var(--nl-display); letter-spacing: -0.02em; }
.rnl-hero h1 em { font-style: normal; color: var(--nl-acid); }
.rnl-lead { margin: 0; max-width: 40rem; color: var(--nl-muted); font-size: 14px; }

.rnl-admin { margin: 0 0 18px; padding: 12px 14px; border: 1px dashed rgba(242, 179, 61, 0.5); border-radius: var(--nl-r); background: rgba(242, 179, 61, 0.06); font-size: 13px; color: var(--nl-gold); }
.rnl-admin code { font-family: var(--nl-mono); font-size: 12px; color: var(--nl-text); }
.rnl-admin a { color: var(--nl-gold); text-decoration: underline; }

/* steps */
.rnl-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.rnl-steps li { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--nl-line); border-radius: var(--nl-r-lg); background: var(--nl-bg); font-size: 12.5px; color: var(--nl-muted); }
.rnl-steps b { font: 700 12px/1.4 var(--nl-mono); color: var(--nl-acid); }
.rnl-steps strong { display: block; color: var(--nl-text); font: 600 13.5px/1.3 var(--nl-display); margin-bottom: 2px; }

/* cards */
.rnl-cards { display: grid; gap: 12px; }
.rnl-card {
  position: relative; padding: 20px; border: 1px solid rgba(57, 255, 136, 0.25); border-radius: var(--nl-r-lg); overflow: hidden;
  background: radial-gradient(500px 220px at 100% 0%, rgba(57, 255, 136, 0.08), transparent 60%), linear-gradient(180deg, var(--nl-surface), var(--nl-bg));
}
.rnl-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--nl-acid), transparent 70%); }
.rnl-card.is-redeemed { border-color: var(--nl-line); }
.rnl-card.is-redeemed::before { background: var(--nl-line-2); }
.rnl-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.rnl-card__meta { margin: 0 0 4px; font: 500 11px/1 var(--nl-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--nl-dim); }
.rnl-card h2 { margin: 0; font: 600 20px/1.2 var(--nl-display); }
.rnl-card__plan { text-align: right; flex: 0 0 auto; }
.rnl-card__plan strong { display: block; font: 700 22px/1 var(--nl-display); color: var(--nl-acid); }
.rnl-card__plan span { display: block; margin-top: 6px; font: 500 11px/1 var(--nl-mono); color: var(--nl-muted); }

.rnl-label { display: block; margin: 0 0 8px; font: 600 11px/1 var(--nl-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nl-muted); }
.rnl-field {
  position: relative; display: flex; align-items: center; height: 56px; padding: 0 14px;
  border: 1px solid var(--nl-line-2); border-radius: var(--nl-r); background: #030403;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.rnl-field:focus-within { border-color: var(--nl-acid); box-shadow: 0 0 0 4px rgba(57, 255, 136, 0.12), 0 0 24px rgba(57, 255, 136, 0.12); }
.rnl-field__pre { font: 500 14px/1 var(--nl-mono); color: var(--nl-dim); white-space: nowrap; user-select: none; }
.rnl-field input {
  flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 0 0 2px; border: 0 !important; outline: 0; background: transparent !important;
  box-shadow: none !important; color: var(--nl-text) !important; font: 600 17px/1 var(--nl-mono); letter-spacing: 0.01em; min-height: 0 !important;
}
.rnl-field input::placeholder { color: var(--nl-dim); font-weight: 400; }
.rnl-field__state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font: 600 10px/1 var(--nl-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nl-dim); }
.rnl-field__state:not(:empty)::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.rnl-field[data-state="checking"] .rnl-field__state, .rnl-field[data-state="typing"] .rnl-field__state { color: var(--nl-muted); }
.rnl-field[data-state="checking"] .rnl-field__state::before { animation: rnl-blink 0.8s infinite; }
.rnl-field[data-state="ok"] { border-color: rgba(57, 255, 136, 0.6); }
.rnl-field[data-state="ok"] .rnl-field__state { color: var(--nl-acid); }
.rnl-field[data-state="ok"] .rnl-field__state::before { box-shadow: 0 0 10px var(--nl-acid); }
.rnl-field[data-state="no"], .rnl-field[data-state="bad"] { border-color: rgba(255, 82, 82, 0.55); }
.rnl-field[data-state="no"] .rnl-field__state, .rnl-field[data-state="bad"] .rnl-field__state { color: var(--nl-down); }
.rnl-field.is-shake { animation: rnl-shake 0.36s; }
.rnl-help { margin: 8px 0 16px; font-size: 13px; color: var(--nl-muted); min-height: 1.4em; }
.rnl-help[data-tone="ok"] { color: var(--nl-acid); }
.rnl-help[data-tone="no"], .rnl-help[data-tone="bad"] { color: var(--nl-down); }
.rnl-warn { margin: 0; padding: 12px 14px; border-left: 2px solid var(--nl-warn); background: rgba(20, 13, 2, 0.6); font-size: 14px; color: var(--nl-muted); }

.rnl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--nl-acid); border-radius: var(--nl-r); background: var(--nl-acid); color: var(--nl-ink) !important;
  font: 700 15px/1 var(--nl-display); cursor: pointer; text-decoration: none !important;
  transition: box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.rnl-btn:hover { box-shadow: 0 0 0 4px rgba(57, 255, 136, 0.12), 0 12px 34px rgba(57, 255, 136, 0.28); transform: translateY(-1px); }
.rnl-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.rnl-btn--ghost { background: rgba(255, 255, 255, 0.02); border-color: var(--nl-line-2); color: var(--nl-text) !important; }
.rnl-btn--ghost:hover { border-color: var(--nl-acid); color: var(--nl-acid) !important; box-shadow: none; }
.rnl-form .rnl-btn { width: 100%; }
.rnl-redeemed { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--nl-muted); }
.rnl-redeemed span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(57, 255, 136, 0.15); color: var(--nl-acid); }
.rnl-redeemed code, .rnl-history code { font: 600 13px/1 var(--nl-mono); color: var(--nl-acid); }

.rnl-empty { padding: 22px; border: 1px dashed var(--nl-line-2); border-radius: var(--nl-r-lg); background: var(--nl-bg); }
.rnl-empty strong { display: block; font: 600 16px/1.3 var(--nl-display); }
.rnl-empty p { margin: 6px 0 14px; color: var(--nl-muted); font-size: 14px; }

.rnl-history { margin-top: 28px; }
.rnl-history h2 { margin: 0 0 12px; font: 600 1.15rem/1.2 var(--nl-display); }
.rnl-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rnl-history li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--nl-line); border-radius: var(--nl-r-lg); background: var(--nl-bg); font-size: 14px; }
.rnl-history__ok { color: var(--nl-acid); font-weight: 700; }
.rnl-history__when { font: 500 11px/1 var(--nl-mono); color: var(--nl-dim); white-space: nowrap; }

.rnl-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 24px 0; padding: 18px 20px; border: 1px solid rgba(57, 255, 136, 0.35); border-left: 2px solid var(--acid, #39ff88); border-radius: var(--r, 6px); background: rgba(3, 18, 8, 0.6); }
.rnl-callout strong { font: 600 16px/1.3 var(--display, sans-serif); }
.rnl-callout p { margin: 4px 0 0; color: var(--muted, #98a395); font-size: 14px; }
.rnl-callout .rnl-btn { --nl-acid: var(--acid, #39ff88); --nl-ink: var(--acid-ink, #031208); --nl-r: var(--r, 6px); --nl-display: var(--display, sans-serif); }

/* dialog */
html.rnl-lock { overflow: hidden; }
.rnl-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.rnl-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.18s ease; }
.rnl-modal__box {
  position: relative; width: min(30rem, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px;
  border: 1px solid rgba(57, 255, 136, 0.3); border-radius: 14px; text-align: center;
  background: radial-gradient(420px 220px at 50% 0%, rgba(57, 255, 136, 0.1), transparent 70%), #0a0c0a;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.02);
  transform: translateY(10px) scale(0.98); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
}
.rnl-modal.is-open .rnl-modal__backdrop { opacity: 1; }
.rnl-modal.is-open .rnl-modal__box { transform: none; opacity: 1; }
.rnl-modal h3 { margin: 10px 0 14px; font: 600 1.35rem/1.2 var(--nl-display); }
.rnl-modal__text { margin: 0 0 16px; color: var(--nl-muted); font-size: 14px; }
.rnl-modal__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.rnl-modal__acts .rnl-btn { flex: 1 1 140px; }
.rnl-confirm-name { margin: 0 0 14px; padding: 16px; border: 1px dashed rgba(57, 255, 136, 0.4); border-radius: var(--nl-r); background: #030403; font-family: var(--nl-mono); word-break: break-all; }
.rnl-confirm-name span { color: var(--nl-dim); font-size: 13px; }
.rnl-confirm-name strong { color: var(--nl-acid); font-size: 22px; text-shadow: 0 0 18px rgba(57, 255, 136, 0.35); }
.rnl-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--nl-line-2); border-radius: var(--nl-r); background: var(--nl-bg); text-align: left; font-size: 13.5px; color: var(--nl-text); cursor: pointer; }
.rnl-check input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--nl-acid); flex: 0 0 auto; }

.rnl-spinner { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.rnl-spinner i { width: 12px; height: 12px; border-radius: 3px; background: var(--nl-acid); box-shadow: 0 0 12px var(--nl-acid); animation: rnl-bounce 0.9s infinite ease-in-out; }
.rnl-spinner i:nth-child(2) { animation-delay: 0.12s; }
.rnl-spinner i:nth-child(3) { animation-delay: 0.24s; }

.rnl-burst { position: relative; width: 84px; height: 84px; margin: 4px auto 6px; }
.rnl-burst svg { width: 84px; height: 84px; fill: none; stroke: var(--nl-acid); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 12px rgba(57, 255, 136, 0.6)); }
.rnl-burst circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: rnl-draw 0.6s ease forwards; }
.rnl-burst path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: rnl-draw 0.4s 0.5s ease forwards; }
.rnl-spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 2px; animation: rnl-spark 0.9s ease-out forwards; }
.rnl-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.rnl-next li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--nl-line); border-radius: var(--nl-r); background: var(--nl-bg); font-size: 13.5px; color: var(--nl-muted); }
.rnl-next b { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: rgba(57, 255, 136, 0.15); color: var(--nl-acid); font: 700 11px/1 var(--nl-mono); }
.rnl-next strong { color: var(--nl-acid); font-family: var(--nl-mono); }
.rnl-err { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto; border-radius: 50%; border: 2px solid var(--nl-down); color: var(--nl-down); font: 700 30px/1 var(--nl-display); box-shadow: 0 0 20px rgba(255, 82, 82, 0.3); }

@keyframes rnl-draw { to { stroke-dashoffset: 0; } }
@keyframes rnl-spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(0.4); opacity: 0; } }
@keyframes rnl-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes rnl-blink { 50% { opacity: 0.2; } }
@keyframes rnl-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (min-width: 760px) {
  .rnl-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rnl-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .rnl-form .rnl-label, .rnl-form .rnl-help { grid-column: 1 / -1; }
  .rnl-form .rnl-help { order: 3; margin-bottom: 0; }
  .rnl-form .rnl-field { grid-column: 1; }
  .rnl-form .rnl-btn { grid-column: 2; grid-row: 2; width: auto; min-height: 56px; }
}
@media (max-width: 520px) {
  .rnl-hero { align-items: flex-start; }
  .rnl-hero__mark { width: 48px; height: 48px; border-radius: 10px; }
  .rnl-card__top { flex-direction: column; }
  .rnl-card__plan { text-align: left; }
  .rnl-field__pre { display: none; }
  .rnl-history li { grid-template-columns: auto minmax(0, 1fr); }
  .rnl-history__when { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .rnl *, .rnl *::before { animation: none !important; transition: none !important; }
  .rnl-burst circle, .rnl-burst path { stroke-dashoffset: 0; }
}

/* fixes */
.rnl-field input:focus, .rnl-field input:focus-visible { outline: none !important; box-shadow: none !important; }
.rnl-modal { z-index: 100000; }
body:has(.rnl-modal:not([hidden])) #rs-dock { display: none; }
.rnl-next li span { min-width: 0; }

/* key card */
.rnl-card--key { border-color: rgba(242, 179, 61, 0.3); background: radial-gradient(500px 220px at 100% 0%, rgba(242, 179, 61, 0.08), transparent 60%), linear-gradient(180deg, var(--nl-surface), var(--nl-bg)); }
.rnl-card--key::before { background: linear-gradient(90deg, var(--nl-gold), transparent 70%); }
.rnl-card--key .rnl-card__plan strong { color: var(--nl-gold); }
.rnl-field--key input { font: 600 17px/1 var(--nl-mono); letter-spacing: 0.08em; padding-left: 0; }
.rnl-field[data-state="typing"] .rnl-field__state { color: var(--nl-dim); }
@media (min-width: 760px) {
  .rnl-form--key { display: block; }
  .rnl-form--key .rnl-btn { width: 100%; margin-top: 4px; min-height: 52px; }
}

.rnl-kicker::before { content: ""; display: inline-block; vertical-align: middle; width: 18px; height: 2px; margin-right: 8px; border-radius: 2px; background: var(--nl-acid); box-shadow: 0 0 8px var(--nl-acid); }

/* username field without a prefix */
.rnl-field input { padding-left: 0; }
.rnl-confirm-name span { display: block; margin-bottom: 6px; font: 500 11px/1 var(--nl-mono); letter-spacing: 0.12em; text-transform: uppercase; }
