/* Custom Adventure wizard. Layout primitives (.setup-card, .setup-header,
   .setup-progress, .setup-form-row, .details-input, .stat-*) come from
   pages/random_setup.css — this file only adds what the wizard introduces. */

.setup-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.setup-card-head h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: #5a4a33;
  text-transform: uppercase;
}

.setup-card-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #8a7757;
}

/* ── Wand ── */
.btn-wand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid rgba(200, 168, 78, 0.6);
  background: rgba(200, 168, 78, 0.1);
  color: #7a6548;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.btn-wand:hover:not(:disabled) {
  background: rgba(200, 168, 78, 0.25);
}

.btn-wand:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wand-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.btn-wand.is-pending .wand-icon {
  animation: wandSpin 1.1s linear infinite;
}

@keyframes wandSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* While a wand is in flight the fields it is about to replace are frozen. */
form.is-generating textarea,
form.is-generating input[type="text"] {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Theme picker ── */
.theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.theme-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-swatch {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.theme-pill:hover .theme-swatch {
  transform: translateY(-1px);
}

.theme-pill input[type="radio"]:checked + .theme-swatch {
  box-shadow: 0 0 0 2px rgba(200, 168, 78, 0.9);
}

.theme-pill input[type="radio"]:focus-visible + .theme-swatch {
  outline: 2px solid #c8a84e;
  outline-offset: 2px;
}

/* ── Repeatable entity rows ── */
.entity-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.entity-row-name { flex: 0 0 26%; }
.entity-row-desc { flex: 1 1 auto; }
.entity-row-status { flex: 0 0 26%; }

.entity-row-remove {
  flex: 0 0 auto;
  line-height: 1;
}

@media (max-width: 640px) {
  .entity-row {
    flex-wrap: wrap;
  }

  .entity-row-name,
  .entity-row-desc,
  .entity-row-status {
    flex: 1 1 100%;
  }
}

/* ── Map toggle and its inline help ──
   Not .sidebar-help: that one is drawn from the in-game theme variables, which
   the wizard's parchment does not set. Same tooltip controller, though — the
   bubble is absolute here, so positionIfFixed() leaves it alone. */
.setup-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.setup-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #5a4a33;
  cursor: pointer;
}

.setup-toggle-label input[type="checkbox"] {
  accent-color: #7a6548;
  cursor: pointer;
}

.setup-help {
  position: relative;
  display: inline-flex;
}

.setup-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border: 1px solid rgba(122, 101, 72, 0.5);
  border-radius: 50%;
  background: transparent;
  color: #8a7757;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.setup-help-btn:hover {
  color: #5a4a33;
  border-color: #7a6548;
}

.setup-help-bubble {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  max-width: 70vw;
  padding: 0.55rem 0.7rem;
  background: #f4ead6;
  border: 1px solid rgba(122, 101, 72, 0.4);
  box-shadow: 0 2px 8px rgba(60, 45, 25, 0.15);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.55;
  color: #6b5942;
  text-align: left;
  z-index: 20;
}
