body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f2f2f2;
    color: #777777;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

*, *::before, *::after {
    box-sizing: inherit;
}

.game-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    gap: 40px;
    align-items: center;
}

.segment {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
}

.title-segment {
    margin-bottom: 20px;
}

.game-title {
    font-size: 48px;
    font-weight: 700;
    color: #777777;
    text-align: center;
    user-select: none;
}

.game-segment {
    gap: 40px;
    width: 100%;
}

.spacing-segment {
    height: 30px;
}

.input-line {
    border-radius: 3px;
    min-height: 50px;
    font-size: 24px;
    font-weight: 600;
    color: #777777;
    text-align: center;
    padding: 15px 20px;
    letter-spacing: 2px;
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.input-line:empty:before {
    content: "Tap letters to spell the phrasal verb";
    color: #777777;
    font-size: 16px;
    font-weight: 400;
}

.letters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 500px;
    padding: 20px;
}

.letter-square {
    border-radius: 3px;
    background-color: #777777;
    color: #f2f2f2;
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
    border: none;
}

.letter-square:hover:not(.used) {
    background-color: #f2f2f2;
    color: #777777;
}

.letter-square.used {
    background-color: #f2f2f2;
    color: #777777;
    cursor: not-allowed;
}

.hints-segment {
    gap: 30px;
    width: 100%;
    max-width: 500px;
}

.hints-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.hint-display {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    padding: 10px;
}

.hint-dashes {
    letter-spacing: 4px;
    margin-left: 15px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.hint-button {
    border-radius: 3px;
    background-color: #777777;
    color: #f2f2f2;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
    min-width: 120px;
    display: block;
    margin: 0 auto;
    border: none;
}

.hint-button:hover:not(:disabled) {
    background-color: #f2f2f2;
    color: #777777;
}

.hint-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(119, 119, 119, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    border-radius: 3px;
    background-color: #f2f2f2;
    padding: 40px;
    position: relative;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 4px 20px rgba(119, 119, 119, 0.15);
    z-index: 1001;
    color: #777777;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: #777777;
    cursor: pointer;
    transition: color 0.3s ease;
    font-weight: bold;
}

.guide-content, .success-content {
    text-align: center;
    min-width: 400px;
}

.guide-title, .success-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
}

.guide-instructions {
    display: flex;
    flex-direction: column;
    gap: 25px;
    text-align: left;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.bullet {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 20px;
}

.guide-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    flex: 1;
}

.success-phrasal-verb {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px;
}
.share-invite-text {
    font-size: 16px;
    font-weight: 400;
    margin: 25px 0 10px 0;
}

#share-block {
    border: 1px solid #777777;
    border-radius: 3px;
    padding: 15px 20px;
    margin: 0 auto 25px auto;
    font-size: 16px;
    font-weight: 600;
    color: #f2f2f2;
    background-color: #777777;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 400px;
    user-select: none;
}

#share-block:hover {
    background-color: #f2f2f2;
    color: #777777;
}



.next-puzzle-text {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 15px;
}

.countdown-timer {
    font-size: 24px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    padding: 10px;
}

.footer-container {
    background-color: #f2f2f2;
    padding: 20px;
    text-align: center;
    width: 100%;
}

.footer-text {
    color: #777777;
    font-size: 14px;
    margin: 5px 0;
}

.footer-link {
    color: #777777;
    text-decoration: none;
    font-weight: 600;
}

.footer-link:hover {
    text-decoration: underline;
}

*:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 36px;
    }
    .input-line {
        font-size: 20px;
        max-width: 350px;
    }
    .letter-square {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    .letters-container {
        max-width: 400px;
        gap: 10px;
    }
    .hint-display {
        font-size: 16px;
    }
    .hint-button {
        font-size: 16px;
        padding: 12px 24px;
    }
    .modal-content {
        padding: 30px;
    }
    .guide-title,
    .success-title {
        font-size: 28px;
    }
    .guide-content,
    .success-content {
        min-width: 320px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 28px;
    }
    .input-line {
        font-size: 18px;
        max-width: 300px;
        padding: 12px 16px;
    }
    .input-line:empty:before {
        font-size: 14px;
    }
    .letter-square {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    .letters-container {
        max-width: 320px;
        gap: 8px;
    }
    .modal-content {
        padding: 25px;
    }
    .guide-content,
    .success-content {
        min-width: 280px;
    }
    .hints-container {
        padding: 15px;
    }
}