/* --- VARIABLES & RESET --- */
:root {
    --bg-gradient: radial-gradient(circle at center, #592e8d 0%, #23084d 100%);
    --bg-dark: #23084d;
    --bg-panel: #341269;
    --primary-btn: #389387;
    --primary-hover: #2c7a70;
    --blue-btn: #2c6cd1;
    --green-btn: #3e8e60;
    --red-btn: #c2185b;
    --red-hover: #ad1450;
    --text-light: #ffffff;
    --text-gray: #dcdcdc;
    --font-main: 'Poppins', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: transparent;
    min-height: 100vh;
}

body {
    font-family: var(--font-main);
    background: transparent;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    background-image: url('bg-halftone.png'), var(--bg-gradient);
    background-size: cover, 100% 100%;
    background-position: center;
    background-blend-mode: luminosity; /* L'image garde son motif mais prend EXACTEMENT la couleur du dégradé (sans aucun bleu) */
    opacity: 0.8; /* Adoucit un peu l'effet */
    z-index: -10000;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* --- UTILITAIRES BOUTONS & INPUTS --- */
button {
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    opacity: 0.8;
    transform: scale(0.98);
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: none;
    margin-bottom: 15px;
    font-size: 1rem;
}

.error-text {
    color: #ff6b6b;
    font-weight: 900;
    margin-top: 15px;
    text-align: center;
    width: 100%;
}

/* --- ECRAN 1 : LOGIN (NEW DA) --- */
.main-container {
    width: fit-content; /* S'adapte parfaitement à la taille de la box violette */
    min-width: 320px;
    max-width: 98vw;
    background: linear-gradient(to bottom right, #5169bd, #743e91);
    border-radius: 40px;
    padding: 140px 40px 60px 40px; 
    margin-top: 10px; /* Remonté encore plus haut */
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    border: 3px solid white;
    position: relative;
}

.login-logo {
    position: absolute;
    top: -100px; /* Remonté un peu */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    z-index: 10;
}

.main-logo {
    max-height: 300px; /* Réduit un peu en taille */
    width: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.lobby-logo-img {
    max-height: 220px;
}

.footer-container {
    position: absolute; 
    bottom: 25px; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    align-items: center; 
    gap: 25px; 
    z-index: 10; 
    width: max-content;
}

.panels-wrapper {
    display: flex;
    flex-direction: row; /* Côte à côte */
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.login-tabs {
    display: flex;
    width: 100%;
    z-index: 10;
    position: relative;
    padding: 0;
    gap: 0;
}

.login-tab {
    flex: 1;
    text-align: center;
    background: rgba(0,0,0,0.2);
    border: 3px solid white;
    border-bottom: 3px solid white;
    padding: 12px 10px;
    font-size: 1.4rem;
    font-weight: 900;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-tab:first-child {
    border-radius: 40px 0 0 0;
    border-right: none;
}

.login-tab:last-child {
    border-radius: 0 40px 0 0;
}

.login-tab:hover {
    background: rgba(255,255,255,0.1);
}

.login-tab.active {
    background: #341269; /* Match login panel */
    border-bottom-color: #341269; /* Creates the seamless opening into the panel */
    color: #4affb0;
    z-index: 10;
}

.login-panel {
    background: #341269;
    border: 3px solid white;
    border-top: none; /* Tabs act as the top border */
    border-radius: 0 0 40px 40px; /* Tabs act as the top corners */
    padding: 40px 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.v-divider {
    width: 2px;
    height: 200px;
    background: rgba(255,255,255,0.1);
}

.panel-info {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Restored beautiful breathing room for premium layout balance */
    width: 400px;
    max-width: 100%;
    flex: 1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 900;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
}

.btn-full-da {
    width: 100% !important;
    justify-content: center;
}

.h-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-weight: 900;
    font-size: 0.9rem;
}

.h-divider::before, .h-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.h-divider span {
    padding: 0 15px;
}

.join-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.code-input {
    width: 200px !important;
}



.avatar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.avatar-nav-row {
    display: flex;
    gap: 20px;
}

.avatar-circle {
    width: 200px; /* On agrandit l'avatar */
    height: 200px;
    background: black;
    border: 5px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7rem; /* On augmente la taille de l'emoji */
    box-shadow: 0 0 35px rgba(74, 255, 176, 0.4);
}

.avatar-arrow {
    width: 50px;
    height: 50px;
    background: white;
    color: #341269;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.avatar-arrow:hover {
    transform: scale(1.1);
    background: #4affb0;
}

.avatar-arrow:active {
    transform: scale(0.95);
}

.da-input {
    background: rgba(255,255,255,0.2) !important;
    border: 3px solid rgba(255,255,255,0.5) !important;
    border-radius: 15px !important;
    padding: 0 20px !important; /* On enlève le padding vertical pour laisser le height gérer */
    height: 65px !important; /* On augmente la taille */
    width: 100% !important;
    color: white !important;
    font-weight: 900 !important;
    font-size: 1.8rem !important;
    text-align: left !important;
    margin: 0 !important; /* On force le retrait de toute marge générique */
    transition: all 0.2s;
    text-transform: uppercase;
    box-sizing: border-box;
}
.da-input::placeholder {
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
}

.da-button {
    background: white;
    border: 3px solid #1a083a;
    border-radius: 12px;
    color: #1a083a;
    font-weight: 900;
    font-size: 1.5rem; /* Plus gros */
    padding: 0 30px; 
    height: 65px; /* Même hauteur */
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.1s;
    width: fit-content;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

/* --- BOUTON RETOUR LOBBY FLOTTANT PREMIUM --- */
#leave-room-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid #1a083a;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s, color 0.2s;
    font-size: 1.8rem;
    font-weight: 900;
    color: #1a083a;
    padding: 0 3px 4px 0; /* Tiny visual offset adjustment to center the '<' perfectly */
    margin: 0;
}
#leave-room-btn:hover {
    background-color: #ff6b6b;
    color: white;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.15);
}
#leave-room-btn:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.da-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.2);
}
.da-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}
.btn-icon {
    color: #4affb0;
    font-size: 1.8rem;
    transform: translateY(-2px); /* On remonte légèrement l'icône flèche */
}



.right-panel-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* --- ECRAN 2 : LOBBY --- */
.lobby-title {
    font-family: 'Bungee', sans-serif;
    font-size: 3rem;
    color: #ffb142;
    text-shadow: -2px -2px 0 #1a083a, 2px -2px 0 #1a083a, -2px 2px 0 #1a083a, 2px 2px 0 #1a083a, 0 8px 0 #1a083a;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.game-title {
    font-family: 'Bungee', sans-serif;
    color: #ffb142;
    text-shadow: -2px -2px 0 #1a083a, 2px -2px 0 #1a083a, -2px 2px 0 #1a083a, 2px 2px 0 #1a083a, 0 8px 0 #1a083a;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.vote-results-title {
    font-size: 3rem;
}

.final-results-title {
    font-size: 3rem;
}

.code-bubble {
    color: white;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.5);
    padding: 5px 15px;
    border-radius: 15px;
    user-select: none;
    transition: background 0.2s, transform 0.1s;
    display: inline-block;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.code-bubble:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}
.code-bubble:active {
    transform: scale(0.95);
}

/* --- SWITCH STREAMER MODE --- */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}
input:checked + .slider {
  background-color: #4affb0;
}
input:focus + .slider {
  box-shadow: 0 0 1px #4affb0;
}
input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

