/* Variables CSS modernes */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --success: #48bb78;
    --dark: #1a202c;
    --light: #f7fafc;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Particules animées en arrière-plan */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: floatBackground 30s ease-in-out infinite;
    pointer-events: none;
}

@keyframes floatBackground {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-20px, -20px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.9); }
}

/* Écrans */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.5s ease-out;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 500px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: containerSlideUp 0.6s ease-out;
}

@keyframes containerSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de brillance sur le container */
.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

h1, h2 {
    margin-bottom: 25px;
    color: #2d3748;
    font-weight: 800;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

h2 {
    font-size: 1.8rem;
}

/* Formulaire de connexion */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 18px 25px;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) border-box;
    border-radius: 15px;
    font-size: 18px;
    text-align: center;
    transition: var(--transition);
    font-weight: 600;
}

input[type="text"]:focus {
    outline: none;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

#sessionCode {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 800;
    font-size: 22px;
}

.btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.error {
    color: var(--danger);
    margin-top: 20px;
    font-weight: 600;
    display: none;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Modal pour nom existant */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-small {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 35px;
    border-radius: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalBounceIn 0.5s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes modalBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content-small h3 {
    color: var(--warning);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-content-small p {
    margin: 15px 0;
    color: #4a5568;
    font-size: 17px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-direction: column;
}



/* Écran d'attente */
.player-info {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 35px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.player-info p {
    margin: 12px 0;
    font-size: 18px;
    color: #4a5568;
}

.player-info strong {
    color: var(--primary);
    font-weight: 700;
}

.waiting-animation {
    margin: 50px 0;
    position: relative;
}

.pulse {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 40px rgba(102, 126, 234, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Ajouter des particules musicales autour */
.pulse::before,
.pulse::after {
    content: '♪';
    position: absolute;
    font-size: 30px;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}

.pulse::before {
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.pulse::after {
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-20px);
        opacity: 1;
    }
}

.info {
    color: #718096;
    font-size: 17px;
    font-style: italic;
}

/* Écran de question */
.question-header {
    margin-bottom: 35px;
}

.timer {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--warning) 0%, #dd6b20 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 36px;
    font-weight: 800;
    position: relative;
    box-shadow: 0 10px 30px rgba(237, 137, 54, 0.3);
    transition: var(--transition);
}

.timer::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

#questionText {
    font-size: 24px;
    line-height: 1.5;
    color: #2d3748;
    font-weight: 700;
}

.options-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.option-btn {
    padding: 25px 30px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 3px solid #e2e8f0;
    border-radius: 20px;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    transform: translateY(-50%);
    transition: width 0.3s ease-out;
    z-index: -1;
}

.option-btn:hover:not(.selected):not(.disabled) {
    transform: translateX(10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.option-btn:hover:not(.selected):not(.disabled)::before {
    width: 10px;
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.option-btn.validated {
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    border-color: var(--success);
    animation: validatePulse 0.5s ease-out;
}

@keyframes validatePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1.02); }
}

.option-btn.validated::after {
    content: ' ✓';
    font-size: 24px;
    margin-left: 10px;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Zone de validation */
.validation-zone {
    margin-top: 35px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(247, 250, 252, 0.9) 0%, rgba(237, 242, 247, 0.9) 100%);
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    animation: validationSlideIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes validationSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-zone::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--primary));
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

.selected-answer {
    font-size: 19px;
    margin-bottom: 20px;
    color: #4a5568;
}

.selected-answer strong {
    color: var(--primary);
    font-size: 21px;
    display: block;
    margin-top: 8px;
}

.btn-validate {
    width: 100%;
    padding: 22px;
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--success) 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-validate:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(72, 187, 120, 0.4);
}

.btn-validate:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-validate:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.pulse-animation {
    animation: validateButtonPulse 1s ease-out;
}

@keyframes validateButtonPulse {
    0% { transform: scale(1); box-shadow: 0 10px 30px rgba(72, 187, 120, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 15px 40px rgba(72, 187, 120, 0.5); }
    100% { transform: scale(1); box-shadow: 0 10px 30px rgba(72, 187, 120, 0.3); }
}

.validation-hint {
    margin-top: 12px;
    font-size: 15px;
    color: #718096;
    font-style: italic;
    animation: hintFade 2s ease-in-out infinite;
}

@keyframes hintFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Feedback de réponse */
.answer-feedback {
    margin-top: 25px;
    padding: 20px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 19px;
    display: none;
    animation: feedbackSlideIn 0.4s ease-out;
}

@keyframes feedbackSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer-feedback.correct {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.2);
}

.answer-feedback.incorrect {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.2);
}

