// TAROT DEL PENSAMIENTO COMPLEJO — data v3 (bilingüe ES/EN)
// 22 Mayores + 56 Menores en 4 palos:
//   CAOS → INTERACCIÓN → ORDEN → ORGANIZACIÓN
// Cada carta tiene campos en español y su contraparte *En para inglés.

const TAROT_SUITS = {
  majors: {
    es: 'ARCANOS MAYORES', en: 'MAJOR ARCANA',
    domain: 'PRINCIPIO', domainEn: 'PRINCIPLE',
    color: '#d4af6a', deep: '#1a1408', glyph: '☉',
    note:   'Los 22 arquetipos rectores de la complejidad.',
    noteEn: 'The 22 governing archetypes of complexity.',
  },
  caos: {
    es: 'CAOS', en: 'CHAOS',
    domain: 'LO QUE PERTURBA', domainEn: 'WHAT DISTURBS',
    color: '#8e54d8', deep: '#1f0c34', glyph: '◌',
    note:   'Desorden, fluctuación, azar — el motor que rompe simetrías.',
    noteEn: 'Disorder, fluctuation, chance — the engine that breaks symmetries.',
  },
  interaccion: {
    es: 'INTERACCIÓN', en: 'INTERACTION',
    domain: 'LO QUE ACOPLA', domainEn: 'WHAT COUPLES',
    color: '#d8a84a', deep: '#2a1c08', glyph: '⇄',
    note:   'Vínculo, señal, intercambio — lo que enlaza partes en conversación.',
    noteEn: 'Bond, signal, exchange — what links parts in conversation.',
  },
  orden: {
    es: 'ORDEN', en: 'ORDER',
    domain: 'LO QUE PATRONIZA', domainEn: 'WHAT PATTERNS',
    color: '#4a8fd8', deep: '#0d1f3a', glyph: '⊞',
    note:   'Regla, repetición, simetría — la forma que se sostiene.',
    noteEn: 'Rule, repetition, symmetry — the form that sustains itself.',
  },
  organizacion: {
    es: 'ORGANIZACIÓN', en: 'ORGANIZATION',
    domain: 'LO QUE INTEGRA', domainEn: 'WHAT INTEGRATES',
    color: '#5cb86a', deep: '#0e2918', glyph: '⬡',
    note:   'Coordinación, sistema, autopoiesis — la totalidad que se sostiene a sí misma.',
    noteEn: 'Coordination, system, autopoiesis — the totality that sustains itself.',
  },
};

