/* ============================================================
   Cosmere RPG Skill Tree - Styles
   Dark theme inspired by Stormlight Archive highstorms
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-deep:       #0a0b10;
  --bg-panel:      #12141cee;
  --bg-card:       #1a1d28;
  --bg-hover:      #242838;
  --border:        #2a2e3d;
  --border-glow:   #3a7bd5;
  --text-primary:  #e8e6e3;
  --text-secondary:#9a98a0;
  --text-muted:    #5c5a63;
  --accent-storm:  #4a9eff;
  --accent-gold:   #d4a853;
  --accent-red:    #e05555;
  --accent-green:  #4ade80;
  --accent-purple: #a78bfa;
  --accent-teal:   #2dd4bf;
  --glow-storm:    rgba(74, 158, 255, 0.35);
  --glow-gold:     rgba(212, 168, 83, 0.35);
  --glow-locked:   rgba(90, 88, 100, 0.2);

  /* Class colors */
  --color-Agente:     #4ade80;
  --color-Emissário:  #facc15;
  --color-Caçador:    #f87171;
  --color-Líder:      #60a5fa;
  --color-Erudito:    #a78bfa;
  --color-Guerreiro:  #fb923c;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
}

/* ---- LAYOUT ---- */
#app {
  display: flex;
  width: 100%; height: 100%;
}

#sidebar {
  width: 340px;
  min-width: 340px;
  height: 100%;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  backdrop-filter: blur(12px);
}

#viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#viewport canvas {
  display: block;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 0;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- SIDEBAR SECTIONS ---- */
.sidebar-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-header-text {
  flex: 1;
  min-width: 0;
}

.sidebar-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-header .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ---- STATS GRID ---- */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.stat-val {
  color: #fff;
  font-size: 13px;
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---- CHARACTER SELECTION ---- */
.race-select {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.race-btn {
  flex: 1;
  padding: 10px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}
.race-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.race-btn.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: rgba(212, 168, 83, 0.08);
  box-shadow: 0 0 12px rgba(212, 168, 83, 0.15);
}
.race-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- PROFILE INPUT ---- */
.profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-row label {
  width: 110px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.profile-row input[type="text"],
.profile-row select {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.profile-row input:focus,
.profile-row select:focus { border-color: var(--accent-storm); }

/* ---- CHARACTER HEADER (portrait + info) ---- */
.character-header-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.char-portrait-wrap {
  position: relative;
  flex-shrink: 0;
}

.char-portrait {
  width: 76px;
  height: 96px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-muted);
  position: relative;
}

.char-portrait:hover {
  border-color: var(--accent-gold);
  background: rgba(212,168,83,0.05);
  color: var(--accent-gold);
}

.char-portrait-placeholder {
  width: 38px;
  height: 38px;
  color: inherit;
}

.char-portrait-hint {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
  font-family: 'Cinzel', serif;
}

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

.char-portrait-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: var(--accent-red);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
  transition: opacity 0.2s;
}
.char-portrait-clear:hover { opacity: 0.8; }

.char-info-col {
  flex: 1;
  min-width: 0;
}

/* Quando dentro do char-info-col, o label pode ser menor */
.char-info-col .profile-row label {
  width: 80px;
}

/* ---- LEVEL DISPLAY ---- */
.level-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.level-display {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 40px;
  text-align: center;
}

.level-controls {
  display: flex;
  gap: 4px;
}

.lvl-btn {
  width: 28px; height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.lvl-btn:hover { background: var(--bg-hover); border-color: var(--accent-storm); }

/* ---- ATTRIBUTES ---- */
.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.attr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
}

.attr-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.attr-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.attr-val {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 20px;
  text-align: center;
}

.attr-btn {
  width: 20px; height: 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.attr-btn:hover { color: var(--text-primary); border-color: var(--accent-storm); }

/* Defense totals */
.defense-row {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.defense-item {
  text-align: center;
}

.defense-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.defense-val {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
}
.defense-val.physical { color: var(--accent-red); }
.defense-val.cognitive { color: var(--accent-storm); }
.defense-val.spiritual { color: var(--accent-purple); }

/* ---- PERÍCIAS ---- */
.pericias-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.pericia-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.pericia-item:hover { border-color: var(--border); }

.pericia-name {
  font-size: 11px;
  color: var(--text-secondary);
}

.pericia-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pericia-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 14px;
  text-align: center;
}

.pericia-btn {
  width: 18px; height: 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pericia-btn:hover { color: var(--text-primary); border-color: var(--accent-storm); }

/* ---- POINTS REMAINING ---- */
.points-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.point-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.point-badge .val { color: var(--accent-gold); }
.point-badge.danger .val { color: var(--accent-red); }

/* ---- CLASS TABS ---- */
.class-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  background: var(--bg-panel);
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
/* -webkit-overflow-scrolling: touch; */
  flex-wrap: nowrap;
  /* força camada de composição acima do canvas WebGL (fix iOS Safari/Chrome) */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.class-tab {
  padding: 10px 16px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  margin-bottom: -2px;
}
.class-tab:hover { color: var(--text-secondary); }
.class-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-storm);
}
.class-tab.tab-all {
  color: var(--accent-gold);
  letter-spacing: 1px;
}
.class-tab.tab-all.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

/* ---- SKILL TOOLTIP ---- */
#tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  max-width: 300px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
#tooltip.visible { opacity: 1; transform: translateY(0); }

#tooltip .tt-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

#tooltip .tt-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

#tooltip .tt-rank {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(74,158,255,0.12);
  color: var(--accent-storm);
  margin-bottom: 8px;
}

