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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #D4A5A5 0%, #C98A8A 100%);
  min-height: 100vh;
  padding: 20px;
  direction: rtl;
}

.container {
  max-width: 960px; /* 80% של 1200 */
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 10px;
    max-width: calc(100% - 20px);
  }
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
  font-size: 2.5em;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 10px;
  transform: scale(0.85);
  transform-origin: center;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.color-palette {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: #333;
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.brush-size {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brush-size label {
  font-weight: bold;
  color: #333;
}

.brush-size input[type="range"] {
  width: 150px;
}

.btn-secondary, .btn-primary {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  display: block;
  margin: 30px auto;
  padding: 20px 50px;
  font-size: 24px;
  background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(255,0,0,0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255,0,0,0.6);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.canvas-container {
  position: relative;
  display: flex;
  justify-content: center;
  background: white;
  border: 3px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

#drawingCanvas {
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: crosshair;
  background: white;
  touch-action: none;
  display: block;
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 10px;
    max-width: calc(100% - 20px);
  }
  
  h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
  
  #drawingCanvas {
    width: 100%;
    height: auto;
  }
  
  .btn-primary {
    font-size: 18px;
    padding: 15px 30px;
    margin: 20px auto;
  }
  
  .controls {
    flex-direction: column;
    width: 100%;
    padding: 15px;
    gap: 12px;
    margin-bottom: 15px;
  }
  
  .color-palette {
    justify-content: center;
    gap: 6px;
  }
  
  .color-btn {
    width: 30px;
    height: 30px;
  }
  
  .brush-size {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }
  
  .brush-size label {
    font-size: 14px;
  }
  
  .brush-size input[type="range"] {
    width: 180px;
  }
  
  .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .canvas-container {
    padding: 10px;
    margin-bottom: 15px;
  }
}

