body {
    margin: 0;
    background: black;
    overflow: hidden;
    font-family: sans-serif;
    color: white;
  }
  
  canvas {
    display: block;
  }
  
  .controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 10, 20, 0.75);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 200, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.15);
    font-family: monospace;
    font-size: 13px;
  }

  .controls label {
    display: block;
    color: rgba(0, 200, 255, 0.85);
    margin-bottom: 2px;
  }

  .controls input[type="range"] {
    accent-color: cyan;
    width: 160px;
    margin-bottom: 10px;
  }

  #infoCard {
    position: absolute;
    bottom: 60px;
    right: 20px;
    width: 260px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(0, 40, 70, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 200, 255, 0.25);
    box-shadow: 0 0 18px rgba(0, 150, 255, 0.2);
    color: #aef;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  #infoCard h3 {
    margin: 0 0 6px;
    font-size: 13px;
    color: cyan;
    letter-spacing: 0.05em;
  }

  #infoCard h3:not(:first-child) {
    margin-top: 12px;
  }

  #infoCard p {
    margin: 0;
    color: rgba(180, 230, 255, 0.85);
  }

  #infoCard strong {
    color: cyan;
  }

  #infoCard .formula {
    margin: 8px 0 2px;
    opacity: 0.65;
    font-size: 12px;
    text-align: center;
    color: rgba(180, 230, 255, 0.9);
    transition: opacity 0.2s ease;
  }

  #infoCard .formula:hover {
    opacity: 1;
  }

  /* KaTeX color override — moștenește paleta neon */
  #infoCard .katex {
    color: rgba(160, 220, 255, 0.9);
    font-size: 1em;
  }

  #infoCard.hidden {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
  }

  #toggleInfo {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    background: rgba(0, 100, 200, 0.35);
    border: 1px solid rgba(0, 200, 255, 0.35);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.25);
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #toggleInfo:hover {
    background: rgba(0, 150, 255, 0.5);
    box-shadow: 0 0 16px rgba(0, 200, 255, 0.45);
  }

  /* ── Responsive ─────────────────────────────────────────────────────────── */

  /* Telefon portrait (≤ 600px) */
  @media (max-width: 600px) {
    .controls {
      top: 8px;
      left: 8px;
      padding: 10px 12px;
      font-size: 12px;
    }

    .controls input[type="range"] {
      width: 100%;
      min-width: 120px;
      margin-bottom: 8px;
      height: 20px;       /* tap target mai mare */
    }

    #infoCard {
      left: 10px;
      right: 10px;
      width: auto;
      bottom: 70px;
      font-size: 12px;
      padding: 14px 14px;
    }

    #toggleInfo {
      width: 44px;
      height: 44px;
      font-size: 18px;
      bottom: 12px;
      right: 12px;
    }
  }

  /* Telefon landscape (înălțime mică) */
  @media (max-height: 450px) {
    .controls {
      top: 6px;
      left: 6px;
      padding: 6px 10px;
      font-size: 11px;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 12px;
    }

    .controls label {
      margin-bottom: 0;
      white-space: nowrap;
    }

    .controls input[type="range"] {
      width: 90px;
      margin-bottom: 0;
    }

    #infoCard {
      max-height: 55vh;
      overflow-y: auto;
      bottom: 56px;
      right: 10px;
      width: 240px;
      font-size: 11px;
    }

    #toggleInfo {
      width: 40px;
      height: 40px;
      bottom: 10px;
      right: 10px;
    }
  }

  /* Tabletă (601px – 1024px) */
  @media (min-width: 601px) and (max-width: 1024px) {
    .controls input[type="range"] {
      width: 140px;
    }

    #infoCard {
      width: 280px;
    }
  }