/* BASE & LAYOUT */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    /*background: #2c3e50; */
    color: white; text-align: center; margin: 0; padding: 20px;
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box;
    transition: background 1s ease;
    background-attachment: fixed;
    /* Empêche le zoom sur double tap sur mobile */
    touch-action: manipulation; 
}

.logo {
    max-width: 300px;
    margin-top: -150px;
}

.container { 
    width: 100%; max-width: 800px; background: #34495e; padding: 30px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.4); position: relative;
    display: flex; flex-direction: column;


    background: rgba(255, 255, 255, 0.15); 
  backdrop-filter: blur(16px);           
  -webkit-backdrop-filter: blur(16px);   
  border: 1px solid rgba(255, 255, 255, 0.25); 
  border-radius: 20px;                   
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.ingame .container {
    background: #34495e;
}
.hidden { display: none !important; }

/* UI Elements */
.container button { background: #e67e22; border: none; padding: 12px 20px; color: white; font-size: 1.1em; cursor: pointer; border-radius: 5px; margin: 5px 0; width: 100%; font-weight: 600; transition: transform 0.2s, background 0.3s; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.container button:hover { filter: brightness(1.1); transform: translateY(-2px); }

.container button:disabled { cursor: not-allowed; opacity: 0.8; background: #7f8c8d; transform: none; }

.container button.primary {
    background: linear-gradient(135deg, rgba(255,0,127,0.8), rgba(112,0,255,0.8));
  border: none;
  width: 100%;
  padding: 12px;
  font-size: 1.1rem;
  margin-top: 15px;
}

.container .leave-btn {
    background: #c0392b; color: #fff; width: auto; font-size: 0.9em; padding: 8px 15px;
    border-radius: 5px; position: absolute; top: -60px; left: 15px; z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); border: 1px solid rgba(0,0,0,0.2); font-weight: bold; cursor: pointer;
}
.container .leave-btn:hover { background: #e74c3c; }

.container .report-btn {
    position: absolute; top: 0; right: 0;
    background: transparent !important; color: #586875 !important;
    font-size: 0.8em; padding: 5px 10px; width: auto; 
    box-shadow: none; transform: none !important; text-shadow: none;
}
.report-btn:hover { color: #e74c3c !important; }

.master-settings { margin-bottom: 15px; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; text-align: left;}
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.95em; }
.setting-row > span {
    min-width: 200px;
}
.container select { padding: 6px; border-radius: 4px; background: #ecf0f1; border: none; font-weight: bold; color: #2c3e50; cursor:pointer;}

.theme-btn { background: #2980b9; min-height: 60px; margin: 0; border: 2px solid transparent;}

.mystery-container { margin-top: 25px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.container .mystery-btn {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border: 2px dashed #f1c40f;
    color: #fff; text-transform: uppercase; letter-spacing: 1px;
    font-size: 1.2em; padding: 20px; width: 80%; max-width: 400px; margin: 0 auto; display: block;
}
.container .mystery-btn:hover { background: linear-gradient(135deg, #9b59b6, #8e44ad); transform: scale(1.05); }

.answer-btn { background: #2980b9; min-height: 60px; display: flex; align-items: center; justify-content: center; flex-direction: column; position: relative; width: 100%; margin:0; word-break: break-word; padding: 10px;}

/* PRIORITÉS CSS CRITIQUES */
/* Selected écrase normal */
.answer-btn.selected { border: 3px solid #f1c40f; background: #3498db !important; } 
/* Correct/Wrong écrase Selected et Disabled (grace à !important et l'ordre) */
.answer-btn.correct { background: #27ae60 !important; border-color: #2ecc71 !important; opacity: 1 !important; color: white !important; }
.answer-btn.wrong { background: #c0392b !important; opacity: 0.8 !important; color: white !important; }

.container input:not([type='checkbox']), .container select { padding: 12px; width: 100%; border-radius: 5px; border: none; font-size: 1.1em; text-align: center; background: #ecf0f1; color: #2c3e50; box-sizing: border-box;

    width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 15px;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  outline: none;  
  font-weight: normal;

}
.container input:not([type='checkbox']) {
    transition: 0.3s;
}
.container input:not([type='checkbox']):focus, .container select:focus {
  background: rgba(0, 0, 0, 0.4);
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}


.step-label { display: block; text-transform: uppercase; font-size: 0.8em; color: #95a5a6; margin-bottom: 5px; letter-spacing: 1px; }
.home-grid { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 30px; align-items: start; margin-top: 20px; }
.home-col { display: flex; flex-direction: column; justify-content: center; }
.separator-vertical { background: rgba(255,255,255,0.1); height: 100%; width: 1px; min-height: 150px; }
.separator-horizontal { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 25px 0; }
@media (max-width: 768px) {
    .home-grid { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 20px; }
    .separator-vertical { width: 100%; height: 1px; min-height: 1px; margin: 10px 0; }
    .leave-btn { position: relative; top: auto; left: auto; width: 100%; margin-bottom: 15px; }
    .mystery-btn { width: 100%; }
    .answer-btn { font-size: 0.9em; min-height: 50px; }
}

.timer { font-size: 2.5em; font-weight: bold; color: #f1c40f; margin: 10px 0; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.theme-header { background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px; margin-bottom: 15px; color: #bdc3c7; text-transform: uppercase; font-size: 0.9em; }
.badge-info { background:#8e44ad; padding: 4px 10px; border-radius:4px; font-size:0.85em; font-weight: bold;}

.players-indicator { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.player-badge { background: #7f8c8d; color: white; padding: 5px 12px; border-radius: 15px; font-size: 0.85em; border: 2px solid transparent; transition: all 0.3s;}
.player-badge.has-answered { background: #27ae60; border-color: #27ae60; }
.player-badge.is-me { border-color: #f1c40f; box-shadow: 0 0 8px rgba(241, 196, 15, 0.5); }
.player-badge.is-eliminated { background: #2c3e50; border: 1px solid #7f8c8d; color: #95a5a6; text-decoration: line-through; }

.player-choices-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 5px; width: 100%; }
.player-choice-badge { background: rgba(0,0,0,0.4); font-size: 0.7em; padding: 2px 6px; border-radius: 4px; }

#server-browser { margin-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; width: 100%; }
.server-list { max-height: 150px; overflow-y: auto; background: rgba(0,0,0,0.2); border-radius: 8px; padding: 10px; }
.server-item { 
    display: flex; justify-content: space-between; align-items: center; 
    background: #2c3e50; padding: 10px; border-radius: 6px; margin-bottom: 8px; cursor: pointer; border: 1px solid transparent;
}
.server-item:hover { background: #34495e; border-color: #3498db; }
.server-badge { font-size: 0.8em; padding: 2px 6px; border-radius: 4px; }
.status-lobby { background: #27ae60; color: white; }
.status-started { background: #e67e22; color: white; }

#live-leaderboard { margin-top: 30px; padding-top: 15px; border-top: 2px dashed #7f8c8d; width: 100%; }
#live-scores-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative;}
.mini-score-item { background: rgba(0, 0, 0, 0.2); padding: 5px 10px; border-radius: 4px; font-size: 0.9em; display: flex; justify-content: space-between; align-items: center; transition: all 0.5s ease;}
.mini-score-item.is-me { background: rgba(230, 126, 34, 0.2); border-left: 3px solid #e67e22; color: #fff; font-weight: bold; }
.score-pill { padding: 2px 6px; border-radius: 10px; font-size: 0.8em; min-width: 20px; text-align: center; }
.win-score { background: #f1c40f; color: #2c3e50; font-weight: bold; margin-left:5px; }
.round-score { background: #34495e; color: #ecf0f1; margin-left:5px; }
.virtual-score { background: #9b59b6; color: #fff; margin-left:5px; font-size:0.7em; }

.round-winner-box { background: #27ae60; padding: 20px; border-radius: 10px; margin: 20px 0; }

@keyframes scoreBump {
    0% { background-color: #27ae60; transform: scale(1.05); box-shadow: 0 0 15px rgba(39, 174, 96, 0.6); }
    100% { background-color: rgba(0, 0, 0, 0.2); transform: scale(1); box-shadow: none; }
}
.score-increase { animation: scoreBump 1s ease-out; border: 1px solid #2ecc71 !important; z-index: 10; }

#footer-game-info { margin-top: auto; padding-top: 20px; font-size: 0.9em; color: #7f8c8d; border-top: 1px solid rgba(0,0,0,0.2); width: 100%; }
.code-pill { background: #2c3e50; color: #f1c40f; padding: 2px 8px; border-radius: 4px; font-weight: bold; letter-spacing: 1px; border: 1px dashed #7f8c8d; user-select: all; }

.big-theme-announce { font-size: 1.5em; color: #f1c40f; text-transform: uppercase; margin: 10px 0; font-weight: bold; letter-spacing: 2px;}
.big-subtheme-announce { font-size: 2.2em; color: #3498db; font-weight: bold; text-shadow: 0 4px 10px rgba(0,0,0,0.5); margin: 5px 0 20px 0;}
.mode-announce { background: #c0392b; color: white; padding: 5px 15px; border-radius: 20px; font-weight: bold; display: inline-block; font-size: 0.9em; margin-bottom: 20px; border: 2px solid rgba(255,255,255,0.3); }

.bet-buttons-container { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }
.bet-btn { background: #34495e; border: 2px solid #7f8c8d; font-size: 1.5em; width: 80px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; color: #fff; transition: all 0.2s; }
.bet-btn:hover { transform: scale(1.1); border-color: #f1c40f; background: #2c3e50; }
.bet-btn.selected { background: #f1c40f; color: #2c3e50; border-color: #fff; box-shadow: 0 0 15px #f1c40f; transform: scale(1.15); }
.bet-label { font-size: 0.4em; text-transform: uppercase; margin-top: 5px; opacity: 0.8; }

.reverse-bet-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.reverse-btn { height: 100px; font-size: 1.8em; text-transform: uppercase; border-radius: 10px; font-weight: bold; }
.btn-yes { background: #27ae60; } .btn-yes:hover { background: #2ecc71; }
.btn-no { background: #c0392b; } .btn-no:hover { background: #e74c3c; }
.reverse-question-preview { opacity: 0.6; pointer-events: none; transform: scale(0.9); margin-top: 20px; filter: grayscale(0.5); }

.hidden-answer { font-size: 2em; color: #f1c40f; font-weight: bold; }

.mode-checkbox { accent-color: #f1c40f; width:18px; height:18px; margin-right:8px; cursor: pointer; }

.tf-btn { font-size: 2em; text-transform: uppercase; font-weight: bold; }
.tf-true { background: #27ae60; border: 3px solid #2ecc71; }
.tf-true:hover { background: #2ecc71; }
.tf-false { background: #c0392b; border: 3px solid #e74c3c; }
.tf-false:hover { background: #e74c3c; }
.displayed-answer-box { background: #2c3e50; padding: 20px; margin-bottom: 20px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); font-size: 1.2em; font-style: italic;}

.eliminated-overlay { background: rgba(192, 57, 43, 0.8); padding: 15px; border-radius: 10px; font-weight: bold; color: white; margin-bottom: 15px; font-size: 1.2em; border: 2px solid #e74c3c; }

/* STOP OU ENCORE */
.stop-encore-overlay { margin-top: 10px; background:rgba(44, 62, 80, 0.95); z-index:100; display:flex; flex-direction:column; justify-content:center; align-items:center; border-radius:10px;}
.sg-btn { width: 45%; height: 80px; font-size: 1.5em; text-transform: uppercase; font-weight: bold; margin: 10px; border-radius: 10px; border: 4px solid transparent; opacity: 0.6; }
.sg-stop { background: #c0392b; }
.sg-encore { background: #27ae60; }
.sg-selected { opacity: 1; border-color: #fff; transform: scale(1.05); box-shadow: 0 0 20px rgba(255,255,255,0.3); }
.virtual-pot-display { font-size: 1.5em; margin-bottom: 20px; color: #f1c40f; }

/* BOMB CHOICE */
.bomb-target-btn { font-size: 1.2em; padding: 20px; font-weight: bold; text-transform: uppercase; color: white; border-radius: 8px; border: 3px solid rgba(255,255,255,0.2); }
.bomb-target-btn:hover { border-color: #f1c40f; }