/* ── RESET & BASE ──────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #0d1420;
  --deep-blue: #1a2f4e;
  --steel-blue: #2a4a6a;
  --gold-blue: #7eb8d4;
  --gold: #c9a84c;
  --gold-bright: #f6d490;
  --gold-dim: rgba(201, 168, 76, 0.35);
  --text: #e8dcc8;
  --text-muted: #a09882;
  --card-bg: rgba(13, 20, 32, 0.92);
  --card-border: rgba(201, 168, 76, 0.3);
  --danger: #c0392b;
  --success: #27ae60;
  --locked: rgba(255, 255, 255, 0.08);
  --radius: 8px;
  --transition: 0.2s ease;
  --header-height: 72px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--text);
  font-family: "EB Garamond", serif;
  font-size: 1.05rem;
  line-height: 1.55;
}

body[data-page="personagem"] {
  position: relative;
  --global-theme-image: none;
  --global-theme-accent: var(--gold);
  --global-theme-soft: rgba(201, 168, 76, 0.18);
  --global-theme-glow: rgba(201, 168, 76, 0.3);
}

body[data-page="personagem"]::before,
body[data-page="personagem"]::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.55s ease, filter 0.55s ease, background 0.55s ease;
}

body[data-page="personagem"]::before {
  background-image: var(--global-theme-image);
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: saturate(1.08) brightness(0.25) contrast(1.02);
}

body[data-page="personagem"]::after {
  background:
    radial-gradient(circle at 15% 10%, transparent 0%, transparent 35%),
    linear-gradient(180deg, rgba(10, 15, 24, 0.16), rgba(10, 15, 24, 0.64));
  opacity: 0;
}

body[data-page="personagem"].personagem-global-themed::before {
  opacity: 0.6;
}

body[data-page="personagem"].personagem-global-themed::after {
  background:
    radial-gradient(circle at 17% 12%, var(--global-theme-soft), transparent 42%),
    linear-gradient(180deg, rgba(10, 15, 24, 0.2), rgba(10, 15, 24, 0.72));
  opacity: 1;
}

body[data-page="personagem"] .site-header,
body[data-page="personagem"] .nav-backdrop,
body[data-page="personagem"] #personagem-root {
  position: relative;
  z-index: 2;
}

/* ── LAYOUT SHELL ─────────────────────────────────────────── */

.creator-shell {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100vw;
  height: calc(100dvh - var(--header-height));
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "preview stepper"
    "preview wizard"
    "preview footer";
  background:
    radial-gradient(ellipse at 20% 30%, rgba(42, 74, 106, 0.18), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(201, 168, 76, 0.06), transparent 50%),
    var(--navy);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

body[data-page="personagem"].personagem-global-themed .creator-shell {
  background:
    radial-gradient(ellipse at 16% 24%, var(--global-theme-soft), transparent 52%),
    radial-gradient(ellipse at 84% 76%, rgba(10, 15, 24, 0.45), transparent 58%),
    linear-gradient(180deg, rgba(8, 12, 19, 0.82), rgba(8, 12, 19, 0.94));
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.02);
}

/* ── STEPPER ──────────────────────────────────────────────── */

.stepper {
  grid-area: stepper;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.7rem;
  align-items: stretch;
  padding: 0.9rem 1rem 1rem;
  border-bottom: 1px solid var(--card-border);
  background: rgba(13, 20, 32, 0.6);
  backdrop-filter: blur(6px);
  overflow: hidden;
  transition: border-color 0.35s ease, background 0.35s ease;
}

body[data-page="personagem"].personagem-global-themed .stepper {
  border-bottom-color: color-mix(in srgb, var(--global-theme-accent) 45%, var(--card-border));
  background: linear-gradient(180deg, rgba(10, 15, 24, 0.64), rgba(10, 15, 24, 0.52));
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  font-family: "Cinzel", serif;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  min-width: 0;
  min-height: 126px;
  text-align: center;
  cursor: pointer;
  padding: 0.5rem 0.35rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.44), rgba(13, 20, 32, 0.16));
  transition:
    transform var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    opacity var(--transition);
}

.step-item:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--step-item-accent) 40%, rgba(255,255,255,0.1));
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.66), rgba(13, 20, 32, 0.24));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.step-item.locked {
  opacity: 0.4;
  filter: grayscale(0.2);
}

.step-item.active {
  color: var(--step-item-accent);
  opacity: 1;
  border-color: color-mix(in srgb, var(--step-item-accent) 60%, rgba(255,255,255,0.18));
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.9), rgba(13, 20, 32, 0.42));
  box-shadow: 0 0 0 1px var(--step-item-glow), 0 0 24px var(--step-item-soft);
}

.step-item.completed {
  color: color-mix(in srgb, var(--step-item-accent) 75%, white 12%);
  opacity: 0.95;
}

.step-thumb-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--step-item-accent) 44%, rgba(255,255,255,0.12));
  background: radial-gradient(circle at 35% 30%, var(--step-item-soft), rgba(13,20,32,0.92));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.step-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.step-num {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(9, 14, 22, 0.92);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
}

.step-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.step-title {
  font-size: 0.72rem;
  line-height: 1.1;
  color: inherit;
}

.step-hint {
  font-family: "EB Garamond", serif;
  font-size: 0.68rem;
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--text-muted);
  opacity: 0.9;
}

/* Passo secreto (subclasse) — destaque dourado especial */
.step-item.step-secret {
  border-style: dashed;
}
.step-item.active .step-num {
  background: var(--step-item-accent);
  color: var(--navy);
  border-color: var(--step-item-accent);
}

.step-item.completed .step-num {
  background: color-mix(in srgb, var(--step-item-accent) 80%, white 8%);
  color: var(--navy);
  border-color: color-mix(in srgb, var(--step-item-accent) 80%, white 8%);
}

/* Badge de subclasse no preview */
.preview-badge.secret {
  background: rgba(195, 155, 73, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── PREVIEW PANEL ────────────────────────────────────────── */

.preview-panel {
  grid-area: preview;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--card-border);
  background:
    linear-gradient(170deg, rgba(26, 47, 78, 0.3) 0%, rgba(13, 20, 32, 0.95) 100%);
  overflow-y: auto;
  text-align: center;
  transition: border-color 0.35s ease, background 0.35s ease;
}

body[data-page="personagem"].personagem-global-themed .preview-panel {
  border-right-color: color-mix(in srgb, var(--global-theme-accent) 35%, var(--card-border));
  background:
    linear-gradient(170deg, color-mix(in srgb, var(--global-theme-soft) 55%, rgba(26, 47, 78, 0.3)) 0%, rgba(13, 20, 32, 0.95) 100%);
}

.preview-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  background:
    radial-gradient(circle at 40% 40%, var(--steel-blue), var(--deep-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--gold);
  font-family: "Cinzel", serif;
  text-transform: uppercase;
  overflow: hidden;
}

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

.preview-name {
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
  color: var(--gold-bright);
  min-height: 2rem;
}

.preview-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  font-size: 0.82rem;
  color: var(--gold-blue);
  background: rgba(42, 74, 106, 0.2);
}

