html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
}

body {
  transition: background-color 0.5s ease, color 0.5s ease;
}

body.dark {
    background-color: #1e1e1e;
    color: #ddd;
}

body.dark .controls {
    background-color: #2c2c2c;
    box-shadow: none;
}

body.dark input,
body.dark select,
body.dark button {
    background-color: #333;
    color: #ddd;
    border: 1px solid #555;
}

body.dark button {
    background-color: #0078d7;
}

body.dark button:hover {
    background-color: #005fa3;
}

body.dark #puzzle-container {
  background-color: #2c2c2c;
}

body.dark .piece {
  border-color: #888;
}

.vertical-space{
    margin-bottom: 0.5em;
}

.controls {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 8px;
}

.controls label {
    font-weight: bold;
    margin-right: 5px;
}

.controls select,
.controls input,
.controls button {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.controls button {
    background-color: #0078d7;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.controls button:hover {
    background-color: #005fa3;
}

#puzzle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f9f9f9;
  overflow: hidden;
}

#progress {
  margin-top: 0.5em;
  font-weight: bold;
  color: #333;
}

.dark #progress {
    color:#ddd;
}

.piece {
  position: absolute;
  cursor: grab;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

@keyframes fadeOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

#puzzle-container {
  transition: background-color 0.5s ease;
}

/* Toggle switch styling */
.toggle-container {
    margin-top: 0.5em;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #0078d7;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

#grid-overlay div {
  box-sizing: border-box;
}

#description {
    text-align:center; 
    margin-top:20px; 
    font-size:1.2em;
}