html,body { 
      height: 100%; 
      margin: 0; 
      padding: 0; 
      background: #000; 
      color: #ddd; 
      font-family: system-ui, -apple-system, "Segoe UI", Roboto;
      overflow: hidden;
    }
    h1 { 
      margin: 0; 
      padding: 8px 0; 
      width: 100%; 
      text-align: center; 
      background-image: linear-gradient(red,green,blue);
      position: absolute;
      top: 0;
      left: 0;
      z-index: 5;
      font-size: 1.5rem;
    }
    h3 { 
      margin: 0 0 8px 0; 
      font-size: 1rem;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    h3::after {
      content: '▼';
      font-size: 0.8rem;
      transition: transform 0.3s;
    }
    h3.collapsed::after {
      transform: rotate(-90deg);
    }
    #ui { 
      position: absolute; 
      left: 12px; 
      top: 60px; 
      z-index: 10; 
      background: rgba(0,0,0,0.5); 
      padding: 12px; 
      border-radius: 8px;
      max-width: 280px;
      max-height: calc(100vh - 120px);
      overflow-y: auto;
    }
    .param-section {
      margin-bottom: 16px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      padding-bottom: 12px;
    }
    .param-section:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    .param-content {
      max-height: 500px;
      overflow: hidden;
      transition: max-height 0.3s ease-out;
    }
    .param-content.collapsed {
      max-height: 0;
    }
    label { 
      font-size: 0.9rem; 
      display: block; 
      margin-top: 8px;
      color: #bbb;
    }
    input[type=range] { 
      width: 100%; 
      margin-top: 4px;
    }
    output { 
      font-size: 0.85rem;
      color: #fff;
      margin-left: 8px;
    }
    canvas { 
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      margin: 0; 
      padding: 0;
    }
    .credits { 
      position: absolute; 
      width: 100%; 
      bottom: 0px; 
      margin: 0; 
      padding: 4px 10px; 
      font-size: 0.7rem; 
      text-align: center; 
      background-image: linear-gradient(blue,green,red);
      z-index: 5;
    }
    .credits a {
      color: #fff;
    }

    #toggleUI {
      display: none;
      position: absolute;
      left: 12px;
      top: 60px;
      z-index: 11;
      background: rgba(0,0,0,0.0);
      color: #fff;
      border: none;
      padding: 10px 16px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 1rem;
      font-family: inherit;
    }
    #toggleUI:hover {
      background: rgba(0,0,0,0.9);
    }

    .spiromorph-item {
      margin-bottom: 10px;
    }
    button{
      width: 100%; 
      padding: 10px; 
      font-size: 14px; 
      cursor: pointer; 
      background: #00ff88; 
      color: black; 
      border: none; 
      border-radius: 4px; 
      font-weight: bold;
    }

    @media(max-width: 768px) {
      h1 {
        font-size: 1.2rem;
        padding: 6px 0;
      }
      #toggleUI {
        display: block;
      }
      #ui {
        left: 8px;
        top: 90px;
        right: 8px;
        max-width: 50%;
        width: calc(100% - 16px);
        padding: 10px;
        font-size: 0.8rem;
        transform: translateX(-120%);
        transition: transform 0.3s ease-out;
      }
      #ui.visible {
        transform: translateX(0);
      }
      h3 {
        font-size: 0.9rem;
      }
      label {
        font-size: 0.8rem;
      }
      output {
        font-size: 0.8rem;
      }
      .credits {
        font-size: 0.55rem;
        padding: 3px 8px;
      }
    }

    @media(max-width: 480px) {
      h1 {
        font-size: 1rem;
        padding: 4px 0;
      }
      #toggleUI {
        top: 40px;
        font-size: 0.9rem;
        padding: 8px 12px;
      }
      #ui {
        top: 70px;
        padding: 8px;
        font-size: 0.85rem;
      }
      h3 {
        font-size: 0.9rem;
      }
      label {
        font-size: 0.8rem;
      }
      .credits {
        font-size: 0.5rem;
        padding: 1px 0px;
      }
    }