.preview-badge.homebrew {
  border-color: rgba(126, 184, 212, 0.5);
  color: var(--gold-blue);
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  margin-top: 0.5rem;
}

.stat-box {
  text-align: center;
  padding: 0.4rem 0.3rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.6);
}

.stat-label {
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 600;
}

.stat-mod {
  font-size: 0.75rem;
  color: var(--gold-blue);
}

.preview-hp {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.preview-hp .hp-val {
  font-size: 1.35rem;
  color: var(--danger);
  font-weight: 700;
}

/* ── WIZARD AREA ──────────────────────────────────────────── */

.wizard-area {
  grid-area: wizard;
  overflow-y: auto;
  padding: 1.5rem 2rem 1rem;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.wizard-area::-webkit-scrollbar { width: 6px; }
.wizard-area::-webkit-scrollbar-track { background: transparent; }
.wizard-area::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 3px;
}

.wizard-step {
  display: none;
  position: relative;
  isolation: isolate;
  animation: fadeStep 0.25s ease;
  --step-accent: var(--gold);
  --step-accent-soft: rgba(201, 168, 76, 0.2);
  --step-accent-glow: rgba(201, 168, 76, 0.32);
}

.wizard-step.active { display: block; }

.wizard-step.has-theme.active::before {
  content: "";
  position: absolute;
  inset: -0.55rem -0.75rem;
  border-radius: 12px;
  background-image: var(--step-theme-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.08) brightness(0.34) contrast(1.05);
  opacity: 0.52;
  z-index: -2;
}

.wizard-step.has-theme.active::after {
  content: "";
  position: absolute;
  inset: -0.55rem -0.75rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 12%, var(--step-accent-soft), transparent 45%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.45), rgba(8, 12, 20, 0.86));
  border: 1px solid rgba(201, 168, 76, 0.22);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.26),
    inset 0 0 28px rgba(255, 255, 255, 0.02);
  z-index: -1;
}

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

.wizard-step h2 {
  font-family: "Cinzel", serif;
  font-size: 1.6rem;
  color: var(--gold-bright);
  margin-bottom: 0.25rem;
}

.wizard-step .step-desc {
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

/* ── FORM CONTROLS ────────────────────────────────────────── */

.field-group {
  margin-bottom: 1rem;
}

.field-group label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.field-group input[type="text"],
.field-group input[type="number"],
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.8);
  color: var(--text);
  font-family: "EB Garamond", serif;
  font-size: 1rem;
  transition: border-color var(--transition);
}

.field-group input[type="file"] {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.82);
  color: var(--text);
  font-family: "EB Garamond", serif;
  font-size: 0.95rem;
}

.field-group input[type="file"]::file-selector-button {
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.95), rgba(13, 20, 32, 0.74));
  color: var(--gold-blue);
  padding: 0.35rem 0.8rem;
  margin-right: 0.65rem;
  font-family: "Cinzel", serif;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.field-group input[type="file"]:hover::file-selector-button {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.field-group select option {
  background: var(--navy);
  color: var(--text);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.identity-photo-block {
  margin-top: 0.95rem;
  padding: 0.95rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(26, 47, 78, 0.22) 0%, rgba(13, 20, 32, 0.78) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.identity-photo-header {
  margin-bottom: 0.65rem;
}

.identity-photo-title {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.identity-photo-field {
  margin-bottom: 0.25rem;
}

.identity-photo-hint {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.identity-photo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 184, 212, 0.45);
  color: var(--gold-blue);
  background: rgba(42, 74, 106, 0.22);
  font-size: 0.78rem;
}

.identity-photo-chip--error {
  border-color: rgba(243, 156, 156, 0.45);
  color: #f3b4b4;
  background: rgba(141, 52, 52, 0.2);
}

.identity-photo-empty {
  margin-top: 0.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.84rem;
  background: rgba(13, 20, 32, 0.36);
}

.identity-photo-preview-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.identity-photo-preview-card {
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.72);
  padding: 0.65rem;
}

.identity-photo-preview-title {
  font-family: "Cinzel", serif;
  font-size: 0.74rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.identity-photo-preview {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: block;
}

.identity-photo-preview--cropped {
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 999px;
  border: 2px solid var(--gold-dim);
}

.identity-photo-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.identity-photo-remove-btn {
  padding: 0.55rem 1.05rem;
  font-size: 0.78rem;
}

.identity-photo-file {
  font-size: 0.82rem;
  color: var(--text-muted);
  word-break: break-word;
}

.identity-photo-crop-panel {
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.72);
  padding: 0.65rem;
}

.identity-photo-crop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
  margin-bottom: 0.18rem;
}

.identity-photo-crop-label {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.identity-photo-crop-value {
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
}

.identity-photo-crop-range {
  width: 100%;
  accent-color: var(--gold);
  margin-bottom: 0.55rem;
}

.identity-photo-crop-range:last-of-type {
  margin-bottom: 0;
}

.identity-photo-crop-actions {
  margin-top: 0.55rem;
  display: flex;
  justify-content: flex-start;
}

.identity-photo-crop-reset {
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
}

/* ── SEARCH BAR ───────────────────────────────────────────── */

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.search-bar__icon {
  position: absolute;
  left: 0.75rem;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: var(--text-muted);
  width: 1rem;
  height: 1rem;
}

.search-bar__icon svg {
  width: 100%;
  height: 100%;
}

.search-bar__input {
  width: 100%;
  padding: 0.55rem 2.4rem 0.55rem 2.25rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.85);
  color: var(--text);
  font-family: "EB Garamond", serif;
  font-size: 1rem;
  transition: border-color var(--transition), background var(--transition);
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

.search-bar__input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(13, 20, 32, 0.95);
}

.search-bar__clear {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  border-radius: 50%;
  transition: color var(--transition);
}

.search-bar__clear:hover {
  color: var(--text);
}

/* ── GENERIC SPLIT LAYOUT (side panel for Races, Classes, Subclasses) ── */

.step-split-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  min-height: 0;
}

.step-cards-col {
  min-width: 0;
}

.step-info-col {
  min-width: 0;
}

/* Side detail panel (generic) */
.side-detail-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
  position: sticky;
  top: 0.5rem;
  /*
   * Altura útil do painel lateral dentro do wizard:
   * viewport - header global - espaço ocupado por stepper/footer/paddings.
   */
  max-height: calc(100dvh - var(--header-height) - 11rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
  animation: fadeInUp 0.2s ease;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.side-detail-panel::-webkit-scrollbar { width: 6px; }
.side-detail-panel::-webkit-scrollbar-track { background: transparent; }
.side-detail-panel::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 3px;
}

