/**
 * Character Sheet studio — Neurollamas brand UI (matches landing / promo).
 */

.nl-cs-page {
  --cs-accent: #00ff9d;
  --cs-accent-glow: rgba(0, 255, 157, 0.35);
  --cs-purple: #b026ff;
  --cs-purple-bright: #e14bff;
  --cs-purple-glow: rgba(176, 38, 255, 0.55);
  --cs-ink: #f4f7f5;
  --cs-muted: rgba(244, 247, 245, 0.68);
  --cs-panel: rgba(8, 10, 12, 0.88);
  --cs-border: rgba(176, 38, 255, 0.28);
  --cs-radius: 20px;
  min-height: 100vh;
  margin: 0;
  padding-top: var(--nav-height, 78px);
  font-family: 'Poppins', 'Vazirmatn', system-ui, sans-serif;
  color: var(--cs-ink);
  background: #060708;
  overflow-x: hidden;
}

.nl-cs-page * {
  box-sizing: border-box;
}

.nl-cs-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 55% at 15% 0%, rgba(176, 38, 255, 0.24), transparent 58%),
    radial-gradient(ellipse 55% 45% at 92% 12%, rgba(0, 255, 157, 0.1), transparent 52%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(127, 92, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #0a0b0e 0%, #060708 100%);
}

.nl-cs-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) 0 clamp(3rem, 6vw, 4.5rem);
}

/* ── Hero ── */
.nl-cs-hero-card {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: var(--cs-panel);
  box-shadow:
    0 0 0 1px rgba(127, 92, 255, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.nl-cs-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cs-accent);
  text-shadow: 0 0 14px var(--cs-accent-glow);
}

.nl-cs-hero-badge img {
  width: 34px;
  height: auto;
  filter: drop-shadow(0 0 10px var(--cs-accent-glow));
}

