/* IL CAMMINO DELL'ALCHIMISTA — RPG-specific styles */

/* ── Act atmosphere ── */
[data-act="nigredo"] { --act-glow: rgba(90,60,140,0.25); --act-accent: #8a8a9a; --act-accent2: #6e5a96; }
[data-act="albedo"]  { --act-glow: rgba(160,180,220,0.20); --act-accent: #c0c4d4; --act-accent2: #8aa0c4; }
[data-act="rubedo"]  { --act-glow: rgba(200,100,40,0.22); --act-accent: #e0a050; --act-accent2: #c44a2a; }
[data-theme="light"][data-act="nigredo"] { --act-glow: rgba(90,60,140,0.08); }
[data-theme="light"][data-act="albedo"]  { --act-glow: rgba(100,130,180,0.08); }
[data-theme="light"][data-act="rubedo"]  { --act-glow: rgba(200,100,40,0.08); }

body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 800px 600px at 50% 80%, var(--act-glow, transparent), transparent 70%);
  transition: background 1.2s ease;
}

/* ── Stats panel ── */
.rpg-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 0.5px solid var(--border);
  margin-bottom: 1rem;
}
@media (max-width: 400px) { .rpg-stats { grid-template-columns: 1fr; } }
.rpg-stat {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.rpg-stat-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 0.5px solid var(--border);
}
.rpg-stat-icon.presenza   { background: rgba(120,160,220,0.12); color: #8ab4e8; border-color: rgba(120,160,220,0.3); }
.rpg-stat-icon.volonta    { background: rgba(220,160,60,0.12);  color: #e0b050; border-color: rgba(220,160,60,0.3); }
.rpg-stat-icon.nongiudizio{ background: rgba(160,120,200,0.12); color: #b49fe0; border-color: rgba(160,120,200,0.3); }
.rpg-stat-icon.compassione{ background: rgba(200,100,120,0.12); color: #e09090; border-color: rgba(200,100,120,0.3); }
[data-theme="light"] .rpg-stat-icon.presenza    { color: #3a6fa0; }
[data-theme="light"] .rpg-stat-icon.volonta     { color: #8a6a10; }
[data-theme="light"] .rpg-stat-icon.nongiudizio { color: #6b5a9e; }
[data-theme="light"] .rpg-stat-icon.compassione { color: #a04050; }
.rpg-stat-info { flex: 1; min-width: 0; }
.rpg-stat-name { font-size: 11px; letter-spacing: 0.04em; font-variant-caps: all-small-caps; color: var(--text-muted); line-height: 1; margin-bottom: 3px; }
.rpg-stat-bar { height: 5px; border-radius: 3px; background: var(--surface); overflow: hidden; border: 0.5px solid rgba(255,255,255,0.06); }
.rpg-stat-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; min-width: 0; }
.rpg-stat-fill.presenza    { background: linear-gradient(90deg, #5a8ac0, #8ab4e8); }
.rpg-stat-fill.volonta     { background: linear-gradient(90deg, #b08030, #e0b050); }
.rpg-stat-fill.nongiudizio { background: linear-gradient(90deg, #7b5ea7, #b49fe0); }
.rpg-stat-fill.compassione { background: linear-gradient(90deg, #a04050, #e09090); }
.rpg-stat-val { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-muted); min-width: 20px; text-align: right; }

/* ── Level badge ── */
.rpg-level {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-size: 14px; color: var(--gold-light);
  letter-spacing: 0.04em; margin-bottom: 0.6rem;
}
.rpg-level-glyph {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hover); font-size: 15px; background: rgba(201,151,58,0.08);
}

/* ── Scenario card ── */
.rpg-scene {
  background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 16px;
  padding: clamp(1.3rem, 4vw, 2rem); position: relative;
}
[data-theme="light"] .rpg-scene { box-shadow: 0 2px 14px rgba(80,60,30,0.07); }
.rpg-scene::before {
  content: ''; position: absolute; inset: 7px; border-radius: 11px;
  border: 0.5px solid rgba(201,151,58,0.12); pointer-events: none;
}
.rpg-scene-text {
  font-family: var(--font-display); font-size: clamp(16px, 2.8vw, 19px);
  line-height: 1.65; color: var(--text); margin-bottom: 1.2rem;
  border-left: 2.5px solid var(--act-accent, var(--gold)); padding-left: 1rem;
  text-wrap: pretty;
}
.rpg-scene-prompt {
  font-size: 12px; letter-spacing: 0.05em; font-variant-caps: all-small-caps;
  color: var(--act-accent, var(--gold)); margin-bottom: 0.7rem;
}

/* ── Choice buttons ── */
.rpg-choices { display: flex; flex-direction: column; gap: 10px; }
.rpg-choice {
  position: relative; text-align: left; cursor: pointer; font: inherit;
  background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px;
  padding: 0.85rem 1rem 0.85rem 1rem; color: var(--text); font-size: 15px; line-height: 1.45;
  min-height: 48px; display: flex; align-items: center;
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-fast);
}
.rpg-choice:hover:not(:disabled) { border-color: var(--border-hover); background: var(--surface-hover); }
.rpg-choice:active:not(:disabled) { transform: scale(0.99); }
.rpg-choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.rpg-choice.chosen-conscious { border-color: var(--green); background: rgba(29,158,117,0.12); }
.rpg-choice.chosen-mechanical { border-color: var(--danger); background: rgba(216,85,79,0.10); }
.rpg-choice.chosen-neutral { border-color: var(--gold); background: rgba(201,151,58,0.10); }
.rpg-choice.dim { opacity: 0.45; }
.rpg-choice:disabled { cursor: default; }

/* ── Feedback ── */
.rpg-feedback {
  margin-top: 1.2rem; opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity var(--t-base), max-height var(--t-slow);
}
.rpg-feedback.show { opacity: 1; max-height: 600px; }
.rpg-result-text {
  font-family: var(--font-display); font-size: 15.5px; line-height: 1.6;
  color: var(--text-muted); margin-bottom: 0.6rem; text-wrap: pretty;
}
.rpg-stat-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  margin-right: 6px; margin-bottom: 4px;
}
.rpg-stat-change.positive { background: rgba(29,158,117,0.14); color: var(--green-soft); }
.rpg-stat-change.negative { background: rgba(216,85,79,0.12); color: #f0a59f; }
[data-theme="light"] .rpg-stat-change.positive { color: #0f7a52; }
[data-theme="light"] .rpg-stat-change.negative { color: #b5443e; }
.rpg-teaching {
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  line-height: 1.6; color: var(--gold-light); margin-top: 0.8rem;
  padding: 0.6rem 1rem; border-radius: 10px;
  background: rgba(201,151,58,0.06); border: 0.5px solid rgba(201,151,58,0.15);
}

/* ── Act intro ── */
.rpg-act-intro {
  text-align: center; max-width: 540px; margin: auto; padding: 2rem 0;
  animation: fade-in var(--t-slow) both;
}
.rpg-act-numeral {
  font-family: var(--font-display); font-size: 14px; letter-spacing: 0.12em;
  color: var(--act-accent, var(--gold)); margin-bottom: 0.5rem;
}
.rpg-act-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 7vw, 48px); color: var(--text); letter-spacing: 0.02em;
}
.rpg-act-sub {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(16px, 3vw, 22px); color: var(--act-accent, var(--text-muted));
  margin-top: 0.3rem;
}
.rpg-act-desc {
  font-family: var(--font-display); font-size: 16px; line-height: 1.65;
  color: var(--text-muted); margin-top: 1.4rem; text-wrap: pretty;
}

/* ── Boss ── */
.rpg-boss-intro {
  text-align: center; max-width: 540px; margin: auto; padding: 2rem 0;
  animation: fade-in var(--t-slow) both;
}
.rpg-boss-seal {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1.2rem;
  border: 1.5px solid var(--act-accent2, var(--danger));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--act-accent, #ccc);
  background: rgba(200,80,60,0.08);
  animation: boss-pulse 2s ease-in-out infinite;
}
@keyframes boss-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(200,80,60,0); } 50% { box-shadow: 0 0 30px 4px rgba(200,80,60,0.2); } }
.rpg-boss-name {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(24px, 5vw, 36px); color: var(--text); margin-bottom: 0.5rem;
}
.rpg-boss-desc {
  font-family: var(--font-display); font-style: italic; font-size: 16px;
  line-height: 1.6; color: var(--text-muted); text-wrap: pretty;
}

/* ── Profile result ── */
.rpg-profile {
  text-align: center; max-width: 560px; margin: 0 auto; padding: 1rem 0;
  animation: fade-in var(--t-slow) both;
}
.rpg-profile-seal {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 1rem;
  border: 1.5px solid var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--gold-light); background: rgba(201,151,58,0.08);
}
.rpg-profile h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 6vw, 40px); color: var(--gold-light); margin-bottom: 0.3rem;
}
.rpg-profile-level {
  font-size: 14px; letter-spacing: 0.06em; font-variant-caps: all-small-caps;
  color: var(--text-muted); margin-bottom: 1rem;
}
.rpg-profile-archetype {
  font-family: var(--font-display); font-size: clamp(20px, 4vw, 28px);
  font-weight: 500; color: var(--text); margin: 1rem 0 0.5rem;
}
.rpg-profile-desc {
  font-family: var(--font-display); font-size: 15.5px; line-height: 1.65;
  color: var(--text-muted); text-align: left; text-wrap: pretty;
  padding: 1rem 1.2rem; border-radius: 12px;
  background: var(--surface-2); border: 0.5px solid var(--border);
}
.rpg-profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 1.2rem 0; text-align: left;
}
@media (max-width: 400px) { .rpg-profile-stats { grid-template-columns: 1fr; } }
.rpg-profile-stat {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 10px; background: var(--surface-2); border: 0.5px solid var(--border);
}
.rpg-profile-stat-val {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  color: var(--gold-light); min-width: 30px;
}
.rpg-profile-stat-name {
  font-size: 13px; color: var(--text-muted);
}
.rpg-profile-actions {
  display: flex; gap: 0.7rem; justify-content: center; margin-top: 1.6rem; flex-wrap: wrap;
}

/* ── Progress bar (act) ── */
.rpg-progress {
  display: flex; align-items: center; gap: 6px; margin-bottom: 0.8rem;
}
.rpg-progress-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  transition: all var(--t-base);
}
.rpg-progress-dot.done { background: var(--gold); border-color: var(--gold); }
.rpg-progress-dot.current { background: var(--gold-light); border-color: var(--gold-light); box-shadow: 0 0 8px rgba(232,201,122,0.5); }
.rpg-progress-dot.boss { width: 14px; height: 14px; }
.rpg-progress-line {
  flex: 1; height: 1px; background: var(--border);
}

/* ── Misc ── */
.rpg-round { animation: fade-in var(--t-base) both; flex: 1; display: flex; flex-direction: column; }
.rpg-foot { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 1.3rem; }

@media (prefers-reduced-motion: reduce) {
  .rpg-boss-seal { animation: none; }
}