// ─── 22 MAJOR ARCANA ─────────────────────────────────────────────────────
const MAJORS = [
  { n: 0,  roman: '0',     name: 'EL CAOS',                 nameEn: 'CHAOS',
    traditional: 'El Loco', traditionalEn: 'The Fool',
    field: 'Lorenz · teoría del caos', fieldEn: 'Lorenz · chaos theory',
    definition:   'Estado pre-formal del que toda forma puede surgir. Sensibilidad extrema a condiciones iniciales.',
    definitionEn: 'Pre-formal state from which any form may emerge. Extreme sensitivity to initial conditions.',
    principle:   'Toda complejidad nace del desorden que aún no decidió ser.',
    principleEn: 'All complexity is born from disorder that has not yet decided to be.' },
  { n: 1,  roman: 'I',     name: 'EL OBSERVADOR',           nameEn: 'THE OBSERVER',
    traditional: 'El Mago', traditionalEn: 'The Magician',
    field: 'von Foerster · cibernética 2°', fieldEn: 'von Foerster · second-order cybernetics',
    definition:   'No hay descripción sin descriptor. La observación instaura la primera distinción y, con ella, el sistema.',
    definitionEn: 'There is no description without a describer. Observation establishes the first distinction and, with it, the system.',
    principle:   'Todo lo dicho es dicho por alguien.',
    principleEn: 'Everything said is said by someone.' },
  { n: 2,  roman: 'II',    name: 'LA INFORMACIÓN',          nameEn: 'INFORMATION',
    traditional: 'La Sacerdotisa', traditionalEn: 'The High Priestess',
    field: 'Shannon · Bateson', fieldEn: 'Shannon · Bateson',
    definition:   'Una diferencia que hace una diferencia. Lo que reduce incertidumbre.',
    definitionEn: 'A difference that makes a difference. What reduces uncertainty.',
    principle:   'Lo importante no es la señal, sino qué hizo cambiar.',
    principleEn: 'What matters is not the signal, but what it made change.' },
  { n: 3,  roman: 'III',   name: 'AUTO-ORGANIZACIÓN',       nameEn: 'SELF-ORGANIZATION',
    traditional: 'La Emperatriz', traditionalEn: 'The Empress',
    field: 'Prigogine · Kauffman', fieldEn: 'Prigogine · Kauffman',
    definition:   'Patrones macroscópicos que emergen sin diseñador, por interacciones locales lejos del equilibrio.',
    definitionEn: 'Macroscopic patterns emerging without a designer, through local interactions far from equilibrium.',
    principle:   'El orden no se impone; se acuerda en lo pequeño.',
    principleEn: 'Order is not imposed; it is agreed upon in the small.' },
  { n: 4,  roman: 'IV',    name: 'LA JERARQUÍA',            nameEn: 'HIERARCHY',
    traditional: 'El Emperador', traditionalEn: 'The Emperor',
    field: 'Simon · Holland', fieldEn: 'Simon · Holland',
    definition:   'Capas anidadas donde cada nivel encierra a los anteriores. Reduce coste de coordinación; aumenta fragilidad.',
    definitionEn: 'Nested layers where each level encloses the previous ones. Lowers coordination cost; raises fragility.',
    principle:   'Obedecer es eficiente. Hasta que deja de serlo.',
    principleEn: 'Obeying is efficient. Until it ceases to be.' },
  { n: 5,  roman: 'V',     name: 'EL LOCK-IN',              nameEn: 'LOCK-IN',
    traditional: 'El Hierofante', traditionalEn: 'The Hierophant',
    field: 'Arthur · path dependence', fieldEn: 'Arthur · path dependence',
    definition:   'Lo contingente al principio se vuelve necesario después. La historia escribe en roca decisiones de barro.',
    definitionEn: 'What was contingent at the start becomes necessary later. History writes in stone decisions made of clay.',
    principle:   'No se elige dos veces el mismo camino: la primera elige el resto.',
    principleEn: 'A path is not chosen twice: the first choice chooses the rest.' },
  { n: 6,  roman: 'VI',    name: 'EL ACOPLAMIENTO',         nameEn: 'COUPLING',
    traditional: 'Los Enamorados', traditionalEn: 'The Lovers',
    field: 'Maturana · Varela', fieldEn: 'Maturana · Varela',
    definition:   'Dos sistemas que perturban su deriva mutuamente sin perder autonomía.',
    definitionEn: 'Two systems that perturb each other’s drift without losing autonomy.',
    principle:   'Lo que dura no es la unión, sino el ritmo de la influencia recíproca.',
    principleEn: 'What lasts is not the union, but the rhythm of reciprocal influence.' },
  { n: 7,  roman: 'VII',   name: 'EL ATRACTOR',             nameEn: 'THE ATTRACTOR',
    traditional: 'El Carro', traditionalEn: 'The Chariot',
    field: 'sistemas dinámicos', fieldEn: 'dynamical systems',
    definition:   'Estado al que un sistema tiende a regresar. Define hacia dónde, no por dónde.',
    definitionEn: 'State to which a system tends to return. Defines where to, not which way.',
    principle:   'No mires la trayectoria. Mira lo que la trayectoria orbita.',
    principleEn: 'Don’t watch the trajectory. Watch what the trajectory orbits.' },
  { n: 8,  roman: 'VIII',  name: 'LA ROBUSTEZ',             nameEn: 'ROBUSTNESS',
    traditional: 'La Fuerza', traditionalEn: 'Strength',
    field: 'Carlson · Doyle · HOT', fieldEn: 'Carlson · Doyle · HOT',
    definition:   'Capacidad de mantener función ante perturbaciones esperadas — a cambio de fragilidad ante las inesperadas.',
    definitionEn: 'Capacity to maintain function under expected perturbations — at the cost of fragility under unexpected ones.',
    principle:   'Resistir lo conocido tiene precio: no ver lo nuevo.',
    principleEn: 'Resisting the known has a price: not seeing the new.' },
  { n: 9,  roman: 'IX',    name: 'LEJOS DEL EQUILIBRIO',    nameEn: 'FAR FROM EQUILIBRIUM',
    traditional: 'El Ermitaño', traditionalEn: 'The Hermit',
    field: 'Prigogine', fieldEn: 'Prigogine',
    definition:   'Sistemas que se mantienen organizados solo mientras fluye energía a través suyo.',
    definitionEn: 'Systems that remain organized only while energy flows through them.',
    principle:   'Lo vivo no descansa: se sostiene en el desequilibrio.',
    principleEn: 'The living does not rest: it sustains itself in disequilibrium.' },
  { n: 10, roman: 'X',     name: 'LA BIFURCACIÓN',          nameEn: 'BIFURCATION',
    traditional: 'La Rueda', traditionalEn: 'The Wheel',
    field: 'teoría de catástrofes', fieldEn: 'catastrophe theory',
    definition:   'Punto donde un cambio mínimo de parámetro produce un cambio cualitativo: el sistema se vuelve dos.',
    definitionEn: 'Point where a minimal parameter change produces a qualitative shift: the system becomes two.',
    principle:   'Lo gradual también tiene momentos en que decide.',
    principleEn: 'Even the gradual has moments in which it decides.' },
  { n: 11, roman: 'XI',    name: 'LA HOMEOSTASIS',          nameEn: 'HOMEOSTASIS',
    traditional: 'La Justicia', traditionalEn: 'Justice',
    field: 'Cannon · Ashby', fieldEn: 'Cannon · Ashby',
    definition:   'Equilibrio dinámico mantenido por compensaciones continuas. No es quietud: es trabajo constante.',
    definitionEn: 'Dynamic equilibrium maintained by continuous compensations. Not stillness: constant work.',
    principle:   'Permanecer igual cuesta más que cambiar.',
    principleEn: 'To stay the same costs more than to change.' },
  { n: 12, roman: 'XII',   name: 'EL RE-ENCUADRE',          nameEn: 'REFRAMING',
    traditional: 'El Colgado', traditionalEn: 'The Hanged Man',
    field: 'Bateson · doble vínculo', fieldEn: 'Bateson · double bind',
    definition:   'Cambio del marco que vuelve nuevo lo que antes era estancamiento.',
    definitionEn: 'A frame shift that makes new what was previously stagnation.',
    principle:   'Cuando no puedas avanzar, gira la pregunta.',
    principleEn: 'When you cannot advance, turn the question.' },
  { n: 13, roman: 'XIII',  name: 'LA DISOLUCIÓN',           nameEn: 'DISSOLUTION',
    traditional: 'La Muerte', traditionalEn: 'Death',
    field: 'Schumpeter · destrucción creativa', fieldEn: 'Schumpeter · creative destruction',
    definition:   'Disolución necesaria de una estructura para que la siguiente pueda formarse. No final: paso.',
    definitionEn: 'The necessary dissolution of a structure so the next can form. Not an end: a passage.',
    principle:   'Lo que muere a tiempo libera lo que sigue.',
    principleEn: 'What dies in time releases what comes next.' },
  { n: 14, roman: 'XIV',   name: 'ACOPLE DE ESCALAS',       nameEn: 'SCALE COUPLING',
    traditional: 'La Templanza', traditionalEn: 'Temperance',
    field: 'multi-scale modeling', fieldEn: 'multi-scale modeling',
    definition:   'Articulación entre lo micro y lo macro. Ningún nivel se explica sin los otros.',
    definitionEn: 'Articulation between micro and macro. No level explains itself without the others.',
    principle:   'Toda escala es la mitad de una pregunta.',
    principleEn: 'Every scale is half of a question.' },
  { n: 15, roman: 'XV',    name: 'EL RUNAWAY',              nameEn: 'RUNAWAY',
    traditional: 'El Diablo', traditionalEn: 'The Devil',
    field: 'feedback positivo', fieldEn: 'positive feedback',
    definition:   'Bucle de retroalimentación positiva sin freno. Acelera hasta agotar su sustrato.',
    definitionEn: 'Positive feedback loop without brake. Accelerates until it exhausts its substrate.',
    principle:   'Lo que se amplifica a sí mismo termina por consumirse.',
    principleEn: 'What amplifies itself ends by consuming itself.' },
  { n: 16, roman: 'XVI',   name: 'EL COLAPSO',              nameEn: 'COLLAPSE',
    traditional: 'La Torre', traditionalEn: 'The Tower',
    field: 'Tainter · sistemas complejos', fieldEn: 'Tainter · complex systems',
    definition:   'Pérdida abrupta de la complejidad sostenible. La estructura ya no puede pagar el coste de sí misma.',
    definitionEn: 'Abrupt loss of sustainable complexity. The structure can no longer pay the cost of itself.',
    principle:   'Construir alto sin recordar el cimiento es construir caída.',
    principleEn: 'To build high without remembering the foundation is to build a fall.' },
  { n: 17, roman: 'XVII',  name: 'EL ATRACTOR EXTRAÑO',     nameEn: 'STRANGE ATTRACTOR',
    traditional: 'La Estrella', traditionalEn: 'The Star',
    field: 'Lorenz · Hénon', fieldEn: 'Lorenz · Hénon',
    definition:   'Atractor de dimensión fractal: el sistema nunca se repite pero nunca escapa de su forma.',
    definitionEn: 'Fractal-dimensional attractor: the system never repeats yet never escapes its form.',
    principle:   'Hay órdenes que solo se dejan ver de lejos.',
    principleEn: 'Some orders let themselves be seen only from afar.' },
  { n: 18, roman: 'XVIII', name: 'LA NO-LINEALIDAD',        nameEn: 'NONLINEARITY',
    traditional: 'La Luna', traditionalEn: 'The Moon',
    field: 'dinámica no lineal', fieldEn: 'nonlinear dynamics',
    definition:   'Causas y efectos sin proporción: pequeñas entradas → grandes salidas; grandes entradas → ninguna.',
    definitionEn: 'Causes and effects without proportion: small inputs → large outputs; large inputs → none.',
    principle:   'En lo complejo la regla y la excepción intercambian asientos.',
    principleEn: 'In the complex, rule and exception trade seats.' },
  { n: 19, roman: 'XIX',   name: 'LA SINCRONIZACIÓN',       nameEn: 'SYNCHRONIZATION',
    traditional: 'El Sol', traditionalEn: 'The Sun',
    field: 'Kuramoto · Strogatz', fieldEn: 'Kuramoto · Strogatz',
    definition:   'Osciladores acoplados que terminan marcando el mismo ritmo. La coherencia se contagia.',
    definitionEn: 'Coupled oscillators that end up beating the same rhythm. Coherence is contagious.',
    principle:   'No hace falta director si hay escucha.',
    principleEn: 'No conductor is needed if there is listening.' },
  { n: 20, roman: 'XX',    name: 'TRANSICIÓN DE FASE',      nameEn: 'PHASE TRANSITION',
    traditional: 'El Juicio', traditionalEn: 'Judgement',
    field: 'mecánica estadística', fieldEn: 'statistical mechanics',
    definition:   'Reorganización colectiva en la que el sistema cambia de régimen como un todo.',
    definitionEn: 'Collective reorganization in which the system changes regime as a whole.',
    principle:   'Al cruzar un umbral, la pregunta de quién eras deja de tener sentido.',
    principleEn: 'Once a threshold is crossed, the question of who you were ceases to make sense.' },
  { n: 21, roman: 'XXI',   name: 'CLAUSURA OPERACIONAL',    nameEn: 'OPERATIONAL CLOSURE',
    traditional: 'El Mundo', traditionalEn: 'The World',
    field: 'Maturana · Varela · autopoiesis', fieldEn: 'Maturana · Varela · autopoiesis',
    definition:   'El sistema produce los elementos que lo producen. No tiene afuera ontológico, solo perturbaciones.',
    definitionEn: 'The system produces the elements that produce it. It has no ontological outside, only perturbations.',
    principle:   'Lo que se sostiene a sí mismo gana el derecho a un mundo.',
    principleEn: 'What sustains itself earns the right to a world.' },
];

