body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #121212;
    /* Dark grey background */
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}


.top-centered-image {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 20px;
}

.top-centered-image img {
    width: 200px;
    height: auto;
}


#roleText {
    font-size: 1.5rem;
    color: white;
    /* Yellow accent */
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    margin: 20px 0;
    user-select: none;
}

#gameContainer {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
    width: 90%;
    max-width: 600px;
    text-align: center;
}

#receivedClues {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 10px 15px;
    max-height: fit-content;
    max-width: 300px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #8ecae6;
    /* Cool blue text */
    user-select: none;
}

#receivedClues h3 {
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

#receivedClues ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#receivedClues ul li {
    background: #333;
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: #e0e0e0;
    box-shadow: inset 0 0 5px #000;
    transition: background-color 0.3s ease;
}

#receivedClues ul li:hover {
    background-color: #444;
    cursor: default;
}

h1 {
    margin-bottom: 20px;
    font-size: 40px;
    color: #f5c518;
}

.miscommunication {
    margin-top: 20px;
    padding: 10px;
    background-color: #2c2c2c;
    color: red;
    border: 2px solid red;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
}


.word-grid .word:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
}

input[type="text"],
input[type="number"] {
    padding: 10px;
    margin: 8px;
    border: none;
    border-radius: 8px;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-size: 16px;
    width: 70%;
    border: 1px solid #444;
}

button {
    margin-top: 12px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #f5c518;
    /* Accent yellow */
    border: none;
    border-radius: 10px;
    color: #121212;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #f5c518;
}

#backBtn {
    margin-top: 20px;
    background-color: #8ecae6;
    /* Cool blue */
    color: #121212;
}

#backBtn:hover {
    background-color: #6db4d4;
}

.hidden {
    display: none;
}

.guess-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.interception-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

#savedCluesContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 220px;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 14px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
    z-index: 9999;
}

#savedCluesContainer h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: center;
}

#savedCluesContainer div {
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

#voice-controls {
    position: fixed;
    top: 130px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

#voice-controls button {
    padding: 10px 16px;
    background-color: rgba(0, 0, 0, 0.85);
    border: none;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#voice-controls button:hover {
    background-color: rgba(0, 0, 0, 0.85);
}

#voice-controls button:disabled {
    background-color: #90caf9;
    cursor: not-allowed;
}

body.team-B {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
    /* Blue gradient */
    color: white;
}

body.team-A {
    background: linear-gradient(135deg, #cb2d3e, #ef473a);
    /* Red gradient */
    color: white;
}


/* Compact styles — tune to your theme */
#voiceBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2f3136;
    /* dark button */
    color: #fff;
    border: none;
    border-radius: 999px;
    /* pill for join, circle for mute state */
    cursor: pointer;
    font-weight: 600;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    transition: background .15s, transform .08s, width .12s;
    user-select: none;
}

#voiceBtn:hover {
    transform: translateY(-1px);
}

/* icon */
#voiceIcon svg {
    display: block;
}

/* Mute state is circular. We'll set this class from JS. */
#voiceBtn.voice-muted,
#voiceBtn.voice-unmuted {
    padding: 8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    justify-content: center;
}

/* different colors for states */
#voiceBtn.voice-joined {
    background: #36393f;
    color: #fff;
}

/* joined unmuted */
#voiceBtn.voice-muted {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
}

/* muted -> red */
#voiceBtn.voice-unmuted {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
}

/* unmuted -> blue */

/* hide label in circular mode */
#voiceBtn.voice-muted #voiceLabel,
#voiceBtn.voice-unmuted #voiceLabel {
    display: none;
}

/* small focus / accessible outline */
#voiceBtn:focus {
    outline: 3px solid rgba(0, 0, 0, 0.15);
    outline-offset: 2px;
}


/* --- Responsive adjustments for mobile devices --- */
.toggle-btn {
    display: none;
}

.reload-btn {
    display: none;

}

.reload-btn:hover {
    background-color: #d32f2f;
}

#playersList {
    display: flex;
    justify-content: center;
    /* centers items horizontally */
    gap: 12px;
    /* space between avatars */
    flex-wrap: wrap;
    /* wrap to next line if too many */
    padding: 10px 0;
}


.player-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    min-width: 60px;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
    /* Remove default border since it's set by JS */
    border: none;
}

.player-avatar {
    border-radius: 50%;
    border: 3px solid transparent;
    /* Slightly thicker */
    transition: none;
    /* No fade delay */
}

.player-avatar.speaking {
    border: 3px solid #00ff7f;
    /* Bright neon green */
    box-shadow: 0 0 12px 4px rgba(0, 255, 127, 0.8);
    /* Glow effect */
}




@media (max-width: 600px) {
    .toggle-btn {
        position: fixed;
        bottom: 15px;
        right: 10px;
        padding: 8px 12px;
        background-color: rgba(0, 0, 0, 0.85);
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        z-index: 1000;
        display: block;
    }

    .reload-btn {
        position: fixed;
        bottom: 15px;
        right: 70px;
        padding: 8px 12px;
        background-color: rgba(0, 0, 0, 0.85);
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        z-index: 1000;
        display: block;
    }

    #voice-controls {
        top: auto !important;
        bottom: 20px !important;
        left: 10px !important;
    }

    #voice-controls {
        bottom: 15px !important;
    }

    #savedCluesContainer {
        display: none;
    }

    #savedCluesContainer.saved-clues-box {
        position: fixed;
        top: 90px;
        right: 20px;

        padding: 12px 16px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 9999;
        max-width: 300px;
        /* limit width */
        max-height: 80vh;
        overflow: auto;
    }

    /* Target the table inside to shrink cells and fonts */
    #savedCluesContainer.saved-clues-box table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.75rem;
        font-weight: 600;
    }

    #savedCluesContainer.saved-clues-box table th,
    #savedCluesContainer.saved-clues-box table td {
        padding: 4px 6px;
        white-space: nowrap;
        /* prevent wrapping for compactness */
    }



    #gameContainer {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        /* Center horizontally and vertically */
        transition: transform 0.3s ease;
        z-index: 1;
    }




    #teamStatsBox {
        font-size: 11px !important;
        padding: 6px 10px !important;
        line-height: 1.4 !important;
        border-radius: 8px !important;
        width: auto !important;
        max-width: 90% !important;
        top: 10px !important;
        left: 10px !important;
        bottom: auto !important;
    }

    h1 {
        font-size: 20px;
    }

    #roleText {
        font-size: 20px;
    }

    #gameContainer {
        max-width: 85vw;
        /* Smaller width */
        max-height: 65vh;
        /* Smaller height */
        font-size: 13px;
        /* Slightly smaller text */
        padding: 8px;
        /* Less padding */
        overflow-y: auto;
        /* Enable vertical scroll if content overflows */
        overflow-x: hidden;
    }

    body.clues-visible #gameContainer {
        transform: translate(-50%, -65%);
    }


    .player-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        object-fit: cover;
        margin-bottom: 4px;
        /* Remove default border since it's set by JS */
        border: none;
    }







}