body {
    background: #1a1a2e;
    color: #e6e6e6;
    font-family: 'Rubik', sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.top-bar {
    position: absolute;
    top: 0px;
    left: 0px;
    background: #11111e;
    z-index: 1000;
    padding: 0 10px;
    text-align: center;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
    width: 100%;
    height: 50px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}
.score {
    position: absolute;
    top: 3px;
    right: 5px;
    background: #5d5fc0;
    font-size: 10px;
    border-radius: 50%;
    padding: 2px 2px;
    border: 1px solid #999999aa;
    min-width: 12px;
    text-align: center;
    color: white;
    font-weight: lighter;
}
.layout {
    display: flex;
    width: 100%;
    max-width: 1500px;
    gap: 20px;
}
.sidebar {
    width: 50%;
    background: #16213e;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.main-content {
    flex: 1;
    background: #16213e;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}
input[type="text"] {
    background: #0f3460;
    border: 2px solid #FFD700;
    border-radius: 8px;
    color: #fff;
    padding: 12px 20px;
    font-size: 16px;
    margin: 10px;
    font-family: 'Rubik', sans-serif;
    width: calc(100% - 64px);
    max-width: 400px;
}
input[type="text"]:disabled {
    opacity: 0.5;
}
button {
    background: #FF5733; /* Changed color to a more visible one */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    margin: 10px;
}
button:hover {
    transform: translateY(-2px);
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #999;
}
.submit-button {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 11px;
    width: 53px;
    height: 49px;
    font-size: 24px;
    text-align: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    margin-left: 10px;
    padding: 10px;
    margin: 5px;
}
.submit-button:hover {
    transform: translateY(-2px);
}
.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#countdown {
    font-size: 30px;
    font-weight: bold;
    color: #FFD700;
    position: absolute;
    top: 20px;
    right: 20px;
}
.letters {

    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.letter-card {
    font-size: 32px;
    background: #ffffff;
    color: #000;
    width: 50px;
    height: 70px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #999;
    cursor: pointer;
    transition: transform 0.2s;
}
.letter-card.small {
    width: 15px;
    height: 20px;
    font-size: 12px;
    border-width: 1px;
    border-radius: 4px;
    margin-right: 1px;
}
.letter-card[placeholder$="true"] {
    border: 2px solid transparent;
    background-color: #000000;
    opacity: 0.2;
    background-size: 10px 10px;
    background-repeat: repeat;
}
.letter-card:hover {
    transform: translateY(-2px);
}
.word-input-area {
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 80px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.word-input-area.valid-word .letter-card {
    background: #FFD700;
    color: #0f3460;
    animation: validWordAnimation 0.5s ease-in-out;
}
@keyframes validWordAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.longest-word {
    display: flex;
    gap: 0px;
    margin-right: 10px;
}
.score-container {
    display: flex;
    align-items: center;
}
.player-list, .player-summary {
    display: grid;
    margin: 20px 0;
}
.player-card {
    background: #0f3460;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 4px;
    height: 18px;
}
.player-card.player {
    background: #FFD700;
    color: #0f3460;
}
h3 {
    color: #FFD700;
    font-size: 24px;
    margin: 0;
}
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    animation: fadeOut 2s forwards;
    z-index: 1000;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.best-word-notification {
    background: #FFD700;
    color: black;
}

.diamond-word-notification {
    background: rgb(200, 230, 255);
    color: #003d7a;
    font-weight: bold;
}

.optimal-word-notification {
    background: #28a745; /* Green background for optimal word notification */
    color: white;
}

.super-optimal-word-notification {
    background: #8e44ad; /* Purple background for super optimal word notification */
    color: white;
}

.player-scoreboard {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

*[hasAccent$="true"] {
    background: #fff; 
    color: #0f3460;
}
@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

#game-placeholder {
    height: 170px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 81px;
    background: #00000022;
    margin-top: 20px;
    border-radius: 8px;
    color: #a1a1a144;
    font-family: '212Sports', sans-serif;
    font-weight: normal;
}

.best-words-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.best-words-list {
    width: 30%;
    border-right: 1px solid #ccc;
    padding-right: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.word-group {
    margin-bottom: 15px;
}

.group-header {
    font-weight: bold;
    color: #FFD700;
    padding: 8px 5px;
    border-bottom: 2px solid #FFD700;
    margin-bottom: 8px;
    font-size: 14px;
}

.group-words {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.best-word-item {
    cursor: pointer;
    padding: 5px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.best-word-item.selected {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
}

.word-definition {
    width: 70%;
    padding-left: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tab-button {
    background: #0f3460;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.tab-button.active {
    background: #FFD700;
    color: #0f3460;
}

.tab-button:hover {
    transform: translateY(-2px);
}

.start-button {
    width: 100%; 
    text-align: center;
    margin: 20px 0 0 0;
}

.best-word .letter-card {
    animation: riseAndShine 0.5s ease-in-out forwards;
    background: #FFD700;
}

.diamond-word .letter-card {
    animation: riseAndShine 0.5s ease-in-out forwards;
    background: rgb(200, 230, 255);
}

.game-container {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1000px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes riseAndShine {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}


@keyframes rainbowBackground {
    0% { background-color: rgb(255, 81, 81); }
    14% { background-color: rgb(255, 194, 80); }
    28% { background-color: rgb(255, 255, 80); }
    42% { background-color: rgb(110, 200, 119); }
    57% { background-color: rgb(130, 207, 255); }
    71% { background-color: rgb(115, 106, 229); }
    85% { background-color: rgb(191, 103, 191); }
    100% { background-color: rgb(255, 80, 80); }
}

/* Let's make a super rainbow background, with diamond colors 
    so all colors should be a gradient between shades of diamond (bluette)
*/

@keyframes superRainbowBackground {
    0% { background-color: rgb(230, 245, 255); }
    14% { background-color: rgb(200, 230, 255); }
    28% { background-color: rgb(170, 215, 255); }
    42% { background-color: rgb(140, 200, 255); }
    57% { background-color: rgb(110, 185, 255); }
    71% { background-color: rgb(80, 170, 255); }
    85% { background-color: rgb(50, 155, 255); }
    100% { background-color: rgb(230, 245, 255); }
}

@keyframes diamondBackground {
    0% { background-color: rgb(200, 230, 255); }
    14% { background-color: rgb(169, 169, 255); }
    28% { background-color: rgb(176, 224, 230); }
    42% { background-color: rgb(173, 216, 230); }
    57% { background-color: rgb(240, 230, 200); }
    71% { background-color: rgb(255, 215, 0); }
    85% { background-color: rgb(200, 230, 255); }
    100% { background-color: rgb(200, 230, 255); }
}

@keyframes rainbowBackgroundClassy {
    0% { background-color: rgb(255, 255, 255); }
    14% { background-color: rgb(255, 253, 225); }
    28% { background-color: rgb(255, 251, 201); }
    42% { background-color: rgb(255, 249, 161); }
    57% { background-color: rgb(255, 245, 99); }
    71% { background-color: rgb(255, 244, 92); }
    85% { background-color: rgb(255, 227, 14); }
    100% { background-color: rgba(255, 238, 0, 1); }
}

.audio-toggle {
    border: none;
    color: #FFD700;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    top: 2px;
}

.restart-button {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    top: 2px;
    margin: 0;
    padding: 0 20px;
}

.top-toolbar {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.bar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-family: '212Sports', sans-serif;
    font-size: 22px;
    font-weight: normal;
}

.bar-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.disconnected-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    color: #e6e6e6;
}

.disconnected-screen h2 {
    margin-bottom: 20px;
}

.disconnected-screen button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
}

.disconnected-screen button:hover {
    transform: translateY(-2px);
}

.summary-score img {
    height: 29px;
    position: relative;
    top: 8px;
    left: 5px;
}

.kevin {
    --size: 170px;
    background: url('/images/kevin.png');
    width: var(--size);
    height: var(--size);
    background-size: cover;
    background-position: center;
    animation: dance 1.5s infinite ease-in-out;
}
  
  @keyframes dance {
    0% {
      transform: translate(0, 0) rotate(0deg);
    }
    12% {
      transform: translate(-10px, -10px) rotate(-5deg);
    }
    24% {
      transform: translate(0, 0) rotate(0deg);
    }
    36% {
      transform: translate(-10px, -10px) rotate(-5deg);
    }
    48% {
      transform: translate(0, 0) rotate(0deg);
    }
    60% {
      transform: translate(10px, -10px) rotate(5deg);
    }
    72% {
      transform: translate(0, 0) rotate(0deg);
    }
    84% {
      transform: translate(10px, -10px) rotate(5deg);
    }
    96% {
      transform: translate(0, 0) rotate(0deg);
    }
  }

.kevin-pyramid {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 81px;
    transform: translate(-50%, 0);
    left: 50%;
}

.kevin-row {
    display: flex;
    justify-content: center;
    padding: 5px 0;
}

.kevin {
    background-image: url('/images/kevin.png');
    background-size: cover;
    animation: dance 1.5s infinite ease-in-out;
}

.kevin-pyramid[size="big"] .kevin {
    --size: 170px;
}

.kevin-pyramid[size="normal"] .kevin {
    --size: 120px;
}

/* ---- Lobby ---- */

.lobby-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.lobby-title {
    font-family: '212Sports', sans-serif;
    font-weight: normal;
    font-size: 40px;
    margin: 0;
    color: #e6e6e6;
}

.lobby-greeting {
    color: #aaa;
    font-size: 14px;
}

.lobby-content {}

.lobby-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lobby-section-header h2 {
    margin: 0;
    font-size: 18px;
    color: #e6e6e6;
}

.lobby-empty {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    background: #11111e;
    border-radius: 10px;
    font-size: 15px;
}

.table-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.table-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #11111e;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #2a2a3e;
    gap: 12px;
}

.table-card-info {
    flex: 1;
    min-width: 0;
}

.table-card-name {
    font-size: 16px;
    font-weight: bold;
    color: #e6e6e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.table-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}

.tipo-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.tipo-normale {
    background: #2a3a2a;
    color: #7adb7a;
}

.tipo-expert {
    background: #1a1a3e;
    color: #aaaaff;
}

.lang-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    background: #2a2a2a;
    color: #ccc;
}

.player-count {
    color: #888;
}

/* Buttons */
.btn-primary {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-primary:disabled {
    background: #2a4a2a;
    color: #666;
    cursor: not-allowed;
}

.btn-secondary {
    background: #2a2a3e;
    color: #aaa;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #3a3a4e;
    color: #e6e6e6;
}

/* Create table form */
.create-table-form {
    background: #11111e;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #2a2a3e;
}

.create-table-form h2 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #e6e6e6;
}

.create-table-field {
    margin-bottom: 12px;
}

.create-table-field > label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.create-table-field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: #1a1a2e;
    color: #e6e6e6;
    border: 1px solid #3a3a5e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.create-table-field input[type="text"]:focus {
    border-color: #5d5fc0;
}

.game-display {
    padding: 10px 12px;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #888;
    font-size: 15px;
}

.tipo-options {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2a2a3e;
}

.tipo-option {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    background: #1a1a2e;
    border: none;
    border-right: 1px solid #2a2a3e;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    color: #aaa;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.tipo-option:last-child {
    border-right: none;
}

.tipo-option input[type="radio"],
.tipo-option input[type="checkbox"] {
    display: none;
}

.tipo-option.selected {
    background: #5d5fc0;
    color: #fff;
}

.create-table-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

/* Leave table button in TopBar */
.leave-table-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0 8px 0 0;
    line-height: 1;
    vertical-align: middle;
}

.leave-table-btn:hover {
    color: #e6e6e6;
}

/* ---- end Lobby ---- */

.kevin-pyramid[size="small"] .kevin {
    --size: 80px;
}

/* ---- Responsive (mobile) ---- */

@media (max-width: 540px) {
    body {
        padding: 8px;
    }

    .lobby-container {
        padding: 20px 12px 16px;
    }

    .lobby-title {
        font-size: 28px;
    }

    .lobby-header {
        margin-bottom: 18px;
    }

    .lobby-section-header h2 {
        font-size: 16px;
    }

    .create-table-form {
        padding: 16px;
    }

    /* Stack pill options vertically on small screens */
    .tipo-options {
        flex-direction: column;
    }

    .tipo-option {
        border-right: none;
        border-bottom: 1px solid #2a2a3e;
    }

    .tipo-option:last-child {
        border-bottom: none;
    }

    /* Stack form action buttons and make them full-width */
    .create-table-actions {
        flex-direction: column;
        gap: 8px;
    }

    .create-table-actions .btn-primary,
    .create-table-actions .btn-secondary {
        width: 100%;
        box-sizing: border-box;
        margin: 10px 0; 
        text-align: center;
        padding: 12px 18px;
    }

    .table-card {
        padding: 10px 12px;
        align-items: center;
    }

    .table-card .btn-primary {
        margin: 0;
        flex-shrink: 0;
    }
}

/* ---- Mobile game layout (phones — iPad portrait is 768px, so this targets phones only) ---- */
@media (max-width: 767px) {
    body {
        align-items: flex-start;
    }

    /* Take game container out of fixed positioning so the page can scroll */
    .game-container {
        position: relative;
        left: auto;
        transform: none;
        width: 100%;
        min-width: 0;
        height: auto;
        overflow: visible;
    }

    /* Top bar becomes independently fixed to the viewport */
    .top-bar {
        position: fixed;
    }

    /* Stack board + chat vertically instead of side-by-side; revert inner scroll (page scrolls instead) */
    .game-inner {
        flex-direction: column;
        min-height: auto;
        overflow-y: visible;
        overflow-x: visible;
        overscroll-behavior: auto;
    }

    /* Hide chat sidebar on phones — too cramped */
    .chat-sidebar {
        display: none;
    }

    /* Score panels: keep side-by-side but full-width and compact */
    .player-scoreboard {
        flex-direction: row;
    }

    .sidebar {
        flex: 1;
        width: auto;
        min-width: 0;
        padding: 12px;
    }

    /* Reduce main board padding */
    .main-content {
        padding: 15px;
    }
}

/* ===== Game layout: left column (scores + board) + right column (chat + voice) ===== */

.game-inner {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
    margin-top: 50px;
    padding: 12px 0 12px 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.game-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-sidebar {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.25s ease;
    width: 270px;
}

.chat-sidebar.closed {
    width: 20px;
}

.chat-sidebar-tab {
    width: 20px;
    min-width: 20px;
    align-self: center;
    height: 48px;
    background: #16213e;
    border: none;
    border-radius: 8px 0 0 8px;
    color: #aaa;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}

.chat-sidebar-tab:hover {
    background: #1e3060;
    color: #FFD700;
}

.game-right {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Chat panel ===== */

.chat-panel {
    background: #16213e;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.chat-panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #0f3460 transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 2px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    background: #0f3460;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    word-break: break-word;
}

.chat-message[data-own="true"] {
    background: #1a3a5c;
    border-left: 2px solid #FFD700;
}

.chat-sender {
    font-weight: 700;
    font-size: 11px;
    color: #aaa;
}

.chat-message[data-own="true"] .chat-sender {
    color: #FFD700;
}

.chat-text {
    margin-top: 2px;
    color: #e6e6e6;
}

.chat-time {
    font-size: 10px;
    color: #666;
    align-self: flex-end;
    margin-top: 2px;
}

.chat-input-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: #0f3460;
    border: 1px solid #2a4a7f;
    border-radius: 8px;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Rubik', sans-serif;
    width: auto;
    max-width: none;
    margin: 0;
}

.chat-input:focus {
    outline: none;
    border-color: #FFD700;
}

.chat-send-btn {
    background: #FFD700;
    color: #0f3460;
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    background: #ffe033;
}

/* ===== Voice panel ===== */

.voice-panel {
    background: #16213e;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 15px;
    flex-shrink: 0;
}

.voice-panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.voice-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.voice-toggle-btn {
    background: #0f3460;
    color: #e6e6e6;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
    transition: background 0.2s;
    flex: 1;
}

.voice-toggle-btn.active {
    background: #c0392b;
}

.voice-toggle-btn:hover {
    transform: translateY(-1px);
}

.voice-mute-btn {
    background: #0f3460;
    color: #e6e6e6;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
}

.voice-mute-btn.muted {
    background: #e67e22;
}

.voice-mute-btn:hover {
    transform: translateY(-1px);
}

.voice-player-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.voice-player-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #e6e6e6;
}

.speaking-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
    transition: background 0.1s;
}

.speaking-indicator.speaking {
    background: #2ecc71;
    animation: pulse-speaking 0.8s ease-in-out infinite;
}

@keyframes pulse-speaking {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.voice-muted-badge,
.voice-connecting-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.voice-muted-badge {
    background: #e67e22;
    color: #fff;
}

.voice-connecting-badge {
    background: #555;
    color: #aaa;
}

.create-table-actions .btn-primary,
.create-table-actions .btn-secondary {
    margin: 10px 0 !important;
    width: 200px;
}

/* ---- Stats page ---- */

.stats-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 12px 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-back-btn {
    flex-shrink: 0;
}

.stats-title {
    font-family: '212Sports', sans-serif;
    font-weight: normal;
    font-size: 36px;
    margin: 0;
    color: #e6e6e6;
}

.stats-lang-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.stats-loading,
.stats-error {
    text-align: center;
    color: #888;
    padding: 40px 20px;
    font-size: 15px;
}

.stats-error {
    color: #e74c3c;
}

.stats-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #2a2a3e;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.stats-th {
    background: #11111e;
    color: #888;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 9px 8px;
    text-align: center;
    border-bottom: 2px solid #2a2a3e;
    cursor: default;
}

.stats-th-rank {
    width: 36px;
}

.stats-th-player {
    text-align: left;
}

.stats-th-gold {
    color: #FFD700;
}

.stats-th-diamond {
    color: #aaaaff;
}

.stats-row {
    transition: background 0.1s;
}

.stats-row-even {
    background: #0d0d1a;
}

.stats-row:hover {
    background: #16213e;
}

.stats-td {
    padding: 8px 8px;
    text-align: center;
    color: #ccc;
    border-bottom: 1px solid #1e1e2e;
}

.stats-td-rank {
    font-size: 16px;
    color: #888;
}

.stats-td-player {
    text-align: left;
    font-weight: 600;
    color: #e6e6e6;
}

.stats-td-gold {
    color: #FFD700;
    font-weight: 600;
}

.stats-td-diamond {
    color: #aaaaff;
    font-weight: 600;
}

/* Trophy button in lobby header */
.lobby-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.stats-trophy-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s, transform 0.15s;
}

.stats-trophy-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: none;
}

/* ---- end Stats page ---- */