#screen-lobby {
    width: 800px !important;
    max-width: 98vw !important;
    padding: 25px !important;
    margin-top: 30px !important; /* Slightly smaller top margin since no logo */
}

.lobby-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 900;
    font-style: italic;
    color: #4affb0;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        -3px -3px 0 #1a083a,  
         3px -3px 0 #1a083a,
        -3px  3px 0 #1a083a,
         3px  3px 0 #1a083a,
         0px  8px 0px #1a083a,
         0px 15px 25px rgba(0,0,0,0.6);
}

.lobby-container {
    display: flex;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.settings-panel {
    flex: 1;
    background-color: var(--bg-panel);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.3);
}

.settings-panel h3 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 900;
    color: #4affb0;
    text-shadow: -1px -1px 0 #1a083a, 1px -1px 0 #1a083a, -1px 1px 0 #1a083a, 1px 1px 0 #1a083a, 0 4px 0 #1a083a;
    font-size: 1.8rem;
    text-transform: uppercase;
}

.setting-row {
    margin-bottom: 20px;
    text-align: center;
}

.setting-row label {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    color: rgba(255,255,255,0.8);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.number-input {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto;
    padding: 5px;
    border: 2px solid rgba(255,255,255,0.2);
}

.number-input button {
    background: white;
    color: var(--bg-panel);
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.number-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}

.number-input button:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.number-input input {
    background: transparent !important;
    color: white !important;
    border: none !important;
    width: 60px !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    padding: 0 !important;
    margin: 0 10px !important;
}

.players-panel {
    flex: 1;
    background-color: var(--bg-panel);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.3);
}

.players-panel h3 {
    margin-bottom: 20px;
    text-align: center;
    font-weight: 900;
    color: #4affb0;
    text-shadow: -1px -1px 0 #1a083a, 1px -1px 0 #1a083a, -1px 1px 0 #1a083a, 1px 1px 0 #1a083a, 0 4px 0 #1a083a;
    font-size: 1.8rem;
    text-transform: uppercase;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding: 5px 8px 15px 5px;
}

#lobby-game-selection {
    max-height: 480px;
    overflow-y: auto;
    padding: 5px 8px 15px 5px;
}

/* Custom premium scrollbar for player list and game selection */
.player-list::-webkit-scrollbar, #lobby-game-selection::-webkit-scrollbar {
    width: 8px;
}
.player-list::-webkit-scrollbar-track, #lobby-game-selection::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.player-list::-webkit-scrollbar-thumb, #lobby-game-selection::-webkit-scrollbar-thumb {
    background: rgba(74, 255, 176, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
}
.player-list::-webkit-scrollbar-thumb:hover, #lobby-game-selection::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 255, 176, 0.6);
}

.player-filled {
    background-color: #f0eaf5;
    border: 3px solid white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 5px 15px;
    height: 60px;
    box-shadow: 0 4px 0 rgba(255,255,255,0.3);
}

.player-filled .avatar-circle-small {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #1a083a;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    margin-right: 15px;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1);
}

.player-filled .player-name {
    flex-grow: 1;
    text-align: left;
    font-weight: 900;
    color: #1a083a;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.player-filled .crown-icon {
    background: #8c52ff;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    border: 2px solid white;
}

.player-empty {
    background-color: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 5px 15px;
    height: 60px;
}

.player-empty .avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    color: rgba(255,255,255,0.2);
    font-size: 1.8rem;
}

.player-empty .empty-text {
    font-weight: 900;
    color: rgba(255,255,255,0.2);
    font-size: 1.2rem;
}

.lobby-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-green {
    background-color: var(--green-btn);
    padding: 10px 30px;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* --- ECRAN 3 : JEU --- */
#screen-game {
    width: 1000px;
    max-width: 95vw;
    text-align: center;
}

.game-header {
    margin-bottom: 30px;
    min-height: 110px;
    height: auto;
}

.game-header h2 {
    color: #d1f2a5;
    font-size: 2rem;
    margin-bottom: 5px;
}

.game-header p {
    font-size: 1.2rem;
}

#timer-display {
    font-size: 1.5rem;
    color: #ffb142;
    font-weight: bold;
    margin-top: 5px;
}

