/* ==============================================
   THÈME GÉNÉRAL (refonte 2026)
   Les couleurs passent par les variables ci-dessous :
   les styles des jeux et les styles en ligne les réutilisent.
   ============================================== */
:root {
    --primary: #6c47ff;
    --primary-dark: #4f2fd6;
    --secondary: #0fb5ae;
    --soft: #ece8ff;
    --danger: #ff5d6c;
    --success: #12b886;
    --dark: #1f1b3a;
    --muted: #6e6a8e;
    --light: #f4f2ff;
    --line: #e4e0f7;
    --radius: 22px;
    --font-title: 'Fredoka', 'Nunito', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-body);
    color: var(--dark);
    margin: 0;
    padding: 0 16px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #17123a;
    background-image:
        radial-gradient(circle at 8% 12%, rgba(255, 79, 163, 0.38), transparent 38%),
        radial-gradient(circle at 92% 18%, rgba(28, 213, 196, 0.30), transparent 36%),
        radial-gradient(circle at 50% 105%, rgba(255, 183, 3, 0.26), transparent 45%),
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: auto, auto, auto, 22px 22px;
    background-attachment: fixed;
}

/* --- EN-TÊTE --- */
.site-header {
    width: 100%;
    max-width: 760px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 0 18px;
    color: white;
}
.site-logo {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    font-size: 1.4em;
    background: linear-gradient(135deg, #ff4fa3, #ffb703);
    border-radius: 14px;
    transform: rotate(-8deg);
    box-shadow: 0 6px 18px rgba(255, 79, 163, 0.45);
}
.site-name {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.6em;
    letter-spacing: 0.01em;
}
.site-name span { color: #ffb703; }

/* --- CONTENEUR PRINCIPAL (Les Cartes) --- */
.card {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 28px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(8, 4, 40, 0.45);
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 20px;
}

h1, h2, h3, h4 {
    font-family: var(--font-title);
    font-weight: 600;
    margin-top: 0;
    line-height: 1.2;
}
h1 { color: var(--dark); font-size: 2em; margin-bottom: 6px; }
h2 { color: var(--dark); font-size: 1.6em; }
h3 { color: var(--primary); font-size: 1.2em; }

.card-subtitle { color: var(--muted); margin: 0 0 22px; }

/* --- BOUTONS --- */
button {
    font-family: var(--font-title);
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    border-radius: 14px;
    padding: 13px 20px;
    font-size: 1.05em;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
    width: 100%;
    margin-bottom: 10px;
    color: white;
    box-sizing: border-box;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}
button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18); filter: brightness(1.05); }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
button:focus-visible { outline: 3px solid #ffb703; outline-offset: 2px; }
button:disabled { cursor: not-allowed; }

.btn-primary { background: var(--primary); box-shadow: 0 4px 0 var(--primary-dark); }
.btn-primary:hover { box-shadow: 0 6px 0 var(--primary-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--primary-dark); }
.btn-secondary { background: var(--soft); color: var(--primary-dark); box-shadow: 0 4px 0 #cfc7fb; }
.btn-secondary:hover { box-shadow: 0 6px 0 #cfc7fb; }
.btn-secondary:active { box-shadow: 0 1px 0 #cfc7fb; }
.btn-danger { background: var(--danger); width: auto; padding: 8px 14px; box-shadow: 0 4px 0 #d63c4b; }

/* --- MENU DES JEUX --- */
#gameSelection { max-width: 760px; }
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
}
.btn-game-choice {
    --c: var(--primary);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-height: 130px;
    margin: 0;
    padding: 16px;
    text-align: left;
    font-size: 1.15em;
    line-height: 1.15;
    border-radius: 20px;
    background: var(--c) !important;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.btn-game-choice::before {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}
.btn-game-choice:hover { box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.btn-game-choice:active { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.game-emoji {
    display: grid; place-items: center;
    min-width: 48px; height: 48px; padding: 0 6px; box-sizing: border-box;
    font-size: 1.5em;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    letter-spacing: -0.1em;
}
.game-name { display: block; }
.game-players {
    display: block;
    margin-top: 4px;
    font-family: var(--font-body);
    font-size: 0.68em;
    font-weight: 700;
    opacity: 0.85;
}
#btnPtitBac { --c: #6c47ff; }
#btnQuiADitQuoi { --c: #0fb5ae; }
#btnQuizz { --c: #9b51e0; }
#btnPendu { --c: #f08c00; }
#btnUndercover { --c: #3b4a6b; }
#btnCodenames { --c: #e03131; }
#btnTimesup { --c: #0ca678; }
#btnNote { --c: #e8590c; }
#btnGartic { --c: #e64980; }
#btnJustOne { --c: #1c7ed6; }
#btnSpyfall { --c: #24456e; }
#btnWavelength { --c: #ae3ec9; }
#btnUno { --c: #d6336c; }
#btnRolandGamos { --c: #212529; }
#btnBlindTest { --c: #f76707; }
#btnMonopoly { --c: #2f9e44; }
#btnGeoGuessr { --c: #1971c2; }
#btnMotus { --c: #e03131; }
#btnWikirace { --c: #495057; }
#btnEncheres { --c: #b8860b; }

/* Bouton retour (menu, page d'un jeu) */
#btnRetourAccueil, #btnCancelChangeGame {
    display: inline-block;
    width: auto;
    padding: 7px 14px;
    font-size: 0.9em;
    margin: 0 0 18px;
}
#accueil { text-align: center; }
#accueil > #btnRetourAccueil { float: left; }
#accueilTitle { clear: both; font-size: 2em; margin-bottom: 14px; }
#hostSetupSection, #joinSetupSection {
    background: var(--light);
    border-radius: 18px;
    padding: 18px;
}
#hostSetupSection h3, #joinSetupSection h3 { text-align: left; margin-bottom: 12px; }
#hostSetupSection > button:last-of-type, #joinSetupSection > button:last-child { margin-bottom: 0; }
#errorMsg:empty { display: none; }

/* --- CHAMPS DE SAISIE --- */
input[type="text"], input[type="number"], textarea, select {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--dark);
}
input[type="text"] {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid var(--line);
    background: white;
    border-radius: 14px;
    font-size: 1em;
    box-sizing: border-box;
    margin-bottom: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]::placeholder { color: #a7a3c4; font-weight: 600; }
input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108, 71, 255, 0.15); outline: none; }

/* --- LISTES ET TABLEAU DES SCORES --- */
ul { list-style-type: none; padding: 0; }
li {
    background: var(--light);
    margin-bottom: 8px;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 700;
}

#scoreCorner {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.97);
    padding: 16px;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(8, 4, 40, 0.4);
    display: none;
    z-index: 1000;
    width: 220px;
    box-sizing: border-box;
}
#scoreCorner h4 {
    margin: 0 0 10px 0; color: var(--dark); font-size: 1.05em;
    border-bottom: 2px solid var(--light); padding-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.corner-code {
    font-family: var(--font-title); font-weight: 700; font-size: 0.95em;
    letter-spacing: 0.12em; color: var(--primary);
    background: var(--light); border: 2px dashed #c9bfff; border-radius: 10px;
    padding: 2px 6px 2px 9px; user-select: all;
}
.corner-code:empty { display: none; }
#scoreList > div {
    margin: 0 0 6px !important;
    padding: 6px 10px;
    background: var(--light);
    border-radius: 10px;
    font-size: 0.92em;
    overflow-wrap: anywhere;
}

/* --- SALON D'ATTENTE --- */
.room-label { margin: 0 0 8px; font-weight: 800; color: var(--muted); text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.12em; }
.room-code {
    display: inline-block;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 2.6em;
    letter-spacing: 0.22em;
    padding: 8px 10px 8px 22px;
    color: var(--primary);
    background: var(--light);
    border: 3px dashed #c9bfff;
    border-radius: 18px;
}
.room-hint { color: var(--muted); font-size: 0.9em; margin: 10px 0 22px; }
#salonWaitingMsg { font-size: 1.05em; color: var(--dark); }
#playersList li { text-align: left; }
#playersList li em { color: var(--muted); font-weight: 600; }
#salon .btn-danger { display: block; margin: 10px auto 0; }

/* --- ÉDITEUR DE QUESTIONS --- */
#optionsDiv {
    display: none;
    background: white;
    padding: 16px;
    border-radius: 14px;
    margin-top: 12px;
    text-align: left;
    border: 2px solid var(--line);
}
.question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.9em;
}
.add-question-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* --- DETAILS (ACCORDÉONS DE FIN) --- */
details { background: white; padding: 14px 16px; margin-bottom: 10px; border-radius: 14px; border: 2px solid var(--line); cursor: pointer; text-align: left;}
summary { font-family: var(--font-title); font-weight: 600; color: var(--primary); outline: none; }
.success-item { color: var(--success); border-left: 4px solid var(--success); padding-left: 10px; }
.fail-item { color: #e03131; border-left: 4px solid #e03131; padding-left: 10px; }

hr { border: 0; height: 2px; background: var(--line); margin: 28px 0; overflow: visible; position: relative; }
#accueilDivider::after {
    content: 'ou';
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    background: white; padding: 0 12px;
    font-family: var(--font-title); font-weight: 600; color: var(--muted);
}