.answer-feedback.waiting {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.2);
}

/* Écran de résultat */
#resultTitle {
    font-size: 32px;
    margin-bottom: 35px;
}

#resultTitle.correct {
    color: var(--success);
    animation: successBounce 0.6s ease-out;
}

#resultTitle.incorrect {
    color: var(--danger);
    animation: shake 0.5s ease-out;
}

#resultTitle.timeout {
    color: var(--warning);
}

@keyframes successBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.correct-answer {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.answer-text {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 12px;
}

.question-stats {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.question-stats p {
    font-size: 18px;
    color: #4a5568;
}

/* Écran final */
.final-scores {
    margin: 35px 0;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 18px;
    margin-bottom: 15px;
    font-size: 19px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.score-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 5px;
    background: #cbd5e0;
    transition: var(--transition);
}

.score-row:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.score-row.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: 800;
    font-size: 24px;
    animation: goldShine 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

@keyframes goldShine {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.score-row.rank-1::before {
    width: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.score-row.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #d1d5db 100%);
    font-weight: 700;
    font-size: 21px;
}

.score-row.rank-2::before {
    background: #9ca3af;
}

.score-row.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #d97706 100%);
    color: white;
    font-weight: 700;
    font-size: 20px;
}

.score-row.rank-3::before {
    background: #92400e;
}

.score-row.my-score {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 800;
    animation: myScoreHighlight 0.6s ease-out;
}

.score-row.my-score::before {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    animation: slideRight 0.6s ease-out;
}

@keyframes myScoreHighlight {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideRight {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.rank {
    font-size: 28px;
    margin-right: 15px;
}

/* Indicateur de reconnexion */
.reconnecting {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--warning) 0%, #dd6b20 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 15px;
    display: none;
    z-index: 1000;
    animation: reconnectSlide 0.5s ease-out;
    box-shadow: 0 10px 30px rgba(237, 137, 54, 0.3);
    font-weight: 600;
}

@keyframes reconnectSlide {
    from {
        transform: translate(-50%, -100px);
    }
    to {
        transform: translate(-50%, 0);
    }
}

/* Responsive mobile */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 25px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    #questionText {
        font-size: 20px;
    }
    
    .option-btn {
        padding: 20px;
        font-size: 17px;
        border-radius: 16px;
    }
    
    .btn-validate {
        padding: 18px;
        font-size: 18px;
    }
    
    .timer {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
    
    .score-row {
        padding: 15px 20px;
        font-size: 17px;
    }
    
    .score-row.rank-1 {
        font-size: 20px;
    }
    
    .btn-disconnect {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Support tactile amélioré */
@media (hover: none) {
    .option-btn:active:not(.disabled) {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* Mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .screen {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .waiting-animation {
        margin: 20px 0;
    }
    
    .pulse {
        width: 60px;
        height: 60px;
    }
}

/* Dark mode (optionnel) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .container {
        background: rgba(45, 55, 72, 0.95);
    }
    
    h1, h2, #questionText {
        color: #e2e8f0;
    }
    
    .player-info {
        background: linear-gradient(135deg, rgba(74, 85, 104, 0.9) 0%, rgba(45, 55, 72, 0.9) 100%);
    }
    
    .player-info p {
        color: #cbd5e0;
    }
    
    .option-btn {
        background: linear-gradient(135deg, rgba(74, 85, 104, 0.9) 0%, rgba(45, 55, 72, 0.9) 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }
}

/* Animations d'entrée pour les options */
.options-container .option-btn {
    animation: optionSlideIn 0.5s ease-out backwards;
}

.options-container .option-btn:nth-child(1) { animation-delay: 0.1s; }
.options-container .option-btn:nth-child(2) { animation-delay: 0.2s; }
.options-container .option-btn:nth-child(3) { animation-delay: 0.3s; }
.options-container .option-btn:nth-child(4) { animation-delay: 0.4s; }
.options-container .option-btn:nth-child(5) { animation-delay: 0.5s; }
.options-container .option-btn:nth-child(6) { animation-delay: 0.6s; }

@keyframes optionSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Effet de confettis pour la victoire */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s linear;
    z-index: 1000;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Ajouts/modifications pour mobile dans play.css */

/* Écran de question optimisé mobile */
@media (max-width: 600px) {
    /* Container principal sans scroll */
    .screen {
        padding: 10px;
        overflow: hidden;
    }
    
    #questionScreen .container {
        padding: 15px;
        height: calc(100vh - 20px);
        display: flex;
        flex-direction: column;
        max-width: 100%;
        margin: 0;
    }
    
  
    
    /* Header de question compact */
    .question-header {
        margin-bottom: 15px;
        flex-shrink: 0;
    }
    
    /* Timer plus petit */
    .timer {
        width: 70px;
        height: 70px;
        font-size: 28px;
        margin: 0 auto 10px;
    }
    
    /* Texte de question plus petit */
    #questionText {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 0;
        padding: 0 10px;
    }
    
    /* Container des options optimisé */
    .options-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Boutons d'option plus compacts */
    .option-btn {
        padding: 15px;
        font-size: 16px;
        border-radius: 12px;
        min-height: 50px;
        flex-shrink: 0;
    }
    
    /* Zone de validation fixe en bas */
    .validation-zone {
        margin-top: auto;
        padding: 15px;
        border-radius: 15px;
        position: sticky;
        bottom: 0;
        background: white;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        flex-shrink: 0;
    }
    
    /* Texte de validation plus compact */
    .selected-answer {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .selected-answer strong {
        font-size: 18px;
        display: inline;
        margin: 0;
    }
    
    /* Bouton de validation optimisé */
    .btn-validate {
        padding: 16px;
        font-size: 17px;
        font-weight: 700;
    }
    
    /* Hint plus petit */
    .validation-hint {
        font-size: 12px;
        margin-top: 8px;
    }
    
    /* Feedback compact */
    .answer-feedback {
        position: absolute;
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 15px;
        font-size: 16px;
        border-radius: 10px;
    }
}

/* Ultra petits écrans (moins de 400px) */
@media (max-width: 400px) {
    #questionScreen .container {
        padding: 10px;
        height: calc(100vh - 20px);
    }
    
    .timer {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    #questionText {
        font-size: 16px;
    }
    
    .option-btn {
        padding: 12px;
        font-size: 15px;
        min-height: 45px;
    }
    
    .validation-zone {
        padding: 12px;
    }
    
    .btn-validate {
        padding: 14px;
        font-size: 16px;
    }
}

/* Fix pour les écrans en mode paysage */
@media (max-height: 500px) and (orientation: landscape) {
    #questionScreen .container {
        padding-top: 40px;
    }
    
    .question-header {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .timer {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin: 0;
    }
    
    #questionText {
        font-size: 16px;
        text-align: left;
        flex: 1;
    }
    
    .options-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        overflow: visible;
    }
    
    .option-btn {
        padding: 10px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .validation-zone {
        padding: 10px;
    }
    
    .selected-answer {
        display: inline;
        margin-right: 15px;
    }
    
    .btn-validate {
        padding: 10px 20px;
        font-size: 15px;
        display: inline-block;
        width: auto;
    }
    
    .validation-hint {
        display: none;
    }
}

/* Amélioration de la disposition verticale */
#questionScreen.screen.active {
    display: flex;
}

/* S'assurer que le container utilise toute la hauteur */
@supports (height: 100dvh) {
    @media (max-width: 600px) {
        #questionScreen .container {
            height: calc(100dvh - 20px);
        }
    }
}

/* Fix pour iOS Safari */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 600px) {
        #questionScreen .container {
            height: calc(100vh - 20px);
            height: calc(100vh - 20px - env(safe-area-inset-bottom));
        }
        
        .validation-zone {
            padding-bottom: calc(15px + env(safe-area-inset-bottom));
        }
    }
}