.side-detail-name {
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.45rem;
}

.side-detail-summary {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.side-detail-section {
  margin-bottom: 0.85rem;
}

.side-detail-section-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.45rem;
}

.side-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}

.side-detail-row + .side-detail-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.side-detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.side-detail-value {
  color: var(--text);
  font-weight: 600;
}

.side-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.side-detail-list li {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.side-detail-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.side-detail-list--compact li {
  font-size: 0.8rem;
  padding-left: 0.85rem;
  gap: 0.2rem;
}

.side-detail-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.65rem;
  line-height: 1.5;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border-left: 2px solid var(--gold);
}

.side-detail-link {
  display: block;
  margin-top: 0.85rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--gold-dim);
  color: var(--gold);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.side-detail-link:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ─── Show Features Button ──────────────────────────── */

.sc-show-features-btn {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(210, 178, 107, 0.45);
  border-radius: var(--radius);
  background: rgba(210, 178, 107, 0.08);
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sc-show-features-btn:hover {
  background: rgba(210, 178, 107, 0.18);
  border-color: var(--gold);
}

/* ─── Subclass Features Modal ───────────────────────── */

.sc-features-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 80;
  background: rgba(0, 0, 0, 0.65);
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: scFadeIn 180ms ease forwards;
}

@keyframes scFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sc-features-panel {
  width: min(680px, 92vw);
  max-height: calc(100dvh - 1.5rem);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(210, 178, 107, 0.5);
  background: linear-gradient(155deg, rgba(7, 11, 18, 0.97), rgba(20, 30, 44, 0.92));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  padding: 1.5rem 1.5rem 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(210,178,107,0.25) transparent;
}

.sc-features-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: 1px solid rgba(210, 178, 107, 0.42);
  background: rgba(7, 11, 18, 0.92);
  color: var(--parchment);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.sc-features-close:hover {
  background: rgba(210, 178, 107, 0.2);
}

.sc-features-title {
  font-family: "Cinzel", serif;
  font-size: 1.15rem;
  color: var(--gold);
  margin: 0 0 0.2rem;
}

.sc-features-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1rem;
}

.sc-features-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sc-feature-item {
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border-left: 2px solid var(--gold);
}

.sc-feature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.sc-feature-name {
  font-family: "Cinzel", serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.sc-feature-level {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
  padding: 0.1rem 0.45rem;
  background: var(--gold-dim);
  border-radius: 4px;
}

.sc-feature-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Side empty panel (generic) */
.side-empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  text-align: center;
  position: sticky;
  top: 0.5rem;
}

.side-empty-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.side-empty-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── BACKGROUND STEP LAYOUT ────────────────────────────────── */

.bg-step-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  min-height: 0;
}

.bg-cards-col {
  min-width: 0;
}

.bg-info-col {
  min-width: 0;
}

/* Detail panel */
.bg-detail-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
  position: sticky;
  top: 0.5rem;
  max-height: calc(100dvh - var(--header-height) - 11rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: fadeInUp 0.2s ease;
}

.bg-detail-name {
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.45rem;
}

.bg-detail-summary {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.bg-detail-section {
  margin-bottom: 0.85rem;
}

.bg-detail-section-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.45rem;
}

.bg-detail-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bg-benefit-line {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.bg-benefit-line::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.bg-benefit-attr {
  font-size: 0.83rem;
  color: var(--gold);
  font-weight: 600;
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.5;
}

.bg-benefit-attr::before {
  content: "⬟";
  position: absolute;
  left: 0;
  font-size: 0.7rem;
  top: 0.15em;
}

/* Attribute bonus selector */
.bg-attr-selector {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
}

.bg-attr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.bg-attr-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.bg-attr-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

.bg-attr-modes {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.bg-tasha-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.bg-tasha-toggle input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bg-tasha-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--text-light);
  transition: transform 0.15s ease;
}

.bg-tasha-toggle input[type="checkbox"]:checked {
  background: rgba(195, 155, 73, 0.3);
  border-color: rgba(195, 155, 73, 0.75);
}

.bg-tasha-toggle input[type="checkbox"]:checked::before {
  transform: translateX(14px);
  background: var(--gold);
}

.bg-tasha-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(195, 155, 73, 0.45);
  outline-offset: 2px;
}

.bg-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  gap: 0.15rem;
}

.bg-mode-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.bg-mode-btn--active {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}

.bg-mode-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.bg-mode-desc {
  font-size: 0.68rem;
  opacity: 0.85;
}

.bg-attr-assign {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bg-attr-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  font-size: 0.88rem;
  font-family: inherit;
}

.bg-attr-btn:hover {
  border-color: var(--gold);
}

.bg-attr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bg-attr-btn--plus2 {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
}

.bg-attr-btn--plus1 {
  border-color: rgba(100, 200, 130, 0.45);
  background: rgba(100, 200, 130, 0.1);
  color: hsl(142 48% 60%);
}

.bg-attr-name {
  font-weight: 500;
}

.bg-attr-val {
  font-weight: 700;
  font-size: 0.92rem;
}

.bg-attr-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: center;
  font-style: italic;
}

.bg-attr-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.bg-attr-tag {
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.bg-attr-tag--plus1 {
  background: rgba(100, 200, 130, 0.12);
  color: hsl(142 50% 62%);
  border: 1px solid rgba(100, 200, 130, 0.3);
}

/* Empty state */
.bg-empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  text-align: center;
  position: sticky;
  top: 0.5rem;
}

.bg-empty-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.bg-empty-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── CATEGORY FILTER (filtros de raça / classe) ────────────── */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.cat-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.cat-btn--active {
  background: var(--step-accent-soft, rgba(201, 168, 76, 0.2));
  border-color: var(--step-accent, var(--gold));
  color: var(--step-accent, var(--gold));
  font-weight: 600;
}

/* ── CARD GRID (races, classes, origins, SP) ──────────────── */

.section-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.2rem 0 0.8rem;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-grid.sp-grid {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid.card-grid--portrait {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}

.pick-card {
  position: relative;
  padding: 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    background var(--transition);
}

.pick-card:hover {
  border-color: rgba(201, 168, 76, 0.55);
  transform: translateY(-2px);
}

.pick-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.2);
}

.wizard-step.has-theme.active .pick-card.selected {
  border-color: var(--step-accent);
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.86), rgba(13, 20, 32, 0.95));
  box-shadow:
    0 0 0 1px var(--step-accent-glow),
    0 0 30px var(--step-accent-soft);
}

.card-media {
  position: relative;
  margin: -0.35rem -0.35rem 0.7rem;
  height: 128px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(42, 74, 106, 0.45), rgba(13, 20, 32, 0.95));
}