.nl-cs-hero-card h1 {
  margin: 0 0 0.75rem;
  max-width: 18ch;
  font-size: clamp(1.65rem, 4.2vw, 2.65rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.nl-cs-lead {
  margin: 0 0 1.15rem;
  max-width: 52ch;
  font-size: clamp(0.92rem, 2.2vw, 1.02rem);
  line-height: 1.6;
  color: var(--cs-muted);
}

.nl-cs-plan-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.nl-cs-credit-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(244, 247, 245, 0.88);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Buttons ── */
.nl-cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.nl-cs-btn-buy {
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, #ff5cff 0%, #d24bff 38%, #b026ff 72%, #7f5cff 100%);
  box-shadow:
    0 0 20px rgba(210, 75, 255, 0.75),
    0 0 44px rgba(176, 38, 255, 0.45);
}

.nl-cs-btn-generate {
  width: 100%;
  min-height: 54px;
  margin-top: 0.35rem;
  padding: 0.9rem 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, #ff5cff 0%, #e14bff 28%, #b026ff 68%, #7f5cff 100%);
  box-shadow:
    0 0 28px rgba(255, 92, 255, 0.65),
    0 0 56px rgba(176, 38, 255, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.nl-cs-btn-download {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.2rem;
  color: #06100c !important;
  background: linear-gradient(135deg, #00ff9d 0%, #39ff14 100%);
  box-shadow: 0 0 22px rgba(0, 255, 157, 0.4);
}

.nl-cs-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.nl-cs-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

/* ── Workspace ── */
.nl-cs-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(0.85rem, 2.5vw, 1.25rem);
  align-items: stretch;
}

.nl-cs-panel {
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: var(--cs-panel);
  padding: clamp(1rem, 2.8vw, 1.35rem);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.nl-cs-panel-head {
  margin-bottom: 1rem;
}

.nl-cs-panel-kicker {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cs-purple-bright);
  text-shadow: 0 0 12px var(--cs-purple-glow);
}

.nl-cs-panel-head h2 {
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: #fff;
}

/* ── Form ── */
.nl-cs-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.nl-cs-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 247, 245, 0.72);
}

.nl-cs-field textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  line-height: 1.5;
}

.nl-cs-field textarea::placeholder {
  color: rgba(244, 247, 245, 0.38);
}

.nl-cs-field textarea:focus {
  outline: none;
  border-color: rgba(210, 75, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(176, 38, 255, 0.18);
}

.nl-cs-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding: 1.15rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(210, 75, 255, 0.45);
  background: rgba(176, 38, 255, 0.06);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nl-cs-dropzone:hover,
.nl-cs-dropzone:focus-within {
  border-color: rgba(255, 92, 255, 0.85);
  background: rgba(176, 38, 255, 0.12);
}

.nl-cs-drop-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 300;
  color: #fff;
  background: linear-gradient(135deg, #d24bff, #7f5cff);
  box-shadow: 0 0 18px var(--cs-purple-glow);
}

.nl-cs-drop-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.nl-cs-drop-hint {
  font-size: 0.82rem;
  color: var(--cs-muted);
  word-break: break-word;
}

.nl-cs-preview {
  position: relative;
  margin-bottom: 0.85rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nl-cs-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.nl-cs-preview-clear {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.nl-cs-status {
  min-height: 1.3rem;
  margin: 0.75rem 0 0;
  font-size: 0.86rem;
  color: rgba(244, 247, 245, 0.72);
  text-align: center;
}

/* ── Result ── */
.nl-cs-panel-result {
  display: flex;
  flex-direction: column;
}

.nl-cs-result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.nl-cs-result-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.nl-cs-result-placeholder {
  width: min(100%, 220px);
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(176, 38, 255, 0.08), rgba(0, 255, 157, 0.05)),
    rgba(0, 0, 0, 0.35);
}

.nl-cs-result-empty p {
  margin: 0;
  max-width: 26ch;
  font-size: 0.9rem;
  color: rgba(244, 247, 245, 0.45);
}

.nl-cs-result-ready {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.nl-cs-result-frame {
  flex: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  min-height: 200px;
}

.nl-cs-result-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(52vh, 520px);
  object-fit: contain;
  background: #050607;
}

.nl-cs-footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(244, 247, 245, 0.38);
}

/* ── Mobile ── */
@media (max-width: 860px) {
  .nl-cs-workspace {
    grid-template-columns: 1fr;
  }

  .nl-cs-hero-card h1 {
    max-width: none;
  }

  .nl-cs-lead {
    max-width: none;
  }

  .nl-cs-plan-row {
    flex-direction: column;
    align-items: stretch;
  }

  .nl-cs-credit-pill,
  .nl-cs-btn-buy {
    width: 100%;
    justify-content: center;
  }

  .nl-cs-result-frame img {
    max-height: min(45vh, 420px);
  }
}

@media (max-width: 480px) {
  .nl-cs-shell {
    width: calc(100% - 1rem);
  }

  .nl-cs-hero-card,
  .nl-cs-panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .nl-cs-field textarea {
    min-height: 112px;
  }
}

/* ── Light theme (site toggle) ── */
html[data-theme="light"] .nl-cs-page {
  background: #f4f7f5;
  color: #102018;
}

html[data-theme="light"] .nl-cs-bg {
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(176, 38, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(0, 255, 157, 0.08), transparent 50%),
    linear-gradient(180deg, #eef2ef 0%, #f4f7f5 100%);
}

html[data-theme="light"] .nl-cs-hero-card,
html[data-theme="light"] .nl-cs-panel {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(176, 38, 255, 0.22);
  box-shadow: 0 12px 40px rgba(16, 32, 24, 0.08);
}

html[data-theme="light"] .nl-cs-hero-card h1,
html[data-theme="light"] .nl-cs-panel-head h2 {
  color: #102018;
}

html[data-theme="light"] .nl-cs-lead,
html[data-theme="light"] .nl-cs-drop-hint,
html[data-theme="light"] .nl-cs-status {
  color: rgba(16, 32, 24, 0.68);
}

html[data-theme="light"] .nl-cs-field textarea {
  background: #fff;
  color: #102018;
  border-color: rgba(16, 32, 24, 0.12);
}

html[data-theme="light"] .nl-cs-credit-pill {
  color: rgba(16, 32, 24, 0.78);
  background: rgba(16, 32, 24, 0.04);
  border-color: rgba(16, 32, 24, 0.1);
}

html[data-theme="light"] .nl-cs-footer {
  color: rgba(16, 32, 24, 0.45);
}

/* RTL */
html[dir="rtl"] .nl-cs-preview-clear {
  right: auto;
  left: 0.55rem;
}

.nl-cs-rial-overlay {
  position: fixed;
  inset: 0;
  z-index: 16000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.nl-cs-rial-overlay[hidden] {
  display: none !important;
}

.nl-cs-rial-card {
  position: relative;
  width: min(460px, 100%);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  padding: 1.5rem 1.35rem 1.4rem;
  border-radius: 20px;
  background: rgba(8, 10, 12, 0.96);
  border: 1px solid rgba(176, 38, 255, 0.4);
  box-shadow: 0 0 40px rgba(176, 38, 255, 0.28);
  color: #f4f7f5;
  font-family: 'Vazirmatn', 'Poppins', sans-serif;
}

.nl-cs-rial-close {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
}

.nl-cs-rial-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.nl-cs-rial-lead,
.nl-cs-rial-hint,
.nl-cs-rial-status {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(244, 247, 245, 0.72);
}

.nl-cs-rial-wallet {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.8rem;
  margin: 0.35rem 0 0.55rem;
  border-radius: 10px;
  background: #050607;
  border: 1px solid rgba(0, 255, 157, 0.25);
  word-break: break-all;
}

.nl-cs-btn-copy {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  margin-bottom: 0.75rem;
  color: #06100c;
  background: #00ff9d;
}

.nl-cs-rial-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.nl-cs-rial-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.nl-cs-rial-form input,
.nl-cs-rial-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #050607;
  color: #fff;
  font: inherit;
  box-sizing: border-box;
}

.nl-cs-rial-ref code {
  font-size: 0.78rem;
  word-break: break-all;
}

