/* ── RPG: character screen, archetype picker ── */
/* ── Character Screen (theme-colored) ─────────────────── */
.rpg-char-screen {
  width: min(520px, calc(100vw - 16px));
  max-height: 92vh;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.rpg-header {
  text-align: center;
  padding: 12px 16px 8px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.rpg-header-ornament { display: none; }
.rpg-title {
  color: var(--text-heading);
  font-size: 18px;
  margin: 0;
}
.rpg-subtitle {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}
.rpg-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none;
  color: var(--text-muted); font-size: 22px; cursor: pointer;
  line-height: 1;
}
.rpg-close:hover { color: var(--text); }

/* gender picker */
.rpg-gender-pick { padding: 20px 16px; text-align: center; }
.rpg-gender-prompt { color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
/* equipment body */
.rpg-body {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  padding: 8px;
  gap: 4px;
}

.rpg-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 110px;
  flex-shrink: 0;
  justify-content: center;
  overflow-y: auto;
}

.rpg-slot {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.rpg-slot:hover { border-color: var(--text-muted); }
.rpg-slot.equipped { border-color: var(--accent); }
.rpg-slot-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.rpg-slot-item {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpg-slot-empty {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}
.rpg-slot-icon {
  font-size: 14px;
  margin-right: 3px;
}

.rpg-paperdoll-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 0;
}
.rpg-paperdoll {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-body);
}

.rpg-theme-row {
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.rpg-theme-row select {
  flex: 1; padding: 3px 6px;
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font-size: 11px;
}

.rpg-footer {
  height: 4px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
}
.rpg-footer-ornament { display: none; }

@media (max-width: 440px) {
  .rpg-char-screen { width: calc(100vw - 8px); }
  .rpg-slots { width: 70px; }
  .rpg-slot-label { font-size: 7px; }
  .rpg-slot-item { font-size: 9px; }
  .rpg-paperdoll { max-height: 240px; }
}


/* ============================================================
 * Add this block to style.css. It's purely additive — it doesn't
 * remove or conflict with the existing .rpg-gender-btn rules,
 * so leaving the old rules in place is fine.
 * ============================================================ */

/* Archetype picker: 6 portrait thumbnails, no text labels */
.rpg-archetype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 10px;
  max-width: 420px;
  margin: 0 auto;
}
.rpg-archetype-card {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  transition: border-color 0.22s, transform 0.1s, box-shadow 0.22s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rpg-archetype-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(59,130,246,0.22);
}
.rpg-archetype-thumb {
  width: 100%;
  aspect-ratio: 8 / 11;     /* matches 80x110 canvas */
  display: block;
  border-radius: 6px;
  background: #08060a;
}
@media (max-width: 440px) {
  .rpg-archetype-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Character name input (sits above the paper doll) */
.char-name-input {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: center;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.char-name-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.char-name-input:focus {
  border-color: var(--accent);
  background: rgba(0,0,0,0.55);
}

/* Make the paperdoll wrapper stack vertically so the name input
 * sits above the canvas instead of next to it. */
.rpg-paperdoll-wrap {
  flex-direction: column;
}

