/* i18n.jsx — El Reto v4. Drag RACKS into ROWS (Hileras). Buses AC/DC, CPU demand, capacity ceiling, cost budget, PUE.
   Wrong voltage is ALLOWED (failure mode surfaced at energise). Rack specs hidden until tapped. */

const RETO_I18N = {
  es: {
    nav: [
      { id: "quienes", label: "Quiénes somos" }, { id: "proyectos", label: "Proyectos" },
      { id: "personas", label: "Personas" }, { id: "talento", label: "Talento" }, { id: "contacto", label: "Contacto" },
    ],
    hero: {
      eyebrow: "Talento · El Reto Aguilera",
      title: "Antes de unirse, equilibre el sistema.",
      sub: "Diseñamos centros de datos que no pueden fallar. Antes de abrir su candidatura, le proponemos el reto real de un CPD: alcance la demanda de cómputo instalando racks en las hileras, respete la tensión de cada bus, refrigere el calor y no se pase del presupuesto. Le sobrarán racks — elija bien. Quien lo resuelve, accede.",
      cta: "Comenzar el reto",
      note: "Salas crecientes · ~8 min · un energizado inestable dispara la protección y reinicia el reto",
    },
    intro: {
      eyebrow: "El planteamiento",
      title: "Equilibre un CPD de IA. Cómputo, tensión, calor y coste.",
      body: "Cada hilera admite un bus de tensión (400 V AC, 400 V DC o 1000 V DC) y tiene una banda de potencia segura. Instale racks hasta dejar cada hilera dentro de su banda y alcanzar la demanda de cómputo de la sala, refrigere todo el calor y respete el presupuesto. Pulse un rack para ver su ficha: los datos no están a la vista. Puede cablear una tensión incorrecta — pero al energizar saltará la protección y volverá a empezar.",
      rules: [
        { k: "Cómputo", v: "Cada rack produce potencia de cómputo. Sume la de los racks instalados hasta alcanzar la demanda de la sala — ojo, no es lo mismo que su potencia eléctrica." },
        { k: "Banda", v: "Cada hilera tiene una banda de potencia: si se queda corto o se pasa, no entra en banda y fallará." },
        { k: "Tensión", v: "Cada rack admite uno o varios buses (AC/DC). Si lo conecta a una hilera incompatible, fallará al energizar." },
        { k: "Calor y coste", v: "La refrigeración debe cubrir el calor, y el coste de racks y equipos no puede superar el presupuesto." },
      ],
    },
    game: {
      roomLabel: "Sala", ofRooms: "de",
      tray: "Racks disponibles", trayEmpty: "Sin racks disponibles",
      row: "Hilera", capacity: "Capacidad", band: "Banda",
      statusEmpty: "Vacía", statusUnder: "Falta potencia", statusOk: "En banda", statusOver: "Fuera de banda", statusTrip: "Sobrecargada", statusMiswire: "Tensión incorrecta",
      deltaNeedMore: "kW para entrar en banda", deltaOver: "kW de exceso",
      energise: "Energizar el sistema",
      reset: "Reiniciar sala", fullscreen: "Pantalla completa", exitFullscreen: "Salir",
      dragHint: "Arrastre los racks a una hilera. Pulse un rack para ver su ficha técnica.",
      roundClear: "Sala equilibrada", next: "Siguiente sala", energiseAll: "Energizar el reto", tries: "Energizados",
      boot: {
        tag: "Reto", name: "Rescata el data center", system: "Centro de Proceso de Datos", loadingLabel: "Inicializando sistema",
        intro: "Va a operar un centro de datos real. Su misión: ponerlo en marcha sala a sala sin que salte la protección.",
        howTitle: "Cómo se juega",
        rules: [
          "Instale racks en cada hilera hasta dejarla dentro de su banda de potencia.",
          "Respete la tensión: cada rack solo entra en su bus (400 V AC / 400 V DC / 1000 V DC).",
          "Alcance la demanda de cómputo de la sala sumando la potencia de los racks.",
          "Refrigere todo el calor y no supere el presupuesto.",
          "Energice solo cuando el sistema sea estable: si falla, salta la protección.",
        ],
        termsTitle: "Términos clave",
        next: "Siguiente", back: "Atrás",
        terms: [
          { k: "Hilera", v: "Fila del CPD con una tensión fija y una banda de potencia que cubrir." },
          { k: "Rack", v: "Unidad de cómputo que instala. Púlselo para ver su ficha técnica." },
          { k: "Potencia eléctrica", v: "Lo que consume el rack; llena la banda de la hilera." },
          { k: "Potencia de cómputo", v: "Lo que produce el rack; sumarla es el objetivo de la sala." },
          { k: "Tensión (bus)", v: "400 V AC, 400 V DC o 1000 V DC. El rack solo entra en su bus." },
          { k: "Refrigeración", v: "Equipos que evacúan el calor que generan los racks." },
          { k: "Presupuesto", v: "Coste total de racks y refrigeración. No lo supere." },
        ],
        start: "Comenzar el reto",
      },
      tutorial: "Tutorial", tourSkip: "Saltar", tourNext: "Siguiente", tourDone: "Empezar a jugar", tourWaiting: "Esperando…",
      tour: [
        { title: "Las hileras", body: "Cada hilera admite una tensión —400 V AC, 400 V DC o 1000 V DC— y una banda de potencia. Tendrá que arrastrar racks dentro hasta dejarla dentro de banda, sin pasarse." },
        { title: "Los racks", body: "Estos son los racks disponibles. Cada modelo tiene propiedades distintas." },
        { title: "Abra una ficha", body: "Pulse cualquier rack para ver su ficha técnica: potencia eléctrica (lo que CONSUME), potencia de cómputo (lo que PRODUCE para la demanda de la sala) y calor que disipa. La de cómputo siempre es menor." },
        { title: "Coloque un rack", body: "Ahora arrastre un rack a una hilera. La barra de potencia se llena conforme añade carga — no se pase de la banda." },
        { title: "Refrigeración", body: "Cada rack genera calor que hay que disipar. Aquí añade equipos de refrigeración que cubran toda esa carga térmica." },
        { title: "Añada un equipo", body: "Pulse una ranura vacía y elija un equipo del catálogo. Verá su capacidad de refrigeración, su consumo y su coste." },
        { title: "Los límites", body: "Arriba vigila lo que importa: la demanda de cómputo que debe alcanzar, la refrigeración cubierta y el presupuesto. Las barras muestran cuánto le queda." },
        { title: "Energizar", body: "Cuando el sistema sea estable, pulse Energizar. Si algo falla —tensión, banda, calor o coste— salta la protección y el reto vuelve a empezar." },
      ],
      // rack sheet
      rackSheet: "Ficha del rack", vendor: "Fabricante", elec: "Potencia eléctrica", cpu: "Potencia de cómputo",
      therm: "Potencia térmica", voltage: "Buses admisibles", cost: "Coste", placeIn: "Colocar en", toTray: "Devolver a disponibles", close: "Cerrar",
      // cooling
      coolingBay: "Refrigeración", addUnit: "Añadir equipo", chooseUnit: "Seleccione un equipo", coolingCovered: "Calor cubierto", drawLabel: "consumo",
      // meters
      budget: "Presupuesto", controlPanel: "Panel de control", mCpu: "Demanda cómputo", mCap: "Hileras", mCooling: "Refrigeración", mBudget: "Presupuesto",
      // pue
      pue: "PUE", pueTarget: "Objetivo", pueExplain: "¿Qué es el PUE?",
      pueExplainBody: "El PUE (Power Usage Effectiveness) mide la eficiencia del CPD: energía total dividida por energía útil de cómputo. PUE = (cómputo + consumo de refrigeración) / cómputo. Más cerca de 1,0 es mejor.",
      harmonics: "Armónicos", harmOrder: "Armónico", harmExplain: "¿Qué son los armónicos?",
      harmExplainBody: "Los racks inyectan corrientes armónicas en la red según su orden (H3, H5, H7, H11…). Si concentras demasiados del mismo orden, los armónicos entran en resonancia y desestabilizan el sistema. Diversifica: no instales más de 2 racks del mismo orden.",
      harmUnstable: "Resonancia",
      platform: "Plataforma", lead: "Plazo de entrega", comm: "Puesta en marcha", projectTitle: "Cronograma", deadline: "Plazo objetivo", weeks: "sem", statusMixplat: "Plataformas mezcladas",
      softwareExplain: "Compatibilidad de software", softwareExplainBody: "Cada rack corre una plataforma de software. Dentro de una misma hilera, todos los racks deben correr la misma plataforma — si mezclas plataformas, no arrancan juntos.",
      pmExplain: "¿Cómo se mide el plazo?", pmExplainBody: "Cada rack tiene un plazo de entrega y un tiempo de puesta en marcha. La puesta en marcha del conjunto no empieza hasta recibir el último rack, así que el proyecto tarda = mayor plazo de entrega + mayor puesta en marcha. Debe quedar bajo el plazo objetivo.",
      locked: "Disponible en la Sala B",
      vUnit: "V",
      // alarm
      alarmTitle: "Protección disparada", alarmSub: "Sistema inestable al energizar.",
      alarmRestart: "Reinicio del reto — volviendo a la Sala 1.", alarmReason: "Causa", alarmContinue: "Reintentar el reto",
      causeUnder: "Hilera {id}: falta potencia", causeOverband: "Hilera {id} fuera de banda", causeTrip: "Hilera {id} sobrecargada", causeMiswire: "Tensión incorrecta en Hilera {id}", causeCpu: "Demanda de cómputo no alcanzada", causeCool: "Refrigeración insuficiente", causeBudget: "Presupuesto superado", causePue: "PUE por encima del objetivo", causeHarm: "Armónicos en resonancia ({h})", causeSoftware: "Hilera {id}: plataformas incompatibles", causePm: "Plazo del proyecto superado",
    },
    win: {
      eyebrow: "Sistema en línea",
      title: "Has rescatado el data center.",
      lead: "Si te gustaría seguir resolviendo retos de ingeniería reales, en Aguilera tenemos sitio para ti.",
      triesLabel: "Intentos",
      /* "Código del juego" deja claro que es un código único generado
         por El Reto al superarlo — no un código de cliente, ni de
         acceso, ni de cupón. Es la huella de que has jugado y ganado. */
      codeLabel: "Tu código del juego",
      copy: "Copiar", copied: "Copiado",
      sendEyebrow: "Cómo presentarte",
      sendTitle: "Encuentra tu sitio.",
      sendLead: "Mándanos un email con estos tres elementos. Lo revisa nuestro equipo de talento personalmente.",
      steps: [
        { k: "01", title: "Tu CV", body: "En PDF, adjunto al correo." },
        { k: "02", title: "Tu código del juego", body: "El de arriba — se ha generado al superar El Reto. Pégalo en el email para acreditar que lo has resuelto." },
        { k: "03", title: "Un párrafo", body: "Cuéntanos por qué crees que encajas con la posición a la que aplicas." },
      ],
      cta: "Encuentra tu sitio",
      ctaApply: "Enviar mi candidatura",
      ctaSub: "Abrirá tu cliente de correo con el código del juego ya incluido.",
      back: "Volver",
      seePositions: "Ver posiciones abiertas",
      fallbackPre: "¿No se abre tu cliente? Escríbenos directamente a",
      emailTo: "talento@aguilera-ingenieros.com",
      mailSubject: "Candidatura — Rescatar el CPD",
      mailBody: [
        "Hola equipo de Aguilera,",
        "",
        "Adjunto mi candidatura tras superar Rescatar el CPD.",
        "",
        "· CV: adjunto en este correo (PDF).",
        "· Código del juego: ",
        "· Por qué encajo:",
        "  [Describe en un párrafo por qué crees que encajas con la posición.]",
        "",
        "Un saludo,",
        "[Tu nombre]",
      ],
    },
    form: {
      name: "Nombre y apellidos", email: "Correo electrónico", phone: "Teléfono", role: "Área de interés",
      roles: ["Ingeniería de instalaciones (MEP)", "Centros de datos / CPD", "Sostenibilidad y energía", "BIM y coordinación", "Dirección de obra", "Otra"],
      linkedin: "LinkedIn o portfolio (opcional)", code: "Código de acceso",
      message: "Cuéntenos brevemente por qué Aguilera", cv: "Adjuntar CV (PDF)", cvChoose: "Seleccionar archivo", cvNone: "Ningún archivo seleccionado",
      submit: "Enviar candidatura", required: "Campo obligatorio", emailBad: "Correo no válido",
      successTitle: "Candidatura recibida.", successBody: "Gracias. Su candidatura ha quedado registrada con prioridad. Nuestro equipo de talento se pondrá en contacto en breve.",
      successMeta: "Ref. de candidatura",
    },
    footer: {
      meta: "Aguilera Ingenieros S.A. · Fundada en 1961", tagline: "Integridad · Excelencia profesional · Vocación de servicio",
      rights: "© 2024 Aguilera Ingenieros S.A. Todos los derechos reservados.", addr: "Calle de Guzmán el Bueno, 133 · Edificio Skandia · Madrid 28003",
    },
  },
  en: {
    nav: [
      { id: "quienes", label: "About us" }, { id: "proyectos", label: "Projects" },
      { id: "personas", label: "People" }, { id: "talento", label: "Careers" }, { id: "contacto", label: "Contact" },
    ],
    hero: {
      eyebrow: "Careers · The Aguilera Challenge",
      title: "Before you join, balance the system.",
      sub: "We engineer data centers that cannot fail. Before you open your application, we set you the real challenge of a data center: meet the compute demand by installing racks in the rows, respect each bus voltage, cool the heat and stay under budget. You will have spare racks — choose well. Solve it, and you are in.",
      cta: "Start the challenge",
      note: "Escalating halls · ~8 min · an unstable energisation trips the protection and restarts the challenge",
    },
    intro: {
      eyebrow: "The brief",
      title: "Balance an AI data center. Compute, voltage, heat and cost.",
      body: "Each row takes a voltage bus (400 V AC, 400 V DC or 1000 V DC) and has a safe power band. Install racks until every row lands within its band and you meet the hall's compute demand, cool all the heat and respect the budget. Tap a rack to see its spec sheet — the data is hidden. You can wire the wrong voltage — but on energise the protection will trip and you start over.",
      rules: [
        { k: "Compute", v: "Each rack produces compute power. Add it up across installed racks to reach the hall's demand — note it is not the same as its electrical power." },
        { k: "Band", v: "Each row has a power band: fall short or overshoot and it is out of band and will fail." },
        { k: "Voltage", v: "Each rack accepts one or more buses (AC/DC). Wire it to an incompatible row and it fails on energise." },
        { k: "Heat & cost", v: "Cooling must cover the heat, and the cost of racks plus units cannot exceed the budget." },
      ],
    },
    game: {
      roomLabel: "Hall", ofRooms: "of",
      tray: "Available racks", trayEmpty: "No racks available",
      row: "Row", capacity: "Capacity", band: "Band",
      statusEmpty: "Empty", statusUnder: "Short on power", statusOk: "In band", statusOver: "Over band", statusTrip: "Overloaded", statusMiswire: "Wrong voltage",
      deltaNeedMore: "kW to reach band", deltaOver: "kW over capacity",
      energise: "Energise the system",
      reset: "Reset hall", fullscreen: "Fullscreen", exitFullscreen: "Exit",
      dragHint: "Drag racks onto a row. Tap a rack to see its spec sheet.",
      roundClear: "Hall balanced", next: "Next hall", energiseAll: "Energise the challenge", tries: "Energisations",
      boot: {
        tag: "Challenge", name: "Save the data center", system: "Data Center", loadingLabel: "Initialising system",
        intro: "You will operate a real data center. Your mission: bring it online hall by hall without tripping the protection.",
        howTitle: "How to play",
        rules: [
          "Install racks in each row until it lands within its power band.",
          "Respect voltage: a rack only fits its bus (400 V AC / 400 V DC / 1000 V DC).",
          "Meet the hall's compute demand by adding up the racks' compute power.",
          "Cool all the heat and stay under budget.",
          "Energise only when the system is stable: if it fails, the protection trips.",
        ],
        termsTitle: "Key terms",
        next: "Next", back: "Back",
        terms: [
          { k: "Row", v: "A data-center row with a fixed voltage and a power band to fill." },
          { k: "Rack", v: "A compute unit you install. Tap one to read its spec sheet." },
          { k: "Electrical power", v: "What the rack draws; it fills the row's band." },
          { k: "Compute power", v: "What the rack produces; adding it up is the hall's goal." },
          { k: "Voltage (bus)", v: "400 V AC, 400 V DC or 1000 V DC. A rack only fits its bus." },
          { k: "Cooling", v: "Units that remove the heat the racks generate." },
          { k: "Budget", v: "Total cost of racks and cooling. Do not exceed it." },
        ],
        start: "Start the challenge",
      },
      tutorial: "Tutorial", tourSkip: "Skip", tourNext: "Next", tourDone: "Start playing", tourWaiting: "Waiting…",
      tour: [
        { title: "The rows", body: "Each row takes a voltage —400 V AC, 400 V DC or 1000 V DC— and a power band. You'll drag racks in until it lands within band, without overshooting." },
        { title: "The racks", body: "These are your available racks. Each model has different properties." },
        { title: "Open a sheet", body: "Tap any rack to open its spec sheet: electrical power (what it DRAWS), compute power (what it PRODUCES toward the hall's demand) and heat dissipated. Compute is always lower than draw." },
        { title: "Place a rack", body: "Now drag a rack onto a row. The power bar fills as you add load — don't overshoot the band." },
        { title: "Cooling", body: "Each rack generates heat that has to be absorbed. Here you add cooling units that cover that thermal load." },
        { title: "Add a unit", body: "Tap an empty slot and pick a unit from the catalogue. You'll see its cooling capacity, its draw and its cost." },
        { title: "The limits", body: "Up top you watch what matters: the compute demand you must reach, the cooling covered and the budget. The bars show how much is left." },
        { title: "Energise", body: "When the system is stable, press Energise. If anything fails —voltage, band, heat or cost— the protection trips and the challenge restarts." },
      ],
      rackSheet: "Rack spec sheet", vendor: "Vendor", elec: "Electrical power", cpu: "Compute power",
      therm: "Thermal load", voltage: "Accepted buses", cost: "Cost", placeIn: "Place in", toTray: "Return to available", close: "Close",
      coolingBay: "Cooling", addUnit: "Add unit", chooseUnit: "Choose a unit", coolingCovered: "Heat covered", drawLabel: "draw",
      budget: "Budget", controlPanel: "Control panel", mCpu: "Compute demand", mCap: "Rows", mCooling: "Cooling", mBudget: "Budget",
      pue: "PUE", pueTarget: "Target", pueExplain: "What is PUE?",
      pueExplainBody: "PUE (Power Usage Effectiveness) measures data-center efficiency: total energy divided by useful compute energy. PUE = (compute + cooling draw) / compute. Closer to 1.0 is better.",
      harmonics: "Harmonics", harmOrder: "Harmonic", harmExplain: "What are harmonics?",
      harmExplainBody: "Racks inject harmonic currents into the grid by order (H3, H5, H7, H11…). Cluster too many of the same order and the harmonics resonate and destabilise the system. Diversify: install no more than 2 racks of the same order.",
      harmUnstable: "Resonance",
      platform: "Platform", lead: "Lead time", comm: "Commissioning", projectTitle: "Schedule", deadline: "Target deadline", weeks: "wk", statusMixplat: "Mixed platforms",
      softwareExplain: "Software compatibility", softwareExplainBody: "Each rack runs a software platform. Within a row, all racks must run the same platform — mix platforms and they will not boot together.",
      pmExplain: "How is the deadline measured?", pmExplainBody: "Each rack has a delivery lead time and a commissioning time. Commissioning the cluster cannot start until the last rack arrives, so the project takes = longest lead time + longest commissioning. Stay under the target deadline.",
      locked: "Unlocks in Hall B",
      vUnit: "V",
      alarmTitle: "Protection tripped", alarmSub: "System unstable on energisation.",
      alarmRestart: "Challenge reset — returning to Hall 1.", alarmReason: "Cause", alarmContinue: "Retry the challenge",
      causeUnder: "Row {id}: short on power", causeOverband: "Row {id} over band", causeTrip: "Row {id} overloaded", causeMiswire: "Wrong voltage in Row {id}", causeCpu: "Compute demand not met", causeCool: "Insufficient cooling", causeBudget: "Over budget", causePue: "PUE above target", causeHarm: "Harmonics in resonance ({h})", causeSoftware: "Row {id}: incompatible platforms", causePm: "Project deadline exceeded",
    },
    win: {
      eyebrow: "System online",
      title: "You rescued the data center.",
      lead: "If you'd like to keep solving real engineering challenges, there's a place for you at Aguilera.",
      triesLabel: "Tries",
      /* "Game code" makes it unambiguous: a one-time code El Reto
         generated for you when you cleared it. Not a customer code,
         not a coupon, not an access key. Proof you played and won. */
      codeLabel: "Your game code",
      copy: "Copy", copied: "Copied",
      sendEyebrow: "How to apply",
      sendTitle: "Find your spot.",
      sendLead: "Send us an email with these three things. Our talent team reviews every application personally.",
      steps: [
        { k: "01", title: "Your CV", body: "A PDF attached to the email." },
        { k: "02", title: "Your game code", body: "The one above — generated by El Reto the moment you cleared it. Paste it into the email so we know you solved it." },
        { k: "03", title: "A paragraph", body: "Tell us why you think you'd fit the role you're applying to." },
      ],
      cta: "Find your spot",
      ctaApply: "Send my application",
      ctaSub: "Opens your mail client with the game code already filled in.",
      back: "Back",
      seePositions: "See open positions",
      fallbackPre: "Mail client not opening? Write to us directly at",
      emailTo: "talento@aguilera-ingenieros.com",
      mailSubject: "Application — Save the Data Center",
      mailBody: [
        "Hi Aguilera team,",
        "",
        "Here's my application after solving Save the Data Center.",
        "",
        "· CV: attached to this email (PDF).",
        "· Game code: ",
        "· Why I'd fit:",
        "  [Write a short paragraph here on why you'd fit the role.]",
        "",
        "Best,",
        "[Your name]",
      ],
    },
    form: {
      name: "Full name", email: "Email", phone: "Phone", role: "Area of interest",
      roles: ["Building services (MEP)", "Data centers", "Sustainability & energy", "BIM & coordination", "Site management", "Other"],
      linkedin: "LinkedIn or portfolio (optional)", code: "Access code",
      message: "Tell us briefly why Aguilera", cv: "Attach CV (PDF)", cvChoose: "Choose file", cvNone: "No file selected",
      submit: "Send application", required: "Required field", emailBad: "Invalid email",
      successTitle: "Application received.", successBody: "Thank you. Your application has been registered with priority. Our talent team will be in touch shortly.",
      successMeta: "Application ref.",
    },
    footer: {
      meta: "Aguilera Ingenieros S.A. · Founded 1961", tagline: "Integrity · Professional excellence · Service",
      rights: "© 2024 Aguilera Ingenieros S.A. All rights reserved.", addr: "Calle de Guzmán el Bueno, 133 · Edificio Skandia · Madrid 28003",
    },
  },
};

