* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-x: hidden;
}

/* Animations de bulles */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite ease-in-out;
    z-index: 0;
}

body::before {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

body::after {
    bottom: 10%;
    right: 10%;
    animation-delay: 7s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-50px) scale(1.1); }
}

/* Écrans */
.screen {
    display: none;
    width: 100%;
    max-width: 1800px;
    padding: 2vw;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 40px;
    padding: 4vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Titres */
.title {
    font-size: clamp(3rem, 6vw, 8rem);
    text-align: center;
    color: #667eea;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 1vw;
    animation: bounce 2s infinite;
}

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

.subtitle {
    font-size: clamp(1.5rem, 3vw, 4rem);
    text-align: center;
    color: #764ba2;
    margin-bottom: 3vw;
}

/* Groupes de sélection */
.selection-group {
    margin-bottom: 3vw;
}

.selection-group h2 {
    font-size: clamp(2rem, 4vw, 5rem);
    color: #667eea;
    margin-bottom: 2vw;
    text-align: center;
}

/* Grille de boutons */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2vw;
    margin-bottom: 2vw;
}

/* Boutons de sélection */
.select-btn {
    font-family: inherit;
    font-size: clamp(1.5rem, 2.5vw, 3.5rem);
    font-weight: bold;
    padding: 2vw 3vw;
    border: 4px solid transparent;
    border-radius: 25px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.select-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.select-btn.selected {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    border-color: #00b894;
    transform: scale(1.1);
}

/* Bouton principal */
.main-btn {
    font-family: inherit;
    font-size: clamp(2rem, 3.5vw, 5rem);
    font-weight: bold;
    padding: 2vw 4vw;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #74ebd5 0%, #ACB6E5 100%);
    color: white;
    cursor: pointer;
    display: block;
    margin: 3vw auto 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.main-btn:hover:not(:disabled) {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.main-btn:disabled {
    background: #dfe6e9;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Header bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3vw;
    flex-wrap: wrap;
    gap: 2vw;
}

.info-box, .timer-box, .progress-box {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: white;
    padding: 1.5vw 3vw;
    border-radius: 20px;
    font-size: clamp(1.5rem, 2.5vw, 3.5rem);
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.info-box.centered {
    display: block;
    text-align: center;
    margin: 2vw auto;
}

/* Contenu exercice */
.exercise-content {
    background: linear-gradient(135deg, #fee140 0%, #fef3c7 100%);
    border-radius: 30px;
    padding: 4vw;
    margin-bottom: 3vw;
    min-height: 40vh;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.1);
}

.exercise-number {
    font-size: clamp(2rem, 3.5vw, 4.5rem);
    color: #e17055;
    margin-bottom: 2vw;
    text-align: center;
}

.question-box {
    font-size: clamp(1.8rem, 3vw, 4rem);
    color: #2d3436;
    line-height: 1.6;
    text-align: center;
    padding: 2vw;
}

/* Contrôles */
.controls {
    display: flex;
    justify-content: center;
    gap: 2vw;
    flex-wrap: wrap;
}

.control-btn {
    font-family: inherit;
    font-size: clamp(1.5rem, 2.5vw, 3.5rem);
    font-weight: bold;
    padding: 1.5vw 3vw;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.control-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.control-btn.primary {
    background: linear-gradient(135deg, #74ebd5 0%, #ACB6E5 100%);
}

.control-btn.success {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

/* Conteneur des réponses */
.answers-container {
    margin: 3vw 0;
}

.answer-item {
    background: linear-gradient(135deg, #ffeaa7 0%, #fff9e6 100%);
    border-radius: 20px;
    padding: 2vw;
    margin-bottom: 2vw;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.answer-item h3 {
    font-size: clamp(1.8rem, 3vw, 4rem);
    color: #e17055;
    margin-bottom: 1vw;
}

.answer-question {
    font-size: clamp(1.5rem, 2.5vw, 3.5rem);
    color: #2d3436;
    margin-bottom: 1vw;
    font-weight: 600;
}

.answer-text {
    font-size: clamp(1.5rem, 2.5vw, 3.5rem);
    color: #00b894;
    padding: 1.5vw;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    border-left: 6px solid #00b894;
}

/* Responsive pour différentes tailles de TV */
@media (min-width: 1920px) and (min-height: 1080px) {
    /* TV Full HD et supérieur */
    .container {
        padding: 60px;
    }
    
    .button-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 2560px) and (min-height: 1440px) {
    /* TV 2K et supérieur */
    .title {
        font-size: 10rem;
    }
    
    .button-grid {
        gap: 40px;
    }
}

@media (min-width: 3840px) and (min-height: 2160px) {
    /* TV 4K */
    .container {
        padding: 100px;
        max-width: 3200px;
    }
    
    .title {
        font-size: 14rem;
    }
}

/* Animation pour les éléments apparaissant */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Curseur personnalisé pour interface TV */
button, .select-btn {
    position: relative;
    overflow: hidden;
}

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

button:active::before, .select-btn:active::before {
    width: 300px;
    height: 300px;
}
/* Login Screen */
.login-container {
    max-width: 500px;
    text-align: center;
}

.login-form {
    margin-top: 2rem;
}

.code-input-container {
    margin-bottom: 2rem;
}

.code-input {
    font-size: clamp(2rem, 4vw, 3rem);
    padding: 1rem 2rem;
    border: 4px solid #fff;
    border-radius: 20px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 0.5rem;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s;
}

.code-input:focus {
    outline: none;
    border-color: #f093fb;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.login-hint {
    margin-top: 1.5rem;
    color: white;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    opacity: 0.9;
}

.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 77, 77, 0.9);
    color: white;
    border-radius: 10px;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    animation: shake 0.5s;
}

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

.header-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

.header-user h2 {
    color: white;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.btn-logout {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 77, 77, 0.8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 77, 77, 1);
    transform: translateY(-2px);
}