/* REMPLACEZ la section mobile existante par celle-ci dans play.css */

@media (max-width: 600px) {
    /* Bouton fixe en haut */
   
    
    /* Écran principal scrollable */
    #questionScreen {
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Container principal */
    #questionScreen .container {
        padding: 70px 15px 20px 15px;
        min-height: 100vh;
        display: block; /* Pas flex ! */
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* Header compact */
    .question-header {
        margin-bottom: 20px;
    }
    
    .timer {
        width: 80px;
        height: 80px;
        font-size: 32px;
        margin: 0 auto 15px;
    }
    
    #questionText {
        font-size: 20px;
        margin-bottom: 20px;
        padding: 0;
    }
    
    /* Options */
    .options-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px; /* Espace fixe avant la validation */
    }
    
    .option-btn {
        padding: 18px 20px;
        font-size: 18px;
        width: 100%;
    }
    
    /* Zone de validation juste après les options */
    .validation-zone {
        margin-top: 0; /* Pas de margin auto ! */
        margin-bottom: 20px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        animation: none; /* Pas d'animation */
    }
    
    .selected-answer {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .btn-validate {
        padding: 18px;
        font-size: 18px;
        width: 100%;
    }
    
    .validation-hint {
        display: none;
    }
    
    /* Supprimer l'espaceur */
    #questionScreen .container::before {
        display: none;
    }
    
    /* Feedback positionné normalement */
    .answer-feedback {
        position: relative;
        margin-top: 20px;
        padding: 18px;
        font-size: 17px;
        border-radius: 15px;
    }
}

