/* styles.css */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

/* Apply styles to the entire body */
body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #1f1c2c, #928dab);
    color: #fff;
    min-height: 100vh;
    /* Smooth Transition for Background Color Changes */
    transition: background-color 0.5s ease-in-out;
}

/* Game Container Styles */
#game-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 30px 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

/* Heading Styles */
#game-container h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* Poem Display */
#poem {
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    min-height: 200px;
    font-size: 1.2em;
    line-height: 1.6;
    text-align: left;
    max-width: 600px;
    overflow-y: auto;
    color: #fff;
    word-wrap: break-word;
    white-space: pre-wrap; /* Preserve line breaks */
    position: relative;
}

/* Phrase Buttons */
.phrase-button {
    padding: 15px 20px;
    margin: 10px;
    font-size: 1em;
    cursor: pointer;
    background: none;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 30px;
    transition: all 0.3s ease;
    display: inline-block;
    width: calc(100% / 3 - 40px); /* Adjust width to fit three buttons in a row */
}

.phrase-button:hover {
    background-color: #fff;
    color: #000;
}

/* Choices Container */
#choices {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

/* User Input Container */
#user-input-container {
    margin-top: 20px;
    text-align: center;
}

#user-phrase-input {
    padding: 10px;
    width: 80%;
    max-width: 500px;
    font-size: 1em;
    border: 2px solid #fff;
    border-radius: 5px;
    background: none;
    color: #fff;
    margin-right: 10px;
}

#user-phrase-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#submit-user-phrase {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background: none;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 30px;
    transition: all 0.3s ease;
}

#submit-user-phrase:hover {
    background-color: #fff;
    color: #000;
}

/* Dark Self Response, Feedback, and Round Counter */
#dark-self-response, #feedback, #round-counter {
    margin: 15px 0;
    font-size: 1.1em;
}

/* Decision Graph */
#decision-graph {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.decision-node {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin: 5px;
    background-color: #555;
    transition: transform 0.3s ease;
}

.correct-guess {
    background-color: #28a745;
}

.incorrect-guess {
    background-color: #dc3545;
}

.decision-node:hover {
    transform: scale(1.2);
}

/* Restart Button */
#restart-button {
    padding: 12px 24px;
    font-size: 1em;
    cursor: pointer;
    background: none;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 30px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

#restart-button:hover {
    background-color: #fff;
    color: #000;
}

/* Dynamic Image */
#dynamic-image {
    width: 150px;
    margin: 20px 0;
    display: none; /* Hide by default */
}

/* Music Control Button */
.music-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    background: none;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.music-button:hover {
    background-color: #fff;
    color: #000;
}

/* Responsive Design for Smaller Screens */
@media (max-width: 600px) {
    #game-container {
        width: 95%;
        padding: 20px;
    }

    #poem {
        font-size: 1em;
    }

    .phrase-button, #restart-button {
        padding: 10px 20px;
        margin: 8px;
        font-size: 0.9em;
        width: calc(100% - 40px); /* Stack buttons on smaller screens */
    }

    #dynamic-image {
        width: 120px;
    }
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: radial-gradient(circle at center, rgba(255,255,255,0.1), rgba(0,0,0,0));
    animation: rotation 20s infinite linear;
    z-index: -1;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar Styles */
#poem::-webkit-scrollbar {
    width: 6px;
}

#poem::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
