body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    text-align: center;
}

h1, h2 {
    color: #007bff;
}

.grid-wrapper {
    position: relative;
    width: fit-content;
    margin: 20px auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    border: 1px solid #ccc;
    padding: 5px;
}

.grid-item {
    background-color: #e9ecef;
    border: 1px solid #ccc;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    min-width: 50px;
}

.grid-item.highlighted {
    background-color: #c9e2b1;
}

#calculateBtn {
    padding: 10px 20px;
    font-size: 1em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 20px;
}

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

.result-box {
    margin-top: 20px;
    padding: 15px;
    border: 2px solid #28a745;
    border-radius: 5px;
    background-color: #d4edda;
}

#resultTitle {
    color: #155724;
    margin-top: 0;
}

.explanation {
    margin-top: 30px;
    text-align: left;
    display: none;
}

.path-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.path {
    stroke: #ff6600;
    stroke-width: 5;
    fill: none;
}