body {
    font-family: sans-serif;
    background-image: url('https://cdn.comic.studio/images/bfdia10c/backgrounds/860768b8f3fc4e1360d8be0f8e158beb.jpg?filename=Goiky1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #333;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

h1, p {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

/* Toggle buttons */
.toggle-button {
    position: fixed;
    top: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.5em;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    border: none;
    z-index: 1010;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background-color 0.2s, transform 0.1s;
}

/* Position for the existing buttons */
#hide-selection-button {
    right: 55px; /* Adjust for the new button */
}

#show-selection-button {
    right: 55px; /* Adjust for the new button */
}

/* New results button specific styles */
.results-button {
    right: 10px; /* Position it to the far right */
    font-size: 1.2em; /* Slightly smaller for the icon */
    padding-top: 2px; /* Adjust padding if needed for icon alignment */
}

.toggle-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.toggle-button:active {
     transform: scale(0.95);
}

/* Initial state is controlled by JS after Websim init */
#hide-selection-button {
    /* display: block or none; Controlled by JS */
}

#show-selection-button {
    /* display: block or none; Controlled by JS */
}

#vote-selection-screen {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: min(95vw, 400px);
    max-height: min(95vh, 300px);
    width: auto;
    height: auto;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    text-align: left;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
}

#vote-selection-screen h1,
#vote-selection-screen p {
     background-color: transparent;
     padding: 0;
     margin-bottom: 10px;
     text-align: left;
     width: 100%;
}

#vote-selection-screen h1 {
    font-size: 1.5em;
}

#vote-selection-screen p {
     font-size: 1em;
     margin-bottom: 15px;
}

#vote-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
    padding: 0;
    width: 100%;
}

#vote-selection-screen button {
    padding: 10px 15px;
    font-size: 1em;
    border-radius: 8px;
    min-width: auto;
    width: 100%;
    min-height: auto;
}

.blue-button {
    background-color: #337CCF;
    color: white;
}

.hidden {
    display: none !important;
}

/* Voting Results Overlay Styles */
#voting-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1020; /* Above other UI elements */
}

.results-content {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80%;
    overflow-y: auto;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.results-content h2 {
    margin-top: 0;
    font-size: 1.8em;
    color: #333;
    background-color: transparent; /* Override global h1, p styles */
    padding: 0;
}

#results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

#results-list li {
    background-color: #f9f9f9;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 5px;
    font-size: 1.1em;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid #4CAF50; /* A little color accent */
}

#results-list li:last-child {
    margin-bottom: 0;
}

#close-results-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.2s;
}

#close-results-button:hover {
    background-color: #0056b3;
}

/* Wrapper for main content and chat */
#content-wrapper {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 60px;
    width: 100%;
    max-width: 1300px;
    justify-content: center;
    align-items: flex-start;
}

#main-voting-content {
     display: flex;
     flex-direction: column;
     align-items: center;
     width: 100%;
     max-width: 900px;
     flex-grow: 1;
}

#options-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 90%;
    max-width: 900px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 10px;
}

/* Team Container Styles */
.team-container {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: white;
}

/* Specific Team Backgrounds */
.team-container:not(.youtube-colors-team):not(.letter-c-games-team) {
     background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
}

.youtube-colors-team {
    background-color: #006400;
    color: white;
}