#tooltip .tt-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
  max-width: 260px;
}

#tooltip .tt-reqs {
  margin-top: 6px;
  margin-bottom: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
#tooltip .tt-req {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
}
#tooltip .tt-req.met { color: var(--accent-green); }
#tooltip .tt-req.unmet { color: var(--accent-red); }
#tooltip .tt-req.special { color: var(--accent-purple); }

#tooltip .tt-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
  font-style: italic;
}

/* ---- BOTTOM BAR ---- */
.bottom-bar {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.save-load-row {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 8px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-secondary);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}
.btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent-storm); }
.btn.primary {
  background: rgba(74,158,255,0.1);
  border-color: var(--accent-storm);
  color: var(--accent-storm);
}
.btn.primary:hover {
  background: rgba(74,158,255,0.2);
}
.btn.danger { border-color: var(--accent-red); color: var(--accent-red); }
.btn.danger:hover { background: rgba(224,85,85,0.1); }

/* ---- RADIANT SECTION ---- */
:root {
  --accent-radiant: #c084fc;
}

.radiant-placeholder {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

#radiant-select {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.radiant-btn {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.radiant-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-radiant);
  color: var(--text-primary);
}
.radiant-btn.active {
  background: rgba(192, 132, 252, 0.1);
  border-color: var(--accent-radiant);
  color: var(--accent-radiant);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.15);
}

/* ---- RADIANT SURTOS (SURGES) ---- */
#radiant-pericias {
  margin-top: 8px;
}

.surtos-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.surtos-grid {
  grid-template-columns: 1fr 1fr;
}

.surto-name {
  color: var(--accent-radiant) !important;
}

/* ---- CLASS TAB SEPARATOR ---- */
.tab-separator {
  display: inline-block;
  width: 1px;
  background: var(--border);
  margin: 8px 4px;
  align-self: stretch;
}
.tab-separator-radiant {
  background: var(--accent-radiant);
  opacity: 0.4;
}
.class-tab.tab-radiant {
  color: var(--accent-radiant);
}
.class-tab.tab-radiant.active {
  color: var(--accent-radiant);
  border-bottom-color: var(--accent-radiant);
}

/* ---- LOADING SCREEN ---- */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.6s;
}
#loading.fade-out { opacity: 0; pointer-events: none; }

#loading h1 {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: var(--accent-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-storm);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- NOTIFICATION ---- */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--accent-green);
  border-radius: 6px;
  color: var(--accent-green);
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}
.notification.show { opacity: 1; transform: translateY(0); }