.time-warning {
    color: var(--red-btn) !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.game-board {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.player-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    transition: opacity 0.3s;
}

.player-column .role-text {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.player-column .name-text {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.player-column .avatar {
    font-size: 3.5rem;
    transition: all 0.3s;
}

.word-slots {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.word-slot {
    background-color: #6a5a78;
    height: auto;
    min-height: 35px;
    padding: 6px 8px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    word-break: break-all;
    line-height: 1.1;
    text-align: center;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.action-area {
    margin-top: 40px;
    background-color: var(--bg-panel);
    padding: 20px;
    border-radius: 10px;
}

.action-area input {
    width: 50%;
    margin-bottom: 0;
    margin-right: 10px;
}

.action-area button {
    padding: 12px 25px;
    background-color: var(--primary-btn);
}

.vote-board-btn {
    background-color: var(--red-btn);
    color: white;
    border: 3px solid transparent;
    padding: 8px 15px;
    border-radius: 8px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: 900;
    width: 100%;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #8c1042;
    text-transform: uppercase;
}
.vote-board-btn:hover { 
    background-color: var(--red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #8c1042;
}
.vote-board-btn.btn-selected {
    background-color: var(--green-btn) !important;
    border-color: white !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 0 #1e5a36, 0 0 15px rgba(74, 255, 176, 0.4);
}

.active-turn .avatar {
    box-shadow: 0 0 20px #d1f2a5;
    border-radius: 50%;
    background-color: #d1f2a5;
    transform: scale(1.1);
}

/* --- ECRAN 4 : VOTE --- */
#screen-vote {
    width: 800px;
    max-width: 95vw;
    text-align: center;
}

#screen-vote h1 {
    color: #ffb142;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

#vote-instruction {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.vote-card {
    background-color: var(--bg-panel);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.vote-card:hover {
    border-color: var(--red-btn);
    background-color: #725a7c;
    transform: translateY(-5px);
}

.vote-card .avatar {
    font-size: 4rem;
    margin-bottom: 10px;
}

.vote-card .name {
    font-weight: bold;
    font-size: 1.2rem;
}

/* Résultats de vote */
.vote-results-container {
    background-color: var(--bg-panel);
    padding: 40px;
    border-radius: 25px;
    border: 3px solid white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    margin-top: 20px;
}

.vote-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    text-align: left;
    display: inline-block;
}

.vote-list li {
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-list .voter-avatar {
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 50%;
}

.arrow {
    color: var(--red-btn);
    font-weight: bold;
}

.target-name {
    color: #d1f2a5;
    font-weight: bold;
}

.eliminated-announcement {
    font-size: 1.8rem;
    color: var(--red-btn);
    font-weight: bold;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

@keyframes zoomPulse {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    30% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes revealBounce {
    0% {
        transform: scale(0.3) rotate(-8deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) rotate(3deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes revealFlyToHeader {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(0.2) translateY(-400px);
        opacity: 0;
        filter: blur(5px);
    }
}

@keyframes headerGlowIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
        text-shadow: 0 0 0 rgba(74, 255, 176, 0);
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
        text-shadow: 0 0 30px rgba(74, 255, 176, 0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        text-shadow: 0 0 8px rgba(74, 255, 176, 0.4);
    }
}

/* --- MOBILE RESPONSIVENESS & STYLING IMPROVEMENTS --- */
@media (max-width: 992px) {
    /* Main body layout and screen scaling */
    body {
        padding: 10px;
        padding-bottom: 30px;
        align-items: flex-start;
        min-height: auto;
    }

    /* Screen login adjustments */
    .main-container {
        margin-top: 0px !important;
        border-radius: 20px !important;
        width: 96vw !important;
        max-width: 96vw !important;
        box-sizing: border-box !important;
    }
    
    #screen-login {
        padding: 5px 10px 60px 10px !important;
    }
    
    #screen-lobby {
        padding: 5px 10px 60px 10px !important;
    }
    
    .login-logo {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        margin-bottom: 5px !important;
        margin-top: 0px !important;
        width: 100% !important;
        overflow: hidden !important;
        text-align: center !important;
    }
    
    .main-logo {
        max-height: 280px !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .lobby-logo-img {
        max-height: 140px !important;
    }
    
    .login-panel {
        flex-direction: column !important;
        padding: 15px 15px !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    .panel-info {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .input-group, .h-divider, .join-group, .btn-full-da {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important; /* Force center alignment */
    }
    
    .footer-container {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        flex-direction: column !important;
        gap: 15px !important;
        margin-top: 20px !important;
        padding-bottom: 20px !important;
        align-items: center !important;
        width: 100% !important;
        justify-content: center !important;
    }
    
    .footer-container > div {
        justify-content: center !important;
        width: 100% !important;
    }
    
    .footer-container > div:nth-child(2) {
        display: none; /* Hide the vertical separator between links and icons */
    }
    
    .v-divider {
        display: none !important; /* Hide vertical divider in stacked layout */
    }

    .join-group {
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }
    
    .join-group input {
        width: 100% !important;
    }

    .join-group button {
        width: 100% !important;
    }
    
    /* Lobby screen and its components */
    #screen-lobby {
        width: 100% !important;
        padding: 15px !important;
    }

    .lobby-container {
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }
    
    .settings-panel, .players-panel {
        width: 100% !important;
    }

    .lobby-actions {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: center !important;
    }

    .lobby-actions button {
        width: 100% !important;
        max-width: 320px !important;
    }
    
    /* Game screen board adjustments */
    #screen-game {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
    }

    .game-header h2 {
        font-size: 1.5rem !important;
        text-align: center !important;
    }

    .game-header p {
        font-size: 1rem !important;
        text-align: center !important;
    }

    .game-board {
        gap: 12px 8px !important;
        justify-content: center !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    .player-column {
        width: 95px !important; /* Fit 3 player cards on mobile screens side by side */
    }
    
    .player-column .avatar {
        font-size: 2.8rem !important;
    }
    
    .player-column .name-text {
        font-size: 0.9rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 90px !important;
    }
    
    .word-slot {
        font-size: 0.72rem !important;
        min-height: 28px !important;
        padding: 3px 5px !important;
    }

    /* Action typing turn area */
    .action-area {
        padding: 15px !important;
        margin-top: 25px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .action-area h3 {
        font-size: 1.2rem !important;
        text-align: center !important;
    }

    .action-area div {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .action-area input {
        width: 100% !important;
        margin-right: 0 !important;
        height: 55px !important;
        font-size: 1.2rem !important;
    }
    
    .action-area button {
        width: 100% !important;
        height: 55px !important;
        font-size: 1.2rem !important;
    }
    
    /* Vote and Podium screen */
    #screen-vote {
        width: 100% !important;
        padding: 10px !important;
    }

    #screen-vote h1 {
        font-size: 1.8rem !important;
    }
    
    #screen-final-results {
        width: 100% !important;
        padding: 10px !important;
    }

    #screen-final-results h1 {
        font-size: 2.2rem !important;
    }

    #screen-final-results > div {
        padding: 20px !important;
    }

    /* Keep exit button neatly positioned without overlapping key titles */
    #leave-room-btn {
        top: 12px !important;
        left: 12px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1.3rem !important;
    }
    
    #quit-confirm-modal > div {
        padding: 25px 20px !important;
        width: 92vw !important;
    }
    
    /* Voter cards grid layout */
    #vote-candidates {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .vote-card {
        padding: 15px 10px !important;
    }
    
    .vote-card .avatar {
        font-size: 3rem !important;
    }
    
    .vote-card .name {
        font-size: 1rem !important;
    }

    .vote-results-container {
        padding: 15px !important;
    }

    .da-button {
        width: 100% !important;
        max-width: 320px !important;
        font-size: 1.15rem !important;
        height: 55px !important;
        padding: 0 15px !important;
    }

    .btn-icon {
        font-size: 1.3rem !important;
        transform: none !important;
    }

    .lobby-title {
        font-size: 2.2rem !important;
    }

    .vote-results-title, .final-results-title {
        font-size: 2rem !important;
    }

    /* --- SKRIBBL MOBILE RESPONSIVE LAYOUTS --- */
    #screen-game-dessinexpress {
        width: 100% !important;
        max-width: 100% !important;
        gap: 15px !important;
        padding-bottom: 65px !important; /* Space for the highly compact mobile guess input */
    }
    
    #screen-game-dessinexpress .game-header {
        padding: 10px 15px !important;
        border-radius: 15px !important;
    }
    
    #dessinexpress-round-indicator {
        font-size: 1rem !important;
    }
    
    #dessinexpress-word-display {
        font-size: 1.5rem !important;
        letter-spacing: 3px !important;
    }
    
    #dessinexpress-timer-display {
        font-size: 1.15rem !important;
        padding: 3px 12px !important;
    }
    
    /* Stack panels vertically on mobile */
    #screen-game-dessinexpress > div[style*="display: flex"] {
        flex-direction: column !important;
        height: auto !important;
        gap: 15px !important;
    }
    
    /* 1. Players Panel: Horizontal scrollable strip */
    #screen-game-dessinexpress .players-panel, #screen-lobby .players-panel {
        width: 100% !important;
        height: auto !important;
        padding: 10px 15px !important;
        border-radius: 15px !important;
    }
    
    #screen-game-dessinexpress .players-panel h3, #screen-lobby .players-panel h3 {
        margin-bottom: 8px !important;
        font-size: 1.1rem !important;
        text-align: center !important;
    }
    
    #dessinexpress-player-list, #lobby-players {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
        padding-bottom: 8px !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    #dessinexpress-player-list > div {
        flex-shrink: 0 !important;
        width: 135px !important;
        margin-bottom: 0 !important;
        padding: 6px 10px !important;
        border-radius: 12px !important;
        gap: 6px !important;
    }
    
    #dessinexpress-player-list .dessinexpress-avatar-wrapper {
        width: 32px !important;
        height: 32px !important;
    }
    
    #dessinexpress-player-list .dessinexpress-avatar-wrapper span {
        font-size: 1.1rem !important;
    }
    
    #dessinexpress-player-list .player-name-text {
        font-size: 0.8rem !important;
    }
    
    #dessinexpress-player-list div[style*="font-size: 1.15rem"] {
        font-size: 0.9rem !important;
    }
    
    /* 2. Center Panel: Aspect-ratio scaled Canvas and Toolbar */
    #screen-game-dessinexpress .dessinexpress-canvas-panel {
        min-width: 100% !important;
        width: 100% !important;
        border-radius: 15px !important;
    }
    
    #screen-game-dessinexpress div[style*="flex-grow: 1; background: white"] {
        height: auto !important;
    }
    
    #screen-game-dessinexpress div[style*="position: relative; flex-grow: 1; background: white"] {
        width: 100% !important;
        aspect-ratio: 800/520 !important; /* Perfect 1:1 ratio lock prevents stretch distortion! */
        height: auto !important;
    }
    
    #dessinexpress-canvas, #gp-canvas {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* 3. Mobile Compact Drawing Toolbar — 2 clean rows */
    #dessinexpress-toolbar,
    #gp-toolbar {
        height: auto !important;
        min-height: 0 !important;
        padding: 8px 10px !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        row-gap: 8px !important;
    }

    /* Row 1: tools pill + color + slider all on one line */
    #dessinexpress-toolbar > div:nth-child(1),
    #gp-toolbar > div:nth-child(1) {
        order: 1 !important;
        flex-shrink: 0 !important;
    }
    #dessinexpress-toolbar > div:nth-child(2),
    #gp-toolbar > div:nth-child(2) {
        order: 2 !important;
        flex-shrink: 0 !important;
    }
    /* Slider: take remaining space on row 1 */
    #dessinexpress-toolbar > div:nth-child(3),
    #gp-toolbar > div:nth-child(3) {
        order: 3 !important;
        flex: 1 1 120px !important;
        min-width: 100px !important;
        max-width: 180px !important;
    }
    /* Row 2: action buttons pill spans full width */
    #dessinexpress-toolbar > div:nth-child(4),
    #gp-toolbar > div:nth-child(4) {
        order: 4 !important;
        flex: 1 1 100% !important;
        justify-content: center !important;
        display: flex !important;
    }

    /* Slim down buttons a touch */
    #dessinexpress-toolbar .dessinexpress-tool-btn,
    #gp-toolbar .dessinexpress-tool-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* Slim down color circle */
    #dessinexpress-color-trigger,
    #gp-color-trigger {
        width: 40px !important;
        height: 40px !important;
    }

    /* Hide EPAISSEUR label text to save space, keep slider */
    #dessinexpress-toolbar span[style*="ÉPAISSEUR"],
    #dessinexpress-toolbar span[style*="EPAISSEUR"],
    #gp-toolbar span[style*="ÉPAISSEUR"],
    #gp-toolbar span[style*="EPAISSEUR"] {
        display: none !important;
    }

    #dessinexpress-color-popover, #dessinexpress-shape-popover,
    #gp-color-popover, #gp-shape-popover {
        bottom: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        bottom: 60px !important;
    }
    
    /* 4. Chat Panel styling */
    #screen-game-dessinexpress .dessinexpress-chat-panel {
        width: 100% !important;
        height: 300px !important;
        border-radius: 15px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }
    
    /* 5. Floating Mobile Chat Input Bar (pins input to bottom, drawer hides it with .hidden) */
    #dessinexpress-input-container:not(.hidden) {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: linear-gradient(180deg, rgba(26, 8, 58, 0.95) 0%, rgba(13, 4, 30, 0.98) 100%) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        padding: 8px 12px !important; /* Extremely compact vertical padding */
        border-top: 2px solid rgba(255, 255, 255, 0.15) !important;
        z-index: 2000 !important;
        box-sizing: border-box !important;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6) !important;
        display: flex !important;
        gap: 6px !important;
    }
    
    /* Make both input and button much smaller and space-saving on mobile */
    #dessinexpress-input-container:not(.hidden) input {
        height: 38px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
        padding: 0 12px !important;
    }
    
    #dessinexpress-input-container:not(.hidden) button {
        height: 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        font-size: 0.85rem !important;
        border-radius: 10px !important;
    }
}

