* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', Arial, sans-serif !important;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 0 20px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 80px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}

.dark-mode-toggle span {
    font-size: 1.5rem;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    margin: 30px 0 10px 0;
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 525px;
    margin-left: auto;
    margin-right: auto;
}

.logo-svg {
    width: 525px;
    max-width: 90vw;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-subscript {
    color: #ea4335;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: right;
    font-family: 'Roboto', 'Product Sans', Arial, sans-serif;
    margin-top: 0px;
    letter-spacing: 1px;
    animation: fadeFlow 3s infinite;
    background: linear-gradient(90deg, transparent 0%, #ea4335 50%, transparent 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 525px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeFlow {
    0% { 
        background-position: -100% 0;
        opacity: 0.3;
    }
    50% { 
        background-position: 0% 0;
        opacity: 1;
    }
    100% { 
        background-position: 100% 0;
        opacity: 0.3;
    }
}

.subtitle {
    font-size: 16px;
    color: #333;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 0;
    text-align: left;
    animation: floatY 2s ease-in-out infinite alternate;
}
@keyframes floatY {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.category-selector {
    margin-bottom: 0;
    text-align: right;
}

.category-selector select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.category-selector select:disabled {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.game-container {
    border-radius: 8px;
    padding: 0;
    box-shadow: none;
    width: 100%;
    max-width: 550px;
    border: none;
}

.search-container {
    padding: 0;
}

.message-container {
    height: 20px;
    width: 100%;
    visibility: hidden;
    font-size: 12px;
    text-align: center;
    color: #ea4335;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guess-container {
    width: 100%;
    margin: 4px 0;
    padding: 0 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
}

.guess-content {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
    height: 24px;
    border-left: 3px solid #4285f4;
    border-right: 3px solid #4285f4;
    overflow: hidden;
    width: fit-content;
    max-width: 400px;
}

.guess-content::before {
    content: "Last Guess:";
    font-size: 1rem;
    color: #5f6368;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}

.guess-text {
    flex: 1;
    font-size: 1rem;
    color: #202124;
    font-weight: 500;
    margin-right: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guess-user {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.guess-img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    background: #eee;
    margin-right: 5px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 16px;
    height: 44px;
}

.search-icon {
    color: #9aa0a6;
    margin-right: 14px;
    font-size: 16px;
}

.search-prompt {
    color: #202124;
    font-size: 1.1rem;
    margin-right: 4px;
    font-weight: bold;
}

.search-input {
    color: #202124;
    flex: 1;
    font-size: 1.1rem;
    border: none;
    outline: none;
    background: transparent;
}

.automation-timer {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: #4285f4;
    color: white;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 8px;
    min-width: 40px;
    justify-content: center;
}

.suggestions-container {
    padding: 0;
}

.suggestion {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 34px;
    height: 34px;
    padding: 0 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.1s ease;
    column-gap: 0.5rem;
    position: relative;
}

.suggestion:hover {
    background-color: #f8f9fa;
}

.suggestion:last-child {
    border-bottom: none;
}

.suggestion-icon {
    color: #9aa0a6;
    margin-right: 14px;
    font-size: 16px;
}

.suggestion-text {
    flex: 1;
    font-size: 1rem;
    color: #202124;
    display: flex;
    align-items: center;
    font-weight: bold;
}

.suggestion-prompt {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.answer-covered {
    background: #4285f4;
    color: transparent;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 4px;
    min-width: 80px;
    height: 20px;
    transition: all 0.2s ease;
    user-select: none;
}

.answer-revealed {
    background: transparent;
    color: #202124;
    padding: 2px 8px;
    margin-left: 4px;
    font-size:18px;
    color: #4285f4;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.answer-covered.wrong {
    animation: shake 0.3s ease-in-out;
}

.btn {
    padding: 6px 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    background: white;
    color: #202124;
}

.btn:hover {
    background: #f1f3f4;
    border-color: #c4c7c5;
}

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

.settings-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-icon span {
    font-size: 2rem;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidepanel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #181818;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 2000;
    color: #fff;
    display: flex;
    overflow:scroll;
    scrollbar-width: none;
    flex-direction: column;
}

.sidepanel.open {
    right: 0;
}

.sidepanel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 16px 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.sidepanel-title {
    font-size: 1.4rem;
    font-weight: bold;
}

.sidepanel-close {
    font-size: 2rem;
    cursor: pointer;
    margin-left: 10px;
    color: #fff;
    font-weight: normal;
}

.accordion {
    width: 100%;
}

.accordion-item {
    background: #222;
    border-bottom: 2px solid #181818;
}

.accordion-header {
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.accordion-icon {
    font-size: 1.2rem;
    margin-left: 10px;
    color: #fff;
}

.accordion-content {
    padding: 0 20px 16px 20px;
    display: none;
    background: #222;
    color: #fff;
}

.accordion-content.open {
    display: block;
}

.profile-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.profile-label {
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 12px;
    display: block;
}

.profile-image-container {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

#profileImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #222;
}

.change-photo-btn {
    background: #4285f4;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 8px;
    margin-top: 0;
    transition: background 0.2s;
    display: inline-block;
    text-align: center;
}

.change-photo-btn:hover {
    background: #3367d6;
}

.profile-note {
    color: #bbb;
    font-size: 0.95rem;
    margin-top: 0;
    margin-bottom: 0;
    text-align: center;
}

.upload-overlay {
    display: none !important;
}

@media (max-width: 600px) {
    .logo-svg {
        width: 336px;
        max-width: 90vw;
    }
    
    .logo-subscript {
        margin-top: 0px;
        font-size: 0.8rem;
        max-width: 336px;
    }
    
    .search-box {
        font-size: 14px;
    }
}

/* Ensure the sidepanel covers the cog */
.sidepanel.open + .settings-icon {
    z-index: 0;
}

/* User info in suggestion row */
.suggestion-userinfo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 180px;
    flex-shrink: 0;
    height: 100%;
    margin: 0 auto;
    position: static;
}
.suggestion-userimg {
    width: 32px;
    height: 32px;
    border-radius: 0;
    object-fit: cover;
    background: #eee;
    margin-right: 8px;
    flex-shrink: 0;
}
.suggestion-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.1rem;
    color: #222;
    font-weight: 600;
    display: block;
    text-align: center;
}

.profile-username-input {
    width: 90%;
    max-width: 260px;
    margin: 12px auto 8px auto;
    display: block;
    font-size: 1.2rem;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #dadce0;
    background: #181818;
    color: #fff;
    text-align: center;
    font-weight: 500;
    outline: none;
    transition: border 0.2s;
}
.profile-username-input:focus {
    border: 1.5px solid #4285f4;
    background: #232323;
}

#gameArea {
    font-size: 1.25rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 550px;
    margin: 0 auto 10px auto;
}

.suggestion.revealed {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-icon.active-simulate span {
    color: #22bb33 !important;
}
.simulate-toggle-label {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.automation-flow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.35);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.automation-flow-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    width: 420px;
    max-width: 95vw;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.automation-flow-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 12px 24px;
    border-bottom: 1px solid #eee;
}
.automation-flow-modal-description {
    padding: 0 24px 16px 24px;
    color: #666;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
}
.automation-flow-modal-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #222;
}
.automation-flow-modal-close {
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    margin-left: 10px;
}
.automation-flow-modal-body {
    padding: 18px 24px 12px 24px;
    max-height: 350px;
    overflow-y: auto;
}
.automation-flow-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}
.automation-categories {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.automation-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
    font-size: 1.1rem;
}
.automation-category-accordion {
    margin-bottom: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}
.automation-accordion-header {
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #444;
    user-select: none;
}
.automation-accordion-header input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.automation-accordion-header:hover {
    background: #f1f3f4;
}
.automation-accordion-icon {
    margin-left: auto;
    font-size: 0.9rem;
    color: #666;
}
.automation-accordion-content {
    display: none;
    padding: 12px 16px;
    background: #fff;
}
.automation-accordion-content.open {
    display: block;
}
.automation-prompt-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #444;
    font-size: 0.95rem;
    margin-bottom: 4px;
    padding: 4px 0;
}
.automation-category-flat {
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.automation-category-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: #222;
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.automation-prompt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #444;
    font-size: 0.98rem;
    margin-left: 24px;
    margin-bottom: 2px;
    padding: 2px 0;
}
.automation-prompts-hidden {
    visibility: hidden;
    height: 0;
    overflow: hidden;
}
.automation-prompts-visible {
    visibility: visible;
    height: auto;
}

.buttons-container-bottom {
    display: flex;
    gap: 8px;
    padding: 8px 0px;
    border-top: 1px solid #f0f0f0;
    justify-content: flex-end;
    align-items: center;
}

.game-mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dadce0;
    height: 28px;
    box-sizing: border-box;
}

.game-mode-toggle-container .toggle-label {
    font-size: 12px;
    color: #202124;
    font-weight: 400;
}

/* .chat-button-container {
    position: relative;
}

.chat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    background: white;
    color: #202124;
}

.chat-btn:hover {
    background: #f1f3f4;
    border-color: #c4c7c5;
}

.chat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #4285f4;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.chat-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 150px;
}

.chat-menu-content {
    padding: 12px;
}

.chat-menu-title {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    text-align: center;
} */

.automate-button-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dadce0;
    height: 28px;
    box-sizing: border-box;
    position: relative;
}

