body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    align-items: center;
    justify-content: flex-start; /* Align items to the top */
    min-height: 100vh;
    background-color: #f8f9fa; /* Lighter page background */
    margin: 0;
    padding: 20px 0; /* Add padding top and bottom */
    overflow: hidden; /* Prevent body scrolling */
    box-sizing: border-box;
}

.game-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: fit-content; /* Let container shrink to content */
    margin: 0 auto 20px auto; /* Center the container horizontally, add bottom margin */
    padding: 10px; /* Add some padding around the game elements */
    /* background-color: #fff; /* Optional: background for the direct container */
    /* border-radius: 8px; /* Optional: rounded corners */
}

#gameCanvas {
    border: 1px solid #adb5bd; /* Lighter border */
    background-color: #e9ecef; /* Slightly darker canvas background */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1); /* Subtle inner shadow */
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 180px; /* Slightly narrower info panel */
    font-size: 0.95em; /* Slightly smaller base font for info */
}

#gameOver {
    color: red;
    font-weight: bold;
    text-align: center;
}

#leaderboard,
.hold-piece-container,
.next-piece-container {
    border: 1px solid #dee2e6; /* Lighter border */
    padding: 12px; /* Slightly more padding */
    background-color: #fff;
    border-radius: 6px; /* Rounded corners */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtle shadow */
    text-align: center;
}

#leaderboard h2,
.hold-piece-container h3,
.next-piece-container h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1em;
    color: #495057; /* Darker grey text */
    border-bottom: 1px solid #eee; /* Lighter separator */
    padding-bottom: 6px;
}

#highScores {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9em; /* Smaller font for scores */
}

#highScores li {
    margin-bottom: 5px;
    color: #6c757d; /* Grey text for scores */
}
#highScores li:last-child {
    margin-bottom: 0;
}


.copyright-footer {
    padding: 10px 0; /* Reduced padding */
    text-align: center;
    color: #6c757d; /* Standard grey */
    font-size: 0.85em; /* Slightly smaller */
    width: 100%;
    background-color: transparent; /* Remove background */
    margin-bottom: 15px; /* Add space below the copyright */
    /* Removed margin-top and border-top */
}

/* Style for the individual blocks */
.block {
    box-sizing: border-box; /* Include border in size */
    border: 1px solid rgba(0, 0, 0, 0.1); /* Much lighter border for blocks */
    box-shadow: inset 0 0 1px rgba(0,0,0,0.1); /* Subtle inset shadow */
}


#nextPieceCanvas,
#holdPieceCanvas {
    background-color: #e9ecef; /* Match game board background */
    border: 1px solid #ced4da; /* Slightly darker border than container */
    display: block;
    margin: 5px auto 0 auto; /* Adjust margin */
    border-radius: 4px; /* Rounded corners for preview */
}

/* Pause Indicator Style */
#pauseIndicator {
    text-align: center;
    padding: 5px;
    background-color: rgba(255, 193, 7, 0.8); /* Semi-transparent warning yellow */
    border-radius: 4px;
    margin-top: 5px;
}

#toggleMusicButton {
    padding: 8px 12px;
    font-size: 0.9em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px; /* Add some space below the button */
    transition: background-color 0.2s ease;
}

#toggleMusicButton:hover {
    background-color: #0056b3;
}

#nowPlayingMessage {
    font-size: 0.8em;
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    height: 1.2em; /* Reserve space to prevent layout shift */
}

.music-toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.music-toggle-label {
    margin-left: 8px;
    font-size: 0.9em;
}

/* The switch - the box around the slider */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 50px; /* Width of the switch */
  height: 28px; /* Height of the switch */
}

/* Hide default HTML checkbox */
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px; /* Height of the knob */
  width: 20px; /* Width of the knob */
  left: 4px; /* Position from left */
  bottom: 4px; /* Position from bottom */
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3; /* Blue when checked */
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(22px); /* Move knob to the right */
  -ms-transform: translateX(22px);
  transform: translateX(22px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 28px; /* Fully rounded switch */
}

.slider.round:before {
  border-radius: 50%; /* Rounded knob */
}