/* ---- TOOLTIP HINT ---- */
#tooltip .tt-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* ---- SKILL DETAIL MODAL ---- */
#skill-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
}
#skill-modal.visible { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.8), 0 0 30px rgba(74,158,255,0.08);
  padding: 0;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  z-index: 1;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-skill-name {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-skill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.modal-class, .modal-sub, .modal-rank, .modal-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.modal-class {
  background: rgba(74,158,255,0.1);
  color: var(--accent-storm);
  border: 1px solid rgba(74,158,255,0.2);
}

.modal-sub {
  background: rgba(167,139,250,0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(167,139,250,0.2);
}

.modal-rank {
  background: rgba(212,168,83,0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(212,168,83,0.2);
}

.modal-status {
  margin-left: auto;
}
.modal-status.unlocked { color: var(--accent-green); }
.modal-status.available { color: var(--accent-gold); }
.modal-status.locked { color: var(--text-muted); }

.modal-body {
  padding: 16px 24px;
}

/* ---- ATIVAÇÃO ---- */
.modal-activation {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.act-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.act-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.act-icon svg {
  display: block;
}

.act-label {
  line-height: 1;
}

/* Ícone menor no tooltip */
.act-icon-sm {
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  vertical-align: middle;
}

.act-icon-sm svg {
  display: block;
}

/* Linha de meta no tooltip (rank + ícone de ativação) */
.tt-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Remove margin-bottom do tt-rank quando está dentro de tt-meta-row */
.tt-meta-row .tt-rank {
  margin-bottom: 0;
}

.modal-desc-section {
  margin-bottom: 16px;
}

.modal-desc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.modal-desc-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-desc-text em {
  color: var(--text-muted);
}

.modal-req-section {
  margin-bottom: 16px;
}

.modal-req-item {
  font-size: 12px;
  padding: 4px 0;
  line-height: 1.4;
}
.modal-req-item.met { color: var(--accent-green); }
.modal-req-item.unmet { color: var(--accent-red); }
.modal-req-item.special { color: var(--accent-purple); }

.modal-points-info {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.modal-points-info strong {
  color: var(--accent-gold);
}

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.modal-action-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.25s;
}

.modal-action-btn.buy {
  background: rgba(74,158,255,0.1);
  border-color: var(--accent-storm);
  color: var(--accent-storm);
}
.modal-action-btn.buy:hover {
  background: rgba(74,158,255,0.25);
  box-shadow: 0 0 20px rgba(74,158,255,0.2);
}

.modal-action-btn.remove {
  background: rgba(224,85,85,0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.modal-action-btn.remove:hover {
  background: rgba(224,85,85,0.2);
  box-shadow: 0 0 20px rgba(224,85,85,0.15);
}

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

.modal-action-reason {
  font-size: 11px;
  color: var(--accent-red);
  text-align: center;
  margin-top: 8px;
}

.modal-root-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px;
}

/* ============================================================
   RADIANT WHEEL OVERLAY
   ============================================================ */

#radiant-wheel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  animation: rw-fade-in 0.3s ease both;
}
#radiant-wheel.visible { display: flex; }

@keyframes rw-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.radiant-wheel-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  z-index: 1;
}
.radiant-wheel-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.radiant-wheel-title {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 5;
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}

.radiant-wheel-subtitle {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 5;
  margin-top: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* Outer wrapper — controls the visible size */
.radiant-wheel-outer {
  /* no explicit width/height here — the inner container sets it via scale */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Wheel container — always 560×560 internally, scaled via JS to fit screen */
.radiant-wheel-container {
  position: relative;
  width: 560px;
  height: 560px;
  flex-shrink: 0;
  transform-origin: center center;
}

.radiant-wheel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* HTML nodes layer (order glyphs + surge icons) */
#radiant-wheel-ring {
  position: absolute;
  inset: 0;
  pointer-events: none; /* individual nodes override this */
}

/* Center symbol */
.rw-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  pointer-events: none;
  transition: all 0.4s ease;
}
.rw-center img {
  width: 100%;
  height: 100%;
  opacity: 0.55;
  filter: saturate(0) brightness(3);
  transition: all 0.4s ease;
}
.rw-center.chosen img {
  opacity: 0.9;
  filter: none;
}

/* ---- ORDER NODES (HTML positioned over SVG) ---- */
.rw-order {
  position: absolute;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  z-index: 2;
  pointer-events: auto;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.rw-order:hover { transform: translate(-50%, -50%) scale(1.12); }
.rw-order.selected { transform: translate(-50%, -50%) scale(1.18); }
.rw-order.dimmed { opacity: 0.25; filter: saturate(0.2); }

.rw-order-glyph-wrap {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.rw-order:hover .rw-order-glyph-wrap {
  border-color: currentColor;
  box-shadow: 0 0 16px currentColor;
}
.rw-order.selected .rw-order-glyph-wrap {
  border-color: currentColor;
  box-shadow: 0 0 24px currentColor, 0 0 6px currentColor inset;
}

.rw-order-glyph-wrap img {
  width: 48px;
  height: 48px;
  opacity: 0.8;
  filter: saturate(0.45) brightness(0.85);
  transition: opacity 0.2s, filter 0.2s;
}
.rw-order:hover .rw-order-glyph-wrap img,
.rw-order.selected .rw-order-glyph-wrap img {
  opacity: 1;
  filter: saturate(1) brightness(1);
}

.rw-order-label {
  font-family: 'Cinzel', serif;
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.3px;
  max-width: 80px;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: visible;
}
.rw-order:hover .rw-order-label { color: var(--text-primary); }
.rw-order.selected .rw-order-label { color: var(--text-primary); }

/* Unplayable order (Vinculadores) */
.rw-order.unplayable {
  cursor: default;
  opacity: 0.35;
  filter: saturate(0.3);
}
.rw-order.unplayable:hover { transform: translate(-50%, -50%); }
.rw-order.unplayable:hover .rw-order-glyph-wrap {
  border-color: transparent;
  box-shadow: none;
}

.rw-not-playable {
  font-size: 7px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---- SURGE NODES ---- */
.rw-surge {
  position: absolute;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
  cursor: default;
  z-index: 1;
  opacity: 0.55;
  transition: opacity 0.2s;
}
.rw-surge.active {
  opacity: 1;
}
.rw-surge:hover {
  opacity: 1;
  z-index: 3;
}

.rw-surge img {
  width: 24px;
  height: 24px;
  transition: filter 0.2s;
}
.rw-surge:hover img {
  filter: brightness(1.5) saturate(1.2);
}

.rw-surge-label {
  font-size: 6.5px;
  color: var(--text-secondary);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.2px;
  text-align: center;
  white-space: nowrap;
  transition: color 0.2s;
}
.rw-surge:hover .rw-surge-label {
  color: var(--text-primary);
}
/* active label color is set inline by JS */

/* Orders lit up when their shared surge is hovered */
.rw-order.surge-highlight {
  transform: translate(-50%, -50%) scale(1.1);
}
.rw-order.surge-highlight .rw-order-glyph-wrap {
  border-color: currentColor;
  box-shadow: 0 0 14px currentColor;
}
.rw-order.surge-highlight .rw-order-glyph-wrap img {
  opacity: 1;
  filter: saturate(1) brightness(1.1);
}
.rw-order.surge-highlight .rw-order-label {
  color: var(--text-primary);
}
/* Override dimmed state for surge-highlighted orders */
.rw-order.dimmed.surge-highlight {
  opacity: 1;
  filter: none;
}

/* ============================================================
   OATH ANIMATION OVERLAY (Primeira Jura)
   ============================================================ */

#radiant-oath-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 10, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#radiant-oath-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
#radiant-oath-overlay.fade-out {
  opacity: 0;
}

.oath-glyph-wrap {
  width: 120px;
  height: 120px;
  margin-bottom: 36px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.oath-glyph-wrap.show {
  opacity: 1;
  transform: scale(1);
}
.oath-glyph-wrap img {
  width: 100%;
  height: 100%;
}

.oath-phrases {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.oath-phrase {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  opacity: 0;
  position: relative;
}
.oath-phrase.show {
  opacity: 1;
  animation: oath-wind-in 1.2s cubic-bezier(0.22, 0.6, 0.36, 1) forwards;
}
/* Frente de vento luminosa que precede a revelação das letras */
.oath-phrase.show::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -14%;
  width: 14%;
  height: calc(100% + 12px);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.25) 35%,
    rgba(255,255,255,0.7) 50%,
    rgba(255,255,255,0.25) 65%,
    transparent 100%
  );
  filter: blur(3px);
  animation: oath-wind-gust 1.2s cubic-bezier(0.22, 0.6, 0.36, 1) forwards;
  pointer-events: none;
}
.oath-phrase.dim {
  animation: oath-wind-dim 0.7s ease forwards;
}

/* ---- PARTÍCULAS DE VENTO / STORMLIGHT ---- */
.wind-particle {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--oath-color, #d4a853);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 0 6px var(--oath-color, #d4a853), 0 0 12px var(--oath-color, #d4a853);
}

.oath-letter {
  opacity: 0; /* Começa invisível */
  display: inline-block;
  transition: opacity 0.1s ease-out;
}

/* Classe adicionada via JS no exato momento que a partícula atinge a letra */
.oath-letter.glow-in {
  opacity: 1;
  text-shadow: 0 0 15px var(--oath-color), 0 0 30px var(--oath-color);
  animation: settle-stormlight 1.5s forwards;
}

@keyframes settle-stormlight {
  100% { 
    /* O brilho se acalma depois que a letra é formada */
    text-shadow: 0 0 2px rgba(255,255,255,0.2); 
  }
}

@keyframes wind-blow {
  0% { 
    transform: translate(0, 0) scale(0); 
    opacity: 0; 
  }
  15% { 
    transform: translate(5px, 0) scale(1.5); 
    opacity: 0.9; 
  }
  100% { 
    transform: translate(var(--dx), var(--dy)) scale(0); 
    opacity: 0; 
  }
}

@keyframes oath-wind-in {
  0%   { opacity: 1; clip-path: inset(0 102% 0 0 round 2px); }
  100% {
    clip-path: inset(0 0% 0 0 round 2px);
    text-shadow: 0 0 22px var(--oath-color, #d4a853), 0 0 44px var(--oath-color, #d4a853);
  }
}
@keyframes oath-wind-gust {
  0%   { left: -14%; }
  100% { left: 110%; }
}
@keyframes oath-wind-dim {
  to { opacity: 0.22; text-shadow: none; }
}

.oath-separator {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--oath-color, #d4a853);
  opacity: 0;
  letter-spacing: 0.3em;
  transition: opacity 0.4s ease;
}
.oath-separator.show { opacity: 0.5; }

.oath-order-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--oath-color, #d4a853);
  opacity: 0;
  margin-top: 8px;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.oath-order-name.show {
  opacity: 0.75;
  transform: translateY(0);
}

@keyframes oath-glyph-pulse {
  0%   { filter: drop-shadow(0 0 18px var(--oath-color, #d4a853)) drop-shadow(0 0 40px var(--oath-color, #d4a853)); }
  50%  { filter: drop-shadow(0 0 40px var(--oath-color, #d4a853)) drop-shadow(0 0 80px var(--oath-color, #d4a853)); }
  100% { filter: drop-shadow(0 0 18px var(--oath-color, #d4a853)) drop-shadow(0 0 40px var(--oath-color, #d4a853)); }
}
.oath-glyph-wrap.pulsing img {
  animation: oath-glyph-pulse 2.2s ease-in-out infinite;
}

/* ============================================================
   RADIANT LOCKED DISPLAY (sidebar)
   ============================================================ */

.radiant-choose-btn {
  width: 100%;
  padding: 12px;
  background: rgba(192,132,252,0.06);
  border: 1px dashed rgba(192,132,252,0.35);
  border-radius: 8px;
  color: var(--accent-radiant);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-align: center;
  transition: all 0.25s;
}
.radiant-choose-btn:hover {
  background: rgba(192,132,252,0.14);
  border-color: var(--accent-radiant);
  box-shadow: 0 0 14px rgba(192,132,252,0.15);
}

.radiant-locked-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.radiant-locked-glyph {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  opacity: 0.9;
}
.radiant-locked-info {
  flex: 1;
  min-width: 0;
}
.radiant-locked-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radiant-sealed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(212,168,83,0.12);
  border: 1px solid rgba(212,168,83,0.35);
  color: var(--accent-gold);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* ============================================================
   VIEWPORT CENTER GLYPH (watermark)
   ============================================================ */

#viewport-center-glyph {
  position: absolute;
  top: 42px;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
#viewport-center-glyph img {
  width: 260px;
  height: 260px;
  opacity: 0;
  transition: opacity 0.9s ease;
}
#viewport-center-glyph.visible img { opacity: 0.07; }

/* ============================================================
   CLASS TAB SLIDE TRANSITION
   ============================================================ */

#viewport-flash {
  position: absolute;
  inset: 0;
  background: var(--bg-primary, #0d0d14);
  z-index: 10;
  pointer-events: none;
  transform: translateX(100%);
}

.sphere-track {
    display: flex;
    gap: 4px;
    align-items: center;
}

.sphere-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
}

.sphere-btn:hover {
    border-color: var(--sphere-color, var(--accent-gold));
    background: rgba(255,255,255,0.08);
}

.sphere-btn.active {
    background: var(--sphere-color, #fff);
    border-color: var(--sphere-color, #fff);
    box-shadow: 0 0 7px var(--sphere-color, #fff), 0 0 14px color-mix(in srgb, var(--sphere-color, var(--accent-gold)) 50%, transparent);
}

.sphere-btn.locked {
    cursor: not-allowed;
    opacity: 0.3;
}

.sphere-btn.canone-locked {
    cursor: not-allowed;
    opacity: 0.25;
    border-style: dashed;
}

.canone-surge-locked {
    opacity: 0.6;
}

.canone-lock-badge {
    font-size: 0.7em;
    vertical-align: middle;
}

/* ---- PERICIA FILTER ---- */
.pericia-filter-wrapper {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.pericia-filter-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.pericia-filter-input:focus {
  border-color: var(--accent-gold);
}
.pericia-filter-input::placeholder {
  color: var(--text-muted);
}

/* --- OVERRIDES PARA SIDEBAR MAIOR E TOGGLE --- */

#sidebar {
    width: 380px; /* Aumentado de onde devia estar (~320px) para acomodar melhor a grade */
    min-width: 380px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

#sidebar.closed {
    transform: translateX(-100%);
    position: absolute; /* Impede que crie buraco no layout quando fechado */
}

#viewport {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#viewport.expanded {
    margin-left: 0 !important;
    width: 100vw !important;
}

/* .sidebar-toggle-btn defined in SIDEBAR TOGGLE BAR section below */

/* Botão flutuante quando sidebar está fechado */
#sidebar-reopen {
    display: none;
    position: fixed;
    top: 80px;
    left: 15px;
    z-index: 200;
    background: rgba(10, 11, 16, 0.9);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    line-height: 0;
}
#sidebar-reopen:hover {
    background: rgba(212, 168, 83, 0.15);
}
body.sidebar-closed #sidebar-reopen {
    display: block;
}
/* ============================================================
   PROFILE CREATION MODAL
   ============================================================ */

#profile-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#profile-modal.visible {
  display: flex;
}

.pm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.pm-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,168,83,0.12);
  overflow: hidden;
}

.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pm-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
}

.pm-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.pm-close:hover { color: var(--text-primary); }

.pm-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* .pm-section {} */

.pm-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.pm-section-title small {
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.pm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pm-name-input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.pm-name-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212,168,83,0.15);
}

/* Race cards */
.pm-race-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pm-race-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0 0 14px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}
.pm-race-card:hover {
  border-color: rgba(212,168,83,0.5);
  background: var(--bg-hover);
}
.pm-race-card.active {
  border-color: var(--accent-gold);
  background: rgba(212,168,83,0.07);
  box-shadow: 0 0 0 1px rgba(212,168,83,0.25), 0 0 18px rgba(212,168,83,0.1);
}

/* Placeholder image area (replaced later with actual art) */
.pm-race-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.pm-race-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-race-img-placeholder {
  font-size: 40px;
  opacity: 0.25;
  user-select: none;
}
.pm-race-card.active .pm-race-img {
  background: rgba(212,168,83,0.06);
}

.pm-race-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.04em;
  padding: 0 12px;
}

.pm-race-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 0 12px;
}
.pm-race-desc em {
  color: #e07b54;
  font-style: normal;
  font-weight: 600;
}

/* Attribute grid in modal */
.pm-attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pm-attr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}

.pm-attr-abbr {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  min-width: 28px;
}

.pm-attr-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-attr-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 18px;
  text-align: center;
}

.pm-attr-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.12s;
}
.pm-attr-btn:hover { background: rgba(255,255,255,0.14); }