// ─── MINOR ARCANA STRUCTURE ──────────────────────────────────────────────
const MINOR_RANKS = [
  { n: 1,  roman: 'I',    es: 'AS',         en: 'ACE' },
  { n: 2,  roman: 'II',   es: 'II',         en: 'II' },
  { n: 3,  roman: 'III',  es: 'III',        en: 'III' },
  { n: 4,  roman: 'IV',   es: 'IV',         en: 'IV' },
  { n: 5,  roman: 'V',    es: 'V',          en: 'V' },
  { n: 6,  roman: 'VI',   es: 'VI',         en: 'VI' },
  { n: 7,  roman: 'VII',  es: 'VII',        en: 'VII' },
  { n: 8,  roman: 'VIII', es: 'VIII',       en: 'VIII' },
  { n: 9,  roman: 'IX',   es: 'IX',         en: 'IX' },
  { n: 10, roman: 'X',    es: 'X',          en: 'X' },
  { n: 11, roman: 'P',    es: 'SOTA',       en: 'PAGE' },
  { n: 12, roman: 'C',    es: 'CABALLERO',  en: 'KNIGHT' },
  { n: 13, roman: 'Q',    es: 'REINA',      en: 'QUEEN' },
  { n: 14, roman: 'R',    es: 'REY',        en: 'KING' },
];