.card-media.card-media--vertical {
  height: 220px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 5%;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.card-media-shadow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 12, 20, 0.06), rgba(8, 12, 20, 0.55)),
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 40%);
}

.pick-card:hover .card-media img {
  transform: scale(1.05);
  filter: saturate(1.04);
}

.wizard-step.has-theme.active .pick-card.selected .card-media {
  border-color: var(--step-accent-glow);
}

.wizard-step.has-theme.active .pick-card.selected .card-media img {
  filter: saturate(1.16) contrast(1.05);
}

.pick-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.pick-card .card-name {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.pick-card .card-detail {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.pick-card .card-traits {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.trait-tag {
  display: inline-flex;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 184, 212, 0.35);
  font-size: 0.76rem;
  color: var(--gold-blue);
  background: rgba(42, 74, 106, 0.15);
}

.badge-hw {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 184, 212, 0.5);
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--gold-blue);
  background: rgba(26, 47, 78, 0.7);
}

.badge-custom {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.55);
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #c084fc;
  background: rgba(88, 28, 135, 0.55);
}

.badge-2024 {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.55);
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #93c5fd;
  background: rgba(30, 58, 138, 0.55);
}

/* ── CUSTOM DIVIDER (Race Step) ───────────────────────────── */

.custom-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.custom-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.4), transparent);
}

.custom-divider-label {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c084fc;
  white-space: nowrap;
}

/* ── TASHA'S ABILITY DISTRIBUTION ─────────────────────────── */

.tasha-distribution {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 168, 76, 0.25);
  background: rgba(10, 22, 40, 0.5);
}

.tasha-title {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  color: var(--gold-bright);
  margin-bottom: 0.25rem;
}

.tasha-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tasha-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tasha-slot-label {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  color: var(--gold);
  min-width: 2rem;
  text-align: center;
}

.tasha-slot-buttons {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tasha-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-size: 0.72rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tasha-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

.tasha-btn--active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.25);
  color: var(--gold-bright);
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.2);
}

.tasha-btn--used {
  opacity: 0.3;
  cursor: not-allowed;
}

.tasha-done {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #4ade80;
  font-weight: 600;
}

/* ── CUSTOM LINEAGE FORM ──────────────────────────────────── */

.custom-lineage-form,
.custom-bg-form {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  background: rgba(10, 22, 40, 0.5);
}

.cl-section-title {
  font-family: "Cinzel", serif;
  font-size: 0.95rem;
  color: #c084fc;
  margin-bottom: 0.75rem;
}

.cl-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.cl-input {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  font-size: 0.82rem;
  font-family: "Inter", sans-serif;
  transition: border-color 0.15s ease;
}

.cl-input:focus {
  border-color: var(--gold);
  outline: none;
}

.cl-select {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 30, 55, 0.9);
  color: var(--text-light);
  font-size: 0.82rem;
  font-family: "Inter", sans-serif;
  cursor: pointer;
}

.cl-select:focus {
  border-color: var(--gold);
  outline: none;
}

.cl-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

.cl-modal-trigger {
  width: 100%;
  min-height: 2.1rem;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(201, 168, 76, 0.45);
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.cl-modal-trigger:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.2);
  transform: translateY(-1px);
}

.cl-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.cl-choice-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: rgba(15, 30, 55, 0.42);
}

.cl-choice-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cl-choice-value {
  color: var(--text);
  font-size: 0.8rem;
  text-align: right;
}

.cl-skill-row {
  display: flex;
  gap: 0.5rem;
}

.cl-skill-row .cl-select {
  flex: 1;
}

.cl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
}

.cl-checkbox-label input[type="checkbox"] {
  accent-color: var(--gold);
}

.cl-row {
  margin-bottom: 0.75rem;
}

.cl-radio-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}

.cl-radio-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-light);
  cursor: pointer;
}

.cl-radio-label input[type="radio"] {
  accent-color: var(--gold);
}

/* ── Choice + Origin Feat Modal ───────────────────────────── */

.choice-feat-overlay {
  z-index: 120;
}

.choice-feat-panel {
  width: min(760px, 94vw);
  max-height: calc(100dvh - 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--text);
}

.choice-feat-progress {
  margin-top: 0.1rem;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.choice-feat-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.2rem 0 0.15rem;
}

.choice-feat-step-dot {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(210, 178, 107, 0.24);
  background: rgba(10, 22, 40, 0.55);
  color: var(--text-muted);
  font-size: 0.74rem;
}

.choice-feat-step-dot--active {
  border-color: rgba(210, 178, 107, 0.62);
  color: var(--gold);
  background: rgba(210, 178, 107, 0.12);
}

.choice-feat-step-dot--done {
  border-color: rgba(92, 189, 133, 0.4);
  color: #9de1bb;
  background: rgba(66, 158, 109, 0.18);
}

.choice-feat-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.15rem;
}

.choice-feat-step-title {
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.45rem;
}

.choice-feat-step-subtitle {
  margin: 0.3rem 0 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.choice-feat-benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.choice-feat-benefit-card {
  appearance: none;
  font: inherit;
  text-align: left;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(15, 30, 55, 0.45);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.choice-feat-benefit-card:hover {
  border-color: rgba(201, 168, 76, 0.55);
  transform: translateY(-1px);
}

.choice-feat-benefit-card.selected {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.14);
}

.choice-feat-benefit-card .card-name {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.choice-feat-benefit-card .card-detail {
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.choice-feat-skill-wrap {
  margin-top: 0.6rem;
}

.choice-feat-help {
  margin-top: 0.65rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(126, 184, 212, 0.35);
  background: rgba(42, 74, 106, 0.2);
  color: var(--gold-blue);
  font-size: 0.78rem;
}

.choice-feat-list {
  margin-top: 0.55rem;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.2rem;
}

.choice-feat-item {
  appearance: none;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(15, 30, 55, 0.42);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.choice-feat-item:hover {
  border-color: rgba(201, 168, 76, 0.5);
}

.choice-feat-item--active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.14);
}

.choice-feat-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.choice-feat-item-name {
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  color: var(--text);
}

.choice-feat-item-source {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-blue);
}

.choice-feat-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: pre-line;
}

.choice-feat-empty {
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px dashed var(--card-border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.choice-feat-actions {
  margin-top: 0.2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.choice-feat-actions .wiz-btn {
  min-height: 2.15rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.choice-feat-actions .wiz-btn:not(.primary) {
  border-color: rgba(126, 184, 212, 0.3);
  color: var(--text-muted);
  background: rgba(13, 20, 32, 0.72);
}

.choice-feat-actions .wiz-btn:not(.primary):hover {
  border-color: rgba(126, 184, 212, 0.55);
  color: var(--text);
  background: rgba(13, 20, 32, 0.92);
}

.choice-feat-actions .wiz-btn.primary {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.24), rgba(42, 74, 106, 0.34));
}

.choice-feat-actions .wiz-btn.primary:hover {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.3), rgba(42, 74, 106, 0.44));
}

