/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Avenir LT Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #FBFCFD;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.game-container {
    width: 100%;
    max-width: 1464px;
    height: 100vh;
    position: relative;
    background-color: #FBFCFD;
}

/* Header Styles */
.header {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 1392px;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-btn, .settings-btn {
    background: white;
    border: 1px solid #EDEEEE;
    border-radius: 12px;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #444D56;
    cursor: pointer;
}

.menu-btn {
    width: 105px;
}

.settings-btn {
    width: 124px;
}

.header-info {
    text-align: center;
}

.subtitle {
    font-weight: 700;
    font-size: 12px;
    color: #6A737D;
    margin-bottom: 7px;
}

.title {
    font-weight: 900;
    font-size: 16px;
    color: #171C21;
}

/* Game Area */
.game-area {
    position: absolute;
    top: 64px;
    left: 36px;
    width: 1392px;
    height: calc(100vh - 136px); /* Full height minus header, top margin, and padding */
    background: white;
    border: 1px solid #EDEEEE;
    border-radius: 12px;
    overflow: hidden;
}

.game-area::before {
    content: '';
    position: absolute;
    top: -82px;
    left: -65px;
    width: 1522px;
    height: calc(100vh + 10px); /* Extend beyond the game area */
    background: white;
    z-index: 1;
}

.game-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 32px;
    margin-top: 64px;
    gap: 64px;
}

/* Instructions Column */
.instructions-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    height: 100%;
}

.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.game-title {
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #205CC6;
    line-height: 20px;
    text-align: left;
}

.instructions-header h2 {
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: #171C21;
    text-align: left;
    letter-spacing: -0.24px;
    line-height: normal;
    margin: 0;
}

.instructions-list {
    width: 100%;
}

.instructions-list ul {
    list-style: disc;
    margin: 0;
    padding-left: 24px;
}

.instructions-list li {
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 550;
    font-size: 16px;
    color: #171C21;
    line-height: 24px;
    margin-bottom: 0;
}

.instructions-list li:last-child {
    margin-bottom: 0;
}

.examples-header h3 {
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #171C21;
    text-align: left;
    line-height: normal;
    margin: 0;
}

.example-row {
    display: flex;
    gap: 24px;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.example-text {
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 550;
    font-size: 16px;
    color: #171C21;
    text-align: left;
    line-height: 24px;
    margin-bottom: 24px;
}

/* Game Column */
.game-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    height: 100%;
}

.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.clue-text {
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 900;
    font-size: 24px;
    color: #171C21;
    text-align: center;
    letter-spacing: -0.24px;
    line-height: normal;
}

/* Game Grid */
.game-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
}

.grid-row {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.letter-box {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: white;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 14px 16px;
    box-sizing: border-box;
}

/* Letter box states */
.letter-box.empty {
    background: #FBFCFD;
    border: 1px solid #CCCFD3;
    color: #171C21;
}

.letter-box.filled {
    background: #FBFCFD;
    border: 1px solid #171C21;
    color: #171C21;
}

.letter-box.correct {
    background: #2872DC;
    border: 1px solid #2872DC;
    color: white;
}

.letter-box.present {
    background: #E1A609;
    border: 1px solid #E1A609;
    color: white;
}

.letter-box.absent {
    background: #7D858C;
    border: 1px solid #7D858C;
    color: white;
}

.letter-box.current-row {
    border: 1px solid #171C21;
}

/* Input field for typing */
.letter-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    color: #171C21;
    text-transform: uppercase;
    outline: none;
}

/* Feedback Message */
.feedback-message {
    min-height: 24px;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    margin-top: 16px;
}

.feedback-message.success {
    color: #2872DC;
}

.feedback-message.error {
    color: #CA4A2B;
}

/* Submit Button */
.submit-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 24px;
}

/* Hint Button */
.hint-container {
    display: flex;
    justify-content: center;
    width: auto;
    height: 32px
}

.hint-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px;
    height: 32px;
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #2872DC;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hint-btn:hover {
    background: rgba(40, 114, 220, 0.1);
    border-radius: 8px;
}

/* Hint Display */
.hint-display {
    display: flex;
    justify-content: center;
    width: 100%;
}

.hint-letters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.hint-letter {
    background: #FBFCFD;
    border: 1px solid #CCCFD3;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #171C21;
    text-transform: uppercase;
    min-width: 32px;
    text-align: center;
}

.submit-btn {
    background: #CA4A2B;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    height: 40px;
    font-family: 'Avenir LT Pro', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.4;
}

.submit-btn:hover {
    background: #B8422A;
}

.submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.submit-btn:disabled:hover {
    background: #CA4A2B;
}

/* Submit button animations */
.submit-btn.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}


/* Responsive adjustments */
@media (max-width: 1500px) {
    .game-container {
        max-width: 100%;
    }
    
    .header {
        width: 90%;
        max-width: 1392px;
    }
    
    .game-area {
        left: 5%;
        width: 90%;
        max-width: 1392px;
    }
}

@media (max-width: 768px) {
    .header {
        width: 95%;
    }
    
    .menu-btn, .settings-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .game-area {
        left: 2.5%;
        width: 95%;
    }
    
    .game-content {
        padding: 20px;
        gap: 20px;
    }
    
    .clue-text {
        font-size: 20px;
    }
    
    .grid-row {
        gap: 16px;
    }
    
    .letter-box {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Video Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #EDEEEE;
}

.modal-header h3 {
    font-weight: 700;
    font-size: 18px;
    color: #171C21;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6A737D;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #FBFCFD;
    color: #171C21;
}

.modal-body {
    padding: 24px;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #EDEEEE;
    display: flex;
    justify-content: center;
}

.next-game-btn {
    background: #2872DC;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.next-game-btn:hover {
    background: #1E5BB8;
}

.next-game-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.next-game-btn:disabled:hover {
    background: #2872DC;
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 16px 20px;
    }
    
    .next-game-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
