/**
 * Character Creation Wizard modal — Dark Fantasy deep blue / arcane purple.
 * SPEC-REALM-006 US-6.6
 * Created: 2026-09-07T00:16:00Z
 */

.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: block;
  padding: 0;
  background: var(--bg-main);
  overflow-y: auto;
}

.wizard-modal {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100dvh;
  height: auto;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.wizard-title {
  font-size: 1.4rem;
  color: var(--color-gold-light);
  letter-spacing: 0.04em;
}

.wizard-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem 0.6rem;
  transition: all 0.2s ease;
}

.wizard-close:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.wizard-steps {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.wizard-step-pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-stats);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.wizard-step-pill.is-current {
  background: rgba(168, 85, 247, 0.18);
  border-color: var(--border-active);
  color: var(--color-purple-light);
}

.wizard-body {
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 1.4rem 1.5rem;
}

.wizard-step-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.wizard-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0.6rem 0;
}

.wizard-point-budget {
  font-family: var(--font-stats);
  color: var(--color-gold-light);
}

/* Generation mode tabs */
.wizard-mode-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.wizard-mode-tab {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.wizard-mode-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.wizard-mode-tab.is-active {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--border-active);
  color: var(--color-purple-light);
}

.wizard-roller {
  margin-bottom: 1rem;
}

.wizard-dice-tray {
  min-height: 56px;
  margin-top: 0.75rem;
}

/* Ability score grid */
.wizard-ability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.wizard-ability-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface-translucent);
}

.wizard-ability-label {
  font-family: var(--font-stats);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

/* Score Bank & Slots */
.wizard-score-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--border-subtle);
}

.score-chip {
  cursor: pointer;
  font-family: var(--font-stats);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.score-chip:hover {
  background: rgba(168, 85, 247, 0.3);
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.8);
}

.slot-card {
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-family: var(--font-stats);
}

.slot-card.is-selected {
  border-color: var(--border-active);
  background: rgba(168, 85, 247, 0.16);
  box-shadow: var(--glow-arcane);
}

.slot-card:hover {
  border-color: var(--border-hover);
}

.wizard-ability-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.2rem;
  position: relative;
}

.slot-placeholder {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.slot-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.remove-score-btn {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.8);
  color: white;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.slot-card:hover .remove-score-btn {
  opacity: 1;
}

.remove-score-btn:hover {
  background: rgb(220, 38, 38);
}

/* Point Buy Controls */
.point-buy-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: space-between;
}

.point-buy-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-translucent);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.point-buy-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.1);
}

.point-buy-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.point-buy-score {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-stats);
}

/* Race / class / background option cards */
.wizard-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.7rem;
}

.wizard-option-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface-translucent);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s ease;
}

.wizard-option-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.wizard-option-card.is-selected {
  border-color: var(--border-active);
  background: rgba(168, 85, 247, 0.16);
  box-shadow: var(--glow-arcane);
}

.wizard-option-name {
  font-size: 0.98rem;
}

.wizard-option-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Skill chips */
.wizard-skill-picker {
  margin-top: 1.2rem;
}

.wizard-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wizard-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.wizard-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.wizard-chip.is-selected {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

/* Text fields */
.wizard-personality {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.wizard-field > span {
  font-family: var(--font-stats);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.wizard-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.wizard-input:focus {
  border-color: var(--border-active);
}

.wizard-summary {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.wizard-summary strong {
  color: var(--text-primary);
}

.wizard-spell-note {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border-left: 3px solid var(--color-purple);
  background: rgba(168, 85, 247, 0.08);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Errors + footer */
.wizard-errors {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 1.5rem;
  background: rgba(239, 68, 68, 0.1);
  border-top: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--color-crimson);
  font-size: 0.82rem;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.wizard-btn {
  padding: 0.6rem 1.4rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

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

.wizard-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.wizard-btn-ghost:not(:disabled):hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.wizard-btn-secondary {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

.wizard-btn-primary {
  background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-blue) 100%);
  border-color: var(--border-active);
  color: #fff;
}

.wizard-btn-primary:not(:disabled):hover {
  box-shadow: var(--glow-arcane);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .wizard-option-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.wizard-backstory {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
}

.wizard-textarea {
  resize: vertical;
  min-height: 96px;
  font-family: inherit;
  line-height: 1.5;
}

/* Portrait in Review & Begin step */
/* Added: 2026-09-16T17:55:00Z */
.wizard-portrait-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-surface-translucent);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.wizard-portrait-slot {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
}

.wizard-portrait-slot.wizard-portrait-staged {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.wizard-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wizard-portrait-placeholder {
  font-size: 2rem;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.wizard-portrait-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.wizard-staged-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.wizard-portrait-actions {
  display: flex;
  gap: 0.4rem;
}

/* Split pane layout */
.wizard-split-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
  height: 100%;
}

.wizard-pane-left {
  display: flex;
  flex-direction: column;
  overflow-y: visible;
  min-height: 0;
  padding-right: 0.5rem;
}

.wizard-pane-right {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-translucent);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  position: sticky;
  top: 1rem;
  height: fit-content;
  max-height: calc(100dvh - 2rem);
}

.wizard-details-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--border-subtle);
}

.wizard-details-content {
  padding: 1.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.wizard-details-title {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.wizard-details-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .wizard-split-layout {
    grid-template-columns: 1fr;
  }
  .wizard-pane-right {
    display: none;
  }
}