@media (max-width: 480px) {
    /* Narrow viewports like iPhone SE / Mini */
    .player-column {
        width: 82px !important;
    }
    
    .player-column .avatar {
        font-size: 2.3rem !important;
    }
    
    .player-column .name-text {
        font-size: 0.8rem !important;
        max-width: 78px !important;
    }
    
    .main-logo {
        max-height: 220px !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    .main-container {
        padding: 10px !important;
    }

    #timer-display {
        font-size: 1.2rem !important;
    }
}

/* --- IMAGE AVATAR STYLES --- */
.avatar-img-selector {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-circle-small img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.player-column .avatar img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.vote-card .avatar img {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.avatar-img-podium {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid #ffb142;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    margin-top: 10px;
}

.avatar-img-results {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.avatar-img-scoreboard {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    vertical-align: middle;
}

.voter-pill-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

/* Mobile responsive fixes for avatar images */
@media (max-width: 480px) {
    .player-column .avatar img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* --- GLOBAL SETTINGS BUTTON --- */
#global-settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #341269;
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    z-index: 9999;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    user-select: none;
    padding-bottom: 2px;
}

#global-settings-btn:hover {
    transform: scale(1.1) rotate(45deg);
    background: #8c52ff;
    box-shadow: 0 0 25px rgba(140, 82, 255, 0.6);
}

#global-settings-btn:active {
    transform: scale(0.9);
}

/* Floating Leave Room Button */
#leave-room-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: #ff6b6b;
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
    z-index: 9999;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    user-select: none;
}

