body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    padding: 50px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.word-row {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.letter-box {
    width: 40px;
    height: 40px;
    display: inline-block;
    border: 2px solid #000;
    font-size: 20px;
    text-align: center;
    line-height: 40px;
    margin: 0 5px;
    background-color: #fff;
}

input[type="text"] {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

button {
    padding: 10px 15px;
    font-size: 16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

button:hover {
    background-color: #0056b3;
}

/* Shake animation */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-2px, 0px) rotate(1deg); }
    30% { transform: translate(1px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-1px, 1px) rotate(0deg); }
    70% { transform: translate(1px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake {
    animation: shake 0.5s;
    animation-iteration-count: 1;
}

/* Error message styling */
#error-message {
    display: none;
    background-color: #e57373;  /* Semi-transparent red background */
    color: white;             /* White text color */
    margin: 10px 0;             /* Margin around the error message */
    padding: 10px;              /* Padding inside the error message */
    text-align: center;         /* Centered text */
    border-radius: 5px;         /* Rounded corners */
    font-size: 1.1em;           /* Slightly larger font */
}

/* Color gradient background */
@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Pulsing effect */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.win-effect {
    animation: gradientBackground 5s ease infinite, pulse 1s ease-in-out infinite;
    background: linear-gradient(270deg, #83a4d4, #b6fbff);
    background-size: 200% 200%;
}

#restart-prompt {
    margin-top: 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}

#restart-prompt button {
    background-color: #83a4d4;
    color: white;
    padding: 5px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#restart-prompt button:hover {
    background-color: #b6fbff;
}

#game-controls {
    margin-top: 20px;
    text-align: center;
}

#give-up-btn {
    background-color: #e57373;
    color: white;
    padding: 5px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#give-up-btn:hover {
    background-color: #ef9a9a;
}

#shortest-paths {
    display: none;
    margin-top: 30px;
}

#paths-list {
    list-style-type: none;
    padding-left: 0;
}

.helper-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.helper-btn {
    font-size: 20px;
    background-color: #007BFF;  /* Light gray background */
    border: 2px solid #d1d5db;  /* Gray border */
    border-radius: 50%;         /* Make it circular */
    width: 30px;                /* Fixed width */
    height: 30px;               /* Fixed height */
    display: flex;              /* Center the question mark */
    align-items: center;        /* Center vertically */
    justify-content: center;    /* Center horizontally */
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.3s, color 0.3s;
}

.helper-btn:hover {
    background-color: #e5e7eb;  /* Slightly darker gray on hover */
    color: #83a4d4;             /* Change the color of question mark on hover */
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    max-height: 60vh; /* This means the modal content can be at most 80% of the viewport height */
    overflow-y: auto; /* This enables vertical scrolling if the content exceeds the max-height */
}

.close-btn {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px; /* Added margin for better alignment */
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.example {
    margin: 20px 0;
    text-align: center;
}

.word-box {
    display: inline-flex;
    margin: 5px;
}

.difficulty-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.difficulty {
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    background-color: grey; /* default state */
}

.difficulty.active {
    background-color: blue; /* active state (available to click) */
}

.difficulty.completed {
    background-color: green; /* completed state */
}

/* add hover to all difficulty buttons */
.difficulty:hover {
    background-color: #e57373;
}

.difficulty-button {
    background-color: grey;  /* default color when game is not started */
    /* ... other styles ... */
}

.difficulty-button.active {
    background-color: #007BFF;  /* color when the level is active */
}

.difficulty-button.completed {
    background-color: green;  /* color when the level is completed */
}

#share-score {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

#copy-score-btn {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
}

#copy-score-btn:hover {
    background-color: #0056b3;
}

/* Tooltip container */
.tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}

/* Tooltip text */
.tooltip .tooltiptext {
    visibility: visible;
    width: 320px;
    background-color: #0071b3;
    color: #fff;
    text-align: center;
    border-radius: 10px;
    padding: 5px 0;
    /* Position the tooltip */
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 105%;

    /* Set your desired font size here */
    font-size: 14px; /* Adjust this as needed */
}

.tooltip:hover .tooltiptext {
    display: block;
}

/* Media query for mobile devices */
@media screen and (max-width: 600px) {
    .tooltip .tooltiptext {
        position: fixed; /* Fixed position relative to the viewport */
        top: 20%; /* Center vertically */
        left: 50%; /* Center horizontally */
        transform: translate(-50%, -50%); /* Adjust for perfect centering */
        width: 90%; /* Set a suitable width */
        max-width: none; /* Override any max-width set previously */
    }
}