/* Petits écrans */
@media (max-width: 600px) and (max-height: 700px) {
    #questionScreen .container {
        padding-top: 60px;
    }
    
    .timer {
        width: 70px;
        height: 70px;
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    #questionText {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .options-container {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .option-btn {
        padding: 15px 18px;
        font-size: 17px;
    }
    
    .validation-zone {
        padding: 15px;
    }
}

/* Mode paysage */
@media (max-height: 500px) and (orientation: landscape) {
    #questionScreen .container {
        padding: 50px 15px 15px 15px;
        min-height: auto;
    }
    
    .question-header {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-bottom: 10px;
    }
    
    .timer {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 0;
    }
    
    #questionText {
        flex: 1;
        font-size: 18px;
        text-align: left;
        margin: 0;
    }
    
    .options-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .option-btn {
        padding: 12px;
        font-size: 15px;
    }
    
    .validation-zone {
        padding: 12px 15px;
    }
}

/* Fix Safari iOS */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 600px) {
     
        #questionScreen .container {
            padding-bottom: max(20px, env(safe-area-inset-bottom));
        }
    }
}



/* S'assurer que le bouton est visible sur tous les écrans */
#joinScreen .btn-disconnect,
#waitingScreen .btn-disconnect,
#questionScreen .btn-disconnect,
#resultScreen .btn-disconnect {
    display: block !important;
}

