/* ──────────────────────────────────────────────────────────────────────── */
/*  Call Forth Five Faces — ecosystem-native bulk NPC generator              */
/* ──────────────────────────────────────────────────────────────────────── */

.faces-page { max-width: 1200px; margin: 0 auto; }

/* Header */
.faces-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.faces-head-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(214,178,87,.25);
  background: rgba(214,178,87,.07);
  color: var(--gold);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .5rem;
}
.faces-head-title h1 {
  margin: 0 0 .4rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 10%, #e5daff 55%, #f0cf7d 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.faces-head-sub { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; max-width: 580px; }
.faces-head-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* Buttons */
.faces-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.05rem; border-radius: 10px;
  font-size: .86rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .16s ease; white-space: nowrap;
  border: 1px solid transparent;
}
.faces-btn-primary {
  background: linear-gradient(135deg, #a589ff 0%, var(--violet) 55%, #6a4df4 100%);
  color: #fff; border-color: rgba(139,112,255,.55);
  box-shadow: 0 3px 14px rgba(139,112,255,.3);
}
.faces-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(139,112,255,.45); }
.faces-btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.faces-btn-ghost:hover { color: var(--text); border-color: var(--gold); background: rgba(214,178,87,.06); }
.faces-btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* Export dropdown */
.faces-export-wrap { position: relative; }
.faces-export-menu {
  display: none; position: absolute; top: calc(100% + .4rem); right: 0;
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  border: 1px solid var(--border); border-radius: 12px; min-width: 220px;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
  z-index: 50; overflow: hidden; padding: .25rem;
}
.faces-export-menu.open { display: block; }
.faces-export-menu button {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; background: none; border: none;
  color: var(--muted); font-size: .82rem; font-family: inherit;
  cursor: pointer; border-radius: 8px; width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.faces-export-menu button:hover { background: rgba(139,112,255,.08); color: var(--text); }
.faces-export-menu button i { color: var(--faint); width: 14px; text-align: center; }
.faces-export-menu .faces-export-divider { border-top: 1px solid var(--border); margin: .25rem 0; }

/* Controls */
.faces-controls {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  padding: 1rem 1.15rem; border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(26,26,45,.65), rgba(19,19,33,.65));
  margin-bottom: 1.5rem; align-items: flex-end;
}
.faces-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.faces-field-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.faces-select {
  padding: .55rem .75rem;
  background: rgba(8,8,14,.65); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: .88rem; font-family: inherit; outline: none;
  transition: border-color .15s ease; min-width: 160px;
}
.faces-select:focus { border-color: var(--gold); }

/* Sex segmented control */
.faces-seg { display: inline-flex; border: 1px solid var(--border); background: rgba(8,8,14,.65); border-radius: 10px; overflow: hidden; }
.faces-seg-btn { background: none; border: none; color: var(--muted); font-family: inherit; font-size: .82rem; font-weight: 600; padding: .5rem .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; transition: all .15s ease; border-right: 1px solid var(--border); }
.faces-seg-btn:last-child { border-right: 0; }
.faces-seg-btn:hover { color: var(--text); background: rgba(139,112,255,.06); }
.faces-seg-btn.is-active { background: linear-gradient(135deg, rgba(139,112,255,.22), rgba(139,112,255,.1)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(139,112,255,.4); }
.faces-seg-btn i { font-size: .78rem; }

/* Results — single column for readable long paragraphs */
.faces-results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.faces-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 3rem 1.5rem;
  color: var(--faint); font-style: italic;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.faces-empty p { margin: 0; }
.faces-idle-icon { font-size: 2rem; color: var(--faint); opacity: .5; }

/* NPC card — full-width stacked layout for comfortable reading */
.face-card {
  background: linear-gradient(180deg, var(--panel-top), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 22px rgba(0,0,0,.25);
  padding: 1.35rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: transform .18s ease, border-color .18s ease;
}
.face-card:hover {
  border-color: rgba(214,178,87,.3);
}

/* Header row: reroll (far left), name, race chip (far right) */
.face-card-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: .25rem;
}
.face-name {
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 0;
  color: var(--gold-hi);
  letter-spacing: .02em;
  flex: 1;
  min-width: 0;
}
/* Race • Sex chip, top-right */
.face-race-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  border-radius: 8px;
  background: rgba(214,178,87,.1);
  border: 1px solid rgba(214,178,87,.3);
  color: var(--gold);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Level + Class subtitle directly under the name */
.face-subtitle {
  font-size: .98rem;
  color: var(--text);
  font-weight: 600;
  margin: -.15rem 0 .5rem;
}
.face-subtitle .face-level-num { color: var(--gold); }

/* Height / weight sub-line with a faint divider above */
.face-physical {
  font-size: .82rem;
  color: var(--muted);
  padding: .5rem 0;
  border-top: 1px solid var(--border-soft);
  margin-bottom: .2rem;
}
.face-physical strong { color: var(--muted); font-weight: 600; }
.face-physical .face-dot { margin: 0 .55rem; color: var(--faint); }

/* Description paragraph — full card width, dimmed for comfortable reading */
.face-description {
  font-size: 1.02rem;
  color: #a8a0c4;
  line-height: 1.9;
  margin: .35rem 0 .85rem;
  font-weight: 400;
}
.face-description:last-child { margin-bottom: 0; }

/* Reroll button — inline, left of the name, always visible */
.face-reroll {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: .9rem;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.face-reroll:hover { color: var(--gold); border-color: var(--gold); background: rgba(214,178,87,.1); transform: rotate(-45deg); }

/* Shimmer skeleton while loading */
.face-skeleton {
  height: 220px;
  background: linear-gradient(110deg, rgba(40,40,60,.4) 25%, rgba(70,70,90,.55) 50%, rgba(40,40,60,.4) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: faces-shimmer 1.4s infinite;
  border: 1px solid var(--border);
}
@keyframes faces-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast */
.faces-toast-host {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  z-index: 99999; display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none; max-width: calc(100vw - 32px);
}
.faces-toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1.05rem; border-radius: 10px;
  background: linear-gradient(180deg, rgba(26,26,45,.97), rgba(19,19,33,.97));
  border: 1px solid var(--border); color: var(--text);
  font-size: .86rem; box-shadow: 0 10px 28px rgba(0,0,0,.5);
  pointer-events: auto; animation: faces-toast-in .22s ease-out;
  max-width: 440px;
}
.faces-toast i { font-size: .9rem; flex-shrink: 0; }
.faces-toast.is-info i { color: var(--violet); }
.faces-toast.is-warn { border-color: rgba(232,160,80,.5); }
.faces-toast.is-warn i { color: #e8a050; }
.faces-toast.is-error { border-color: rgba(233,69,96,.55); }
.faces-toast.is-error i { color: #e94560; }
.faces-toast.is-out { opacity: 0; transform: translateY(-6px); transition: all .2s ease-in; }
@keyframes faces-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive */
@media (max-width: 720px) {
  .faces-head { align-items: stretch; }
  .faces-head-actions { justify-content: space-between; }
  .faces-controls { flex-direction: column; align-items: stretch; }
  .faces-select { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .faces-head-actions { flex-direction: column; align-items: stretch; }
  .faces-export-wrap, .faces-export-wrap > .faces-btn { width: 100%; }
  .faces-export-menu { left: 0; right: 0; }
}