@media (max-width: 700px) {
  .choice-feat-panel {
    width: min(96vw, 96vw);
    max-height: calc(100dvh - 1rem);
    padding: 0.95rem 0.85rem 0.85rem;
  }

  .choice-feat-content {
    padding-right: 0;
  }

  .choice-feat-benefit-grid {
    grid-template-columns: 1fr;
  }

  .cl-choice-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .cl-choice-value {
    text-align: left;
  }
}

/* ── CUSTOM BACKGROUND EXTRAS ─────────────────────────────── */

.cb-skill-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.cb-skill-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  background: rgba(15, 30, 55, 0.42);
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.76rem;
  line-height: 1.3;
}

.cb-skill-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  margin: 0;
  position: relative;
  flex: 0 0 auto;
}

.cb-skill-check input[type="checkbox"]:checked {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.cb-skill-check input[type="checkbox"]:checked::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--gold);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cb-skill-check--active {
  border-color: rgba(195, 155, 73, 0.65);
  background: rgba(195, 155, 73, 0.16);
}

.cb-skill-check--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cb-equip-fixed {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cb-equip-notes {
  resize: vertical;
  min-height: 3rem;
}

/* ── BACKGROUND BENEFITS PANEL ────────────────────────────── */

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

.bg-benefits-panel {
  margin-top: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  animation: fadeInUp 0.25s ease;
}

.bg-benefits-title {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.bg-benefits-list {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
}

.bg-benefits-list li {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.wizard-step.has-theme.active .bg-benefits-panel {
  border-color: var(--step-accent-glow);
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.86), rgba(13, 20, 32, 0.95));
}

.wizard-step.has-theme.active .bg-benefits-title {
  color: var(--step-accent);
}

/* ── STARTING POINT CARDS ─────────────────────────────────── */

.sp-card {
  text-align: center;
  padding: 1.2rem 0.85rem;
}

.sp-card .sp-level {
  font-family: "Cinzel", serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.sp-card .sp-name {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--text);
  margin: 0.3rem 0 0.5rem;
}

.sp-card .sp-narrative {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.sp-card .sp-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.sp-card .sp-features li {
  font-size: 0.82rem;
  color: var(--gold-blue);
  padding-left: 1rem;
  position: relative;
}

.sp-card .sp-features li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.7rem;
}

.sp-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(201, 168, 76, 0.25);
}

.sp-card.selected .sp-level {
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(246, 212, 144, 0.3);
}

.sp-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.sp-card .lock-icon {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.sp-card .lock-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.4rem;
}

.sp-legendary {
  border-image: linear-gradient(135deg, var(--gold), var(--gold-blue), var(--gold)) 1;
}

/* ── ORIGIN CARD extras ───────────────────────────────────── */

.origin-emoji {
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
  display: block;
}

.origin-region {
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

/* ── ATTRIBUTES ───────────────────────────────────────────── */

/* Section wrapper */
.attr-section {
  margin-bottom: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.4);
}

.attr-section--locked {
  opacity: 0.55;
  pointer-events: none;
}

.attr-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.attr-section-title {
  font-family: "Cinzel", serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0;
}

.section-lock-badge {
  font-size: 0.72rem;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-family: "Cinzel", serif;
}

