html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #008;
}

body {
    font-family: Segoe UI, Tahoma, sans-serif;
    background: #008;
    color: #ccc;
    margin: 0;
    padding: 0;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
}

#container {
    width: 33em;
    margin: 0 auto;
    padding: 3% 0 3% 0;
    text-align: left;
    position: relative;
    max-width: 90vw;
}

#greetings, #gameOutput {
    color: #ccc;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 1.5em;
    font-size: 1em;
    font-family: inherit;
    white-space: pre-wrap;
}

#userInput {
    width: 33em;
    margin: 0 auto;
    text-align: left;
    max-width: 90vw;
}

.input-line {
    display: flex;
    align-items: center;
    font-family: inherit;
    font-size: 1em;
    color: #ccc;
    margin-top: 1em;
}

.prompt {
    margin-right: 0.5em;
    color: #ccc;
    font-family: inherit;
    font-size: 1em;
}

input {
    background: #008;
    color: #ccc;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1em;
    width: 100%;
    padding: 0;
}

input:focus {
    background: #008;
    color: #ccc;
    border-bottom: 1px solid #fff;
}

a, .togo-link, .tag-link, .answer-link, .start-game-link {
    color: #ccc;
    text-decoration: none;
}

a:hover, .togo-link:hover, .tag-link:hover, .answer-link:hover, .start-game-link:hover {
    color: #fff;
    text-decoration: underline;
}

#graphCanvas {
    position: fixed;
    top: 10em;
    right: 50px; /* Fixed distance from the right edge of viewport */
    width: 200px;
    height: 150px;
    background: #008;
    border-radius: 10px;
    border: 1px dashed #fff;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#graphCanvas.game-started {
    opacity: 1;
    visibility: visible;
}

/* Responsive canvas positioning */
@media screen and (max-width: 1200px) {
    #graphCanvas {
        width: 180px;
        height: 135px;
        right: 30px;
    }
}

@media screen and (max-width: 1000px) {
    #graphCanvas {
        width: 160px;
        height: 120px;
        right: 20px;
    }
}

@media screen and (max-width: 800px) {
    #graphCanvas {
        width: 140px;
        height: 105px;
        right: 15px;
    }
}

@media screen and (max-width: 600px) {
    #container, #userInput {
        width: 98vw;
    }
    body {
        font-size: 1rem;
    }
    
    #graphCanvas {
        position: absolute;
        top: 0;
        right: -160px; /* Position to the right of the container */
        width: 120px;
        height: 90px;
        z-index: 1000;
    }
}

@media screen and (max-width: 500px) {
    #graphCanvas {
        position: static;
        width: 100%;
        height: 120px;
        margin-top: 1em;
        margin-bottom: 1em;
        border-radius: 5px;
    }
}

h1, h2, h3 {
    color: #ccc;
    font-family: inherit;
    font-weight: bold;
    margin: 0 0 1em 0;
}

.game-guidelines {
    padding: 2em;
    margin: 2em 0;
    font-size: 0.95em;
    line-height: 1.5;
}

.guidelines-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.guidelines-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.1em;
    cursor: pointer;
}

.toggle-guidelines {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    transition: color 0.2s ease;
}

.toggle-guidelines:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.guidelines-content {
    margin-top: 1em;
}

.game-guidelines ul {
    margin: 0;
    padding-left: 1.5em;
}

.game-guidelines li {
    margin-bottom: 0.4em;
    color: #ddd;
}

.game-guidelines strong {
    color: #fff;
    font-weight: bold;
}

.game-guidelines p {
    margin: 1em 0 0 0;
    color: #ffd700;
    font-style: italic;
}
hr {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 1.5em 0;
}