/* Points badge */
.pm-attr-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(212,168,83,0.1);
  border: 1px solid rgba(212,168,83,0.25);
  border-radius: 20px;
  padding: 2px 10px;
}
.pm-attr-badge.over {
  color: var(--accent-red);
  background: rgba(224,85,85,0.12);
  border-color: rgba(224,85,85,0.3);
}
.pm-attr-badge.done {
  color: var(--accent-green);
  background: rgba(74,222,128,0.1);
  border-color: rgba(74,222,128,0.3);
}

/* Footer */
.pm-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Footer em duas linhas: alternativas em cima, ação principal embaixo */
.pm-footer--stacked {
  flex-direction: column;
  align-items: stretch;
}

.pm-footer-alts {
  display: flex;
  gap: 8px;
}

.pm-footer-alts .btn {
  flex: 1;
}

.pm-confirm-btn { min-width: 140px; }
.pm-cancel-btn  { color: var(--text-muted); }

/* ---- SAVES MODAL ---- */
#saves-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9100;
  align-items: center;
  justify-content: center;
}
#saves-modal.visible {
  display: flex;
}

.sm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.sm-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 520px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(212,168,83,0.12);
  overflow: hidden;
}

.sm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sm-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
}

.sm-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.sm-close:hover { color: var(--text-primary); }