.automate-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.automate-label {
    font-size: 12px;
    color: #202124;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

.automation-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
}

.automation-menu-content {
    padding: 12px;
}

.automation-menu-title {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 8px;
}

.automation-condition {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.automation-condition span {
    font-size: 12px;
    color: #5f6368;
}

.automation-timeout-select {
    padding: 4px 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.start-automation-btn {
    width: 100%;
    padding: 6px 12px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.start-automation-btn:hover {
    background: #3367d6;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 400;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4285f4;
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #34a853;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.game-mode-description {
    font-size: 0.8rem;
    color: #bbb;
    margin-bottom: 16px;
    line-height: 1.3;
}

.escape-character-input {
    width: 60px;
    padding: 6px 8px;
    font-size: 1rem;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #181818;
    color: #fff;
    text-align: center;
    font-weight: 500;
    outline: none;
    transition: border 0.2s;
}

.escape-character-input:focus {
    border: 1.5px solid #4285f4;
    background: #232323;
}

.comments {
    width: 100%;
    max-width: 550px;
    margin: 12px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.comment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 10px;
    padding: 4px 16px;
    font-size: 1.1rem;
    min-height: 34px;
    height: 34px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.comment-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 220px;
    margin-right: 20px;
}
.comment-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    background: #eee;
}
.comment-username {
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #222;
}
.comment-guess {
    font-weight: 400;
    color: #333;
    text-align: right;
    flex: 1;
    margin-left: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Round Winners Modal */
.round-winners-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-winners-modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 400px;
    max-width: 90vw;
    padding: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.round-winners-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.round-winners-modal-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.round-winners-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.round-winner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 4px 10px;
    height: 36px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.round-winner-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.round-winner-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.round-winner-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    background: #eee;
    border-radius: 4px;
    flex-shrink: 0;
}

.round-winner-username {
    font-weight: 600;
    font-size: 1rem;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.round-winner-score {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1rem;
    color: #4285f4;
    flex-shrink: 0;
    min-width: 20px;
    justify-content: center;
}

.round-winners-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

.round-winners-branding {
    color: #4285f4;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Test Form for handleRealComment */
.test-form {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 280px;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    font-family: 'Nunito', Arial, sans-serif;
}

.test-form-header {
    background: #333;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #444;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.test-form-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-form-toggle:hover {
    background: #444;
    border-radius: 3px;
}

.test-form-body {
    padding: 12px;
    display: block;
}

.test-form-body.collapsed {
    display: none;
}

.test-form-row {
    margin-bottom: 8px;
}

.test-form-row label {
    display: block;
    color: #ccc;
    font-size: 0.8rem;
    margin-bottom: 3px;
    font-weight: 500;
}

.test-form-row input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #444;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
}

.test-form-row input:focus {
    outline: none;
    border-color: #4285f4;
    background: #4a4a4a;
}

.test-form-submit {
    width: 100%;
    padding: 8px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

.test-form-submit:hover {
    background: #3367d6;
}

.test-form-submit:active {
    background: #2d5aa0;
}

/* Answers accordion content */
.answers-content {
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
    height: 400px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #2a2a2a;
}

.answer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 4px 0;
    background: #333;
    border-radius: 6px;
    border-left: 4px solid #4285f4;
}

.answer-item.revealed {
    background: #2d4a2d;
    border-left-color: #34a853;
}

.answer-text {
    flex: 1;
    font-weight: 500;
}

.answer-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.answer-status.hidden {
    background: #4285f4;
    color: white;
}

.answer-status.revealed {
    background: #34a853;
    color: white;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6000;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    font-weight: 500;
    max-width: 400px;
    text-align: center;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid #4285f4;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hide {
    transform: translateY(-100px);
    opacity: 0;
}

/* Floating Leaderboard */
.floating-leaderboard {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 280px;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    font-family: 'Nunito', Arial, sans-serif;
    cursor: move;
    user-select: none;
}

.floating-leaderboard-header {
    background: #333;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #444;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: move;
}

.floating-leaderboard-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-leaderboard-toggle:hover {
    background: #444;
    border-radius: 3px;
}

.floating-leaderboard-body {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: block;
}

.floating-leaderboard-body.collapsed {
    display: none;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #3a3a3a;
    border-radius: 4px;
    padding: 6px 10px;
    height: 36px;
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.leaderboard-rank {
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 18px;
    text-align: right;
    flex-shrink: 0;
}

.leaderboard-img {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    background: #555;
    flex-shrink: 0;
}

.leaderboard-username {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.leaderboard-points {
    color: #4285f4;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.leaderboard-empty {
    color: #888;
    font-size: 0.8rem;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.leaderboard-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.leaderboard-nav-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.2s;
}

.leaderboard-nav-btn:hover:not(:disabled) {
    background: #444;
}

.leaderboard-nav-btn:disabled {
    color: #666;
    cursor: not-allowed;
}

.leaderboard-page-info {
    color: #ccc;
    font-size: 0.75rem;
    min-width: 24px;
    text-align: center;
    margin: 0 2px;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .logo-subscript {
    color: #ea4335;
}

body.dark-mode .subtitle {
    color: #e0e0e0;
}

body.dark-mode .category-selector select {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .category-selector select:disabled {
    background: #1a1a1a;
    color: #888;
    border-color: #333;
}

body.dark-mode .search-box {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .search-prompt {
    color: #e0e0e0;
}

body.dark-mode .search-input {
    color: #e0e0e0;
}

body.dark-mode .search-input::placeholder {
    color: #888;
}

body.dark-mode .message-container {
    color: #ea4335;
}

body.dark-mode .guess-content {
    background: #2d2d2d;
    border-left-color: #4285f4;
    border-right-color: #4285f4;
}

body.dark-mode .guess-content::before {
    color: #b0b0b0;
}

body.dark-mode .guess-text {
    color: #e0e0e0;
}

body.dark-mode .suggestion {
    border-bottom-color: #333;
    background: #2d2d2d;
}

body.dark-mode .suggestion:hover {
    background-color: #3a3a3a;
}

body.dark-mode .suggestion-text {
    color: #e0e0e0;
}

body.dark-mode .suggestion-username {
    color: #ffffff;
}

body.dark-mode .answer-revealed {
    color: #4285f4;
}

body.dark-mode .btn {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .btn:hover {
    background: #3a3a3a;
    border-color: #555;
}

body.dark-mode .buttons-container-bottom {
    border-top-color: #333;
}

body.dark-mode .game-mode-toggle-container {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .game-mode-toggle-container .toggle-label {
    color: #e0e0e0;
}

body.dark-mode .chat-btn {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .chat-btn:hover {
    background: #3a3a3a;
    border-color: #555;
}

body.dark-mode .chat-menu {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .chat-menu-title {
    color: #e0e0e0;
}

body.dark-mode .automate-button-container {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .automate-label {
    color: #e0e0e0;
}

body.dark-mode .automation-menu {
    background: #2d2d2d;
    border-color: #444;
}

body.dark-mode .automation-menu-content {
    color: #e0e0e0;
}

body.dark-mode .automation-menu-title {
    color: #e0e0e0;
}

body.dark-mode .automation-condition span {
    color: #b0b0b0;
}

body.dark-mode .automation-timeout-select {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .start-automation-btn {
    background: #4285f4;
    color: white;
}

body.dark-mode .start-automation-btn:hover {
    background: #3367d6;
}

body.dark-mode .toggle-label {
    color: #e0e0e0;
}

body.dark-mode .toggle-slider {
    background-color: #4285f4;
}

body.dark-mode .toggle-switch input:checked + .toggle-slider {
    background-color: #34a853;
}

body.dark-mode .game-mode-description {
    color: #b0b0b0;
}

body.dark-mode .escape-character-input {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .escape-character-input:focus {
    border-color: #4285f4;
    background: #3a3a3a;
}

body.dark-mode .comments {
    color: #e0e0e0;
}

body.dark-mode .comment-row {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .comment-username {
    color: #e0e0e0;
}

body.dark-mode .comment-guess {
    color: #e0e0e0;
}

body.dark-mode .round-winners-modal {
    background: rgba(0,0,0,0.8);
}

body.dark-mode .round-winners-modal-content {
    background: #2d2d2d;
}

body.dark-mode .round-winners-modal-header {
    border-bottom-color: #444;
}

body.dark-mode .round-winners-modal-title {
    color: #e0e0e0;
}

body.dark-mode .round-winner-item {
    background: #3a3a3a;
}

body.dark-mode .round-winner-username {
    color: #e0e0e0;
}

body.dark-mode .round-winners-modal-footer {
    background: #3a3a3a;
    border-top-color: #444;
}

body.dark-mode .round-winners-branding {
    color: #4285f4;
}

body.dark-mode .automation-flow-modal {
    background: rgba(0,0,0,0.8);
}

body.dark-mode .automation-flow-modal-content {
    background: #2d2d2d;
}

body.dark-mode .automation-flow-modal-header {
    border-bottom-color: #444;
}

body.dark-mode .automation-flow-modal-description {
    color: #b0b0b0;
    border-bottom-color: #444;
}

body.dark-mode .automation-flow-modal-title {
    color: #e0e0e0;
}

body.dark-mode .automation-flow-modal-close {
    color: #b0b0b0;
}

body.dark-mode .automation-flow-modal-footer {
    border-top-color: #444;
}

body.dark-mode .automation-category-flat {
    border-bottom-color: #444;
}

body.dark-mode .automation-category-row {
    color: #e0e0e0;
}

body.dark-mode .automation-prompt-row {
    color: #b0b0b0;
}

body.dark-mode .test-form {
    background: #1a1a1a;
    border-color: #444;
}

body.dark-mode .test-form-header {
    background: #2d2d2d;
    border-bottom-color: #444;
}

body.dark-mode .test-form-row input {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .test-form-row input:focus {
    border-color: #4285f4;
    background: #3a3a3a;
}

body.dark-mode .test-form-row label {
    color: #b0b0b0;
}

body.dark-mode .floating-leaderboard {
    background: #1a1a1a;
    border-color: #444;
}

body.dark-mode .floating-leaderboard-header {
    background: #2d2d2d;
    border-bottom-color: #444;
}

body.dark-mode .leaderboard-item {
    background: #2d2d2d;
}

body.dark-mode .leaderboard-username {
    color: #e0e0e0;
}

body.dark-mode .leaderboard-rank {
    color: #b0b0b0;
}

body.dark-mode .leaderboard-page-info {
    color: #b0b0b0;
}

body.dark-mode .leaderboard-nav-btn:hover:not(:disabled) {
    background: #444;
}

body.dark-mode .leaderboard-empty {
    color: #b0b0b0;
}

body.dark-mode .toast {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .answers-content {
    background: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .answer-item {
    background: #2d2d2d;
    border-left-color: #4285f4;
}

body.dark-mode .answer-item.revealed {
    background: #1a3a1a;
    border-left-color: #34a853;
}

body.dark-mode .answer-text {
    color: #e0e0e0;
}

/* Dark mode toggle styling */
body.dark-mode .dark-mode-toggle span {
    color: #ffd700;
}

body.dark-mode .settings-icon span {
    color: #b0b0b0;
}

/* Preserve Google logo colors in dark mode */
body.dark-mode .logo-svg path[fill="#4385f5"] {
    fill: #4385f5;
}

body.dark-mode .logo-svg path[fill="#dc4437"] {
    fill: #dc4437;
}

body.dark-mode .logo-svg path[fill="#f5b401"] {
    fill: #f5b401;
}

body.dark-mode .logo-svg path[fill="#109d59"] {
    fill: #109d59;
}