.section-locked-msg {
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* Background bonus banner */
.bg-bonus-banner {
  background: var(--gold-dim);
  border: 1px solid rgba(195, 155, 73, 0.35);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.bg-bonus-banner__title {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.bg-bonus-banner__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.bg-bonus-banner__tag {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.bg-bonus-banner__tag--plus2 {
  background: rgba(195, 155, 73, 0.2);
  color: var(--gold);
  border: 1px solid rgba(195, 155, 73, 0.4);
}

.bg-bonus-banner__tag--plus1 {
  background: rgba(100, 200, 130, 0.12);
  color: hsl(142 50% 62%);
  border: 1px solid rgba(100, 200, 130, 0.3);
}

.bg-bonus-banner__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Method selector */
.method-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.method-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.method-card:hover:not(:disabled) {
  border-color: var(--gold-dim);
  background: rgba(201, 168, 76, 0.06);
}

.method-card--active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

.method-card--disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.method-card__icon {
  font-size: 1.4rem;
  line-height: 1;
}

.method-card__label {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.method-card__desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.method-card__lock {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  font-size: 0.8rem;
}

/* Method panels */
.attr-method-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Rolled sets */
.rolled-sets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.rolled-set {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.4rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.5);
  transition: border-color var(--transition);
}

.rolled-set--assigned {
  border-color: var(--gold-dim);
}

.rolled-dice {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.rolled-formula {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.die-val { color: var(--text); }
.die-val-dropped { color: var(--text-muted); text-decoration: line-through; opacity: 0.55; }
.die-sep { color: var(--text-muted); }
.rolled-total { color: var(--gold); font-size: 0.85rem; }

.assigned-badge {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

/* Assign table */
.assign-table {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.assign-table-header {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--card-border);
}

.assign-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background var(--transition);
}

.assign-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.assign-ability {
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.assign-final {
  font-size: 0.82rem;
  color: var(--text);
}

.origin-bonus {
  font-size: 0.72rem;
  color: var(--gold-blue);
  font-style: normal;
}

/* Standard array chips */
.standard-chips-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.standard-chips-label {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.standard-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.standard-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  transition: all var(--transition);
}

.standard-chip--used {
  opacity: 0.35;
  text-decoration: line-through;
  border-color: var(--card-border);
  color: var(--text-muted);
}

/* Point Buy */
.pb-budget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: rgba(13, 20, 32, 0.5);
}

.pb-budget--done { border-color: var(--gold); }
.pb-budget--over { border-color: hsl(0 70% 55%); }

.pb-budget-label {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pb-budget-value {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  color: var(--gold);
}

.pb-budget-total {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pb-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pb-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background var(--transition);
}

.pb-row:hover { background: rgba(255, 255, 255, 0.03); }

.pb-ability {
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  color: var(--gold);
}

.pb-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pb-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.pb-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

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

.pb-value {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  min-width: 2rem;
  text-align: center;
}

.pb-total {
  font-size: 0.82rem;
  color: var(--text);
}

.pb-cost {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

/* Confirm button */
.confirm-btn {
  align-self: flex-start;
  padding: 0.5rem 1.2rem;
  border: 1px solid hsl(142 60% 48%);
  border-radius: var(--radius);
  background: hsla(142 60% 48% / 0.14);
  color: hsl(142 60% 68%);
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition);
}

.confirm-btn:hover {
  background: hsla(142 60% 48% / 0.28);
  border-color: hsl(142 60% 60%);
}

/* Confirmed summary */
.confirmed-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.confirmed-badge {
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.confirmed-attrs-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.confirmed-attr-cell {
  text-align: center;
  padding: 0.5rem 0.25rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.55);
}

.confirmed-attr-label {
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.confirmed-attr-val {
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.confirmed-attr-mod {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.confirmed-attr-bonus {
  font-size: 0.65rem;
  color: var(--gold-blue);
}

/* HP Section */
.hp-section-inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.hp-formula-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.5);
}

.hp-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
}

.hp-info-icon { font-size: 1rem; }
.hp-info-class { color: var(--text-muted); font-size: 0.82rem; }

.hp-method-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.hp-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.hp-method-btn:hover {
  border-color: var(--gold-dim);
  background: rgba(201, 168, 76, 0.06);
}

.hp-method-btn--active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
}

.hp-method-icon { font-size: 1.3rem; line-height: 1; }

.hp-method-name {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  color: var(--text);
}

.hp-method-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hp-method-formula {
  font-size: 0.82rem;
  color: var(--gold);
}

.hp-method-click {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

.hp-rolling-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.hp-roll-result {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: rgba(201, 168, 76, 0.06);
}

.hp-roll-text {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
}

.hp-roll-total {
  font-size: 1.1rem;
  color: var(--gold);
}

.reroll-btn {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.reroll-btn:hover:not(:disabled) {
  border-color: var(--gold-dim);
  color: var(--text);
}

/* HP confirmed display */
.hp-confirmed-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hp-confirmed-value {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.hp-confirmed-label {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Final summary */
.attr-final-summary {
  border-color: var(--gold-dim);
}

.attr-hp-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--card-border);
}

.attr-hp-label {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.attr-hp-value {
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  color: var(--gold);
}

/* HP Breakdown (fórmula detalhada) */
.hp-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(13, 20, 32, 0.45);
  font-size: 0.85rem;
}

.hp-breakdown-row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.hp-breakdown-label {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 6.5rem;
  flex-shrink: 0;
}

.hp-breakdown-value {
  color: var(--text);
}

.hp-breakdown-value em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.78rem;
}

.hp-breakdown-divider {
  border-top: 1px dashed var(--card-border);
  margin: 0.15rem 0;
}

.hp-breakdown-total {
  font-size: 0.88rem;
  color: var(--gold);
}

.hp-info-row--hint {
  margin-top: 0.2rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--card-border);
  color: var(--text-muted) !important;
  font-size: 0.8rem !important;
}

/* Método escolhido badge */
.hp-method-chosen-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: rgba(201, 168, 76, 0.08);
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  color: var(--gold);
  align-self: flex-start;
}

/* Dice row para rolagem de HP (nível 3/5) */
.hp-dice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.2rem 0;
}

.hp-die-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.hp-die-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: "Cinzel", serif;
}

/* Fórmula do resultado da rolagem de HP */
.hp-roll-formula {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: rgba(201, 168, 76, 0.06);
}

.hp-roll-formula-text {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.hp-die-val {
  font-family: "Cinzel", serif;
  color: var(--gold);
  font-size: 0.95rem;
}

/* Ações de re-roll + confirm em linha */
.hp-roll-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.hp-rolling-center {
  text-align: center;
  padding: 1.2rem 0;
  font-size: 0.95rem;
}

/* Final summary — breakdown de HP por nível */
.attr-hp-summary {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--card-border);
  font-size: 0.84rem;
}

.attr-hp-detail-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  gap: 0.5rem;
}

.attr-hp-total-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--card-border);
}

/* ── DICE FACES ───────────────────────────────────────────── */

.die-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

/* d6 pip faces */
.die-d6 {
  background: rgba(30, 45, 70, 0.9);
  border: 1.5px solid var(--gold-dim);
}

.die-dropped .die-d6,
.die-d6.die-dropped {
  opacity: 0.38;
  filter: grayscale(0.6);
  border-style: dashed;
}

.die-pips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 5px;
  width: 100%;
  height: 100%;
}

