/**
 * Oráculo de runas nórdicas - Hoja de estilos canónica
 * Estética nórdica mística: pizarra oscura, relieves pétreos y runas luminiscentes.
 */

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta nórdica oscura */
  --bg-page: #0b0f17;
  --bg-surface: #121824;
  --bg-surface-elevated: #1a2233;
  --bg-altar: radial-gradient(circle at center, #1b2438 0%, #0d121c 70%, #080b12 100%);
  --border-color: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(56, 189, 248, 0.35);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-bright: #ffffff;

  /* Acentos místicos */
  --runic-cyan: #38bdf8;
  --runic-cyan-glow: rgba(56, 189, 248, 0.6);
  --runic-gold: #fbbf24;
  --runic-gold-glow: rgba(251, 191, 36, 0.5);
  --runic-ember: #f43f5e;

  /* Piedra rúnica */
  --stone-bg: linear-gradient(145deg, #263143 0%, #171f2b 100%);
  --stone-border: #334155;
  --stone-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.12), inset 0 -3px 6px rgba(0, 0, 0, 0.6);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-altar: radial-gradient(circle at center, #e2e8f0 0%, #cbd5e1 70%, #94a3b8 100%);
  --border-color: rgba(51, 65, 85, 0.16);
  --border-glow: rgba(2, 132, 199, 0.3);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-bright: #020617;

  --runic-cyan: #0284c7;
  --runic-cyan-glow: rgba(2, 132, 199, 0.4);
  --runic-gold: #d97706;
  --runic-gold-glow: rgba(217, 119, 6, 0.35);

  --stone-bg: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 100%);
  --stone-border: #94a3b8;
  --stone-shadow: 0 10px 20px rgba(15, 23, 42, 0.15), inset 0 2px 3px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(100, 116, 139, 0.3);
}

/* Reset y layout base conforme a generales.md */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-bright);
}

/* Layout principal */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Intro de la herramienta */
.tool-intro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.tool-intro-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--runic-cyan), var(--runic-gold), var(--runic-cyan));
}

.tool-intro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.tool-intro-title {
  font-size: 1.65rem;
  color: var(--text-bright);
}

.tool-intro-subtitle {
  font-size: 0.95rem;
  color: var(--runic-cyan);
  font-family: var(--font-heading);
  font-weight: 600;
  display: block;
  margin-top: 0.2rem;
}

.tool-intro-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 850px;
}

/* Barra de controles superiores */
.top-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.spread-selector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-spread-tab {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-spread-tab:hover {
  border-color: var(--runic-cyan);
  color: var(--runic-cyan);
}

.btn-spread-tab.active {
  background: var(--runic-cyan);
  border-color: var(--runic-cyan);
  color: #0b0f17;
  font-weight: 700;
  box-shadow: 0 0 12px var(--runic-cyan-glow);
}

.utility-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-util {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-util:hover {
  color: var(--text-bright);
  border-color: var(--border-glow);
}

.btn-util.active {
  color: var(--runic-gold);
  border-color: var(--runic-gold);
}

/* ALTAR RÚNICO (Mesa de tiradas) */
.runic-altar-card {
  background: var(--bg-altar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

/* Símbolo de fondo Vegvísir */
.altar-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  height: 340px;
  opacity: 0.08;
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .altar-watermark {
  opacity: 0.12;
}

.altar-watermark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Estado vacío del altar (Bolsa rúnica para empezar) */
.altar-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
  gap: 1.25rem;
  max-width: 480px;
}

.pouch-interactive-box {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--stone-bg);
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
  position: relative;
}

.pouch-interactive-box:hover {
  transform: scale(1.06);
  border-color: var(--runic-cyan);
  box-shadow: 0 0 20px var(--runic-cyan-glow);
}

.pouch-interactive-box svg {
  width: 54px;
  height: 54px;
  stroke: var(--runic-gold);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.pouch-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--runic-cyan);
  color: #080b12;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.altar-instructions-title {
  font-size: 1.3rem;
  color: var(--text-bright);
}

.altar-instructions-text {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Botón principal de acción */
.btn-primary-action {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.55);
}

.btn-primary-action:active {
  transform: translateY(0);
}

/* CONTENEDOR DE RUNAS EN EL ALTAR */
.runes-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  z-index: 2;
  padding: 1rem 0;
}