.sm-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sm-save-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.sm-save-btn-row .btn {
  flex: 1;
}

.sm-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

.sm-slot {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
}
.sm-slot:hover {
  border-color: rgba(212,168,83,0.35);
}

.sm-slot-info {
  flex: 1;
  min-width: 0;
}

.sm-slot-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-slot-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sm-slot-date {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 2px;
}

.sm-slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.sm-slot-actions .btn {
  padding: 5px 12px;
  font-size: 12px;
}

.sm-slot-actions .btn.danger {
  padding: 5px 9px;
}

.sm-replace-btn {
  color: var(--accent-gold) !important;
  border-color: rgba(212,168,83,0.4) !important;
  font-size: 11px !important;
  padding: 5px 9px !important;
}
.sm-replace-btn:hover {
  background: rgba(212,168,83,0.1) !important;
  border-color: var(--accent-gold) !important;
}

.sm-notice {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(212,168,83,0.07);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  flex-shrink: 0;
}

.sm-notice strong {
  color: var(--accent-gold);
}

/* ---- SIDEBAR: race display row ---- */
.profile-row-race {
  display: flex;
  align-items: center;
  gap: 8px;
}

.race-display {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
}

.race-edit-btn {
  padding: 2px 8px;
  font-size: 13px;
  flex-shrink: 0;
}

