* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg, #fff);
}

#glcanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.controls {
  position: fixed;
  display: flex;
  flex-direction: column;
  bottom: 8px;
  left: 10px;
  display: flex;
  z-index: 10;

  button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #80808001;
    color: contrast-color(var(--bg, #fff));
    mix-blend-mode: difference;
    opacity: 0.35;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    &:hover {
      background: rgba(255, 255, 255, 0.22);
      opacity: 1;
    }

    &:active {
      background: rgba(255, 255, 255, 0.3);
    }
  }
}

#fileInput {
  display: none;
}

.pcr-color-chooser {
  grid-area: 2/1/2/3 !important;
}

.pcr-palette {
  border-bottom-right-radius: none !important;
  border-bottom-left-radius: none !important;
}

.settings {
  position: fixed;
  bottom: 32px;
  left: 48px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border-bottom-left-radius: 0;
  padding: 14px 18px;
  display: none;
  flex-direction: column;
  gap: 10px;
  min-width: min(calc(100vw - 72px), 400px);
  max-height: 80vh;
  overflow-y: auto;
  color: #fff;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 12px;
  z-index: 10;

  &.open {
    display: flex;
  }

  .row {
    display: flex;
    align-items: center;
    gap: 10px;

    label {
      flex: 0 0 130px;
      opacity: 0.8;
    }

    input[type="range"] {
      width: 140px;
    }

    select {
      flex: 1;
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
      border: none;
      border-radius: 6px;
      padding: 6px 8px;
      font-size: 12px;
    }

    input[type="color"] {
      flex: 1;
      height: 28px;
      border: none;
      border-radius: 3px;
      background: none;
      cursor: pointer;
      padding: 0;
    }

    .val {
      max-width: 6em;
      field-sizing: content;
      background: transparent;
      color: #fff;
      border: none;
      font-size: 12px;
      font-variant-numeric: tabular-nums;
      padding: 3px 4px;
    }
  }

  .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 2px 0;
  }

  .spacer {
    height: 1em;
  }

  .text-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    text-align: left;

    &:hover {
      color: #fff;
    }
  }
}