/* Voltage buses */
const BUSES = {
  AC400:  { label: { es: "400 V AC", en: "400 V AC" }, color: "amber" },
  DC400:  { label: { es: "400 V DC", en: "400 V DC" }, color: "green" },
  DC1000: { label: { es: "1000 V DC", en: "1000 V DC" }, color: "cyan" },
};

/* Cooling units — capKw, drawKw (PUE), costK (k€) */
const COOLING_UNITS = {
  "IR-30": { family: "CoolRow in-row", capKw: 30, drawKw: 5, costK: 10, label: "CoolRow IR-30" },
  "RD-45": { family: "ArcticDoor rear-door", capKw: 45, drawKw: 6, costK: 16, label: "ArcticDoor RD-45" },
  "CW-60": { family: "AireMax CRAH", capKw: 60, drawKw: 12, costK: 18, label: "AireMax CW-60" },
  "CW-90": { family: "AireMax CRAH (legacy)", capKw: 90, drawKw: 28, costK: 24, label: "AireMax CW-90" },
};

/* Rooms — verified solvable with the full constraint stack. */
const RETO_ROUNDS = [
  {
    id: 1,
    name: { es: "Sala A · Puesta en marcha", en: "Hall A · First energisation" },
    intro: {
      es: "Tres buses: 400 V AC, 400 V DC y 1000 V DC. Deje CADA hilera dentro de su banda (ninguna vacía), alcance 80 kW de cómputo, refrigere el calor y quédese en €170k. Los datos no están en el rack: púlselo para ver su ficha — y cuidado con la tensión.",
      en: "Three buses: 400 V AC, 400 V DC and 1000 V DC. Land EVERY row within its band (none empty), reach 80 kW of compute, cool the heat and stay under €170k. The data is not on the rack: tap it for its spec sheet — and mind the voltage.",
    },
    features: ["cpu", "voltage", "band", "coolingCap", "cost"],
    rows: [
      { id: "A", bus: "AC400", lo: 40, hi: 55, cap: 65 },
      { id: "B", bus: "DC400", lo: 45, hi: 65, cap: 78 },
      { id: "C", bus: "DC1000", lo: 60, hi: 85, cap: 100 },
    ],
    cpuDemand: 80,
    racks: [
      { id: "r1", model: "Atlas R9", vendor: "Coretek", e: 28, cpu: 18, t: 25, cost: 22, buses: ["AC400"] },
      { id: "r2", model: "Brio 2", vendor: "NubiX", e: 20, cpu: 13, t: 18, cost: 16, buses: ["AC400"] },
      { id: "r3", model: "Helio X4", vendor: "VertaCore", e: 25, cpu: 16, t: 22, cost: 18, buses: ["AC400"] },
      { id: "r4", model: "Mica 6", vendor: "Coretek", e: 15, cpu: 9, t: 13, cost: 13, buses: ["AC400"] },
      { id: "r5", model: "Vega 7", vendor: "Mitral", e: 30, cpu: 19, t: 27, cost: 24, buses: ["DC400"] },
      { id: "r6", model: "Quartz 3", vendor: "Coretek", e: 22, cpu: 14, t: 19, cost: 18, buses: ["DC400"] },
      { id: "r7", model: "Nimbus 5", vendor: "NubiX", e: 25, cpu: 16, t: 22, cost: 21, buses: ["DC400", "DC1000"] },
      { id: "r8", model: "Cirro 8", vendor: "VertaCore", e: 22, cpu: 14, t: 19, cost: 19, buses: ["DC400", "DC1000"] },
      { id: "r9", model: "Orca X2", vendor: "NubiX", e: 40, cpu: 27, t: 37, cost: 34, buses: ["DC1000"] },
      { id: "r10", model: "Pyxis 4", vendor: "Mitral", e: 30, cpu: 20, t: 27, cost: 26, buses: ["DC1000"] },
      { id: "r11", model: "Titan 1", vendor: "NubiX", e: 120, cpu: 70, t: 110, cost: 75, buses: ["DC1000"] },
    ],
    coolingSlots: 4,
    coolingCatalog: ["IR-30", "RD-45", "CW-60", "CW-90"],
    budget: 170,
    pueTarget: null,
  },
  {
    id: 2,
    name: { es: "Sala B · Eficiencia energética", en: "Hall B · Energy efficiency" },
    intro: {
      es: "Sube la demanda a 105 kW y el presupuesto a €200k, con bandas más estrechas. Dos nuevos límites: el PUE objetivo de 1,30 (la refrigeración eficiente consume menos pero cuesta más) y los armónicos — cada rack inyecta un orden armónico, y si juntas demasiados del mismo orden el sistema entra en resonancia.",
      en: "Compute demand rises to 105 kW with a €200k budget and tighter bands. Two new limits: the target PUE of 1.30 (efficient cooling draws less but costs more) and harmonics — each rack injects a harmonic order, and clustering too many of the same order makes the system resonate.",
    },
    features: ["cpu", "voltage", "band", "coolingCap", "cost", "pue", "harmonics"],
    rows: [
      { id: "A", bus: "AC400", lo: 40, hi: 55, cap: 65 },
      { id: "B", bus: "DC400", lo: 50, hi: 75, cap: 90 },
      { id: "C", bus: "DC1000", lo: 65, hi: 90, cap: 105 },
    ],
    cpuDemand: 105,
    harmLimit: 2,
    racks: [
      { id: "r1", model: "Aura 3", vendor: "Mitral", e: 30, cpu: 19, t: 27, cost: 23, buses: ["AC400"], h: "H5" },
      { id: "r2", model: "Lumen 8", vendor: "NubiX", e: 22, cpu: 14, t: 19, cost: 18, buses: ["AC400"], h: "H7" },
      { id: "r3", model: "Pixel 5", vendor: "Coretek", e: 25, cpu: 16, t: 22, cost: 20, buses: ["AC400"], h: "H5" },
      { id: "r4", model: "Spark 2", vendor: "VertaCore", e: 18, cpu: 11, t: 16, cost: 15, buses: ["AC400"], h: "H3" },
      { id: "r5", model: "Basalt 7", vendor: "Coretek", e: 35, cpu: 23, t: 32, cost: 29, buses: ["DC400"], h: "H7" },
      { id: "r6", model: "Flint 4", vendor: "NubiX", e: 25, cpu: 16, t: 22, cost: 22, buses: ["DC400"], h: "H5" },
      { id: "r7", model: "Zephyr 9", vendor: "VertaCore", e: 28, cpu: 18, t: 25, cost: 24, buses: ["DC400", "DC1000"], h: "H11" },
      { id: "r8", model: "Cirrus 6", vendor: "Mitral", e: 22, cpu: 14, t: 19, cost: 20, buses: ["DC400", "DC1000"], h: "H7" },
      { id: "r9", model: "Kraken X3", vendor: "NubiX", e: 45, cpu: 30, t: 42, cost: 38, buses: ["DC1000"], h: "H11" },
      { id: "r10", model: "Marlin 5", vendor: "Coretek", e: 35, cpu: 23, t: 32, cost: 31, buses: ["DC1000"], h: "H3" },
      { id: "r11", model: "Goliath 1", vendor: "NubiX", e: 130, cpu: 80, t: 120, cost: 82, buses: ["DC1000"], h: "H5" },
    ],
    coolingSlots: 4,
    coolingCatalog: ["IR-30", "RD-45", "CW-60", "CW-90"],
    budget: 200,
    pueTarget: 1.30,
  },
  {
    id: 3,
    name: { es: "Sala C · Misión crítica", en: "Hall C · Mission critical" },
    intro: {
      es: "La sala final. Sin PUE ni armónicos, pero con dos retos de ingeniería real: compatibilidad de software (todos los racks de una hilera deben correr la MISMA plataforma) y plazos (cada rack tiene un plazo de entrega y una puesta en marcha; el proyecto tarda = mayor plazo de entrega + mayor puesta en marcha). Debe quedar bajo el plazo objetivo.",
      en: "The final hall. No PUE or harmonics, but two real engineering problems: software compatibility (all racks in a row must run the SAME platform) and scheduling (each rack has a delivery lead time and a commissioning time; the project takes = longest lead + longest commissioning). Stay under the target deadline.",
    },
    features: ["cpu", "voltage", "band", "coolingCap", "cost", "software", "pm"],
    rows: [
      { id: "A", bus: "AC400", lo: 40, hi: 55, cap: 65 },
      { id: "B", bus: "DC400", lo: 50, hi: 75, cap: 90 },
      { id: "C", bus: "DC1000", lo: 65, hi: 90, cap: 105 },
    ],
    cpuDemand: 100,
    deadline: 12,
    racks: [
      { id: "r1", model: "Sigma 4", vendor: "Coretek", e: 28, cpu: 18, t: 25, cost: 22, buses: ["AC400"], p: "Orion", lead: 6, comm: 3 },
      { id: "r2", model: "Sigma 2", vendor: "Coretek", e: 22, cpu: 14, t: 19, cost: 18, buses: ["AC400"], p: "Orion", lead: 5, comm: 3 },
      { id: "r3", model: "Volta 5", vendor: "Mitral", e: 25, cpu: 16, t: 22, cost: 20, buses: ["AC400"], p: "Kube", lead: 5, comm: 4 },
      { id: "r4", model: "Volta 3", vendor: "Mitral", e: 18, cpu: 11, t: 16, cost: 15, buses: ["AC400"], p: "Kube", lead: 6, comm: 3 },
      { id: "r5", model: "Tardo 8", vendor: "Coretek", e: 30, cpu: 19, t: 27, cost: 24, buses: ["AC400"], p: "Orion", lead: 11, comm: 6 },
      { id: "r6", model: "Dínamo 7", vendor: "VertaCore", e: 35, cpu: 23, t: 32, cost: 29, buses: ["DC400"], p: "Orion", lead: 6, comm: 4 },
      { id: "r7", model: "Dínamo 4", vendor: "VertaCore", e: 25, cpu: 16, t: 22, cost: 21, buses: ["DC400"], p: "Orion", lead: 5, comm: 3 },
      { id: "r8", model: "Kuanta 6", vendor: "NubiX", e: 28, cpu: 18, t: 25, cost: 24, buses: ["DC400"], p: "Kube", lead: 5, comm: 4 },
      { id: "r9", model: "Kuanta 3", vendor: "NubiX", e: 25, cpu: 16, t: 22, cost: 22, buses: ["DC400"], p: "Kube", lead: 6, comm: 3 },
      { id: "r10", model: "Flux 9", vendor: "NubiX", e: 45, cpu: 30, t: 42, cost: 38, buses: ["DC1000"], p: "Orion", lead: 7, comm: 4 },
      { id: "r11", model: "Flux 5", vendor: "NubiX", e: 35, cpu: 23, t: 32, cost: 31, buses: ["DC1000"], p: "Orion", lead: 6, comm: 3 },
      { id: "r12", model: "Korex 7", vendor: "Mitral", e: 40, cpu: 26, t: 37, cost: 34, buses: ["DC1000"], p: "Kube", lead: 6, comm: 5 },
      { id: "r13", model: "Korex 4", vendor: "Mitral", e: 30, cpu: 20, t: 27, cost: 27, buses: ["DC1000"], p: "Kube", lead: 5, comm: 4 },
      { id: "r14", model: "Coloso 1", vendor: "NubiX", e: 130, cpu: 80, t: 120, cost: 82, buses: ["DC1000"], p: "Orion", lead: 9, comm: 7 },
    ],
    coolingSlots: 4,
    coolingCatalog: ["IR-30", "RD-45", "CW-60", "CW-90"],
    budget: 205,
    pueTarget: null,
  },
];

Object.assign(window, { RETO_I18N, RETO_ROUNDS, COOLING_UNITS, BUSES });