/* Cantor class color variable */
:root {
  --color-Cantor: #e07b54;
}

.sidebar-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(212, 168, 83, 0.08);
}

/* ---- CREDITS LINK ROW ---- */
.credits-link-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-credits-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-credits-link:hover {
  color: var(--accent-gold);
}

/* ---- CREDITS MODAL ---- */
.credits-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.credits-modal-overlay.visible {
  display: flex;
}

.credits-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 460px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

.credits-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.credits-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credits-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

.credits-modal-close:hover {
  color: var(--text-primary);
}

.credits-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.credits-badge {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: rgba(212,168,83,0.08);
  border: 1px solid rgba(212,168,83,0.25);
  border-radius: 20px;
  padding: 5px 14px;
  align-self: center;
}

.credits-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credits-section-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.credits-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
}

.credits-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.credits-value {
  color: var(--text-primary);
  text-align: right;
}

.credits-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.credits-disclaimer strong {
  color: var(--text-secondary);
}

/* ============================================================
   MOBILE — touch-action e media queries
   ============================================================ */

/* Impede o browser de interceptar gestos de pinça no canvas */
#viewport canvas {
  touch-action: none;
}

@media (max-width: 768px) {

  /* Sidebar ocupa 100% e fica como overlay */
  #sidebar {
    position: fixed !important;
    left: 0; top: 0; bottom: 0;
    width: 100vw !important;
    min-width: unset !important;
    max-width: 100vw;
    z-index: 500 !important;
    /* Começa fechada no mobile — classe .closed é aplicada pelo JS */
  }

  /* O viewport sempre ocupa a tela toda no mobile */
  #viewport {
    width: 100vw !important;
    margin-left: 0 !important;
  }

  /* Botão de reabrir: fica na barra superior (topbar), não sobreposta */
  #sidebar-reopen {
    display: block !important;
    top: 0;
    left: 0;
    padding: 0 14px;
    height: 44px;              /* mesma altura da topbar */
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 2px solid var(--border);
    background: var(--bg-panel);
    z-index: 600 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  /* Empurrar as abas para não ficar atrás do botão + altura fixa para alinhar com botão */
  .class-tabs {
    padding-left: 52px;
    height: 48px; /* Aumentado um pouquinho para a barra de 4px caber sem ser cortada */
    padding-bottom: 4px; /* Empurra os itens levemente para cima para a barra não sobrepor */
    align-items: center; /* Evita que os botões estiquem até esmagar a barra */
    scrollbar-width: none; /* Para Firefox Mobile */
  }
  
  /* Forçando a renderização em Chrome/Safari Mobile */
  .class-tabs::-webkit-scrollbar { 
    display: none; 
  }

  /* Quando sidebar está aberta no mobile, esconder o botão flutuante */
  body:not(.sidebar-closed) #sidebar-reopen {
    display: none !important;
  }

  .class-tab {
    white-space: nowrap;
    padding: 12px 14px;
    font-size: 11px;
  }

  /* Botões maiores para toque */
  .btn {
    padding: 12px 0;
    font-size: 13px;
    min-height: 44px;
  }

  .lvl-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .attr-btn {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .pericia-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  /* Radiant wheel: textos não podem ser nowrap em telas pequenas */
  .radiant-wheel-title {
    font-size: 16px;
    white-space: normal;
    width: 80%;
    text-align: center;
    top: 14px;
  }

  .radiant-wheel-subtitle {
    white-space: normal;
    width: 80%;
    text-align: center;
    top: 46px;
  }

  /* Notificação não vaza pela direita */
  .notification {
    right: 12px;
    left: 12px;
    text-align: center;
  }

  /* Tooltip: centralizado e sem overflow */
  #tooltip {
    max-width: 90vw;
  }

  /* Modal de skill ocupa mais espaço na tela */
  .modal-content {
    width: 96vw;
    max-height: 88vh;
  }

  /* Profile modal e saves modal */
  .pm-content,
  .sm-content {
    width: 98vw;
    max-height: 92vh;
  }

  /* Sidebar header menor */
  .sidebar-header h1 {
    font-size: 15px;
  }
  .sidebar-header .subtitle {
    display: none;
  }

  /* font-size ≥ 16px em todos os inputs — impede iOS de dar zoom automático ao focar */
  input[type="text"],
  input[type="search"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Prepared slot for singer art */
.pm-race-img--singer {
  background: linear-gradient(135deg, rgba(224,123,84,0.08) 0%, rgba(0,0,0,0.4) 100%);
}

/* ---- COLLAPSIBLE SECTION ---- */
.sidebar-section--collapsible .collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sidebar-section--collapsible .collapsible-header:hover {
  color: var(--text-primary);
}

.collapse-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

.sidebar-section--collapsible.collapsed .collapse-arrow {
  transform: rotate(-90deg);
}

.collapsible-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 600px;
  opacity: 1;
}