#leave-room-btn:hover {
    transform: scale(1.1);
    background: #ff4757;
    box-shadow: 0 0 25px rgba(255, 71, 87, 0.8);
}

#leave-room-btn:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {
    #global-mute-btn {
        top: 12px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }
    #leave-room-btn {
        top: 12px !important;
        left: 12px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }
}

/* --- GAME SELECTOR & SETTINGS STYLES --- */
.game-card-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    user-select: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.game-card-selector:hover {
    transform: translateY(-4px);
    border-color: #ffb142;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 30px rgba(255, 177, 66, 0.22);
}

.game-card-selector .game-icon {
    font-size: 2.5rem;
    background: rgba(0, 0, 0, 0.25);
    width: 65px;
    height: 65px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.game-card-selector .game-info {
    flex-grow: 1;
}

.game-card-selector .game-name {
    font-family: 'Bungee', sans-serif;
    font-size: 1.15rem;
    color: white;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.game-card-selector .game-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

/* Back button in settings */
.btn-settings-back {
    margin-top: 25px;
    width: 100% !important;
    height: 52px !important;
    font-size: 1.15rem !important;
    border-radius: 15px !important;
}

/* --- SKRIBBL SPECIFIC STYLES --- */
.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    transform: scale(1.2);
    border-color: white !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.size-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.size-swatch:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.size-swatch.active {
    background: #ffb142;
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255, 177, 66, 0.4);
}

/* DessinExpress chat bubble styles */
.dessinexpress-msg {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.95rem;
    color: white;
    word-break: break-word;
    border-left: 3px solid rgba(255, 255, 255, 0.2);
}

.dessinexpress-msg-system {
    background: rgba(255, 177, 66, 0.15);
    border-left: 3px solid #ffb142;
    color: #ffb142;
    font-weight: bold;
}

.dessinexpress-msg-success {
    background: rgba(74, 255, 176, 0.15);
    border-left: 3px solid #4affb0;
    color: #4affb0;
    font-weight: 900;
}

.dessinexpress-msg-close {
    background: rgba(255, 107, 107, 0.15);
    border-left: 3px solid #ff6b6b;
    color: #ff6b6b;
    font-weight: bold;
}

.dessinexpress-msg-guess {
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
}

.dessinexpress-msg-chat-solver {
    background: rgba(140, 82, 255, 0.12);
    border-left: 3px solid #8c52ff;
    color: #cca3ff;
    font-weight: bold;
}

/* --- SKRIBBL PREMIUM PLAYER CARD STYLING --- */
.dessinexpress-player-card {
    background: rgba(255, 255, 255, 0.06);
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.dessinexpress-player-card.is-drawer {
    border-color: #ffb142;
    background: rgba(255, 177, 66, 0.15);
    box-shadow: 0 0 15px rgba(255, 177, 66, 0.25);
}

.dessinexpress-player-card.is-guessed {
    border-color: #4affb0;
    background: rgba(74, 255, 176, 0.15);
    box-shadow: 0 0 15px rgba(74, 255, 176, 0.25);
}

.dessinexpress-avatar-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid white;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1);
}

.dessinexpress-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dessinexpress-avatar-wrapper span {
    font-size: 1.6rem;
    line-height: 1;
}

.dessinexpress-player-card .player-info-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.dessinexpress-player-card .player-name-text {
    font-weight: bold;
    font-size: 1.05rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dessinexpress-player-card .player-points-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
}

/* --- SKRIBBL PREMIUM DRAWING BUTTONS --- */
.dessinexpress-tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dessinexpress-tool-btn:hover {
    transform: scale(1.15) translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}
