        <header class="page-heading"><p class="eyebrow">PRODUCCIÓN ORBITAL</p><h1>Astillero de {{ planet.name }}</h1><p>Construye naves para misiones y defensas estacionarias para proteger el planeta.</p></header>
        <div class="notice notice-warning"><strong>Estas defensas son orbitales.</strong> Láseres, cañones y lanzamisiles combaten flotas, pero no tropas que ya hayan desembarcado. <a href="{{ url_for('game_view', section='invasions', planet=planet.id) }}">Preparar soldados, blindados y suministros terrestres</a>.</div>
        {% set ship_queue = queues|selectattr('category','equalto','shipyard')|selectattr('planet_id','equalto',planet.id)|list %}
        {% if ship_queue %}{% set q = ship_queue[0] %}{% set queued_unit = SHIPS.get(q.item) or DEFENSES.get(q.item) %}<section class="active-queue" data-queue-id="{{ q.id }}"><div><span>Producción en curso</span><strong>{{ q.amount }} × {{ queued_unit.name }}</strong></div><div class="queue-time"><span>Tiempo restante</span><time class="countdown" data-end="{{ q.completes_at }}">{{ (q.completes_at-now)|duration }}</time></div><form method="post" action="{{ url_for('cancel_action') }}"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"><input type="hidden" name="queue_id" value="{{ q.id }}"><input type="hidden" name="return_section" value="shipyard"><button class="button button-danger" type="submit">Cancelar producción de {{ queued_unit.name }}</button></form></section>{% endif %}
        {% for group_name, entries in groups %}<section aria-labelledby="group-{{ loop.index }}"><h2 id="group-{{ loop.index }}" class="section-title">{{ group_name }}</h2><div class="card-grid">
          {% for entry in entries %}<article class="tech-card"><div class="card-number {% if group_name == 'Defensas' %}defense{% endif %}" aria-hidden="true">{{ '%02d'|format(loop.index) }}</div><div class="card-copy"><h3>{{ entry.definition.name }} <span>Disponibles: {{ entry.owned }}</span></h3>
            <p>{% if group_name == 'Naves' %}Ataque {{ entry.definition.attack }}, escudo {{ entry.definition.shield }}, carga {{ entry.definition.cargo|number }}.{% else %}Ataque {{ entry.definition.attack }}, escudo {{ entry.definition.shield }}, estructura {{ entry.definition.hull }}.{% endif %}</p>
            {% if entry.missing %}<p class="requirement">Requiere: {{ entry.missing|join(', ') }}</p>{% endif %}<dl class="cost-list"><div><dt>Metal</dt><dd>{{ entry.cost.metal|number }}</dd></div><div><dt>Cristal</dt><dd>{{ entry.cost.crystal|number }}</dd></div><div><dt>Deuterio</dt><dd>{{ entry.cost.deuterium|number }}</dd></div><div><dt>Tiempo por unidad</dt><dd>{{ entry.duration|duration }}</dd></div><div><dt>Tiempo total</dt><dd class="unit-total-duration" data-unit-duration="{{ entry.duration }}">{{ entry.duration|duration }}</dd></div></dl><a href="{{ url_for('game_view', section='encyclopedia') }}#wiki-{{ 'ship' if group_name == 'Naves' else 'defense' }}-{{ entry.key }}">Consultar ficha completa</a></div>
            <form class="inline-form" method="post" action="{{ url_for('shipyard_action') }}" data-cost-metal="{{ entry.cost.metal }}" data-cost-crystal="{{ entry.cost.crystal }}" data-cost-deuterium="{{ entry.cost.deuterium }}" data-cost-quantity="amount"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"><input type="hidden" name="item" value="{{ entry.key }}"><label for="shipyard-amount-{{ entry.key }}">Cantidad de {{ entry.definition.name }} <input id="shipyard-amount-{{ entry.key }}" type="number" name="amount" value="1" min="1" max="999" inputmode="numeric" data-duration-quantity></label><button class="button button-primary" type="submit" {% if ship_queue or not entry.met %}disabled{% endif %}>Producir {{ entry.definition.name }}</button></form>
          </article>{% endfor %}
        </div></section>{% endfor %}