.sidebar-section--collapsible.collapsed .collapsible-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---- TALENTS LIST (sidebar) ---- */
.talents-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.talents-group {
  margin-bottom: 10px;
}
.talents-group:last-child {
  margin-bottom: 0;
}

.talents-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.talents-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.talents-group-count {
  margin-left: auto;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.6;
}

.talents-group-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid rgba(255,255,255,0.06);
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.talent-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.talent-rank {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 18px;
  flex-shrink: 0;
}

.talent-name {
  color: var(--text-primary);
  font-size: 12px;
}

/* ---- VIEWPORT SETTINGS BUTTON ---- */
.viewport-settings-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 20;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 20, 28, 0.75);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  backdrop-filter: blur(6px);
}
.viewport-settings-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(18, 20, 28, 0.92);
}

/* ---- VIEW SETTINGS PANEL ---- */
#view-settings-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
}
#view-settings-panel.visible {
  display: flex;
}
.vsp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}
.vsp-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 340px;
  max-width: 95vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  overflow: hidden;
}
.vsp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.vsp-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.03em;
}
.vsp-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.vsp-close:hover { color: var(--text-primary); }
.vsp-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.vsp-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vsp-row--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.vsp-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vsp-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vsp-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  outline: none;
  cursor: pointer;
}
.vsp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(212,168,83,0.5);
}
.vsp-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  cursor: pointer;
  border: none;
}
.vsp-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold);
  min-width: 28px;
  text-align: right;
}
/* Toggle switch */
.vsp-toggle { position: relative; display: inline-block; cursor: pointer; }
.vsp-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.vsp-toggle-track {
  display: block;
  width: 40px;
  height: 22px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}
