body {
  margin: 0;
  padding: 0;
  background: #121212;
  color: #e0e0e0;
  font-family: 'Zain', sans-serif;
  direction: rtl;
  overflow-x: hidden;
}
#linkBtn {
  background-color: #666;
  border: none;
  color: white;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin: 5px 0;
  width: 100%;
  transition: background 0.3s ease;
}
#linkBtn.active {
  background-color: #4a90e2;
}

.main-container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: 100vh;
}

canvas {
  flex: 1;
  background: #222;
  display: block;
  max-width: 80%;
  max-height: 100vh;
  margin-right: 20%;
}

.controls-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 20%;
  height: 100vh;
  background: #1e1e1e;
  border-left: 2px solid #333;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.7);
  padding: 20px;
  overflow-y: auto;
}

.controls-panel h2 {
  margin-top: 0;
  text-align: center;
  font-size: 1.4rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.controls div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.controls label {
  font-size: 0.9rem;
  color: #ccc;
}

.controls input[type="range"] {
  width: 100%;
}

.controls input[type="number"] {
  width: 100%;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #2c2c2c;
  color: #fff;
}

button#downloadBtn {
  background-color: #4a90e2;
  border: none;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
}
button#downloadBtn:hover {
  background-color: #357ABD;
}

/* 📱 در موبایل controls بیاد زیر */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  .controls-panel {
    position: relative;
    width: 100%;
    height: auto;
    border-left: none;
    box-shadow: none;
  }
}