/* Posicionamiento en Cruz Rúnica (5 runas) */
.runes-board.layout-cruz {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 120px));
  grid-template-rows: repeat(3, minmax(130px, 160px));
  gap: 1rem;
  justify-content: center;
  align-items: center;
  max-width: 480px;
}

.runes-board.layout-cruz .rune-slot:nth-child(1) {
  grid-column: 2;
  grid-row: 2; /* Centro: Núcleo */
}
.runes-board.layout-cruz .rune-slot:nth-child(2) {
  grid-column: 2;
  grid-row: 1; /* Arriba: Desafío */
}
.runes-board.layout-cruz .rune-slot:nth-child(3) {
  grid-column: 2;
  grid-row: 3; /* Abajo: Raíz */
}
.runes-board.layout-cruz .rune-slot:nth-child(4) {
  grid-column: 1;
  grid-row: 2; /* Izquierda: Consejo */
}
.runes-board.layout-cruz .rune-slot:nth-child(5) {
  grid-column: 3;
  grid-row: 2; /* Derecha: Desenlace */
}

/* HUECO / SLÓT DE CADA RUNA */
.rune-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  perspective: 1000px;
}

.rune-slot-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--runic-cyan);
  text-align: center;
  white-space: nowrap;
  text-transform: none;
}

/* PIEDRA RÚNICA (TUMBLED STONE 3D) */
.runic-stone-card {
  width: 95px;
  height: 135px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.runic-stone-card.is-revealed {
  transform: rotateY(180deg);
}

.stone-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 28px 34px 30px 36px / 34px 28px 36px 30px; /* Forma orgánica mineral */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--stone-shadow);
  border: 1px solid var(--stone-border);
  background: var(--stone-bg);
  user-select: none;
}

/* Cara trasera (oculta en la bolsa) */
.stone-back {
  transform: rotateY(0deg);
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

.stone-back-pattern {
  width: 44px;
  height: 44px;
  opacity: 0.4;
  stroke: var(--text-muted);
}

.stone-back-hint {
  font-size: 0.68rem;
  font-family: var(--font-heading);
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Cara delantera (revelada) */
.stone-front {
  transform: rotateY(180deg);
  position: relative;
  overflow: hidden;
  padding: 0.6rem;
}

/* Runas invertidas (Merkstave) giran 180° internamente */
.stone-front.is-inverted .rune-glyph-char {
  transform: rotate(180deg);
}

.rune-glyph-char {
  font-family: 'Segoe UI Historic', 'Symbola', sans-serif;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--runic-cyan);
  text-shadow: 0 0 16px var(--runic-cyan-glow), 0 2px 4px rgba(0, 0, 0, 0.8);
  transition: transform 0.4s ease;
  font-weight: bold;
}

[data-theme="light"] .rune-glyph-char {
  text-shadow: 0 0 10px var(--runic-cyan-glow);
}

.rune-name-badge {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-top: 0.35rem;
  text-align: center;
}

.rune-status-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: lowercase;
  color: var(--runic-gold);
  margin-top: 0.1rem;
}

.rune-status-tag.inverted-tag {
  color: var(--runic-ember);
}

/* BARRA DE ACCIONES POST-TIRADA */
.altar-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  z-index: 2;
  justify-content: center;
  width: 100%;
}

.btn-secondary-action {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
}

.btn-secondary-action:hover {
  border-color: var(--runic-cyan);
  color: var(--runic-cyan);
}

/* PANEL DE INTERPRETACIÓN Y LECTURA */
.reading-panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.reading-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.reading-title {
  font-size: 1.35rem;
  color: var(--text-bright);
}

.reading-runes-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.reading-rune-entry {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  transition: var(--transition);
}

.reading-rune-entry:hover {
  border-color: var(--border-glow);
}

.entry-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.entry-glyph-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--stone-bg);
  border: 1px solid var(--stone-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--runic-cyan);
  box-shadow: var(--stone-shadow);
  flex-shrink: 0;
}

.entry-glyph-box.is-inverted span {
  transform: rotate(180deg);
}

.entry-title-area {
  flex: 1;
  min-width: 0;
}

.entry-position-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--runic-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.entry-name {
  font-size: 1.25rem;
  margin: 0.1rem 0;
}

.entry-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.pill-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

.pill-tag.aett-pill {
  color: var(--runic-gold);
  background: rgba(251, 191, 36, 0.12);
}

.pill-tag.status-pill {
  color: var(--runic-cyan);
  background: rgba(56, 189, 248, 0.12);
}