// ─── 14 cards × 4 suits = 56 minors (con campos EN) ──────────────────────
const MINORS_MAP = {
  caos: [
    { n:1,  name:'PERTURBACIÓN',     nameEn:'PERTURBATION',
      field:'Prigogine', fieldEn:'Prigogine',
      definition:'Toda historia compleja empieza por algo que llegó del afuera y desordenó lo dado.',
      definitionEn:'Every complex history begins with something that arrived from outside and disordered what was given.',
      principle:'El cambio no nace dentro: entra.',
      principleEn:'Change is not born inside: it enters.' },
    { n:2,  name:'FLUCTUACIÓN',      nameEn:'FLUCTUATION',
      field:'mecánica estadística', fieldEn:'statistical mechanics',
      definition:'Pequeña desviación local que, lejos del equilibrio, puede crecer y reorganizar el todo.',
      definitionEn:'Small local deviation that, far from equilibrium, may grow and reorganize the whole.',
      principle:'Lo que aún no se nota ya está decidiendo.',
      principleEn:'What is not yet noticed is already deciding.' },
    { n:3,  name:'RUIDO',            nameEn:'NOISE',
      field:'Shannon', fieldEn:'Shannon',
      definition:'Lo que satura el canal y obliga a distinguir señal de fondo. Sin ruido no hay escucha real.',
      definitionEn:'What saturates the channel and forces distinguishing signal from ground. Without noise there is no real listening.',
      principle:'Sin ruido no hay aprendizaje: solo eco.',
      principleEn:'Without noise there is no learning: only echo.' },
    { n:4,  name:'AZAR',             nameEn:'CHANCE',
      field:'Monod', fieldEn:'Monod',
      definition:'Lo genuinamente impredecible que aporta variación irreducible al sistema.',
      definitionEn:'The genuinely unpredictable that brings irreducible variation to the system.',
      principle:'Sin azar la complejidad se asfixia en sus reglas.',
      principleEn:'Without chance, complexity suffocates in its own rules.' },
    { n:5,  name:'DIVERGENCIA',      nameEn:'DIVERGENCE',
      field:'Lorenz', fieldEn:'Lorenz',
      definition:'Trayectorias inicialmente vecinas se separan exponencialmente. La predicción tiene un horizonte.',
      definitionEn:'Initially neighboring trajectories separate exponentially. Prediction has a horizon.',
      principle:'Dos comienzos casi iguales no llegan al mismo lugar.',
      principleEn:'Two nearly identical beginnings do not arrive at the same place.' },
    { n:6,  name:'TURBULENCIA',      nameEn:'TURBULENCE',
      field:'Kolmogórov', fieldEn:'Kolmogorov',
      definition:'Régimen donde la energía se rompe en cascada hacia escalas más finas sin un patrón estable.',
      definitionEn:'Regime where energy breaks in a cascade toward finer scales without a stable pattern.',
      principle:'Lo que no se puede laminar, aprende a fluir distinto.',
      principleEn:'What cannot be laminated learns to flow differently.' },
    { n:7,  name:'AVALANCHA',        nameEn:'AVALANCHE',
      field:'Bak · SOC', fieldEn:'Bak · SOC',
      definition:'Liberación abrupta de tensión acumulada. Tamaño impredecible aunque la regla sea simple.',
      definitionEn:'Abrupt release of accumulated tension. Unpredictable size even though the rule is simple.',
      principle:'Una arena de más basta cuando todas las demás ya pesan.',
      principleEn:'One grain more is enough when all the others already weigh.' },
    { n:8,  name:'INCERTIDUMBRE',    nameEn:'UNCERTAINTY',
      field:'Heisenberg · Knight', fieldEn:'Heisenberg · Knight',
      definition:'Lo que no es solo desconocido sino indecidible desde dentro del marco.',
      definitionEn:'What is not merely unknown but undecidable from within the frame.',
      principle:'Algunas preguntas no esperan respuesta: piden otro lenguaje.',
      principleEn:'Some questions do not await an answer: they ask for another language.' },
    { n:9,  name:'ENTROPÍA',         nameEn:'ENTROPY',
      field:'Boltzmann · Shannon', fieldEn:'Boltzmann · Shannon',
      definition:'Medida del desorden o de las configuraciones posibles. Crece sola; reducirla cuesta trabajo.',
      definitionEn:'Measure of disorder or of possible configurations. Grows on its own; reducing it costs work.',
      principle:'El orden no es lo natural: es lo costoso.',
      principleEn:'Order is not the natural: it is the costly.' },
    { n:10, name:'CISNE NEGRO',      nameEn:'BLACK SWAN',
      field:'Taleb', fieldEn:'Taleb',
      definition:'Evento extremo, raro, retrospectivamente narrable y prospectivamente invisible.',
      definitionEn:'Extreme, rare event, narratable in retrospect and invisible in prospect.',
      principle:'Lo que cambió tu vida no estaba en la lista.',
      principleEn:'What changed your life was not on the list.' },
    { n:11, name:'EL EXPLORADOR',    nameEn:'THE EXPLORER',
      field:'random walk', fieldEn:'random walk',
      definition:'Sota — busca sin mapa, encuentra sin objetivo. Aprende del territorio que pisa.',
      definitionEn:'Page — searches without a map, finds without a goal. Learns from the territory it walks.',
      principle:'No todo paseo es para llegar.',
      principleEn:'Not every walk is for arriving.' },
    { n:12, name:'EL MUTANTE',       nameEn:'THE MUTANT',
      field:'evolución', fieldEn:'evolution',
      definition:'Caballero — introduce variación que aún no se sabe si es ventaja o error.',
      definitionEn:'Knight — introduces variation not yet known to be advantage or error.',
      principle:'Equivocarse a tiempo es ya casi adaptarse.',
      principleEn:'To err on time is already almost to adapt.' },
    { n:13, name:'LA CISNE NEGRA',   nameEn:'THE BLACK SWAN',
      field:'Taleb', fieldEn:'Taleb',
      definition:'Reina — encarna lo improbable que cambia el mapa. Persona, evento o decisión irreversible.',
      definitionEn:'Queen — embodies the improbable that changes the map. Person, event, or irreversible decision.',
      principle:'Lo que parecía un detalle resultó ser el pivote.',
      principleEn:'What seemed a detail turned out to be the pivot.' },
    { n:14, name:'EL DEMONIO',       nameEn:'THE DEMON',
      field:'Laplace · Maxwell', fieldEn:'Laplace · Maxwell',
      definition:'Rey — la promesa imposible de orden total. Sueño del determinismo y de la información completa.',
      definitionEn:'King — the impossible promise of total order. Dream of determinism and complete information.',
      principle:'Quien sueña con saberlo todo elige no entender nada.',
      principleEn:'Whoever dreams of knowing all chooses to understand nothing.' },
  ],

  interaccion: [
    { n:1,  name:'CONTACTO',         nameEn:'CONTACT',
      field:'topología social', fieldEn:'social topology',
      definition:'Primer acontecimiento donde dos sistemas comparten frontera y la frontera empieza a importar.',
      definitionEn:'First event where two systems share a boundary and the boundary begins to matter.',
      principle:'Antes del contacto, todo es lo mismo.',
      principleEn:'Before contact, everything is the same.' },
    { n:2,  name:'SEÑAL',            nameEn:'SIGNAL',
      field:'Shannon', fieldEn:'Shannon',
      definition:'Patrón emitido para que otro responda. Toda señal es un puente que pide ser cruzado.',
      definitionEn:'Pattern emitted so that another may respond. Every signal is a bridge asking to be crossed.',
      principle:'Comunicar no es decir: es ser oído.',
      principleEn:'To communicate is not to say: it is to be heard.' },
    { n:3,  name:'RETROALIMENTACIÓN',nameEn:'FEEDBACK',
      field:'Wiener · cibernética', fieldEn:'Wiener · cybernetics',
      definition:'Salida que vuelve como entrada y modifica la siguiente salida. El sistema se vuelve sensible a sí mismo.',
      definitionEn:'Output returning as input that modifies the next output. The system becomes sensitive to itself.',
      principle:'Pensar no es proyectar: es volver sobre lo hecho.',
      principleEn:'To think is not to project: it is to return upon what was done.' },
    { n:4,  name:'COOPERACIÓN',      nameEn:'COOPERATION',
      field:'Axelrod', fieldEn:'Axelrod',
      definition:'Coordinación voluntaria que produce más para todos que la suma de sus esfuerzos aislados.',
      definitionEn:'Voluntary coordination that produces more for all than the sum of isolated efforts.',
      principle:'Lo que doy regresa con intereses si confío.',
      principleEn:'What I give returns with interest if I trust.' },
    { n:5,  name:'CONFLICTO',        nameEn:'CONFLICT',
      field:'teoría de juegos', fieldEn:'game theory',
      definition:'Encuentro donde los intereses se cruzan. No es ruido: es información sobre las prioridades del sistema.',
      definitionEn:'Encounter where interests cross. Not noise: information about the system’s priorities.',
      principle:'El conflicto bien planteado revela lo que importa.',
      principleEn:'Conflict well posed reveals what matters.' },
    { n:6,  name:'NEGOCIACIÓN',      nameEn:'NEGOTIATION',
      field:'Schelling', fieldEn:'Schelling',
      definition:'Búsqueda de un equilibrio donde ninguno gana del todo pero todos siguen jugando.',
      definitionEn:'Search for an equilibrium where no one fully wins but everyone keeps playing.',
      principle:'Acordar es decidir qué se conserva del otro.',
      principleEn:'To agree is to decide what is preserved of the other.' },
    { n:7,  name:'CONTAGIO',         nameEn:'CONTAGION',
      field:'epidemiología social', fieldEn:'social epidemiology',
      definition:'Cualquier patrón —idea, gesto, virus— que se transmite por proximidad y se vuelve estructura.',
      definitionEn:'Any pattern — idea, gesture, virus — that transmits by proximity and becomes structure.',
      principle:'Lo que tocas te toca también.',
      principleEn:'What you touch touches you too.' },
    { n:8,  name:'COMPETENCIA',      nameEn:'COMPETITION',
      field:'Lotka–Volterra', fieldEn:'Lotka–Volterra',
      definition:'Presión que filtra lo que funciona mejor. Selecciona sin diseñar.',
      definitionEn:'Pressure that filters what works better. Selects without designing.',
      principle:'Competir por lo mismo nos vuelve más parecidos.',
      principleEn:'Competing for the same thing makes us more alike.' },
    { n:9,  name:'INTERCAMBIO',      nameEn:'EXCHANGE',
      field:'economía emergente', fieldEn:'emergent economics',
      definition:'Transferencia recíproca donde cada parte valora lo del otro más que lo propio.',
      definitionEn:'Reciprocal transfer where each party values the other’s more than its own.',
      principle:'El valor es asimetría de deseo.',
      principleEn:'Value is the asymmetry of desire.' },
    { n:10, name:'RED',              nameEn:'NETWORK',
      field:'Barabási', fieldEn:'Barabási',
      definition:'Trama de relaciones con propiedades emergentes que ningún nodo posee solo.',
      definitionEn:'Web of relations with emergent properties no single node possesses alone.',
      principle:'Lo importante no son los nodos: son los puentes que aceptaste.',
      principleEn:'What matters is not the nodes: it is the bridges you accepted.' },
    { n:11, name:'EL MENSAJERO',     nameEn:'THE MESSENGER',
      field:'mediación', fieldEn:'mediation',
      definition:'Sota — quien cruza fronteras llevando información, sin pertenecer del todo a ninguna orilla.',
      definitionEn:'Page — the one who crosses borders carrying information, belonging fully to no shore.',
      principle:'Quien traduce, cambia lo que traduce.',
      principleEn:'Who translates changes what they translate.' },
    { n:12, name:'EL CATALIZADOR',   nameEn:'THE CATALYST',
      field:'enzimas · facilitación', fieldEn:'enzymes · facilitation',
      definition:'Caballero — acelera lo que iba a pasar y sale intacto. Su don es la oportunidad.',
      definitionEn:'Knight — accelerates what was going to happen and emerges intact. Its gift is opportunity.',
      principle:'Bajar la barrera basta cuando el deseo ya estaba.',
      principleEn:'Lowering the barrier is enough when the desire was already there.' },
    { n:13, name:'LA ESCUCHA',       nameEn:'LISTENING',
      field:'Pask · conversación', fieldEn:'Pask · conversation',
      definition:'Reina — dejarse perturbar por el otro sin disolverse. Acoplamiento estructural sostenido.',
      definitionEn:'Queen — letting oneself be perturbed by the other without dissolving. Sustained structural coupling.',
      principle:'Comprender no es estar de acuerdo: es haber sido modificado.',
      principleEn:'To understand is not to agree: it is to have been modified.' },
    { n:14, name:'EL VÍNCULO',       nameEn:'THE BOND',
      field:'teoría del apego', fieldEn:'attachment theory',
      definition:'Rey — relación lo bastante estable para resistir el conflicto sin quebrarse. Confianza endurecida.',
      definitionEn:'King — relation stable enough to withstand conflict without breaking. Hardened trust.',
      principle:'Lo que persiste no es el afecto sino su reparación.',
      principleEn:'What persists is not the affection but its repair.' },
  ],

  orden: [
    { n:1,  name:'LA DISTINCIÓN',    nameEn:'DISTINCTION',
      field:'Spencer-Brown', fieldEn:'Spencer-Brown',
      definition:'Acto primero del pensamiento: trazar la marca que separa "esto" de "lo demás".',
      definitionEn:'First act of thought: tracing the mark that separates "this" from "the rest".',
      principle:'Pensar empieza siempre por cortar.',
      principleEn:'Thinking always begins by cutting.' },
    { n:2,  name:'REPETICIÓN',       nameEn:'REPETITION',
      field:'aprendizaje', fieldEn:'learning',
      definition:'Lo que vuelve confirma que algo se estabilizó. Sin repetición no hay reconocimiento.',
      definitionEn:'What returns confirms that something stabilized. Without repetition there is no recognition.',
      principle:'La segunda vez ya hay regla.',
      principleEn:'The second time, there is already a rule.' },
    { n:3,  name:'SIMETRÍA',         nameEn:'SYMMETRY',
      field:'Noether · física', fieldEn:'Noether · physics',
      definition:'Invariancia bajo transformación. Toda simetría conserva algo y por eso algo se puede contar.',
      definitionEn:'Invariance under transformation. Every symmetry conserves something, and so something can be counted.',
      principle:'Lo que no cambia al cambiar es lo que vale la pena medir.',
      principleEn:'What does not change when things change is what is worth measuring.' },
    { n:4,  name:'PATRÓN',           nameEn:'PATTERN',
      field:'Alexander · diseño', fieldEn:'Alexander · design',
      definition:'Relación que se repite en contextos distintos y por eso se vuelve legible.',
      definitionEn:'Relation that repeats in different contexts and so becomes legible.',
      principle:'El patrón es lo que la mirada ya aprendió a esperar.',
      principleEn:'A pattern is what the gaze has already learned to expect.' },
    { n:5,  name:'GRADIENTE',        nameEn:'GRADIENT',
      field:'termodinámica', fieldEn:'thermodynamics',
      definition:'Diferencia que orienta el flujo. Sin gradiente no hay dirección posible.',
      definitionEn:'Difference that orients flow. Without gradient no direction is possible.',
      principle:'Toda dirección es deuda con una diferencia.',
      principleEn:'Every direction is a debt to a difference.' },
    { n:6,  name:'PROTOCOLO',        nameEn:'PROTOCOL',
      field:'sistemas distribuidos', fieldEn:'distributed systems',
      definition:'Regla que dos partes acuerdan respetar para poder entenderse — aunque no se conozcan.',
      definitionEn:'Rule two parties agree to respect in order to understand each other — even without knowing each other.',
      principle:'Compartir reglas es prestar futuro.',
      principleEn:'Sharing rules is lending future.' },
    { n:7,  name:'ESTRUCTURA',       nameEn:'STRUCTURE',
      field:'Lévi-Strauss', fieldEn:'Lévi-Strauss',
      definition:'Conjunto de relaciones que sobrevive al cambio de sus elementos.',
      definitionEn:'Set of relations that survives the change of its elements.',
      principle:'No te define lo que eres sino con qué te relacionas.',
      principleEn:'What defines you is not what you are but what you relate to.' },
    { n:8,  name:'INVARIANTE',       nameEn:'INVARIANT',
      field:'matemática', fieldEn:'mathematics',
      definition:'Lo que permanece igual bajo toda operación admitida. El esqueleto del cambio.',
      definitionEn:'What remains the same under every admitted operation. The skeleton of change.',
      principle:'Mira lo que dura para entender lo que se mueve.',
      principleEn:'Watch what lasts to understand what moves.' },
    { n:9,  name:'NORMA',            nameEn:'NORM',
      field:'sociología', fieldEn:'sociology',
      definition:'Patrón que se vuelve obligación. Lo que era frecuente ahora se exige.',
      definitionEn:'Pattern that becomes obligation. What was frequent is now demanded.',
      principle:'Cuando el "es" se vuelve "debe", aparece la ley.',
      principleEn:'When the "is" becomes "ought", law appears.' },
    { n:10, name:'CRISTAL',          nameEn:'CRYSTAL',
      field:'cristalografía', fieldEn:'crystallography',
      definition:'Máximo orden con mínima información: una sola regla aplicada hasta el infinito.',
      definitionEn:'Maximum order with minimum information: a single rule applied to infinity.',
      principle:'Toda perfección formal es promesa de no cambiar.',
      principleEn:'Every formal perfection is a promise not to change.' },
    { n:11, name:'EL CLASIFICADOR',  nameEn:'THE CLASSIFIER',
      field:'taxonomía', fieldEn:'taxonomy',
      definition:'Sota — quien aprende a separar lo confuso en categorías útiles. Primer escalón del orden.',
      definitionEn:'Page — who learns to separate confusion into useful categories. First rung of order.',
      principle:'Nombrar bien es ya casi entender.',
      principleEn:'To name well is already almost to understand.' },
    { n:12, name:'EL CARTÓGRAFO',    nameEn:'THE CARTOGRAPHER',
      field:'modelado', fieldEn:'modeling',
      definition:'Caballero — traza el mapa que vuelve transitable lo desconocido. El mapa, no el territorio.',
      definitionEn:'Knight — draws the map that makes the unknown passable. The map, not the territory.',
      principle:'Un buen mapa miente útilmente.',
      principleEn:'A good map lies usefully.' },
    { n:13, name:'LA REGLA',         nameEn:'THE RULE',
      field:'lógica formal', fieldEn:'formal logic',
      definition:'Reina — produce los mismos efectos cada vez. Cuando se obedece sin pensar, ya gobierna.',
      definitionEn:'Queen — produces the same effects each time. When obeyed without thought, it already governs.',
      principle:'La regla vive cuando deja de notarse.',
      principleEn:'A rule lives when it ceases to be noticed.' },
    { n:14, name:'EL ALGORITMO',     nameEn:'THE ALGORITHM',
      field:'Turing · computación', fieldEn:'Turing · computation',
      definition:'Rey — secuencia finita de pasos que resuelve toda una clase de problemas. El orden hecho operación.',
      definitionEn:'King — finite sequence of steps that solves a whole class of problems. Order made operation.',
      principle:'Lo que se puede automatizar deja de necesitarte.',
      principleEn:'What can be automated ceases to need you.' },
  ],

  organizacion: [
    { n:1,  name:'LA MEMBRANA',      nameEn:'THE MEMBRANE',
      field:'biología', fieldEn:'biology',
      definition:'Primera distinción YO/NO-YO que se sostiene en el tiempo. Donde nace la posibilidad de un sistema.',
      definitionEn:'First SELF/NOT-SELF distinction that holds across time. Where the possibility of a system is born.',
      principle:'Sin afuera no hay adentro: sin frontera no hay vida.',
      principleEn:'Without outside there is no inside: without boundary there is no life.' },
    { n:2,  name:'DIFERENCIACIÓN',   nameEn:'DIFFERENTIATION',
      field:'biología del desarrollo', fieldEn:'developmental biology',
      definition:'Partes iguales que se vuelven distintas para servir mejor al todo.',
      definitionEn:'Equal parts that become distinct to better serve the whole.',
      principle:'Ser parte exige renunciar a ser todo.',
      principleEn:'To be a part requires renouncing being the whole.' },
    { n:3,  name:'ESPECIALIZACIÓN',  nameEn:'SPECIALIZATION',
      field:'economía · ecología', fieldEn:'economics · ecology',
      definition:'Acumulación de capacidad sobre un rango cada vez más estrecho. Eficiencia comprada con flexibilidad.',
      definitionEn:'Accumulation of capacity over an ever narrower range. Efficiency bought with flexibility.',
      principle:'Saber mucho de poco te obliga a depender.',
      principleEn:'Knowing much about little forces you to depend.' },
    { n:4,  name:'COORDINACIÓN',     nameEn:'COORDINATION',
      field:'organizaciones', fieldEn:'organizations',
      definition:'Capacidad de actuar como uno sin perder la pluralidad. Más cara que la jerarquía, más viva.',
      definitionEn:'Capacity to act as one without losing plurality. More costly than hierarchy, more alive.',
      principle:'Lo que se coordina no se manda.',
      principleEn:'What is coordinated is not commanded.' },
    { n:5,  name:'METABOLISMO',      nameEn:'METABOLISM',
      field:'bioquímica', fieldEn:'biochemistry',
      definition:'Flujo continuo donde lo que entra se transforma en lo que sostiene. La permanencia es ritmo.',
      definitionEn:'Continuous flow where what enters transforms into what sustains. Permanence is rhythm.',
      principle:'Vivir es saber gastar exactamente lo que entra.',
      principleEn:'To live is to know how to spend exactly what enters.' },
    { n:6,  name:'ADAPTACIÓN',       nameEn:'ADAPTATION',
      field:'evolución · cognición', fieldEn:'evolution · cognition',
      definition:'Cambio interno que mantiene viable la relación con un entorno cambiante. No es triunfo: es sobrevivir.',
      definitionEn:'Internal change that keeps viable the relation with a changing environment. Not triumph: survival.',
      principle:'Cambiar para seguir siendo es la forma adulta de durar.',
      principleEn:'Changing in order to remain is the adult form of lasting.' },
    { n:7,  name:'MEMORIA',          nameEn:'MEMORY',
      field:'neurociencia · cultura', fieldEn:'neuroscience · culture',
      definition:'Capacidad del sistema de actuar hoy modificado por lo que le pasó antes. El pasado vuelto recurso.',
      definitionEn:'Capacity of the system to act today modified by what happened before. The past turned resource.',
      principle:'Lo que no se olvida nos hace posibles.',
      principleEn:'What is not forgotten makes us possible.' },
    { n:8,  name:'APRENDIZAJE',      nameEn:'LEARNING',
      field:'Bateson · niveles', fieldEn:'Bateson · levels',
      definition:'Modificación de la propia regla para responder mejor a clases nuevas de problemas.',
      definitionEn:'Modification of one’s own rule to respond better to new classes of problems.',
      principle:'Aprender es cambiar lo que cambia.',
      principleEn:'To learn is to change what changes.' },
    { n:9,  name:'AUTOPOIESIS',      nameEn:'AUTOPOIESIS',
      field:'Maturana · Varela', fieldEn:'Maturana · Varela',
      definition:'Red de procesos que produce los componentes que producen la red. El sistema se fabrica a sí mismo.',
      definitionEn:'Network of processes that produces the components that produce the network. The system makes itself.',
      principle:'Lo vivo no se vive: se hace.',
      principleEn:'The living is not lived: it is made.' },
    { n:10, name:'ECOSISTEMA',       nameEn:'ECOSYSTEM',
      field:'ecología', fieldEn:'ecology',
      definition:'Conjunto de sistemas acoplados que se sostienen unos a otros sin coordinador. Resiliencia distribuida.',
      definitionEn:'Set of coupled systems that sustain one another without a coordinator. Distributed resilience.',
      principle:'Nadie sobrevive solo aunque crea que sí.',
      principleEn:'No one survives alone even if they believe so.' },
    { n:11, name:'EL APRENDIZ',      nameEn:'THE APPRENTICE',
      field:'desarrollo', fieldEn:'development',
      definition:'Sota — todavía depende del afuera para regularse. Aún no es sistema, pero ya tiene piel.',
      definitionEn:'Page — still depends on the outside to regulate itself. Not yet a system, but already has skin.',
      principle:'Lo primero que se aprende es a depender bien.',
      principleEn:'The first thing one learns is how to depend well.' },
    { n:12, name:'EL ORGANIZADOR',   nameEn:'THE ORGANIZER',
      field:'biología del desarrollo', fieldEn:'developmental biology',
      definition:'Caballero — su sola presencia configura el patrón en torno suyo. Reorganiza sin imponer.',
      definitionEn:'Knight — its mere presence configures the pattern around it. Reorganizes without imposing.',
      principle:'Estar ahí basta cuando lo que importa es la posición.',
      principleEn:'Being there is enough when what matters is position.' },
    { n:13, name:'LA HOMEÓSTATA',    nameEn:'THE HOMEOSTAT',
      field:'Ashby', fieldEn:'Ashby',
      definition:'Reina — mantiene viables las variables críticas en un entorno que cambia. Estabilidad lograda.',
      definitionEn:'Queen — keeps critical variables viable in a changing environment. Stability achieved.',
      principle:'Cuidar es ajustar invisiblemente para que nada caiga.',
      principleEn:'To care is to adjust invisibly so that nothing falls.' },
    { n:14, name:'EL SISTEMA',       nameEn:'THE SYSTEM',
      field:'teoría general de sistemas', fieldEn:'general systems theory',
      definition:'Rey — totalidad que se sostiene y se reproduce. Su nombre es su clausura operacional.',
      definitionEn:'King — totality that sustains and reproduces itself. Its name is its operational closure.',
      principle:'Lo que se sostiene a sí mismo gana el derecho a un mundo.',
      principleEn:'What sustains itself earns the right to a world.' },
  ],
};