.dessinexpress-tool-btn:active {
    transform: scale(0.9) !important;
}
.dessinexpress-tool-btn.active {
    background: #ffb142 !important;
    box-shadow: 0 4px 12px rgba(255, 177, 66, 0.4);
    transform: scale(1.1) rotate(-5deg);
}

.dessinexpress-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}
.dessinexpress-action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
.dessinexpress-action-btn:active {
    transform: translateY(2px);
    box-shadow: none !important;
}

/* --- SKRIBBL COLOR POPUP SWATCHES --- */
.color-swatch-popover {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}
.color-swatch-popover:hover {
    transform: scale(1.2) translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
    z-index: 5;
}
.color-swatch-popover:active {
    transform: scale(0.9) !important;
}
.color-swatch-popover.active {
    border-color: #ffb142 !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 4px 10px rgba(0,0,0,0.5) !important;
    transform: scale(1.15);
}

/* --- SKRIBBL SHAPE SELECTOR --- */
.shape-swatch-popover {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.15s ease;
    outline: none;
}
.shape-swatch-popover:hover {
    transform: scale(1.2) translateY(-2px) !important;
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.5) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 5;
}
.shape-swatch-popover:active {
    transform: scale(0.9) !important;
}
.shape-swatch-popover.active {
    background: #ffb142 !important;
    border-color: white !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 4px 10px rgba(0,0,0,0.5) !important;
    transform: scale(1.15);
}

/* --- RESPONSIVE SETTINGS MODAL & INVITATION --- */
.settings-invite-row {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .settings-modal-content {
        padding: 20px 15px !important;
        border-radius: 20px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
    
    .settings-invite-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    #settings-room-code-display {
        width: 100% !important;
        font-size: 1.1rem !important;
        padding: 8px !important;
    }
    
    #settings-invite-copy-btn {
        width: 100% !important;
        margin: 0 !important;
        height: 40px !important;
        font-size: 0.9rem !important;
    }
}

/* Custom premium scrollbars for all game scrollable panels */
#dessinexpress-end-scores::-webkit-scrollbar {
    width: 6px;
}
#dessinexpress-end-scores::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}
#dessinexpress-end-scores::-webkit-scrollbar-thumb {
    background: rgba(255, 177, 66, 0.35); /* Curated gold/orange color to match the overlay theme */
    border-radius: 10px;
}
#dessinexpress-end-scores::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 177, 66, 0.65);
}

#dessinexpress-chat-feed::-webkit-scrollbar {
    width: 6px;
}
#dessinexpress-chat-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}
#dessinexpress-chat-feed::-webkit-scrollbar-thumb {
    background: rgba(140, 82, 255, 0.3); /* Purple accent */
    border-radius: 10px;
}
#dessinexpress-chat-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 82, 255, 0.6);
}

#chat-feed::-webkit-scrollbar {
    width: 6px;
}
#chat-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}
#chat-feed::-webkit-scrollbar-thumb {
    background: rgba(140, 82, 255, 0.3);
    border-radius: 10px;
}
#chat-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 82, 255, 0.6);
}

/* --- PREMIUM SECONDARY BACK TO GAMES BUTTON --- */
.btn-settings-back {
    margin: 25px auto 0 auto !important;
    width: 100% !important;
    max-width: 280px !important;
    height: 65px !important;
    font-size: 1.5rem !important;
    border-radius: 12px !important;
    background: white !important;
    border: 3px solid #1a083a !important;
    color: #1a083a !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-transform: uppercase !important;
    font-weight: 900 !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
}

.btn-settings-back:hover {
    background: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2) !important;
}

.btn-settings-back:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) !important;
}

.btn-settings-back .btn-icon {
    font-size: 1.8rem !important;
    transform: translateY(-2px) !important;
    margin-right: 4px;
}

/* --- BOMB PARTY STYLES --- */
.bp-player-card {
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.bp-player-card.is-active-turn {
    border-color: #ff3838;
    background: rgba(255, 56, 56, 0.12);
    box-shadow: 0 0 15px rgba(255, 56, 56, 0.35);
    transform: scale(1.02);
}

.bp-player-card.is-eliminated {
    opacity: 0.45;
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.bp-player-card .bp-avatar {
    font-size: 1.6rem;
}

.bp-player-card .bp-name {
    flex-grow: 1;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-player-card .bp-hearts {
    display: flex;
    gap: 3px;
    font-size: 0.95rem;
}

/* History logs */
.bp-log-item {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    word-break: break-all;
}
.bp-log-item.success {
    background: rgba(74, 255, 176, 0.12);
    border-left: 3px solid #4affb0;
    color: #4affb0;
}
.bp-log-item.error {
    background: rgba(255, 107, 107, 0.12);
    border-left: 3px solid #ff6b6b;
    color: #ff6b6b;
}

/* Shake Animations */
@keyframes bombShake {
    0% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-3px, 2px) rotate(-1deg); }
    20% { transform: translate(2px, -2px) rotate(1deg); }
    30% { transform: translate(-2px, -3px) rotate(-1.5deg); }
    40% { transform: translate(3px, 2px) rotate(1deg); }
    50% { transform: translate(-2px, 1px) rotate(-1deg); }
    60% { transform: translate(2px, 2px) rotate(1.5deg); }
    70% { transform: translate(-3px, -2px) rotate(-1deg); }
    80% { transform: translate(3px, -3px) rotate(2deg); }
    90% { transform: translate(-2px, 2px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes bombShakeAvatar {
    0% { transform: translate(-50%, -50%) scale(var(--card-scale, 1)) rotate(0deg); }
    10% { transform: translate(calc(-50% - 3px), calc(-50% + 2px)) scale(var(--card-scale, 1)) rotate(-2deg); }
    20% { transform: translate(calc(-50% + 3px), calc(-50% - 2px)) scale(var(--card-scale, 1)) rotate(2deg); }
    30% { transform: translate(calc(-50% - 2px), calc(-50% - 3px)) scale(var(--card-scale, 1)) rotate(-3deg); }
    40% { transform: translate(calc(-50% + 3px), calc(-50% + 2px)) scale(var(--card-scale, 1)) rotate(2deg); }
    50% { transform: translate(calc(-50% - 2px), calc(-50% + 1px)) scale(var(--card-scale, 1)) rotate(-2deg); }
    60% { transform: translate(calc(-50% + 2px), calc(-50% + 2px)) scale(var(--card-scale, 1)) rotate(3deg); }
    70% { transform: translate(calc(-50% - 3px), calc(-50% - 2px)) scale(var(--card-scale, 1)) rotate(-2deg); }
    80% { transform: translate(calc(-50% + 3px), calc(-50% - 3px)) scale(var(--card-scale, 1)) rotate(4deg); }
    90% { transform: translate(calc(-50% - 2px), calc(-50% + 2px)) scale(var(--card-scale, 1)) rotate(-2deg); }
    100% { transform: translate(-50%, -50%) scale(var(--card-scale, 1)) rotate(0deg); }
}

.shake-fast {
    animation: bombShake 0.12s infinite linear !important;
}

.shake-medium {
    animation: bombShake 0.35s infinite linear !important;
}

.shake-slow {
    animation: bombShake 0.75s infinite linear !important;
}

/* Responsive grid for Chrono Mots on Mobile */
@media (max-width: 768px) {
    #screen-game-chronomots {
        width: 100% !important;
        padding: 10px !important;
    }
    #screen-game-chronomots > div:nth-child(2) {
        flex-direction: column !important;
        height: auto !important;
    }
    #screen-game-chronomots > div:nth-child(2) > div {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
    #bp-guess-input {
        font-size: 1.2rem !important;
        height: 52px !important;
    }
    #bp-syllable-display {
        font-size: 3rem !important;
    }
    #bp-player-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    .bp-player-card {
        width: calc(50% - 5px) !important;
    }
    #bp-history-feed {
        max-height: 180px !important;
    }
}

