<!doctype html>
<html lang="{{ current_language }}">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Eclipse Imperia, estrategia espacial accesible contra inteligencia artificial.">
  <meta name="csrf-token" content="{{ csrf_token() }}">
  <meta name="theme-color" content="#071827">
  <title>{% block title %}{{ SECTION_LABELS.get(section, 'Eclipse Imperia') }}{% endblock %} — Eclipse Imperia</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='strategy.css', v=APP_META.version) }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='encyclopedia.css', v=APP_META.version) }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='help_audio.css', v=APP_META.version) }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css', v=APP_META.version) }}">
  <link rel="manifest" href="{{ url_for('static', filename='manifest.webmanifest', v=APP_META.version) }}">
  <script src="{{ url_for('static', filename='audio.js', v=APP_META.version) }}" defer></script>
  <script src="{{ url_for('static', filename='app.js', v=APP_META.version) }}" defer></script>
  <script src="{{ url_for('static', filename='i18n.js', v=APP_META.version) }}" defer></script>
</head>
<body data-game-status="{{ game.status }}" data-section="{{ section }}"
      data-music-enabled="{{ audio_preferences.music_enabled }}" data-effects-enabled="{{ audio_preferences.effects_enabled }}"
      data-music-volume="{{ audio_preferences.music_volume }}" data-effects-volume="{{ audio_preferences.effects_volume }}"
      data-interface-volume="{{ audio_preferences.interface_volume }}" data-notification-volume="{{ audio_preferences.notification_volume }}"
      data-combat-volume="{{ audio_preferences.combat_volume }}" data-ambient-volume="{{ audio_preferences.ambient_volume }}"
      data-mono-audio="{{ audio_preferences.mono_audio }}" data-screen-reader-ducking="{{ audio_preferences.screen_reader_ducking }}"
      data-music-track="{{ audio_preferences.music_track }}" data-music-random="{{ audio_preferences.music_random }}"
      data-high-contrast="{{ interface_preferences.high_contrast }}" data-large-text="{{ interface_preferences.large_text }}"
      data-updates-paused="{{ interface_preferences.updates_paused }}"
      data-compact-panels="{{ interface_preferences.compact_panels }}"
      data-select-current-first="{{ interface_preferences.select_current_first }}"
      data-shortcut-shift="{{ interface_preferences.shortcut_shift }}"
      data-navigation-mode="{{ interface_preferences.navigation_mode }}"
      data-confirm-spend-percent="{{ assistance_profile.confirm_spend_percent }}"
      data-sound-cue="{{ sound_cue }}">
  <script id="input-bindings" type="application/json">{{ binding_payload|safe }}</script>
  <script id="audio-catalog" type="application/json">{"music":[{% for key, track in MUSIC_TRACKS.items() %}{"key":{{ key|tojson }},"name":{{ track.name|tojson }},"description":{{ track.description|tojson }},"url":{{ url_for('static', filename=track.file)|tojson }}}{% if not loop.last %},{% endif %}{% endfor %}],"effects":[{% for key, effect in EFFECT_SOUNDS.items() %}{"key":{{ key|tojson }},"name":{{ effect.name|tojson }},"category":{{ effect.category|tojson }},"actions":{{ effect.actions|tojson }},"character":{{ effect.character|tojson }},"url":{{ url_for('static', filename=effect.file)|tojson }}}{% if not loop.last %},{% endif %}{% endfor %}]}</script>
  <nav class="skip-links" aria-label="Accesos directos de la página">
    <a class="skip-link" href="#main">Saltar al contenido principal</a>
    <a class="skip-link" href="#resources">Saltar a recursos</a>
    <a class="skip-link" href="#primary-navigation">Saltar a navegación</a>
    <a class="skip-link" href="#planet-controls">Saltar al planeta activo</a>
  </nav>
  <div id="sr-events" class="sr-only" role="status" aria-live="polite" aria-atomic="true"></div>

  {% include "components/_topbar.html" %}

  <div class="app-shell">
    {% include "components/_sidebar.html" %}

    <main id="main" class="main-content" tabindex="-1">
      {% if game.status == 'paused' %}
        <div class="notice notice-warning" role="status">El universo está pausado. No avanzan recursos, colas, flotas ni rivales.</div>
      {% endif %}
      {% if winner %}<div class="notice notice-success" role="status"><strong>Victoria declarada:</strong> {{ winner.name }} cumplió el objetivo. Puedes continuar jugando este universo.</div>{% endif %}
      {% if not ONLINE_MODE and config.get('cheat_mode') and config.get('cheat_empire_id') == empire.id %}<div class="notice notice-warning" role="status"><strong>Modo trampas activo.</strong> Puedes modificar el progreso desde <a href="{{ url_for('game_view', section='settings', planet=planet.id, _anchor='cheat-mode-title') }}">Configuración</a>. Este universo queda identificado como partida con trampas.</div>{% endif %}
      {% if assistance_warnings %}
        <section class="notice notice-warning" aria-labelledby="assistance-warning-title">
          <h2 id="assistance-warning-title">Avisos anticipados del perfil de asistencia</h2>
          <ul>{% for warning in assistance_warnings %}<li>{{ warning }}</li>{% endfor %}</ul>
        </section>
      {% endif %}
      {% with messages = get_flashed_messages(with_categories=true) %}
        {% for category, message in messages %}
          <div class="notice notice-{{ category }}" role="{{ 'alert' if category == 'error' else 'status' }}">{{ message }}</div>
        {% endfor %}
      {% endwith %}

      <div id="section-content">
      {% if section == 'overview' %}
        {% include "sections/_overview.html" %}


      {% elif section == 'help' %}
        {% include "sections/_help.html" %}

      {% elif section == 'manual' %}
        {% include "sections/_manual.html" %}

      {% elif section == 'command' %}
        {% include "_command.html" %}

      {% elif section == 'encyclopedia' %}
        {% include "_encyclopedia.html" %}

      {% elif section == 'economy' %}
        {% include "sections/_economy.html" %}


      {% elif section == 'research' %}
        {% include "sections/_research.html" %}


      {% elif section == 'shipyard' %}
        {% include "sections/_shipyard.html" %}


      {% elif section == 'agriculture' %}
        {% include "sections/_agriculture.html" %}


      {% elif section == 'commerce' %}
        {% include "sections/_commerce.html" %}


      {% elif section == 'market' %}
        {% include "sections/_market.html" %}


      {% elif section == 'frontier' %}
        {% include "sections/_frontier.html" %}


      {% elif section == 'expeditions' %}
        {% include "sections/_expeditions.html" %}


      {% elif section == 'governance' %}
        {% include "sections/_governance.html" %}


      {% elif section == 'diplomacy' %}
        {% include "sections/_diplomacy.html" %}


      {% elif section == 'operations' %}
        {% include "sections/_operations.html" %}


      {% elif section == 'galaxy' %}
        {% include "sections/_galaxy.html" %}


      {% elif section == 'fleet' %}
        {% include "sections/_fleet.html" %}


      {% elif section == 'messages' %}
        {% include "sections/_messages.html" %}

      {% elif section == 'timeline' %}
        {% include "sections/_timeline.html" %}

      {% elif section == 'society' %}
        {% include "sections/_society.html" %}

      {% elif section == 'senate' %}
        {% include "sections/_senate.html" %}

      {% elif section == 'intelligence' %}
        {% include "sections/_intelligence.html" %}

      {% elif section == 'designs' %}
        {% include "sections/_designs.html" %}

      {% elif section == 'invasions' %}
        {% include "sections/_invasions.html" %}

      {% elif section == 'encounters' %}
        {% include "sections/_encounters.html" %}

      {% elif section == 'scenarios' %}
        {% include "sections/_scenarios.html" %}

      {% elif section == 'planning' %}
        {% include "sections/_planning.html" %}

      {% elif section == 'empire' %}
        {% include "sections/_empire.html" %}

      {% elif section == 'statistics' %}
        {% include "sections/_statistics.html" %}

      {% elif section == 'museum' %}
        {% include "sections/_museum.html" %}

      {% elif section == 'logistics' %}
        {% include "sections/_logistics.html" %}

      {% elif section == 'seasons' %}
        {% include "sections/_seasons.html" %}

      {% elif section == 'orbital' %}
        {% include "sections/_orbital.html" %}

      {% elif section == 'settings' %}
        {% include "sections/_settings.html" %}

      {% elif section == 'about' %}
        {% include "sections/_about.html" %}
      {% endif %}
      </div>
      <nav id="page-section-index" class="panel page-section-index" aria-labelledby="page-section-index-title" tabindex="-1" aria-keyshortcuts="{{ shortcut_map.headings }}" data-binding-action="headings" hidden>
        <h2 id="page-section-index-title">Secciones de esta pantalla</h2>
        <p>Usa estos enlaces para saltar directamente entre grupos de controles y resultados.</p>
        <ul data-page-section-links></ul>
      </nav>
    </main>
  </div>
  {% include "components/_shortcut_dialog.html" %}
  {% include "components/_audio_dialog.html" %}
</body>
</html>
