:root {
    --primary-color: #777777;
    --secondary-color: #f2f2f2;
}

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

.snow-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; 
    z-index: 9999;        
    display: none;       
}

body.theme-active .snow-frame {
    display: block;
}
body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2dvh 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
body.theme-active {
    
    background: linear-gradient(180deg,#70171e 75%, #3f0d11 120%);
    
    background-attachment: fixed;
    --primary-color: #EFE8D9;
    --secondary-color: #70171e;
}
*, *::before, *::after {
    box-sizing: inherit;
}

.game-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    gap: 2.5dvh;
    align-items: center;
    padding: 0 min(55px, 13.6%);
}

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

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

.game-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    user-select: none;
}
.theme-toggle {
    position: absolute;
    top: 50%;
    left: -35px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.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: var(--primary-color);
    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: var(--primary-color);
    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: var(--primary-color);
    color: var(--secondary-color);
    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;
    touch-action: manipulation;
}
.letter-square.used {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    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: 'Open Sans', sans-serif;
    font-weight: regular;
}

.hint-button {
    border-radius: 3px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    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;
    -webkit-tap-highlight-color: transparent;
}
.hint-button--active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.hint-button:focus {
    outline: none;
}
.hint-button:disabled {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    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: var(--secondary-color);
    padding: 40px;
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90%;
    box-shadow: 0 4px 20px rgba(119, 119, 119, 0.15);
    z-index: 1001;
    color: var(--primary-color);
}

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

.guide-content, .success-content {
    text-align: center;
}
#guide-video {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: contain;
}
.video-wrapper {
    position: relative;
    max-width: 270px;
    width: 100%;
    margin: 0 auto;
}

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

.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;
    letter-spacing: 1px;
}

.success-phrasal-verb {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0px;
    padding: 10px;
    letter-spacing: 1px;
}
.success-phrasal-meaning {
    font-size: 16px;
    font-weight: 400;
    color: var(--primary-color);
    text-align: center;
    margin: 0px 0 40px 0;
    line-height: 1.4;
    letter-spacing: 1px;
}
.share-invite-text {
    font-size: 16px;
    font-weight: 400;
    margin: 0px 0 10px 0;
    letter-spacing: 1px;
}

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

#share-block:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}



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

.countdown-timer {
    font-size: 24px;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    padding: 10px;
    letter-spacing: 3px;
}

.footer-container {
    background-color: transparent;
    padding: 20px;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
    
}

.footer-text {
    color: var(--primary-color);
    font-size: 14px;
    margin: 5px 0;
}

.footer-link {
    color: var(--primary-color);
    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-height: 670px) {
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        padding: 25px;
    }

    #guide-video {
        max-height: 50vh;
    }
}

@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;
    }
}

@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;
    }
    .hints-container {
        padding: 15px;
    }
}
@media (hover: hover) and (pointer: fine) {
    .hint-button:hover:not(:disabled) {
        background-color: var(--secondary-color);
        color: var(--primary-color);
    }
}
@keyframes wriggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}