/* Random setup wizard (all 3 steps) — parchment manuscript style */

/* ── Parchment body ── */
body:has(.setup-header) {
  background:
    repeating-conic-gradient(
      rgba(120, 90, 50, 0.03) 0% 25%,
      transparent 0% 50%
    ) 0 0 / 4px 4px,
    radial-gradient(ellipse at 0% 0%, rgba(90, 60, 30, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(100, 65, 25, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 0% 100%, rgba(95, 60, 30, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 100% 100%, rgba(90, 55, 25, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 40%, #efe3cd 0%, #e2d3b8 40%, #d4c4a4 80%);
  color: #3a2a14;
}
body:has(.setup-header)::before { display: none; }

/* ── Nav overrides ── */
body:has(.setup-header) .app-nav { border-bottom: 1px solid rgba(138, 115, 84, 0.3); }
body:has(.setup-header) .app-nav-home { color: #7a6548; }
body:has(.setup-header) .app-nav-home:hover { color: #3a2a14; }
body:has(.setup-header) .app-nav-user { color: #7a6548; }
body:has(.setup-header) .app-nav-tokens { color: #9a8568; }
body:has(.setup-header) .app-nav-signout { border-color: #b5a382; color: #7a6548; }
body:has(.setup-header) .app-nav-signout:hover { color: #3a2a14; border-color: #8a7354; }
body:has(.setup-header) .app-nav-locale { border-color: #b5a382; color: #7a6548; }
body:has(.setup-header) .app-nav-locale:hover { color: #3a2a14; border-color: #8a7354; }

/* ── Flash overrides ── */
body:has(.setup-header) .flash-notice {
  background: rgba(106, 138, 120, 0.12);
  border-color: #8a7354;
  color: #3a2a14;
}
body:has(.setup-header) .flash-alert {
  background: rgba(138, 64, 64, 0.1);
  border-color: #9a6040;
  color: #6a3020;
}

/* ── Header ── */
.setup-header {
  padding: 2.5rem 1rem 1.5rem;
  border-bottom: none;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}
.setup-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    #a0895e 20%,
    #8a7354 50%,
    #a0895e 80%,
    transparent 100%
  );
  opacity: 0.5;
}
.setup-header h1 {
  font-family: 'Cinzel', 'Palatino Linotype', serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #3a2a14;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 245, 220, 0.5);
}
.setup-header p {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: #7a6548;
  font-size: 0.88rem;
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}

/* ── Step indicator ── */
.setup-step {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: #9a8568;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* ── Card ── */
.setup-card {
  border: 1px solid rgba(138, 115, 84, 0.3);
  padding: 1.5rem;
  background: rgba(239, 227, 205, 0.35);
  max-width: 640px;
  margin: 0 auto 1rem;
  animation: setupReveal 0.8s ease-out both;
}

@keyframes setupReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Labels ── */
.setup-card label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #9a8568;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.4rem;
}

/* ── Textarea ── */
.setup-card textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(255, 250, 240, 0.4);
  color: #3a2a14;
  border: 1px solid rgba(138, 115, 84, 0.35);
  padding: 0.75rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}
.setup-card textarea::placeholder {
  color: #b5a382;
  font-style: italic;
}
.setup-card textarea:focus {
  outline: none;
  border-color: #8a7354;
}

/* ── Select ── */
.setup-card select {
  background: rgba(239, 227, 205, 0.5);
  color: #5a4a30;
  border: 1px solid rgba(138, 115, 84, 0.35);
  padding: 0.3rem 0.5rem;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.82rem;
}

/* ── Form row ── */
.setup-form-row {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ── Narrator style badge ── */
.narrator-style-badge {
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(138, 115, 84, 0.2);
  font-family: 'Lora', Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
  color: #7a6548;
  line-height: 1.5;
}
.narrator-style-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-style: normal;
  letter-spacing: 0.15em;
  color: #9a8568;
  text-transform: uppercase;
  margin-right: 0.3rem;
}

/* ── Generated preview ── */
.generated-preview {
  background: rgba(255, 250, 240, 0.3);
  border: 1px solid rgba(138, 115, 84, 0.25);
  padding: 1rem;
  margin-bottom: 1.2rem;
}
.generated-preview h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: #3a2a14;
  margin-bottom: 0.5rem;
}
.generated-preview p {
  font-family: 'Lora', Georgia, serif;
  color: #7a6548;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-line;
}
.generated-preview .hero-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #3a2a14;
}

/* ── Equipment list ── */
.equipment-list {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(138, 115, 84, 0.2);
}
.equipment-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: #9a8568;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.equipment-item {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.8rem;
  color: #7a6548;
  padding: 0.1rem 0;
}
.equipment-item .item-name { color: #3a2a14; }
.equipment-item .item-status { color: #9a8568; font-style: italic; }

/* ── Tag selection ── */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag-pill {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.78rem;
  color: #7a6548;
  background: rgba(255, 250, 240, 0.3);
  border: 1px solid rgba(138, 115, 84, 0.3);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.3;
}
.tag-pill:hover {
  background: rgba(138, 115, 84, 0.1);
  border-color: #8a7354;
}
.tag-pill.selected {
  background: rgba(90, 74, 48, 0.15);
  border-color: #8a7354;
  color: #3a2a14;
}
.tag-pill-custom .tag-pill-remove {
  margin-left: 0.3rem;
  font-size: 0.9rem;
  opacity: 0.6;
}
.tag-pill-custom:hover .tag-pill-remove {
  opacity: 1;
}
.tag-custom-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}
.tag-custom-input {
  flex: 1;
  background: rgba(255, 250, 240, 0.4);
  color: #3a2a14;
  border: 1px solid rgba(138, 115, 84, 0.35);
  padding: 0.3rem 0.5rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.82rem;
}
.tag-custom-input::placeholder {
  color: #b5a382;
  font-style: italic;
}
.tag-custom-input:focus {
  outline: none;
  border-color: #8a7354;
}
.tag-custom-add {
  padding: 0.25rem 0.6rem !important;
  font-size: 0.65rem !important;
}

/* ── Tag badges (read-only, setup page) ── */
.tag-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.tag-badge {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.72rem;
  color: #7a6548;
  background: rgba(138, 115, 84, 0.08);
  border: 1px solid rgba(138, 115, 84, 0.25);
  padding: 0.15rem 0.5rem;
  line-height: 1.3;
}

/* ── Button overrides ── */
body:has(.setup-header) .btn {
  border-color: #b5a382;
  color: #5a4a30;
  background: transparent;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.45rem 1rem;
  transition: all 0.3s ease;
}
body:has(.setup-header) .btn:hover {
  background: rgba(138, 115, 84, 0.12);
  border-color: #8a7354;
  color: #3a2a14;
}
body:has(.setup-header) .btn-primary {
  background: rgba(90, 74, 48, 0.1);
  border-color: #8a7354;
  color: #3a2a14;
}
body:has(.setup-header) .btn-primary:hover {
  background: rgba(90, 74, 48, 0.2);
}
body:has(.setup-header) .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Waiting dots ── */
.setup-waiting-dots {
  padding: 0.75rem 0;
  text-align: center;
}

/* ── Progress indicator ── */
.setup-progress {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.setup-progress-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: #b5a382;
  text-transform: uppercase;
}
.setup-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #b5a382;
  background: transparent;
  transition: all 0.3s ease;
}
.setup-progress-step.in-progress .setup-progress-dot {
  background: #c8a84e;
  border-color: #c8a84e;
  animation: progressPulse 1.2s ease-in-out infinite;
}
.setup-progress-step.in-progress {
  color: #7a6548;
}
.setup-progress-step.complete .setup-progress-dot {
  background: #6a8a60;
  border-color: #6a8a60;
}
.setup-progress-step.complete {
  color: #5a7a50;
}
@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