.pip {
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.pip-on {
  background: var(--gold);
}

/* Non-d6 dice (SVG polygon) */
.die-face:not(.die-d6) {
  background: transparent;
}

.die-svg {
  width: 100%;
  height: 100%;
}

.die-poly-path {
  fill: rgba(30, 45, 70, 0.9);
  stroke: var(--gold-dim);
  stroke-width: 3;
}

.die-poly-text {
  font-family: "Cinzel", serif;
  font-size: 36px;
  font-weight: 700;
  fill: var(--gold);
}

.die-face.die-dropped .die-poly-path {
  opacity: 0.38;
  stroke-dasharray: 4 3;
}

.die-face.die-dropped .die-poly-text {
  opacity: 0.38;
}

/* Roll animation */
@keyframes diceShake {
  0%   { transform: rotate(0deg) scale(1); }
  15%  { transform: rotate(-18deg) scale(0.88); }
  35%  { transform: rotate(14deg) scale(1.12); }
  55%  { transform: rotate(-9deg) scale(0.94); }
  75%  { transform: rotate(6deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.dice-rolling .die-face {
  animation: diceShake 0.56s ease-in-out;
}

.dice-rolling .die-face:nth-child(2) { animation-delay: 0.05s; }
.dice-rolling .die-face:nth-child(3) { animation-delay: 0.1s; }
.dice-rolling .die-face:nth-child(4) { animation-delay: 0.15s; }

/* Legacy roll button (kept for compatibility) */
.attr-mode-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}

.mode-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}

.attr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.attr-cell {
  text-align: center;
  padding: 0.7rem 0.5rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.attr-cell label {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

.attr-cell input {
  width: 60px;
  text-align: center;
  padding: 0.35rem;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: rgba(13, 20, 32, 0.8);
  color: var(--text);
  font-family: "Cinzel", serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.attr-cell input:focus { outline: none; border-color: var(--gold); }
.attr-cell .attr-bonus { font-size: 0.75rem; color: var(--gold-blue); margin-top: 0.2rem; min-height: 1rem; }
.attr-cell .attr-final { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

.roll-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: rgba(42, 74, 106, 0.25);
  color: var(--gold-blue);
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.roll-btn:hover:not(:disabled) {
  border-color: var(--gold-blue);
  background: rgba(42, 74, 106, 0.4);
}

/* ── Race card "Ver detalhes" button ───────────────────────────── */
.card-details-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  background: none;
  border: 1px solid rgba(126, 184, 212, 0.3);
  border-radius: 4px;
  color: var(--gold-blue);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.card-details-btn:hover {
  background: rgba(42, 74, 106, 0.35);
  border-color: var(--gold-blue);
}

/* ── Trait tag variants ─────────────────────────────────────────── */
.trait-tag--more {
  background: rgba(126, 184, 212, 0.2);
  border-color: rgba(126, 184, 212, 0.5);
  font-weight: 600;
}
.trait-tag--hp {
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.45);
  background: rgba(201, 168, 76, 0.08);
}

/* ── Race details modal ─────────────────────────────────────────── */
.race-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 10, 20, 0.88);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.race-modal-panel {
  position: relative;
  background: #0b1422;
  border: 1px solid rgba(126, 184, 212, 0.3);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  overflow-y: auto;
  padding: 2rem 2rem 1.75rem;
}
.race-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: none;
  border: 1px solid rgba(126, 184, 212, 0.25);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.race-modal-close:hover {
  color: var(--gold-blue);
  border-color: var(--gold-blue);
}
.race-modal-image-wrap {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: rgba(42, 74, 106, 0.2);
}
.race-modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.race-modal-title {
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin: 0 0 0.4rem;
}
.race-modal-detail {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 1.2rem;
}
.race-modal-traits-title {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--gold-blue);
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.race-modal-traits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.race-modal-traits-list li {
  padding: 0.4rem 0.6rem;
  border-left: 2px solid var(--gold-blue);
  background: rgba(42, 74, 106, 0.15);
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
  color: var(--text);
}

/* ── Character Hub ──────────────────────────────────────────────── */
.char-hub {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.char-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.char-hub-title {
  font-family: "Cinzel", serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin: 0;
}
.char-hub-new-btn {
  white-space: nowrap;
}
.char-hub-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 4rem 1rem;
  color: var(--text-muted);
  text-align: center;
}
.char-hub-empty p {
  font-size: 1rem;
  margin: 0;
}
.char-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

/* ── Character card ─────────────────────────────────────────────── */
.char-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid rgba(126, 184, 212, 0.2);
  border-radius: 8px;
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.char-card:hover {
  border-color: rgba(126, 184, 212, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.char-card-portrait {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(42, 74, 106, 0.45);
  border: 2px solid rgba(126, 184, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.char-card-initial {
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  color: var(--gold);
  line-height: 1;
}
.char-card-body {
  text-align: center;
  width: 100%;
}
.char-card-name {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--gold);
  margin: 0 0 0.25rem;
  word-break: break-word;
}
.char-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}
.char-card-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.char-card-stat {
  display: inline-flex;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(126, 184, 212, 0.3);
  font-size: 0.75rem;
  color: var(--gold-blue);
  background: rgba(42, 74, 106, 0.15);
}
.char-card-stat--hp {
  color: var(--gold);
  border-color: rgba(201, 168, 76, 0.4);
  background: rgba(201, 168, 76, 0.07);
}
.char-card-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.char-card-delete:hover {
  color: #e06c75;
  background: rgba(224, 108, 117, 0.12);
}

.roll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Attribute assign pills (Roll + Standard) ────────────────── */
.assign-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.assign-row-new {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  transition: background var(--transition);
}
.assign-row-new:hover {
  background: rgba(255, 255, 255, 0.03);
}

.assign-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.assign-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid rgba(126, 184, 212, 0.3);
  border-radius: 5px;
  background: rgba(42, 74, 106, 0.15);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.1;
}
.assign-pill:hover {
  border-color: var(--gold-blue);
  background: rgba(42, 74, 106, 0.4);
}
.assign-pill--active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.18);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}
.assign-pill--used {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}
.assign-pill--used:hover {
  opacity: 0.75;
  border-color: rgba(126, 184, 212, 0.4);
}
.assign-pill-val {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
}
.assign-pill--active .assign-pill-val {
  color: var(--gold-bright);
}
.assign-pill--used .assign-pill-val {
  color: var(--text-muted);
}
.assign-pill-owner {
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ── Character detail modal ──────────────────────────────────── */
.char-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 10, 20, 0.88);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.char-detail-panel {
  position: relative;
  background: #0b1422;
  border: 1px solid rgba(126, 184, 212, 0.3);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}
.char-detail-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: none;
  border: 1px solid rgba(126, 184, 212, 0.2);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.char-detail-close:hover {
  color: var(--gold-blue);
  border-color: var(--gold-blue);
}
.char-detail-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.char-detail-portrait {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(42, 74, 106, 0.5);
  border: 2px solid rgba(126, 184, 212, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.char-detail-initial {
  font-family: "Cinzel", serif;
  font-size: 1.7rem;
  color: var(--gold);
  line-height: 1;
}
.char-detail-name {
  font-family: "Cinzel", serif;
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0 0 0.2rem;
}
.char-detail-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.char-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.char-detail-section-title {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-blue);
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(126, 184, 212, 0.15);
}
.char-detail-attrs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.char-detail-attr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.3rem;
  background: rgba(42, 74, 106, 0.18);
  border: 1px solid rgba(126, 184, 212, 0.18);
  border-radius: 6px;
  gap: 0.1rem;
}
.char-detail-attr-label {
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.char-detail-attr-val {
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.char-detail-attr-mod {
  font-size: 0.78rem;
  color: var(--gold-blue);
}
.char-detail-json-toggle {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  background: none;
  border: 1px solid rgba(126, 184, 212, 0.2);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.char-detail-json-toggle:hover {
  border-color: var(--gold-blue);
  color: var(--gold-blue);
}
.char-detail-json {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 1rem;
}
.char-detail-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(126, 184, 212, 0.12);
}

/* ── SUMMARY ──────────────────────────────────────────────── */

.summary-grid {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(201, 168, 76, 0.15);
}

.summary-label {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.summary-value {
  color: var(--text);
  font-size: 0.95rem;
  text-align: right;
}

.export-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--card-border);
}

.export-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--card-border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--card-bg);
  color: var(--text-muted);
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-right: -1px;
}

.export-tab.active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold-dim);
}

.export-content {
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem;
  background: rgba(13, 20, 32, 0.5);
  min-height: 120px;
}

.export-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--gold-blue);
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.export-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

/* ── FOOTER NAV ───────────────────────────────────────────── */

.wizard-footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 2rem;
  border-top: 1px solid var(--card-border);
  background: rgba(13, 20, 32, 0.8);
  backdrop-filter: blur(6px);
}

.wiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.95), rgba(13, 20, 32, 0.72));
  color: var(--text);
  font-family: "Cinzel", serif;
  font-size: 0.88rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all var(--transition);
}

.wiz-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.wiz-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.wiz-btn.primary {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.28), rgba(42, 74, 106, 0.32));
  border-color: var(--gold);
  color: var(--gold-bright);
}

.wiz-btn.primary:hover {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.3), rgba(42, 74, 106, 0.4));
}

