body {
    /* font-family: Arial, sans-serif; */
    font-family: 'Poppins', sans-serif;
}

button, .no-select {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera, and Firefox */
}

.wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin-top: env(safe-area-inset-top);
    margin-bottom: 100px;
}

.header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    padding: 10px 20px;
    border-bottom: 2px solid #ccc;
    margin-bottom: 40px;
    width: 100%;
    max-width: 600px; /* Adjust this value to your preferred max width */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.title-container {
    text-align: center;
    position: relative;
}

.button-container {
    position: absolute;
    /* Absolute positioning */
    right: 20px;
    /* Adjust as needed */
    top: 50%;
    transform: translateY(-50%);
    /* Vertical centering */
    display: flex;
    gap: 10px;
}

.game-title {
    font-size: 24px;
    margin: 5px 5px;
    text-align: center;
    z-index: 1;
}

.icon-button {
    background: none;
    border: none;
    padding: 5px;
    outline: none;
    font-size: 28px;
    cursor: pointer;
    color: gray;
}

.icon-button:hover {
    color: lightgray;
}

/* Adjust styles for mobile devices */
@media (max-width: 480px) {
    .icon-button {
        font-size: 24px;
    }
}

.puzzle {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    grid-gap: 2px;
}

.puzzle-piece {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 0;
}

.empty {
    background-color: white;
}

.green-circle {
    background-color: green;
    border-radius: 50%;
    color: white;
    z-index: 1; /* This ensures the green circle is always on top */
}

.crossword-clues {
    display: flex;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
    width: 80%;
    max-width: 600px;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow items to wrap onto the next line if there isn't enough space */
}

.move-counter {
    font-size: 24px;
    margin-top: 20px;
    text-align: center;
}

.across,
.down {
    width: 45%;
    box-sizing: border-box; /* Makes sure the width includes padding and border */
}

.across h3,
.down h3 {
    font-size: 20px;
    margin: 0;
    text-align: center;
    text-decoration: underline;
}

/* Media query for narrower screens */
@media (max-width: 768px) {

    .across,
    .down {
        width: 100%; /* Make them take up the full width on smaller screens */
        margin-bottom: 10px; /* Add a little margin for spacing */
    }
}

.in-place {
    background-color: yellow;
}

.reset {
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background-color: #007BFF;
    /* A shade of blue */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    outline: none; /* Removes the default browser outline on focus for a cleaner look */
    margin-top: 20px;
}

.reset:hover {
    background-color: #0056b3; /* A darker shade of blue for the hover state */
}

.reset:active {
    background-color: #004492; /* Even darker for the active/clicked state */
}

/* ol {
    list-style-type: none;
    padding-left: 0;
} */

ol li {
    margin-bottom: 5px;
    padding-left: 10px;
    position: relative;
}

/* ol li::before {
    content: counter(item) ".";
    counter-increment: item;
    position: absolute;
    left: 0;
} */

/* Modal Styles */
.win-modal, .info-modal, .stats-modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.win-modal-content, .info-modal-content, .stats-modal-content {
    position: relative;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    background-color: #fff;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.win-modal.show, .info-modal.show, .stats-modal.show {
    opacity: 1;
}

.info-subtext {
    text-align: left;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-label {
    font-size: 14px;
    margin-top: 5px;
}

.copy-stats {
    margin-top: 20px;
    text-align: center;
}

#copy-stats-btn {
    font-family: 'Poppins', sans-serif;
    background-color: #007BFF;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    outline: none;
}

#copy-stats-btn:hover {
    background-color: #0056b3; /* A darker shade of blue for the hover state */
}

#copy-stats-btn:active {
    background-color: #004492; /* Even darker for the active/clicked state */
}

#notification {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 1;
    font-size: 12px;
    text-align: center;
    /* So it doesn't interfere with any interactions */
}

.notification-visible {
    opacity: 1 !important;
    /* Override other styles */
}

footer {
    width: 100%;
    padding: 10px 20px;
    /* Adjust the horizontal padding */
    background-color: #f2f2f2;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    font-size: 14px;
    box-sizing: border-box;
    white-space: normal;
    /* Allow wrapping */
    word-wrap: break-word;
}

footer a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    /* Allow the anchor to fill the width */
    word-wrap: break-word;
    /* This should force longer text to wrap */
}

footer a:hover {
    color: #0056b3;
}

.rank-chart {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.rank-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

/* Default styles for screens less than 375px */
.rank-label {
    width: 30%;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
}

/* Override for screens 375px or wider */
@media (min-width: 450px) {
    .rank-label {
        width: 20%;
    }
}

.rank-bar {
    height: 10px;
    background-color: #3498db;
    /* You can change this to your preferred color */
    /* transition: width 0.3s ease; */
    border-radius: 5px;
}