.pill-tag.inverted-pill {
  color: var(--runic-ember);
  background: rgba(244, 63, 94, 0.12);
}

/* Áreas temáticas de la lectura */
.entry-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.92rem;
}

.reading-aspect-box {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border-left: 3px solid var(--runic-cyan);
}

[data-theme="light"] .reading-aspect-box {
  background: rgba(0, 0, 0, 0.03);
}

.reading-aspect-box.advice-box {
  border-left-color: var(--runic-gold);
  background: rgba(251, 191, 36, 0.06);
}

.aspect-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aspect-desc {
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.5;
}

.havamal-quote {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-left: 2px dashed var(--border-color);
  padding-left: 0.75rem;
  margin-top: 0.5rem;
}

/* ENCICLOPEDIA RÚNICA (GRIMORIO) */
.encyclopedia-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.encyclopedia-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.encyclopedia-title-box h2 {
  font-size: 1.35rem;
}

.encyclopedia-title-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.encyclopedia-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 240px;
}

.search-input-wrap input {
  width: 100%;
  height: 42px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 1rem 0 2.4rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-input-wrap input:focus {
  outline: none;
  border-color: var(--runic-cyan);
  box-shadow: 0 0 8px var(--runic-cyan-glow);
}

.search-icon-svg {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
}

.aett-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-aett-filter {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  height: 42px;
}

.btn-aett-filter:hover {
  color: var(--text-bright);
  border-color: var(--border-glow);
}

.btn-aett-filter.active {
  background: var(--runic-cyan);
  color: #0b0f17;
  border-color: var(--runic-cyan);
  font-weight: 700;
}

/* Grid de runas de la enciclopedia */
.encyclopedia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.encyclopedia-item-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.encyclopedia-item-card:hover {
  transform: translateY(-4px);
  border-color: var(--runic-cyan);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 12px var(--runic-cyan-glow);
}

.encyclopedia-glyph {
  font-family: 'Segoe UI Historic', 'Symbola', sans-serif;
  font-size: 2.6rem;
  color: var(--runic-cyan);
  text-shadow: 0 0 12px var(--runic-cyan-glow);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.encyclopedia-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
}

.encyclopedia-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* SECCIÓN INFORMATIVA / GUÍA DE ADIVINACIÓN */
.runic-guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.runic-guide-section h3 {
  font-size: 1.25rem;
}

.guide-grid-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.guide-card h4 {
  font-size: 1rem;
  color: var(--runic-gold);
  margin-bottom: 0.4rem;
}

.guide-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-summary {
  padding: 0.85rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-bright);
  user-select: none;
}

.faq-content {
  padding: 0 1rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* MODALES NATIVOS CANÓNICOS (CERO ALERT) */
.fijate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fijate-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.fijate-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.fijate-modal-overlay.open .fijate-modal-box {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-bright);
  background: var(--bg-surface-elevated);
}

.modal-header {
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.4rem;
  color: var(--text-bright);
}

.modal-body {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast de notificación de copiado */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--runic-cyan);
  color: #0b0f17;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE DESIGN CONFORME A REGLAS DE FIJATE */
@media (max-width: 900px) {
  .tool-with-sidebar {
    flex-direction: column;
  }
  .tool-ad-sidebar {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2.5rem;
  }

  .tool-intro-card {
    padding: 1.15rem;
  }

  .tool-intro-title {
    font-size: 1.4rem;
  }

  .spread-selector-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .btn-spread-tab {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
  }

  .btn-primary-action {
    width: 100%;
    min-height: 44px;
  }

  .altar-actions-bar {
    flex-direction: column;
  }

  .btn-secondary-action {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .runic-altar-card {
    padding: 1.5rem 0.75rem;
    min-height: 380px;
  }

  .runic-stone-card {
    width: 80px;
    height: 115px;
  }

  .rune-glyph-char {
    font-size: 2.8rem;
  }

  .runes-board.layout-cruz {
    grid-template-columns: repeat(3, minmax(75px, 95px));
    grid-template-rows: repeat(3, minmax(110px, 130px));
    gap: 0.5rem;
  }

  .encyclopedia-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 0.6rem;
  }

  .encyclopedia-glyph {
    font-size: 2.1rem;
  }

  .aett-filter-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .btn-aett-filter {
    width: 100%;
    min-height: 40px;
  }
}
