html, body {
      width: 100%;
      height: 100%;
      margin: 0;
      overflow: hidden;
      background: #05070a;
      font-family: system-ui, sans-serif;
    }

    #renderCanvas {
      width: 100%;
      height: 100%;
      touch-action: none;
      cursor: grab;
    }
    #renderCanvas:active {
      cursor: grabbing;
    }

    /* Loader pełnoekranowy */
    #loading {
      position: fixed;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      background: radial-gradient(circle at top, #20253a 0, #05070a 55%, #000 100%);
      color: #f3f3f3;
      letter-spacing: 0.06em;
      font-size: 18px;
      text-transform: uppercase;
      z-index: 10;
      font-weight: 500;
      white-space: nowrap;
      transition: opacity 0.4s ease;
    }

    #loadingText {
      display: flex;
      align-items: baseline;
      gap: 4px;
    }

    /* Stała szerokość na 3 kropki – brak skakania */
    #dots {
      display: inline-block;
      width: 3ch;
      text-align: left;
    }

    /* Pasek postępu */
    #progressContainer {
      width: 260px;
      height: 6px;
      border-radius: 999px;
      background: rgba(255,255,255,0.1);
      overflow: hidden;
    }

    
    #progressBar {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, #4fd1ff, #9f7aea);
      border-radius: 999px;
      transition: width 0.15s linear;
    }

    /* Panel przycisków (góra prawa strona) */
    #ui {
      position: fixed;
      top: 20px;
      right: 20px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      z-index: 20;
      max-width: 360px;
      justify-content: flex-end;
    }

    .btn {
      padding: 8px 12px;
      background: rgba(20,20,35,0.9);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 8px;
      color: #fff;
      font-size: 12px;
      backdrop-filter: blur(8px);
      cursor: pointer;
      transition: 0.18s;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }
    .btn:hover {
      background: rgba(40,40,70,0.95);
      transform: translateY(-1px);
    }
    .btn.active {
      border-color: #4fd1ff;
      background: rgba(79,209,255,0.18);
    }

    /* Panel sterowania (dół środek) – ruch / zoom / obrót */
    #controls {
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 8px;
      z-index: 20;
    }

    /* Presety widoku (dół lewa strona) */
    #views {
      position: fixed;
      bottom: 20px;
      left: 20px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      z-index: 20;
    }
    #viewsTitle {
      color: #aaa;
      font-size: 11px;
      margin-bottom: 2px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .view-row {
      display: flex;
      gap: 6px;
    }

    /* Legenda (dół prawa strona) */
    #legend {
      position: fixed;
      bottom: 20px;
      right: 20px;
      padding: 10px 14px;
      background: rgba(8,10,20,0.9);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 8px;
      color: #fff;
      font-size: 12px;
      line-height: 1.4;
      backdrop-filter: blur(8px);
      z-index: 20;
      max-width: 220px;
    }
    #legend b {
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #9f7aea;
    }

    @media (max-width: 640px) {
      #ui {
        max-width: 100%;
        left: 10px;
        right: 10px;
        justify-content: center;
      }
      #legend {
        display: none;
      }
      #views {
        display: none;
      }
    }