/* Zone de validation/feedback unifiée */
@media (max-width: 600px) {
    /* Container principal ajusté pour le bouton fixe */
    .screen .container {
        padding-top: 65px !important; /* Espace pour le bouton fixe */
    }
    
    /* Zone de validation transformable */
    .validation-zone {
        margin-top: 20px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        transition: all 0.4s ease;
        position: relative;
        overflow: hidden;
    }
    
    /* État initial - Avant validation */
    .validation-zone:not(.answered) {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 250, 252, 0.95) 100%);
    }
    
    /* État réponse envoyée */
    .validation-zone.sending {
        background: linear-gradient(135deg, rgba(254, 243, 199, 0.95) 0%, rgba(253, 230, 138, 0.95) 100%);
    }
    
    /* État bonne réponse */
    .validation-zone.correct {
        background: linear-gradient(135deg, rgba(209, 250, 229, 0.95) 0%, rgba(167, 243, 208, 0.95) 100%);
    }
    
    /* État mauvaise réponse */
    .validation-zone.incorrect {
        background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 202, 202, 0.95) 100%);
    }
    
    /* Contenu de la validation */
    .validation-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        text-align: center;
    }
    
    /* Réponse sélectionnée */
    .selected-answer {
        font-size: 17px;
        color: #4a5568;
        margin: 0;
        transition: all 0.3s ease;
    }
    
    .selected-answer strong {
        color: var(--primary);
        font-size: 19px;
    }
    
    /* État en attente - réponse envoyée */
    .validation-zone.sending .selected-answer {
        font-size: 15px;
        opacity: 0.8;
    }
    
    /* Bouton de validation */
    .btn-validate {
        padding: 18px 30px;
        font-size: 18px;
        width: 100%;
        transition: all 0.4s ease;
        position: relative;
    }
    
    /* Bouton après envoi - plus petit */
    .validation-zone.sending .btn-validate,
    .validation-zone.answered .btn-validate {
        padding: 10px 20px;
        font-size: 14px;
        width: auto;
        opacity: 0.6;
        pointer-events: none;
        transform: scale(0.8);
    }
    
    /* Message de statut */
    .validation-status {
        display: none;
        font-size: 16px;
        font-weight: 600;
        margin: 0;
        animation: fadeInScale 0.4s ease;
    }
    
    .validation-zone.sending .validation-status {
        display: block;
        color: #92400e;
    }
    
    /* Feedback de résultat */
    .validation-result {
        display: none;
        flex-direction: column;
        gap: 8px;
        animation: slideInUp 0.5s ease;
        width: 100%;
    }
    
    .validation-zone.answered .validation-result {
        display: flex;
    }
    
    .result-message {
        font-size: 19px;
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .validation-zone.correct .result-message {
        color: #065f46;
    }
    
    .validation-zone.incorrect .result-message {
        color: #991b1b;
    }
    
    .result-points {
        font-size: 17px;
        font-weight: 600;
        color: #4a5568;
    }
    
    .result-bonus {
        font-size: 15px;
        color: #d97706;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    /* Masquer les éléments selon l'état */
    .validation-zone.answered .selected-answer,
    .validation-zone.answered .btn-validate {
        display: none;
    }
    
    .validation-zone.sending .btn-validate {
        display: block;
        margin-top: 10px;
    }
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adaptation pour petits écrans */
@media (max-width: 400px) {
   
    
    .validation-zone {
        padding: 15px;
    }
    
    .result-message {
        font-size: 17px;
    }
    
    .result-points {
        font-size: 15px;
    }
}

/* Fix pour Safari iOS */
@supports (-webkit-touch-callout: none) {
    .btn-disconnect {
        top: max(15px, env(safe-area-inset-top));
        left: max(15px, env(safe-area-inset-left));
    }
}

/* Supprimer l'ancien style answer-feedback */
.answer-feedback {
    display: none !important;
}

/* === BOUTON "QUITTER" TOUJOURS FIXE ET AU-DESSUS DE TOUT === */
#disconnectBtn,
#disconnectBtnQuestion,
#disconnectBtnResult,
.btn-disconnect {
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    z-index: 99999 !important;
    padding: 10px 22px !important;
    font-size: 16px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    border: none !important;
    border-radius: 22px !important;
    color: #374151 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08) !important;
    transition: all 0.3s;
    display: block !important;
    width: auto !important;
    height: auto !important;
    cursor: pointer !important;
}

#disconnectBtn:hover,
#disconnectBtnQuestion:hover,
#disconnectBtnResult:hover,
.btn-disconnect:hover {
    background: #fff !important;
    color: #222 !important;
    transform: translateX(-2px) scale(1.03);
    box-shadow: 0 6px 24px rgba(30,41,59,0.08) !important;
}

/* S'assurer qu'il est présent sur tous les écrans */
#joinScreen .btn-disconnect,
#waitingScreen .btn-disconnect,
#questionScreen .btn-disconnect,
#resultScreen .btn-disconnect,
#finalScreen .btn-disconnect {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Adapter le contenu pour ne jamais être caché sous le bouton (mobile) */
@media (max-width: 600px) {
    .screen .container {
        padding-top: 70px !important;
    }
    #disconnectBtn,
    #disconnectBtnQuestion,
    #disconnectBtnResult,
    .btn-disconnect {
        top: 10px !important;
        left: 10px !important;
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
}

/* Safe-area pour iOS */
@supports (-webkit-touch-callout: none) {
    #disconnectBtn,
    #disconnectBtnQuestion,
    #disconnectBtnResult,
    .btn-disconnect {
        top: max(10px, env(safe-area-inset-top)) !important;
        left: max(10px, env(safe-area-inset-left)) !important;
    }
}
