:root {
  --canvas-width: 400px;
  --canvas-height: 300px;
  --canvas-top: 50px;
  --canvas-left: 20px;
}

html, body {
  font-family: 'Avenir', 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh; 
  line-height: 1.8;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  touch-action: none;
}

canvas {
  padding: 0;
  display: block;
  position: relative;
  top: var(--canvas-top);
  left: calc(50% - var(--canvas-width) / 2);
  z-index: 0;
  cursor: pointer;
  transition: box-shadow 0.15s ease-in-out;
}

canvas:hover {
  box-shadow: inset 0 0 0 2px #000;
}

.top-buttons {
  position: fixed;
  top: 12px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001;
}

.overlay {
  position: fixed;
  top: 0;     
  left: 0;    
  width: 100%; 
  height: 100%; 
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#qr-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 1);
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: none; /* hidden by default */
  z-index: 2000;
}

#orderBtn:hover {
  background-color: #e0e0e0;
  transition: background-color 0.2s ease; 
}

#infoToggle {
  border: none;
  padding: 4px 4px;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background-color 0.3s ease;
}

.info-overlay {
  position: fixed;
  left: 0;
  top: var(--canvas-top);
  width: 100vw;
  height: calc(100vh - var(--canvas-top));
  height: calc(100dvh - var(--canvas-top));
  background: white;
  z-index: 150;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.info-content {
  box-sizing: border-box;
  padding: 24px 20px 40px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.info-content h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.info-content p {
  margin-bottom: 15px;
  font-size: 14px;
}

.divider {
  position: fixed;
  left: 0;
  width: 100vw;
  height: 1px;
  background: #000;
  z-index: -10;
}

.divider-top {
  top: 55px;
}

.divider-bottom {
  bottom: 160px;
}

.title {
  position: fixed;
  top: 15px;
  left: calc(50% - var(--canvas-width) / 2);
  font-size: 20px;
  font-weight: bold;
  z-index: 200;
}

.buttons {
  position: fixed;
  bottom: 20px;
  left: calc(50% - var(--canvas-width) / 2);
  z-index: 10;
  -webkit-user-select: none;
  user-select: none;
}

.buttons div {
  margin: 10px 0;
}

.buttons button:hover {
  background-color: #e0e0e0;
  transition: background-color 0.2s ease; 
}

button {
  font-size: 12px;
  color: black;
  background-color: transparent;
  border: 1px solid black;
  padding: 8px 14px;
  cursor: pointer;
}

#generateBtn {
  background-color: black;
  color: white;
  letter-spacing: 1px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#generateBtn:hover {
  background-color: white;
  color: black;
  cursor: pointer;
}

.popup {
  background: white;
  padding: 20px 30px;
  width: 300px;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.popup h2 {
  margin-top: 0;
}
.popup input {
  width: 95%;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid;
}

.popup button:hover {
  background-color: #e0e0e0;
  transition: background-color 0.2s ease; 
}

.sliders {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  grid-template-rows: auto auto; 
  justify-items: start; 
  align-items: center;
  gap: 20px 20px;
  position: fixed;
  bottom: 30px;
    left: calc(50% + var(--canvas-width) / 2 - 560px);
  z-index: -10;
  -webkit-user-select: none;
  user-select: none;
}

.sliders div {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sliders div label {
  width: 65px;
  text-align: right;
  font-size: 14px;
}

.sliders div output {
  width: 20px;
  text-align: left;
  font-size: 12px;
  padding: 0px 0px;
}

input[type="range"] {
  width: 170px;
  height: 16px;
  border: 1px solid black;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: black;
  cursor: pointer;
  border: none;
  border-radius: 0;
  -webkit-border-radius: 0;
  box-shadow: none;
  -webkit-box-shadow: none;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: black;
  cursor: pointer;
  border: none;
  border-radius: 0;
}

/* mobile style */
@media screen and (max-width: 768px), screen and (aspect-ratio < 0.7) {
  .title {
    position: fixed;
    top: 10px;
    left: 20px;
    font-size: 16px;
  }

  .top-buttons {
    position: fixed;
    top: 6px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
  }

  canvas {
    position: fixed;
    top: var(--canvas-top);
    left: calc(50% - var(--canvas-width) / 2);
    z-index: 0;
  }
  
  .sliders {
    grid-template-columns: 1fr;
    gap: 0px 0px;
    position: fixed;
    bottom: 10px;
    left: calc(100% - 240px);
    max-width: calc(100vw - 40px);
  }

  .sliders div {
    margin: 5px 0 !important;
  }

  input[type="range"] {
    width: 130px;
  }
  
  .buttons {
    position: fixed;
    bottom: 10px;
    left: 20px;
  }
  .divider-top {
    top: 45px;
  }
  .divider-bottom {
    bottom: 160px;
  }
  
  input[type="range"]::-webkit-slider-thumb {
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
  }
}










