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

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #1f1c2c, #928dab);
  color: white;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.container {
  max-width: 400px;
  width: 100%;
}

h1 {
  margin-bottom: 1rem;
}

.preview {
  margin-bottom: 1rem;
}

.preview img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 5px;
}

#puzzle-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 auto 1rem;
  width: 300px;
  height: 300px;
}

.tile {
  width: 100%;
  height: 100%;
  background-image: url('images/img1.jpg');
  background-size: 300px 300px;
  border-radius: 8px;
  cursor: grab;
  transition: transform 0.2s ease;
}

.tile.dragging {
  opacity: 0.5;
}

button {
  padding: 10px 20px;
  font-size: 1rem;
  background: #00f2fe;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#message {
  margin-top: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
  color: #00ff7f;
}

.timer {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 400px) {
  #puzzle-container {
    width: 260px;
    height: 260px;
  }

  .tile {
    background-size: 260px 260px;
  }

  .preview img {
    width: 100%;
  }
}
