<!-- ======================================================== -->
  <!-- ESTILOS CSS EN LÍNEA: SIN DEPENDENCIAS EXTERNAS NI CDN   -->
  <!-- PALETA PASTEL SUAVE Y TIPOGRAFÍA DEL SISTEMA             -->
  <!-- ======================================================== -->

     .aistudio-hover-highlight { box-shadow: inset 0 0 0 0.5px white, inset 0 0 0 1.5px rgba(128,128,128,0.6) !important; }.aistudio-active-highlight { outline: 2px solid #87a9ff !important; outline-offset: -2px !important; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.3), inset 0 0 0 0.5px rgba(0,0,0,0.3) !important; }.aistudio-generating-blur { filter: blur(5px) grayscale(100%) brightness(28%) !important; transition: filter 0.3s ease; }#aistudio-focus-mode-tag { position: absolute; display: none; align-items: center; gap: 4px; background: #87a9ff; border-radius: 12px; z-index: 10000; padding: 8px; color: #32302c; font-family: Inter, sans-serif; font-size: 14px; font-style: normal; font-weight: 500; line-height: 21px; pointer-events: none; }#aistudio-hover-mode-tag { position: absolute; display: none; align-items: center; gap: 4px; background: rgba(128,128,128,0.6); border-radius: 12px; z-index: 10000; padding: 8px; color: white; font-family: Inter, sans-serif; font-size: 14px; font-style: normal; font-weight: 500; line-height: 21px; pointer-events: none; }.aistudio-img-icon { display: none; vertical-align: middle; pointer-events: auto; cursor: pointer; }.aistudio-img-icon.visible { display: inline-flex; }#aistudio-focus-mode-tag .aistudio-img-icon { position: relative; width: 26px; height: 26px; background: #32302c; border-radius: 6px; margin: -4px -4px -4px 0; }#aistudio-focus-mode-tag .aistudio-img-icon::before { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; background-color: white; -webkit-mask-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/edit_fix_auto/default/24px.svg"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; mask-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/edit_fix_auto/default/24px.svg"); mask-size: contain; mask-repeat: no-repeat; }#aistudio-hover-mode-tag .aistudio-img-icon { position: relative; width: 18px; height: 18px; margin-left: 4px; }#aistudio-hover-mode-tag .aistudio-img-icon::before { content: ""; position: absolute; top: 0; left: 0; width: 18px; height: 18px; background-color: white; -webkit-mask-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/edit_fix_auto/default/24px.svg"); -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; mask-image: url("https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/edit_fix_auto/default/24px.svg"); mask-size: contain; mask-repeat: no-repeat; }#aistudio-focus-mode-tag .aistudio-img-icon:hover, #aistudio-hover-mode-tag .aistudio-img-icon:hover { background: #424242 !important; }#aistudio-focus-mode-tag .aistudio-img-icon:active, #aistudio-hover-mode-tag .aistudio-img-icon:active { background: #393f51 !important; }


    /* VARIABLES DE COLOR Y DISEÑO */
    :root {
      --bg-main: #f4f8f5;
      --bg-card: #ffffff;
      --bg-card-alt: #edf2ee;
      --text-main: #2d3748;
      --text-muted: #5a6a7e;
      --text-light: #718096;
      
      /* Acentos Pastel */
      --mint-primary: #4a7c59;
      --mint-light: #81a080;
      --mint-soft: #eaf2eb;
      --mint-border: #c4dcce;

      --blue-primary: #3b7a9e;
      --blue-light: #7ea1b7;
      --blue-soft: #e9f2f7;
      --blue-border: #bfd8e6;

      --earth-primary: #a67c52;
      --earth-light: #c4a482;
      --earth-soft: #f7f1ea;
      --earth-border: #e2d1c1;

      --forest-primary: #2e7d5e;
      --forest-light: #66bb6a;
      --forest-soft: #e8f5e9;

      /* Estado Quiz */
      --success-bg: #dcfce7;
      --success-text: #166534;
      --success-border: #86efac;
      --error-bg: #fee2e2;
      --error-text: #991b1b;
      --error-border: #fca5a5;

      --radius-sm: 8px;
      --radius-md: 14px;
      --radius-lg: 20px;
      --shadow-sm: 0 2px 6px rgba(45, 55, 72, 0.05);
      --shadow-md: 0 6px 18px rgba(45, 55, 72, 0.08);
      --shadow-lg: 0 14px 30px rgba(45, 55, 72, 0.12);
      --transition-smooth: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* RESET BÁSICO Y TIPOGRAFÍA */
    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      background-color: var(--bg-main);
      color: var(--text-main);
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-x: hidden;
    }

    a {
      color: inherit;
      text-decoration: none;
    }

    button {
      font-family: inherit;
      cursor: pointer;
      border: none;
      outline: none;
      background: none;
      transition: var(--transition-smooth);
    }

    /* CONTENEDOR PRINCIPAL */
    .container {
      width: 100%;
      max-width: 1300px;
      margin: 0 auto;
      padding: 0 20px;
    }

    /* ENCABEZADO SUPERIOR */
    .header {
      background: linear-gradient(180deg, #ffffff 0%, var(--bg-main) 100%);
      border-bottom: 1px solid var(--mint-border);
      padding: 24px 0 20px 0;
      position: sticky;
      top: 0;
      z-index: 100;
      backdrop-filter: blur(8px);
    }

    .header-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 16px;
    }

    .brand-group {
      display: flex;
      flex-direction: column;
    }

    .badge-tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      background: var(--mint-soft);
      color: var(--mint-primary);
      border: 1px solid var(--mint-border);
      width: fit-content;
      margin-bottom: 6px;
    }

    .header-title {
      font-size: 1.6rem;
      font-weight: 800;
      color: #1f3d2b;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .header-subtitle {
      font-size: 0.9rem;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .nav-links {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .nav-btn {
      padding: 8px 16px;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-main);
      background: var(--bg-card);
      border: 1px solid #d3e2d7;
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-sm);
    }

    .nav-btn:hover {
      background: var(--mint-soft);
      border-color: var(--mint-light);
      color: var(--mint-primary);
    }

    .nav-btn-download {
      background: var(--mint-primary);
      color: #ffffff;
      border-color: var(--mint-primary);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .nav-btn-download:hover {
      background: #396446;
      color: #ffffff;
      border-color: #396446;
    }

    /* SECCIÓN GENERAL */
    .section-wrap {
      padding: 44px 0;
    }

    .section-header {
      margin-bottom: 24px;
      text-align: left;
    }

    .section-pill {
      display: inline-block;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 3px 12px;
      border-radius: 30px;
      margin-bottom: 8px;
    }

    .pill-green {
      background: var(--mint-soft);
      color: var(--mint-primary);
      border: 1px solid var(--mint-border);
    }

    .pill-blue {
      background: var(--blue-soft);
      color: var(--blue-primary);
      border: 1px solid var(--blue-border);
    }

    .pill-earth {
      background: var(--earth-soft);
      color: var(--earth-primary);
      border: 1px solid var(--earth-border);
    }

    .section-title {
      font-size: 1.5rem;
      font-weight: 750;
      color: #1a3324;
      line-height: 1.25;
    }

    .section-desc {
      font-size: 0.95rem;
      color: var(--text-muted);
      max-width: 820px;
      margin-top: 6px;
    }

    /* ======================================================== */
    /* MÓDULO 1: CANVAS ANIMADO Y PANEL LATERAL                */
    /* ======================================================== */
    .ecosystem-grid {
      display: grid;
      grid-template-columns: 7fr 3fr;
      gap: 20px;
      align-items: stretch;
    }

    .canvas-container {
      background: var(--bg-main);
      border-radius: var(--radius-lg);
      border: 1px solid var(--mint-border);
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      min-height: 540px;
    }

    .canvas-toolbar {
      position: absolute;
      top: 14px;
      left: 14px;
      right: 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      pointer-events: none;
      z-index: 10;
      flex-wrap: wrap;
      gap: 8px;
    }

    .toolbar-left, .toolbar-right {
      display: flex;
      gap: 8px;
      pointer-events: auto;
    }

    .canvas-btn {
      padding: 6px 12px;
      font-size: 0.8rem;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid var(--mint-border);
      color: var(--text-main);
      border-radius: 20px;
      box-shadow: var(--shadow-sm);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      backdrop-filter: blur(4px);
    }

    .canvas-btn:hover {
      background: #ffffff;
      color: var(--mint-primary);
      border-color: var(--mint-primary);
      box-shadow: var(--shadow-md);
    }

    .canvas-btn.active {
      background: var(--mint-primary);
      color: #ffffff;
      border-color: var(--mint-primary);
    }

    #ecosystemCanvas {
      width: 100%;
      height: 100%;
      min-height: 540px;
      display: block;
      cursor: grab;
      touch-action: none;
    }

    .canvas-legend-hint {
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.78rem;
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.88);
      padding: 5px 14px;
      border-radius: 20px;
      border: 1px solid var(--mint-border);
      pointer-events: none;
      white-space: nowrap;
      box-shadow: var(--shadow-sm);
    }

    /* PANEL LATERAL INFORMATIVO */
    .info-panel {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      border: 1px solid var(--mint-border);
      box-shadow: var(--shadow-md);
      padding: 24px;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow-y: auto;
      max-height: 600px;
      transition: var(--transition-smooth);
    }

    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--mint-border);
    }

    .panel-header-info {
      flex: 1;
    }

    .panel-category {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--mint-primary);
      margin-bottom: 4px;
    }

    .panel-title {
      font-size: 1.25rem;
      font-weight: 750;
      color: #1f3d2b;
      line-height: 1.3;
    }

    .btn-close-panel {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--bg-card-alt);
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      font-weight: bold;
      margin-left: 8px;
    }

    .btn-close-panel:hover {
      background: var(--error-bg);
      color: var(--error-text);
    }

    .panel-body {
      flex: 1;
      font-size: 0.88rem;
      color: var(--text-main);
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .stat-card-group {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      margin-top: 4px;
    }

    .stat-card {
      background: var(--mint-soft);
      border: 1px solid var(--mint-border);
      padding: 12px 14px;
      border-radius: var(--radius-sm);
    }

    .stat-card.blue {
      background: var(--blue-soft);
      border-color: var(--blue-border);
    }

    .stat-card.earth {
      background: var(--earth-soft);
      border-color: var(--earth-border);
    }

    .stat-title {
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--mint-primary);
      margin-bottom: 2px;
    }

    .stat-card.blue .stat-title {
      color: var(--blue-primary);
    }

    .stat-card.earth .stat-title {
      color: var(--earth-primary);
    }

    .stat-highlight {
      font-size: 1.2rem;
      font-weight: 800;
      color: #1b4d2e;
      margin-bottom: 4px;
    }

    .stat-card.blue .stat-highlight {
      color: #1a5170;
    }

    .stat-card.earth .stat-highlight {
      color: #634325;
    }

    .stat-desc {
      font-size: 0.82rem;
      color: var(--text-main);
      line-height: 1.45;
    }

    .key-points-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .key-point-item {
      display: flex;
      gap: 8px;
      font-size: 0.84rem;
      line-height: 1.4;
      background: var(--bg-card-alt);
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      border-left: 3px solid var(--mint-light);
    }

    .point-dot {
      color: var(--mint-primary);
      font-weight: bold;
    }

    /* Panel en estado vacío */
    .empty-state {
      text-align: center;
      padding: 40px 10px;
      color: var(--text-muted);
      margin: auto 0;
    }

    .empty-state-icon {
      font-size: 2.8rem;
      margin-bottom: 12px;
      opacity: 0.75;
    }

    .empty-state-title {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--text-main);
      margin-bottom: 6px;
    }

    .empty-state-desc {
      font-size: 0.85rem;
      line-height: 1.5;
    }

    .quick-nodes-list {
      margin-top: 18px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      text-align: left;
    }

    .quick-node-btn {
      padding: 8px 12px;
      background: var(--bg-card-alt);
      border: 1px solid #d8e5dc;
      border-radius: var(--radius-sm);
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--text-main);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .quick-node-btn:hover {
      background: var(--mint-soft);
      border-color: var(--mint-border);
      color: var(--mint-primary);
    }

    /* ======================================================== */
    /* MÓDULO 2: FLASHCARDS ANIMADAS (EFECTO 3D)                */
    /* ======================================================== */
    .flashcards-section {
      background: #ffffff;
      border-top: 1px solid var(--mint-border);
      border-bottom: 1px solid var(--mint-border);
    }

    .flashcards-layout {
      display: flex;
      flex-direction: column;
      align-items: center;
      max-width: 820px;
      margin: 0 auto;
    }

    .flashcard-meta-bar {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      flex-wrap: wrap;
      gap: 10px;
    }

    .flashcard-counter {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--mint-primary);
      background: var(--mint-soft);
      padding: 4px 12px;
      border-radius: 20px;
      border: 1px solid var(--mint-border);
    }

    .flashcard-progress-outer {
      flex: 1;
      max-width: 320px;
      height: 8px;
      background: #e2ede5;
      border-radius: 4px;
      overflow: hidden;
      margin: 0 12px;
    }

    .flashcard-progress-inner {
      height: 100%;
      background: var(--mint-primary);
      width: 10%;
      transition: width 0.3s ease;
    }

    .flashcard-shortcut-hint {
      font-size: 0.78rem;
      color: var(--text-light);
    }

    /* PERSPECTIVA 3D DE LA TARJETA */
    .flashcard-scene {
      width: 100%;
      min-height: 290px;
      perspective: 1200px;
      cursor: pointer;
      user-select: none;
    }

    .flashcard-card {
      width: 100%;
      min-height: 290px;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
      border-radius: var(--radius-lg);
    }

    .flashcard-card.flipped {
      transform: rotateY(180deg);
    }

    .flashcard-face {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      backface-visibility: hidden;
      border-radius: var(--radius-lg);
      padding: 32px 36px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      box-shadow: var(--shadow-md);
      border: 2px solid #e1eee4;
      background: #ffffff;
      overflow: hidden;
    }

    .flashcard-front {
      background: linear-gradient(145deg, #ffffff 0%, var(--bg-card-alt) 100%);
    }

    .flashcard-back {
      background: linear-gradient(145deg, #f0f8f3 0%, #e5f3eb 100%);
      transform: rotateY(180deg);
      border-color: var(--mint-border);
    }

    .card-top-tag {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .card-topic-tag {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: var(--mint-primary);
    }

    .card-flip-prompt {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-light);
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .card-content-wrap {
      margin: auto 0;
      text-align: center;
      padding: 12px 0;
    }

    .card-front-title {
      font-size: 1.35rem;
      font-weight: 750;
      color: #1a3324;
      line-height: 1.4;
    }

    .card-back-text {
      font-size: 1.15rem;
      font-weight: 600;
      color: #143522;
      line-height: 1.5;
    }

    .card-back-badge {
      display: inline-block;
      margin-top: 10px;
      font-size: 0.8rem;
      padding: 4px 10px;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 12px;
      color: var(--mint-primary);
      border: 1px solid var(--mint-border);
    }

    .card-bottom-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.78rem;
      color: var(--text-light);
      border-top: 1px solid rgba(0, 0, 0, 0.06);
      padding-top: 10px;
    }

    /* CONTROLES DE FLASHCARDS */
    .flashcard-controls {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 12px;
      margin-top: 24px;
      flex-wrap: wrap;
    }

    .fc-btn {
      padding: 10px 20px;
      font-size: 0.9rem;
      font-weight: 600;
      border-radius: var(--radius-sm);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      box-shadow: var(--shadow-sm);
    }

    .fc-btn-primary {
      background: var(--mint-primary);
      color: #ffffff;
      border: 1px solid var(--mint-primary);
    }

    .fc-btn-primary:hover {
      background: #3c6549;
    }

    .fc-btn-secondary {
      background: var(--bg-card);
      color: var(--text-main);
      border: 1px solid #d3e2d7;
    }

    .fc-btn-secondary:hover {
      background: var(--mint-soft);
      border-color: var(--mint-border);
      color: var(--mint-primary);
    }

    /* ======================================================== */
    /* MÓDULO 3: QUIZ DE EVALUACIÓN (10 PREGUNTAS)              */
    /* ======================================================== */
    .quiz-card {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      border: 1px solid var(--mint-border);
      box-shadow: var(--shadow-md);
      padding: 32px;
      max-width: 900px;
      margin: 0 auto;
    }

    .quiz-status-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e2ede5;
    }

    .quiz-progress-text {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--mint-primary);
    }

    .quiz-score-badge {
      font-size: 0.85rem;
      font-weight: 700;
      background: var(--mint-soft);
      color: var(--mint-primary);
      padding: 4px 12px;
      border-radius: 20px;
      border: 1px solid var(--mint-border);
    }

    .quiz-progress-line-outer {
      width: 100%;
      height: 6px;
      background: #eef4f0;
      border-radius: 3px;
      overflow: hidden;
      margin-bottom: 24px;
    }

    .quiz-progress-line-inner {
      height: 100%;
      background: var(--mint-primary);
      width: 10%;
      transition: width 0.3s ease;
    }

    .quiz-question-box {
      margin-bottom: 24px;
    }

    .quiz-q-num {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-light);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 6px;
    }

    .quiz-q-title {
      font-size: 1.25rem;
      font-weight: 750;
      color: #1a3324;
      line-height: 1.4;
    }

    .quiz-options-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      margin-bottom: 24px;
    }

    .option-btn {
      width: 100%;
      text-align: left;
      padding: 14px 18px;
      font-size: 0.95rem;
      color: var(--text-main);
      background: #fafdfa;
      border: 1.5px solid #dbe8e0;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: flex-start;
      gap: 12px;
      transition: var(--transition-smooth);
    }

    .option-btn:hover:not(:disabled) {
      background: var(--mint-soft);
      border-color: var(--mint-light);
      transform: translateY(-1px);
    }

    .opt-letter {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: #e9f2eb;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--mint-primary);
      flex-shrink: 0;
    }

    .opt-text {
      flex: 1;
      line-height: 1.4;
    }

    /* Estados de respuesta */
    .option-btn.correct {
      background: var(--success-bg) !important;
      border-color: var(--success-border) !important;
      color: var(--success-text) !important;
      font-weight: 600;
    }

    .option-btn.correct .opt-letter {
      background: #166534;
      color: #ffffff;
    }

    .option-btn.incorrect {
      background: var(--error-bg) !important;
      border-color: var(--error-border) !important;
      color: var(--error-text) !important;
    }

    .option-btn.incorrect .opt-letter {
      background: #991b1b;
      color: #ffffff;
    }

    .option-btn:disabled {
      cursor: default;
    }

    /* Panel de feedback tras responder */
    .feedback-box {
      margin-top: 20px;
      padding: 16px 20px;
      border-radius: var(--radius-sm);
      animation: fadeIn 0.3s ease;
      display: none;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .feedback-box.is-correct {
      background: var(--success-bg);
      border: 1px solid var(--success-border);
      color: var(--success-text);
      display: block;
    }

    .feedback-box.is-incorrect {
      background: var(--error-bg);
      border: 1px solid var(--error-border);
      color: var(--error-text);
      display: block;
    }

    .feedback-header {
      font-size: 0.95rem;
      font-weight: 750;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .feedback-explanation {
      font-size: 0.88rem;
      line-height: 1.5;
    }

    .quiz-bottom-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      margin-top: 20px;
      gap: 12px;
    }

    .quiz-next-btn {
      padding: 10px 24px;
      font-size: 0.92rem;
      font-weight: 700;
      background: var(--mint-primary);
      color: #ffffff;
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-sm);
      display: none;
    }

    .quiz-next-btn:hover {
      background: #396446;
    }

    /* PANTALLA DE RESULTADOS DEL QUIZ */
    .quiz-results-screen {
      display: none;
      text-align: center;
      padding: 20px 0;
      animation: fadeIn 0.4s ease;
    }

    .results-badge-icon {
      font-size: 3.5rem;
      margin-bottom: 12px;
    }

    .results-title {
      font-size: 1.6rem;
      font-weight: 800;
      color: #1a3324;
      margin-bottom: 6px;
    }

    .results-subtitle {
      font-size: 0.95rem;
      color: var(--text-muted);
      margin-bottom: 24px;
    }

    .score-circle-wrap {
      width: 140px;
      height: 140px;
      border-radius: 50%;
      background: var(--mint-soft);
      border: 6px solid var(--mint-light);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin: 0 auto 24px auto;
      box-shadow: var(--shadow-md);
    }

    .score-big-num {
      font-size: 2.2rem;
      font-weight: 850;
      color: var(--mint-primary);
      line-height: 1;
    }

    .score-label {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-muted);
      margin-top: 4px;
    }

    .results-breakdown-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
      max-width: 720px;
      margin: 0 auto 28px auto;
      text-align: left;
    }

    .breakdown-card {
      background: var(--bg-card-alt);
      border: 1px solid #dce8df;
      padding: 12px 14px;
      border-radius: var(--radius-sm);
    }

    .breakdown-card-title {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      color: var(--mint-primary);
      margin-bottom: 2px;
    }

    .breakdown-card-val {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-main);
    }

    .restart-btn {
      padding: 12px 28px;
      font-size: 0.95rem;
      font-weight: 700;
      background: var(--mint-primary);
      color: #ffffff;
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-md);
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .restart-btn:hover {
      background: #396446;
    }

    /* FOOTER */
    .footer {
      background: #ffffff;
      border-top: 1px solid var(--mint-border);
      padding: 30px 0;
      margin-top: 60px;
      font-size: 0.85rem;
      color: var(--text-muted);
      text-align: center;
    }

    .footer-inner {
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: center;
    }

    /* RESPONSIVE DESIGN */
    @media (max-width: 960px) {
      .ecosystem-grid {
        grid-template-columns: 1fr;
      }
      .canvas-container {
        min-height: 440px;
      }
      #ecosystemCanvas {
        min-height: 440px;
      }
      .info-panel {
        max-height: none;
      }
    }

    @media (max-width: 640px) {
      .header-title {
        font-size: 1.25rem;
      }
      .section-title {
        font-size: 1.3rem;
      }
      .flashcard-face {
        padding: 24px 20px;
      }
      .card-front-title {
        font-size: 1.15rem;
      }
      .card-back-text {
        font-size: 1rem;
      }
      .quiz-card {
        padding: 20px 16px;
      }
    }