body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: #f0f0f0;
    height: 100vh;
    margin: 0;
    user-select: none;
    overflow: hidden;
}
#chessboard {
    display: grid;
    grid-template-columns: repeat(8, 50px);
    grid-template-rows: repeat(8, 50px);
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    position: relative;
    margin-top: 20px;
}
.square {
    width: 50px;
    height: 50px;
    position: relative;
}
.target-square {
    border: 5px solid #00ff00; /* Bright green border */
    box-sizing: border-box;
}
.white {
    background-color: #eee;
}
.black {
    background-color: #777;
}
.knight {
    width: 50px;
    height: 50px;
    background-image: url('knight.svg');
    background-size: cover;
    cursor: grab;
    position: absolute;
    z-index: 3;
}
.heatmap {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.7;
    z-index: 1;
}
.distance-label {
    position: absolute;
    width: 100%;
    height: 100%;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    text-shadow: 1px 1px 2px #000;
    z-index: 2;
}
#sum-label {
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
}
#color-switch {
    margin-top: 10px;
}
.path-line {
    position: absolute;
    background-color: gray;
    z-index: 4;
}
.landing-dot {
    width: 10px;
    height: 10px;
    background-color: gray;
    border-radius: 50%;
    position: absolute;
    z-index: 5;
}
/* New styles for Puzzle Mode */
.square.obstacle {
    // background-color: #000;
}
#puzzle-info {
    margin-top: 20px;
    text-align: center;
}
#puzzle-instructions {
    font-size: 18px;
    font-weight: bold;
}
#puzzle-score {
    font-size: 16px;
}
#puzzle-toggle {
    margin-top: 20px;
}
.obstacle-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px; /* Adjust this value to change the size of the obstacle symbol */
    z-index: 2; /* Ensure it's above the square but below the knight */
}
.path-donut {
    position: absolute;
    width: 4px;
    height: 4px;
    border: 2px solid darkgray;  // Replace with your desired color
    border-radius: 50%;
    background-color: darkgray;
}

#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

#puzzle-toggle {
    margin-right: 20px;
    padding: 10px 20px;
    font-size: 16px;
}

.toggle-container {
    display: flex;
    align-items: center;
}

#toggle-color {
    margin-right: 5px;
}