@keyframes slideInBp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bp-avatar-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 50% !important;
}

/* --- GARTIC PHONE STYLES --- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(15px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gp-chain-item {
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.gp-chain-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: #ffb142;
    font-size: 1.1rem;
}

.gp-chain-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    background: rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gp-chain-text {
    font-family: 'Bungee', sans-serif;
    font-size: 1.3rem;
    color: white;
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 2.5px dashed rgba(255,255,255,0.15);
    word-break: break-word;
}

.gp-chain-drawing-container {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.gp-chain-drawing {
    width: 100%;
    height: auto;
    display: block;
}

/* --- GARTIC PHONE PREMIUM SCROLLBARS --- */
#gp-reveal-chain::-webkit-scrollbar,
#gp-summary-book-content::-webkit-scrollbar,
#gp-summary-player-list::-webkit-scrollbar {
    width: 8px;
}
#gp-reveal-chain::-webkit-scrollbar-track,
#gp-summary-book-content::-webkit-scrollbar-track,
#gp-summary-player-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
#gp-reveal-chain::-webkit-scrollbar-thumb,
#gp-summary-book-content::-webkit-scrollbar-thumb,
#gp-summary-player-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}
#gp-reveal-chain::-webkit-scrollbar-thumb:hover,
#gp-summary-book-content::-webkit-scrollbar-thumb:hover,
#gp-summary-player-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 177, 66, 0.5);
}

/* --- RESPONSIVE DRAWING TOOLBARS FOR SKRIBBL & GARTIC PHONE --- */
@media (max-width: 768px) {
    /* Reduce height of canvas panel so it fits nicely on screen */
    .dessinexpress-canvas-panel {
        height: auto !important;
        min-height: 400px;
    }
    
    /* Make toolbars auto-wrap, adjust spacing and stack nicely */
    #dessinexpress-toolbar,
    #gp-toolbar {
        height: auto !important;
        flex-wrap: wrap !important;
        padding: 10px 15px !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    /* Reduce thickness slider width and push to its own full line on small mobile */
    #dessinexpress-toolbar > div:nth-child(3),
    #gp-toolbar > div:nth-child(3) {
        max-width: none !important;
        width: 100% !important;
        order: 4; /* Stacks thickness slider at the bottom of the toolbar */
        margin: 5px 0 !important;
        align-items: center !important;
    }

    /* Shrink the size of tool buttons slightly for better mobile thumb tapping */
    .dessinexpress-tool-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* Adjust color selector trigger circle size */
    #dessinexpress-color-trigger,
    #gp-color-trigger {
        width: 40px !important;
        height: 40px !important;
    }

    /* Adjust RGB picker height */
    #rgb-picker-preview,
    #gp-rgb-picker-preview {
        width: 30px !important;
        height: 30px !important;
    }
    
    /* Reposition Popover shape/color grids on mobile so they don't get cut off */
    #dessinexpress-shape-popover,
    #gp-shape-popover {
        bottom: 55px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    #dessinexpress-color-popover,
    #gp-color-popover {
        bottom: 55px !important;
    }

    /* Dessin Relais Mobile Recap (Album) responsive styling */
    #gp-workspace-summary {
        padding: 15px !important;
        min-height: auto !important;
    }
    
    #gp-workspace-summary h2 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
    }

    .gp-summary-layout {
        flex-direction: column !important;
        max-height: none !important;
        height: auto !important;
        min-height: auto !important;
        gap: 15px !important;
    }

    .gp-summary-sidebar {
        width: 100% !important;
        max-height: 100px !important;
        padding: 10px !important;
        overflow-y: hidden !important;
        overflow-x: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .gp-summary-sidebar span {
        display: none !important; /* Hide "Choisir un livre" text on mobile */
    }

    #gp-summary-player-list {
        flex-direction: row !important;
        gap: 10px !important;
        width: auto !important;
        display: flex !important;
    }

    .gp-summary-player-card {
        padding: 6px 12px !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
        transform: none !important;
        margin: 0 !important;
    }
    
    .gp-summary-player-card:hover {
        transform: none !important; /* Prevent sliding effect on touch hover */
    }
    
    .gp-summary-player-card.active {
        transform: scale(1.05) !important; /* Subtle scaling instead of translation */
    }

    .gp-summary-main-content {
        width: 100% !important;
        max-height: none !important;
        padding: 15px !important;
    }

    /* Fix "LIVRE DE :" header wrapping on mobile */
    #gp-workspace-reveal > div:first-child {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 15px !important;
        margin-bottom: 15px !important;
    }

    /* Move share/download buttons BELOW the image instead of overlaying it */
    .gp-share-btn, .gp-download-btn {
        position: static !important;
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
    }

    /* Make the drawing card buttons container a row below the image */
    .gp-summary-main-content div[style*="position: absolute; bottom"] {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 8px !important;
        padding: 0 !important;
    }
}