/* ── LOADING SPINNER ──────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--card-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-msg {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

/* ── EXTRA FIELDS (summary) ───────────────────────────────── */

.extra-fields {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

/* ── MOBILE PREVIEW TOGGLE ────────────────────────────────── */

.mobile-preview-toggle {
  display: none;
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.45rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(13, 20, 32, 0.95);
  color: var(--gold);
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.mobile-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  place-items: center;
}

.mobile-preview-overlay.open {
  display: grid;
}

.mobile-preview-overlay .preview-panel {
  width: 90vw;
  max-width: 360px;
  max-height: 80vh;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--navy);
}

.mobile-preview-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 1rem;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */

/* ── Tablet / Monitor pequeno (≤ 900px) ────────────────────── */
@media (max-width: 900px) {
  .creator-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stepper"
      "wizard"
      "footer";
  }

  .preview-panel { display: none; }
  .mobile-preview-toggle { display: block; }

  .card-grid.sp-grid {
    grid-template-columns: 1fr;
  }

  .wizard-area {
    padding: 1rem;
    min-height: 0;
  }

  /* Split layouts: reduz coluna lateral */
  .step-split-layout {
    grid-template-columns: 1fr 260px;
    gap: 1rem;
  }

  .bg-step-layout {
    grid-template-columns: 1fr 260px;
    gap: 1rem;
  }
}

/* ── Mobile landscape / tela média (≤ 700px) ───────────────── */
@media (max-width: 700px) {
  /* Split layouts: empilha em coluna única */
  .step-split-layout,
  .bg-step-layout {
    grid-template-columns: 1fr;
  }

  .step-info-col,
  .bg-info-col {
    order: -1;
  }

  .side-detail-panel,
  .side-empty-panel,
  .bg-detail-panel,
  .bg-empty-panel {
    position: static;
  }

  .side-detail-panel,
  .bg-detail-panel {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  /* Method selector empilha */
  .method-selector {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .method-card {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    text-align: left;
  }

  .method-card__icon {
    font-size: 1.3rem;
    flex-shrink: 0;
  }

  .method-card__desc {
    display: none;
  }

  /* Dados rolados: 2 colunas */
  .rolled-sets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }

  /* Assign row: coluna ao invés de grid inline */
  .assign-row-new {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: rgba(13, 20, 32, 0.3);
    margin-bottom: 0.25rem;
  }

  .assign-ability {
    font-size: 0.82rem;
  }

  .assign-pills {
    justify-content: center;
  }

  .assign-final {
    text-align: center;
    font-size: 0.85rem;
  }

  /* Point Buy rows: 2 colunas */
  .pb-row {
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    row-gap: 0.15rem;
    flex-wrap: wrap;
  }

  .pb-total {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.82rem;
  }

  .pb-cost {
    grid-column: 1 / -1;
    text-align: center;
  }

  /* Confirmed attrs grid: 3 colunas */
  .confirmed-attrs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* HP method row */
  .hp-method-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* HP formula wrap */
  .hp-roll-formula-text {
    font-size: 0.82rem;
    justify-content: center;
  }

  /* HP actions stack */
  .hp-roll-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hp-roll-actions .confirm-btn,
  .hp-roll-actions .reroll-btn {
    width: 100%;
    justify-content: center;
  }

  /* Background bonus banner */
  .bg-bonus-banner {
    padding: 0.6rem 0.75rem;
  }

  /* Summary row wrap */
  .summary-row {
    flex-direction: column;
    gap: 0.15rem;
  }

  .summary-value {
    text-align: left;
  }

  /* Export tabs scroll */
  .export-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Mobile portrait (≤ 600px) ─────────────────────────────── */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-grid.card-grid--portrait {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .identity-photo-block {
    padding: 0.75rem;
  }

  .identity-photo-preview-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .identity-photo-preview {
    height: 170px;
  }

  .identity-photo-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .identity-photo-crop-actions {
    justify-content: stretch;
  }

  .identity-photo-crop-reset {
    width: 100%;
    justify-content: center;
  }

  .identity-photo-remove-btn {
    width: 100%;
    justify-content: center;
  }

  .stepper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.5rem 0.5rem 0.6rem;
  }

  .step-item {
    min-height: 90px;
    padding-inline: 0.15rem;
    gap: 0.3rem;
  }

  .step-thumb {
    width: 44px;
    height: 44px;
  }

  .step-title {
    font-size: 0.6rem;
  }

  .step-hint {
    display: none;
  }

  /* Footer */
  .wizard-footer {
    padding: 0.55rem 0.75rem;
  }

  .wiz-btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }

  /* Wizard area */
  .wizard-area {
    padding: 0.75rem 0.65rem 0.5rem;
    min-height: 0;
  }

  /* Section titles */
  .attr-section-title {
    font-size: 0.95rem;
  }

  /* Roll button */
  .roll-btn,
  .confirm-btn {
    width: 100%;
    justify-content: center;
  }

  /* Category filter: scroll horizontal */
  .category-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.3rem;
  }

  .cat-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Background attr selector buttons */
  .bg-attr-head {
    flex-direction: column;
    align-items: stretch;
  }

  .bg-tasha-toggle {
    justify-content: space-between;
    width: 100%;
  }

  .bg-attr-modes {
    flex-direction: column;
    gap: 0.35rem;
  }

  .cb-skill-check-grid {
    grid-template-columns: 1fr;
  }

  /* HP breakdown */
  .hp-breakdown-row {
    flex-direction: column;
    gap: 0.1rem;
  }

  .hp-breakdown-label {
    font-size: 0.72rem;
  }

  .hp-breakdown-value {
    font-size: 0.78rem;
  }

  /* Search bar ajuste */
  .search-bar__input {
    font-size: 0.82rem;
  }
}

/* ── Mobile compacto (≤ 420px) ─────────────────────────────── */
@media (max-width: 420px) {
  .stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
    padding: 0.4rem;
  }

  .step-thumb {
    width: 38px;
    height: 38px;
  }

  .step-title {
    font-size: 0.55rem;
  }

  .step-check {
    font-size: 0.65rem;
  }

  .card-grid.card-grid--portrait {
    grid-template-columns: 1fr 1fr;
  }

  /* Assign pills menores */
  .assign-pill {
    padding: 0.25rem 0.4rem;
    min-width: 32px;
  }

  .assign-pill-val {
    font-size: 0.78rem;
  }

  /* Point Buy botões menores */
  .pb-btn {
    width: 32px;
    height: 32px;
  }

  .pb-value {
    min-width: 28px;
    font-size: 0.95rem;
  }

  /* Confirmed attrs: 2 colunas */
  .confirmed-attrs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wiz-btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.72rem;
  }

  /* Mobile preview toggle sobe um pouco */
  .mobile-preview-toggle {
    bottom: 64px;
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
  }
}