// Build flat MINORS list
const MINORS = [];
for (const suit of ['caos','interaccion','orden','organizacion']) {
  MINORS_MAP[suit].forEach((m, i) => {
    const rank = MINOR_RANKS[i];
    const S = TAROT_SUITS[suit];
    MINORS.push({
      kind: 'minor',
      suit,
      n: m.n,
      roman: rank.roman,
      rankEs: rank.es, rankEn: rank.en,
      name: m.name, nameEn: m.nameEn,
      traditional:   `${rank.es} de ${S.es}`,
      traditionalEn: `${rank.en} of ${S.en}`,
      field: m.field, fieldEn: m.fieldEn,
      definition: m.definition, definitionEn: m.definitionEn,
      principle: m.principle, principleEn: m.principleEn,
    });
  });
}

// ─── PILOT CARDS ─────────────────────────────────────────────────────────
const PILOTS = [
  { kind:'major', n:0, suit:'majors', roman:'0', name:'EL CAOS', nameEn:'CHAOS',
    traditional:'El Loco', traditionalEn:'The Fool',
    field:'Lorenz · teoría del caos', fieldEn:'Lorenz · chaos theory',
    definition:'Estado pre-formal del que toda forma puede surgir. Sensibilidad extrema a condiciones iniciales.',
    definitionEn:'Pre-formal state from which any form may emerge. Extreme sensitivity to initial conditions.',
    principle:'Toda complejidad nace del desorden que aún no decidió ser.',
    principleEn:'All complexity is born from disorder that has not yet decided to be.' },
  { kind:'major', n:16, suit:'majors', roman:'XVI', name:'EL COLAPSO', nameEn:'COLLAPSE',
    traditional:'La Torre', traditionalEn:'The Tower',
    field:'Tainter · sistemas complejos', fieldEn:'Tainter · complex systems',
    definition:'Pérdida abrupta de la complejidad sostenible. La estructura ya no puede pagar el coste de sí misma.',
    definitionEn:'Abrupt loss of sustainable complexity. The structure can no longer pay the cost of itself.',
    principle:'Construir alto sin recordar el cimiento es construir caída.',
    principleEn:'To build high without remembering the foundation is to build a fall.' },
  { kind:'major', n:17, suit:'majors', roman:'XVII', name:'EL ATRACTOR EXTRAÑO', nameEn:'STRANGE ATTRACTOR',
    traditional:'La Estrella', traditionalEn:'The Star',
    field:'Lorenz · Hénon', fieldEn:'Lorenz · Hénon',
    definition:'Atractor de dimensión fractal: el sistema nunca se repite pero nunca escapa de su forma.',
    definitionEn:'Fractal-dimensional attractor: the system never repeats yet never escapes its form.',
    principle:'Hay órdenes que solo se dejan ver de lejos.',
    principleEn:'Some orders let themselves be seen only from afar.' },
  MINORS.find(m => m.suit === 'orden' && m.n === 1),       // LA DISTINCIÓN
  MINORS.find(m => m.suit === 'interaccion' && m.n === 13), // LA ESCUCHA
];

Object.assign(window, { TAROT_SUITS, MAJORS, MINOR_RANKS, MINORS, MINORS_MAP, PILOTS });