.letter-c-games-team {
    background: linear-gradient(to right, #006400 50%, #8B4513 50%);
    color: white;
    border: 1px solid #ccc;
}

.team-container h2,
.team-container p {
    background-color: transparent;
    padding: 0;
    margin: 0;
    text-align: center;
    color: inherit;
}

.team-container h2 {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.team-container p {
    font-size: 0.9em;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.team-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

button {
    padding: 15px 20px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    width: 100%;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    word-break: break-word;
    white-space: normal;
}

button:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.02);
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Ensure button text color is visible */
#option1 {
    background-color: #4CAF50;
    color: white;
}
#option2 {
    background-color: #9C27B0;
}
#option3 {
    background-color: #E91E63;
}
#option4 {
    background-color: #F44336;
}
.green-button {
    background-color: #45C44A;
}
.red-button {
    background-color: #F44336;
}
.orange-button {
    background-color: #FF9800;
}
.yellow-button {
    background-color: #FFEB3B;
    color: #333;
}
.blue-button {
     background-color: #2196F3;
}
.indigo-button {
     background-color: #4B0082;
}
.pink-button {
     background-color: #FF69B4;
}
.grey-button {
     background-color: #808080;
}
.green-blue-gradient-button {
    background: linear-gradient(to right, #45C44A 50%, #337CCF 50%);
}
.green-purple-pink-gradient-button {
    background: linear-gradient(to right, #45C44A 33%, #9C27B0 33%, #9C27B0 66%, #E91E63 66%);
}
.green-blue-gradient-button-alt {
     background: linear-gradient(to right, #45C44A 50%, #2196F3 50%);
}
.rainbow-gradient-button {
     background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);
}
.black-grey-white-gradient-button {
    background: linear-gradient(to right, black, grey, white);
    color: black;
}

#option14 {
    background-color: #95b6d9;
    color: #333;
}

#option15 {
    background-color: #41aa55;
    color: white;
}

#option38,
#option39,
#option40 {
    background-color: #808080; /* Grey color */
}

.vote-count {
    margin-top: 8px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    color: black;
}

#volume-control {
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 90%;
    max-width: 900px;
}

#volume-control label {
    font-weight: bold;
}

#volume-slider {
    flex-grow: 1;
}

#volume-value {
    min-width: 40px;
    text-align: right;
}

#players-list {
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
}

#players-list h2 {
    margin-top: 0;
    background-color: transparent;
    padding: 0;
    text-align: left;
}

#players {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

#players li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
    border-radius: 4px;
}

#players li img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #ccc;
    background-color: #eee;
}

#players li span {
    font-size: 0.9em;
}

/* Waiting Chat Styles */
#waiting-chat {
    width: 100%;
    max-width: 300px;
    min-width: 250px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: calc(100vh - 100px);
    margin-top: 60px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

#waiting-chat h2 {
    margin-top: 0;
    margin-bottom: 10px;
    background-color: transparent;
    padding: 0;
    text-align: left;
    font-size: 1.2em;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    display: flex;
    flex-direction: column;
}

/* For Webkit browsers */
#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {

}

/* Typing Indicator Styles */
#typing-indicators {
    margin-bottom: 10px;
    min-height: 1.2em; /* Reserve space even if empty */
    font-size: 0.9em;
    color: #555;
    font-style: italic;
}

.typing-indicator {
    margin-top: 5px;
}

#chat-input-area {
    display: flex;
    gap: 5px;
}

#chat-message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

#send-message-button {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: auto; /* Override default button width */
    min-height: auto;
}

#send-message-button:hover {
    background-color: #45a049;
}

/* Chat Message Styles */
.chat-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 8px;
    max-width: 95%;
    word-break: break-word;
}

.chat-message.self {
    /* Optional: Style for messages sent by the current user */
    background-color: rgba(220, 248, 198, 0.9); /* Light green background */
    align-self: flex-end; /* Align self messages to the right */
}

.chat-message img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    border: 1px solid #ccc;
    background-color: #eee;
}

.chat-message.self img {
     /* Optional: Adjust avatar margin for self messages if aligned right */
     margin-right: 0;
     margin-left: 10px; /* Add margin on the left */
}

.message-content {
    display: flex;
    flex-direction: column;
}

.chat-message.self .message-content {
    align-items: flex-end; /* Align text to the right for self messages */
}

.message-author {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 2px;
    color: #0056b3; /* A distinct color for author names */
}

.chat-message.self .message-author {
    color: #28a745; /* A different color for self author names */
}

.message-text {
    font-size: 1em;
    color: #333;
}