/* --- PREMIUM GARTIC PHONE RECAP WORKSPACE BACKGROUND --- */
#gp-workspace-summary {
    background: var(--bg-panel) !important;
    position: relative;
    overflow: hidden;
}

#gp-workspace-summary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.025) 2px, transparent 2px);
    background-size: 32px 32px;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

/* Ensure inner columns stack above the absolute grid overlay */
#gp-workspace-summary > * {
    position: relative;
    z-index: 2;
}

/* Dessin Relais typing indicator bounce animation */
@keyframes gpDotBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Dessin Relais drawing indicator brush/pencil movement */
@keyframes gpPencilDraw {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-8px, -4px) rotate(-15deg);
    }
    50% {
        transform: translate(8px, 4px) rotate(15deg);
    }
    75% {
        transform: translate(-4px, 6px) rotate(-10deg);
    }
}

/* Smooth zoom-in / reveal animation for drawing image */
@keyframes gpImageReveal {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gp-chain-drawing-animate {
    animation: gpImageReveal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Responsive aspect-ratio canvas wrapper for both DessinExpress and Dessin Relais */
.gp-canvas-wrapper {
    width: 800px;
    height: 520px;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 800 / 520;
    margin: auto;
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

#dessinexpress-canvas, #gp-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.dessinexpress-canvas-panel {
    height: auto !important;
}

@media (max-width: 992px) {
    .gp-canvas-wrapper {
        width: 100% !important;
        height: auto !important;
    }
}

/* Hide back button for guest players in lobby */
.is-guest .btn-settings-back {
    display: none !important;
}

/* --- PIÈCES DÉTACHÉES COLOR PICKER DOTS --- */
.color-picker-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
.color-picker-dot:hover {
    transform: scale(1.15) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}
.color-picker-dot.active {
    transform: scale(1.2);
    border-color: white !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* --- PIÈCES DÉTACHÉES VOTE CARDS --- */
.pieces-vote-card:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: #ffb142 !important;
    box-shadow: 0 12px 25px rgba(255, 177, 66, 0.3) !important;
}

/* --- Cartes Sans Limite STYLES --- */
.limite-red-card {
    background-color: #d12229;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 20px 15px;
    width: 170px;
    height: 140px;
    min-width: 170px;
    min-height: 140px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 2px 10px rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    color: white;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.4;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    user-select: none;
    box-sizing: border-box;
    word-break: break-word;
    position: relative;
}
.limite-red-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 20px rgba(209, 34, 41, 0.5);
    border-color: #ffb142;
}
.limite-red-card.selected {
    border-color: #4affb0 !important;
    box-shadow: 0 0 20px rgba(74, 255, 176, 0.6) !important;
    transform: translateY(-10px) scale(1.05) !important;
}
.limite-red-card.disabled {
    opacity: 0.9;
    cursor: default !important;
    transform: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 2px 10px rgba(255,255,255,0.1) !important;
}
/* Generic custom scrollbar */
.custom-scrollbar::-webkit-scrollbar { width: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }

@media (max-width: 600px) { 
    :root { 
        --card-scale: 0.65; 
    }
}

/* Aggressive Mobile Compression to avoid scrolling */
@media (max-width: 768px) {
    /* Lobby adjustments */
    #lobby-game-list {
        max-height: 250px !important;
        overflow-y: auto !important;
    }
    .game-card-selector {
        padding: 10px 15px !important;
        margin-bottom: 8px !important;
    }
    .game-card-selector .game-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.8rem !important;
    }
    .game-card-selector .game-name {
        font-size: 1rem !important;
        margin-bottom: 2px !important;
    }
    .game-card-selector .game-desc {
        font-size: 0.75rem !important;
    }

    /* Dessin Express & Gartic Phone adjustments */
    #screen-game-dessinexpress > div {
        height: auto !important;
        min-height: 0 !important;
    }
    #screen-game-dessinrelais > div {
        height: auto !important;
        min-height: 0 !important;
    }
    #gp-workspace-text {
        min-height: 250px !important;
        padding: 15px !important;
        gap: 15px !important;
    }
    .game-header {
        margin-bottom: 15px !important;
        padding: 10px 15px !important;
        min-height: 80px !important;
    }
    
    /* Override hardcoded 600px height on drawing game body */
    #dessinexpress-main-body {
        height: auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
    }

    /* Game screens scrollable on mobile */
    #screen-game-dessinexpress,
    #screen-game-dessinrelais {
        overflow-y: auto !important;
    }

    /* À DESSINER: make label wrap on small screens */
    #gp-workspace-draw .players-panel {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 15px !important;
    }
    #gp-workspace-draw .players-panel h3 {
        font-size: 1rem !important;
        white-space: normal !important;
    }
    #gp-workspace-draw .players-panel p {
        font-size: 1.1rem !important;
    }

    /* Body scrollable for login/lobby, locked for games */
    html {
        height: 100% !important;
    }
    body {
        overflow-y: auto !important; /* Allow body scroll for login/lobby */
        width: 100% !important;
    }

    /* Only lock scroll when in a game screen */
    body:has(.main-container[id^="screen-game"]:not(.hidden)) {
        overflow: hidden !important;
    }
    
    .main-container:not(#screen-login):not(#screen-lobby) {
        padding: 5px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
    }
    
    /* Shrink the main canvas slightly more if needed */
    .gp-canvas-wrapper {
        margin-bottom: 5px !important;
    }
    
    #dessinexpress-toolbar, #gp-toolbar {
        height: 70px !important;
        padding: 0 10px !important;
    }
}
@ m e d i a   ( m a x - w i d t h :   6 0 0 p x )   {   : r o o t   {   - - c a r d - s c a l e :   0 . 6 5 ;   }   } 
 
 