/* --- ADAPTATION POUR TÉLÉPHONES (MOBILE FIRST) --- */
@media (max-width: 1000px) {
    #scoreCorner {
        position: static;
        width: 100%;
        max-width: 520px;
        margin-bottom: 14px;
        padding: 12px 14px;
        box-shadow: 0 8px 24px rgba(8, 4, 40, 0.3);
    }
    .score-actions { display: flex; gap: 8px; }
    .score-actions button { flex: 1; min-width: 0; }
    #scoreCorner h4 { border: 0; padding: 0; margin-bottom: 8px; text-align: left; }
    #scoreList { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
    #scoreList > div { margin: 0 !important; border-radius: 999px; padding: 4px 6px 4px 12px; }
}
@media (max-width: 600px) {
    body { padding: 0 12px 30px; }
    .site-header { padding: 14px 0 12px; }
    .card { padding: 22px 18px; }
    h1 { font-size: 1.7em; }
    .game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .btn-game-choice { min-height: 118px; padding: 14px; font-size: 1.05em; }
    .room-code { font-size: 2.2em; }
}

/* --- NOUVEAUX STYLES AJOUTÉS --- */
.header-game { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; background: var(--light); padding: 10px; border-radius: 8px;}
.pb-validation-item { display: flex; justify-content: space-between; align-items: center; background: white; border: 1px solid #ccc; padding: 10px; margin-bottom: 8px; border-radius: 6px;}
.hidden-points { font-style: italic; color: #888; font-size: 0.8em; }

/* Styles spécifiques au Quizz */
.quizz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.quizz-btn { 
	padding: 15px; 
	font-size: 1.1em; 
	border-radius: 8px; 
	background: var(--light); 
	border: 2px solid #ccc; 
	cursor: pointer; 
	transition: 0.2s; 
	font-weight: bold;
	color: #2c3e50 !important; 
	}
.quizz-btn:hover, .quizz-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.quizz-theme-btn { margin-bottom: 10px; width: 100%; }
.quizz-themes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 12px 0; }
.quizz-themes-list .quizz-theme-btn { margin-bottom: 0; }
.quizz-question-theme { margin: 16px 0 0; font-size: 0.85em; font-weight: bold; color: var(--secondary); }
.result-box { background: var(--light); padding: 15px; border-radius: 8px; margin-top: 20px; text-align: left; }


/* --- Styles spécifiques au PENDU --- */
#penduKeyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto 20px auto;
}
.pendu-key { 
    padding: 10px; 
    font-size: 1.2em; 
    border-radius: 8px; 
    background: #ffffff; 
    border: 2px solid #ccc; 
    cursor: pointer; 
    width: 45px; /* Largeur fixe pour faire des carrés propres */
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--dark);
    transition: 0.2s;
    box-sizing: border-box;
}
.pendu-key:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pendu-key:disabled { background: #dfe6e9; color: #b2bec3; border-color: #dfe6e9; cursor: not-allowed; transform: none; box-shadow: none; }


/* ==============================================
   STYLES JEU UNDERCOVER
   ============================================== */

.undercover-view {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Grille de catégories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.btn-category {
    padding: 15px 10px;
    background: #3b4a6b;
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 0 #26314a;
}

.btn-category:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Carte du mot secret */
.uc-category-badge {
    display: inline-block;
    background: var(--soft);
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 18px;
}

.uc-word-card {
    background: linear-gradient(135deg, #6c47ff, #a35bff);
    border-radius: 20px;
    padding: 34px 20px;
    margin: 15px 0 18px;
    font-family: var(--font-title);
    font-size: 2.2em;
    font-weight: 700;
    color: white;
    overflow-wrap: anywhere;
    box-shadow: 0 6px 0 var(--primary-dark), 0 18px 40px rgba(108, 71, 255, 0.35);
}

.uc-instructions {
    color: var(--muted);
    font-style: italic;
    margin-bottom: 25px;
}

/* Carte de fin et révélation */
.uc-reveal-card {
    background: var(--light);
    border-radius: 18px;
    padding: 20px;
    margin: 20px 0;
}

.highlight-name {
    color: var(--danger);
    font-size: 1.3em;
    text-decoration: underline;
}

.uc-words-reveal {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.reveal-box {
    flex: 1;
    padding: 15px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow-wrap: anywhere;
}

.reveal-box.civil {
    background: #e6fcf5;
    border: 2px solid #63e6be;
    color: #087f5b;
}

.reveal-box.undercover {
    background: #fff0f1;
    border: 2px solid #ffa8b0;
    color: #c92a3a;
}

.reveal-box strong {
    font-family: var(--font-title);
    font-size: 1.4em;
    margin-top: 5px;
}



/* ==============================================
   STYLES JEU CODENAMES
   ============================================== */

.cn-card { max-width: 720px; }
.cn-subtitle { font-size: 0.9em; color: #636e72; }
.cn-teams { display: flex; gap: 10px; margin-bottom: 10px; }
.cn-team { flex: 1; border-radius: 10px; padding: 10px; }
.cn-team h3 { margin-bottom: 8px; }
.cn-team ul { margin: 0 0 10px 0; min-height: 40px; }
.cn-team li { background: white; font-size: 0.9em; padding: 6px 8px; text-align: left; overflow-wrap: anywhere; }
.cn-team li small { display: block; font-weight: 400; color: #636e72; }
.cn-team-red { background: #fdecea; }
.cn-team-red h3 { color: #c0392b; }
.cn-team-blue { background: #eaf2fb; }
.cn-team-blue h3 { color: #2471a3; }
.cn-btn-red { background: #e74c3c; font-size: 0.9em; padding: 10px; }
.cn-btn-blue { background: #2980b9; font-size: 0.9em; padding: 10px; }
.cn-unassigned { font-size: 0.9em; color: #636e72; }
.cn-wait { font-style: italic; color: #636e72; }
.cn-error { color: #d63031; font-weight: bold; min-height: 1em; }
.cn-rules { margin-top: 10px; font-size: 0.9em; }
.cn-rules p { cursor: default; }

.cn-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--light); padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 1.1em;
}
.cn-role { font-size: 0.85em; font-weight: 600; }
.cn-banner { padding: 10px; border-radius: 8px; color: white; font-weight: 800; font-size: 1.15em; margin-bottom: 8px; }
.cn-banner-red { background: #e74c3c; }
.cn-banner-blue { background: #2980b9; }
.cn-info { min-height: 1.5em; margin: 0 0 12px 0; font-size: 0.95em; line-height: 1.5; }

.cn-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.cn-word {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 58px; padding: 4px 2px; box-sizing: border-box;
    background: #fdf6e3; border: 2px solid #e0d6bf; border-radius: 8px;
    font-weight: 700; font-size: clamp(0.6rem, 2.5vw, 0.95rem); line-height: 1.1; color: var(--dark);
    text-align: center; overflow-wrap: anywhere; hyphens: auto; user-select: none;
    transition: transform 0.15s;
}
.cn-word.cn-clickable { cursor: pointer; }
.cn-word.cn-clickable:hover { border-color: var(--primary); }
.cn-word.cn-proposed { outline: 3px solid #f1c40f; outline-offset: 1px; transform: scale(1.05); z-index: 1; }
.cn-proposer {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    max-width: 110%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    background: #f1c40f; color: var(--dark); font-size: 0.6rem; padding: 0 5px; border-radius: 6px;
}

/* Couleur visible par l'espion maître (et par tous en fin de partie) sur les mots pas encore touchés */
.cn-key.cn-c-red { background: #fadbd8; border-color: #e74c3c; color: #922b21; }
.cn-key.cn-c-blue { background: #d6eaf8; border-color: #2980b9; color: #1b4f72; }
.cn-key.cn-c-neutral { background: #fdf6e3; border-color: #e0d6bf; color: #7d6b4a; }
.cn-key.cn-c-assassin { background: #636e72; border-color: #2d3436; color: white; }

/* Mots déjà touchés */
.cn-revealed.cn-c-red { background: #e74c3c; border-color: #c0392b; color: white; }
.cn-revealed.cn-c-blue { background: #2980b9; border-color: #1f618d; color: white; }
.cn-revealed.cn-c-neutral { background: #d9cdb0; border-color: #c4b48f; color: #6b5d3f; }
.cn-revealed.cn-c-assassin { background: #2d3436; border-color: #000; color: white; }
.cn-revealed { opacity: 0.85; text-decoration: line-through; text-decoration-thickness: 2px; }

@media (max-width: 768px) {
    .cn-card { padding: 14px 10px; }
    .cn-board { gap: 4px; }
    .cn-word { min-height: 52px; border-radius: 6px; }
}


/* ==============================================
   STYLES JEU TIME'S UP
   ============================================== */

.tu-card { max-width: 600px; }
.tu-subtitle { font-size: 0.9em; color: #636e72; }
.tu-small { font-size: 0.9em; color: #636e72; overflow-wrap: anywhere; }
.tu-wait { font-style: italic; color: #636e72; }
.tu-error { color: #d63031; font-weight: bold; min-height: 1em; }
.tu-rules { margin: 10px 0; font-size: 0.9em; text-align: left; }
.tu-rules summary { cursor: pointer; font-weight: 600; }

.tu-teams { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.tu-team { flex: 1 1 140px; border-radius: 10px; padding: 10px; }
.tu-team h3 { margin-bottom: 8px; }
.tu-team ul { margin: 0 0 10px 0; min-height: 40px; }
.tu-team li { background: white; font-size: 0.9em; padding: 6px 8px; text-align: left; overflow-wrap: anywhere; }
.tu-team-0 { background: #fdecea; } .tu-team-0 h3 { color: #c0392b; }
.tu-team-1 { background: #eaf2fb; } .tu-team-1 h3 { color: #2471a3; }
.tu-team-2 { background: #e9f7ef; } .tu-team-2 h3 { color: #1e8449; }
.tu-team-3 { background: #fef9e7; } .tu-team-3 h3 { color: #b7950b; }
.tu-bg-0 { background: #e74c3c; color: white; }
.tu-bg-1 { background: #2980b9; color: white; }
.tu-bg-2 { background: #27ae60; color: white; }
.tu-bg-3 { background: #f1c40f; color: #2d3436; }
.tu-btn-team { font-size: 0.9em; padding: 10px; }

.tu-settings { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tu-settings label { flex: 1 1 120px; font-size: 0.85em; font-weight: 600; text-align: left; }
.tu-settings select {
    display: block; width: 100%; margin-top: 4px; padding: 8px;
    font-family: var(--font-body); font-size: 1em;
    border: 2px solid #dfe6e9; border-radius: 8px; background: white;
}
.tu-themes { text-align: left; margin-bottom: 10px; }
.tu-theme { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; font-size: 0.9em; cursor: pointer; }
.tu-theme input { margin-top: 5px; }
.tu-theme small { color: #636e72; font-weight: 400; }

.tu-round-title { margin-bottom: 0; }
.tu-rule { background: var(--light); border-radius: 10px; padding: 12px; font-size: 0.95em; }
.tu-next { font-size: 1.1em; font-weight: 600; }
.tu-btn-big { font-size: 1.4em; padding: 18px; }
.tu-banner { padding: 10px; border-radius: 8px; font-weight: 800; font-size: 1.1em; margin-bottom: 8px; }

.tu-clock { margin: 8px 0 14px 0; }
.tu-clock span { font-size: 3em; font-weight: 800; color: var(--primary); line-height: 1; }
.tu-clock-track { height: 10px; background: #dfe6e9; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.tu-clock-bar { height: 100%; background: var(--primary); width: 100%; transition: width 0.2s linear; }
.tu-clock-hurry span { color: #d63031; }
.tu-clock-hurry .tu-clock-bar { background: #d63031; }

.tu-cardbox {
    border: 3px solid var(--primary); border-radius: 14px; padding: 24px 12px; margin-bottom: 14px;
    background: #f8f7ff; min-height: 90px; display: flex; flex-direction: column; justify-content: center;
}
.tu-card-name { font-size: 1.9em; font-weight: 800; color: var(--dark); overflow-wrap: anywhere; line-height: 1.2; }
.tu-card-cat { font-size: 0.85em; color: #636e72; margin-top: 6px; }
.tu-btn-found { background: #27ae60; }
#btnTuPass:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.tu-found { font-size: 0.95em; color: #27ae60; font-weight: 600; overflow-wrap: anywhere; }
.tu-winner { font-size: 1.4em; font-weight: 800; color: var(--primary); }

.tu-scores { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.9em; }
.tu-scores th, .tu-scores td { padding: 6px 4px; border-bottom: 1px solid #dfe6e9; text-align: center; }
.tu-scores th:first-child { text-align: left; }
.tu-scores tr.tu-my-team { background: #f8f7ff; }

@media (max-width: 768px) {
    .tu-card { padding: 16px 12px; }
    .tu-card-name { font-size: 1.6em; }
}

/* --- QUITTER LE SALON / RETIRER UN JOUEUR --- */
.btn-leave, .btn-change-game {
    margin: 8px 0 0; width: 100%; padding: 7px 10px; font-size: 0.88em;
    background: white; box-shadow: none;
}
.btn-leave { color: var(--danger); border: 2px solid #ffd0d5; }
.btn-change-game { color: var(--primary); border: 2px solid #d9d0ff; }
.btn-leave:hover, .btn-change-game:hover { box-shadow: none; background: var(--light); }
.btn-kick {
    width: auto; margin: 0 0 0 6px; padding: 0 7px; font-size: 0.75em; line-height: 1.7;
    background: white; color: var(--danger); border: 1px solid #ffc2c8; border-radius: 999px; box-shadow: none;
}
.btn-kick:hover { box-shadow: none; background: #fff0f1; }
#toasts {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
    z-index: 2000; display: flex; flex-direction: column; gap: 8px;
    width: max-content; max-width: calc(100% - 32px); pointer-events: none;
}
.toast {
    background: var(--dark); color: #fff; padding: 11px 18px; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35); font-size: 0.95em; font-weight: 700; text-align: center;
}


/* ==============================================
   STYLES JEU NOTE SECRÈTE
   ============================================== */

.ns-card { max-width: 560px; }
.ns-round { font-size: 0.55em; color: #636e72; font-weight: 600; }
.ns-subtitle { font-size: 0.9em; color: #636e72; }
.ns-wait { font-style: italic; color: #636e72; }
.ns-error { color: #d63031; font-weight: bold; min-height: 1em; }
.ns-rules { margin: 10px 0; font-size: 0.9em; text-align: left; }
.ns-rules summary { cursor: pointer; font-weight: 600; }
.ns-players { margin: 0 0 12px 0; }
.ns-players li { font-size: 0.95em; padding: 6px 8px; text-align: left; overflow-wrap: anywhere; }

.ns-roles {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px;
    background: var(--light); padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 0.95em;
    overflow-wrap: anywhere;
}
.ns-note-box { margin-bottom: 10px; }
.ns-note-box:empty { display: none; }
.ns-note {
    display: inline-block; background: #d35400; color: white; border-radius: 12px;
    padding: 8px 22px; font-size: 2.4em; font-weight: 800; line-height: 1.2;
}
.ns-note small { font-size: 0.45em; font-weight: 600; }
.ns-note-hidden { background: #636e72; }
.ns-info { font-size: 1.05em; line-height: 1.5; margin: 0 0 12px 0; overflow-wrap: anywhere; }
.ns-info strong { color: #d35400; }

.ns-order { margin: 0 0 12px 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ns-order li { background: var(--light); border-radius: 14px; padding: 4px 10px; font-size: 0.85em; overflow-wrap: anywhere; }
.ns-order li.ns-done { opacity: 0.55; text-decoration: line-through; }
.ns-order li.ns-current { background: #d35400; color: white; font-weight: 700; }

.ns-picker-title { font-weight: 600; margin-bottom: 8px; }
.ns-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.ns-grid button {
    margin: 0; padding: 12px 0; font-size: 1.2em; font-weight: 800;
    background: #fdebd0; color: #a04000; border: 2px solid #f5cba7;
}
.ns-grid button.ns-selected { background: #d35400; color: white; border-color: #a04000; }
#btnNsValidate:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.ns-result-gap { font-size: 1.1em; font-weight: 700; }

/* ==============================================
   STYLES JEU JUST ONE
   ============================================== */

.jo-card { max-width: 560px; }
.jo-progress { font-size: 0.55em; color: #636e72; font-weight: 600; }
.jo-subtitle { font-size: 0.9em; color: #636e72; }
.jo-wait { font-style: italic; color: #636e72; }
.jo-error { color: #d63031; font-weight: bold; min-height: 1em; }
.jo-rules { margin: 10px 0; font-size: 0.9em; text-align: left; }
.jo-rules summary { cursor: pointer; font-weight: 600; }
.jo-players { margin: 0 0 12px 0; }
.jo-players li { font-size: 0.95em; padding: 6px 8px; text-align: left; overflow-wrap: anywhere; }
.jo-role { background: var(--light); padding: 8px 12px; border-radius: 8px; margin: 0 0 10px 0; overflow-wrap: anywhere; }
.jo-word-box { margin-bottom: 10px; }
.jo-word-box:empty { display: none; }
.jo-word {
    display: inline-block; background: #2980b9; color: white; border-radius: 12px;
    padding: 10px 22px; font-size: 2em; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere;
}
.jo-word-hidden { background: #636e72; }
.jo-info { font-size: 1.05em; line-height: 1.5; margin: 0 0 12px 0; overflow-wrap: anywhere; }
.jo-info strong { color: #2980b9; }
.jo-clues { margin: 0 0 12px 0; padding: 0; list-style: none; }
.jo-clues li {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    background: var(--light); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; text-align: left; overflow-wrap: anywhere;
}
.jo-clues li.jo-cancelled { opacity: 0.6; }
.jo-clues li.jo-cancelled .jo-clue-text { text-decoration: line-through; }
.jo-clue-text { font-weight: 700; font-size: 1.1em; }
.jo-clue-who { font-size: 0.8em; color: #636e72; }
.jo-clue-tag { font-size: 0.75em; color: #d63031; font-weight: 600; }
.jo-clues button { margin: 0; width: auto; padding: 4px 10px; font-size: 0.85em; }
.jo-end-score { font-size: 2.2em; font-weight: 800; color: #2980b9; margin: 0; }
.jo-end-list { margin: 0 0 12px 0; padding: 0; list-style: none; text-align: left; font-size: 0.9em; }
.jo-end-list li { padding: 3px 0; overflow-wrap: anywhere; }

/* Règles du jeu sur la page d'accueil de chaque jeu */
.game-rules {
    text-align: left;
    background: var(--light);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 0 0 20px;
    font-size: 0.95em;
}
.game-rules summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
}
.game-rules-players {
    margin: 8px 0 4px;
    font-weight: 600;
}
.game-rules ul {
    list-style-type: disc;
    margin: 5px 0 0;
    padding-left: 20px;
}
.game-rules li {
    background: none;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
    margin-bottom: 6px;
    line-height: 1.4;
}