.vsp-toggle input:checked + .vsp-toggle-track {
  background: rgba(212,168,83,0.25);
  border-color: var(--accent-gold);
}
.vsp-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s, background 0.2s;
}
.vsp-toggle input:checked + .vsp-toggle-track .vsp-toggle-thumb {
  transform: translateX(18px);
  background: var(--accent-gold);
}
.vsp-row--color { align-items: center; }
.vsp-control--color { display: flex; align-items: center; gap: 10px; }
.vsp-color {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  padding: 2px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  outline: 1px solid rgba(255,255,255,0.12);
  transition: outline-color 0.2s;
}
.vsp-color:hover { outline-color: var(--accent-gold); }
.vsp-color::-webkit-color-swatch-wrapper { padding: 0; border-radius: 4px; }
.vsp-color::-webkit-color-swatch { border: none; border-radius: 4px; }

/* ---- CÂNONE MODAL (Pulverizador) ---- */
#canone-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(4px);
}
#canone-modal-overlay.visible {
  opacity: 1;
}
.canone-modal {
  background: #1a1a1f;
  border: 1px solid var(--canone-color, #ef4444);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 0 40px var(--canone-color, #ef4444)33, 0 8px 32px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.canone-modal-glyph {
  text-align: center;
}
.canone-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
  letter-spacing: 0.04em;
}
.canone-modal-text {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.92rem;
  text-align: center;
  margin: 0;
}
.canone-modal-choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.canone-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 0.2s, border-color 0.2s;
  color: inherit;
}
.canone-btn:hover {
  background: rgba(255,255,255,0.08);
}
.canone-btn-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.canone-btn-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- JURAMENTO PESSOAL MODAL ---- */
#personal-oath-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(6px);
}
#personal-oath-overlay.visible {
  opacity: 1;
}

.personal-oath-modal {
  background: linear-gradient(160deg, #13131a 0%, #1a1624 100%);
  border: 1px solid color-mix(in srgb, var(--oath-color) 40%, transparent);
  border-radius: 20px;
  padding: 2rem 2.5rem 2.25rem;
  max-width: 560px;
  width: 92%;
  box-shadow:
    0 0 60px color-mix(in srgb, var(--oath-color) 18%, transparent),
    0 12px 48px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.personal-oath-glyph {
  text-align: center;
  margin-bottom: 0.25rem;
}

.personal-oath-header {
  text-align: center;
}
.personal-oath-ideal-name {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--oath-color, #d4a853);
  letter-spacing: 0.06em;
}
.personal-oath-order {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.personal-oath-philosophy {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
  color: color-mix(in srgb, var(--oath-color) 80%, white);
  opacity: 0.85;
  padding: 0 0.5rem;
}

.personal-oath-divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, var(--oath-color) 50%, transparent),
    transparent
  );
  margin: 0.25rem 0;
}

.personal-oath-instruction {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.personal-oath-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.personal-oath-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  background: rgba(255,255,255,0.04);
  border: 1px solid color-mix(in srgb, var(--oath-color) 30%, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: inherit;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.personal-oath-textarea:focus {
  border-color: color-mix(in srgb, var(--oath-color) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--oath-color) 15%, transparent);
}
.personal-oath-textarea::placeholder {
  color: rgba(255,255,255,0.2);
  font-style: italic;
}

.personal-oath-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.personal-oath-mic {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.personal-oath-mic:hover {
  background: rgba(255,255,255,0.1);
  color: var(--oath-color, #d4a853);
  border-color: var(--oath-color, #d4a853);
}
.personal-oath-mic.listening {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239,68,68,0.12);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.personal-oath-confirm {
  flex: 1;
  padding: 0.75rem 1.25rem;
  background: color-mix(in srgb, var(--oath-color) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--oath-color) 60%, transparent);
  border-radius: 10px;
  color: var(--oath-color, #d4a853);
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.personal-oath-confirm:not(:disabled):hover {
  background: color-mix(in srgb, var(--oath-color) 30%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--oath-color) 30%, transparent);
}
.personal-oath-confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Frase única longa (2º/3º ideais) — wraps e centraliza melhor */
.oath-phrase--single {
  font-size: 18px !important;
  max-width: 640px;
  text-align: center;
  line-height: 1.5;
}
