/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: #000000;
}

/* Détection mobile uniquement */
@media (min-width: 768px) {
    body::before {
        content: "Ce jeu est conçu uniquement pour les appareils mobiles. Veuillez utiliser un smartphone ou une tablette.";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.9);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        padding: 20px;
        text-align: center;
        font-size: 18px;
        line-height: 1.6;
    }
}

/* Écrans */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 16px;
    min-height: 100vh;
    max-width: 100%;
}

/* Logo */
.logo-container {
    margin-bottom: 12px;
    text-align: center;
}

.logo {
    max-width: 120px;
    height: auto;
    filter: invert(1);
}

/* Contenu du formulaire */
.form-content {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

h1 {
    color: #000000;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

p {
    color: #666666;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Container JotForm */
.jotform-container {
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Iframe JotForm */
.jotform-container iframe {
    border-radius: 4px;
    overflow: hidden;
    transform: scale(0.9);
    transform-origin: top center;
    background: white;
    border: none;
    outline: none;
}


/* Liens légaux */
.legal-links {
    margin-top: 16px;
    text-align: center;
}

.legal-links p {
    color: #666666;
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
}

.legal-links a {
    color: #000000;
    text-decoration: underline;
    font-weight: 500;
}

.legal-links a:hover {
    color: #333333;
    text-decoration: none;
}

/* Détails de confidentialité */
.privacy-details {
    margin-top: 12px;
    text-align: left;
    background: #f8f8f8;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.privacy-details p {
    color: #666666;
    font-size: 10px;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.privacy-details p:last-child {
    margin-bottom: 0;
}

.privacy-details strong {
    color: #000000;
    font-weight: 600;
}

.privacy-details ol {
    margin: 8px 0;
    padding-left: 16px;
}

.privacy-details li {
    color: #666666;
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.privacy-details a {
    color: #000000;
    text-decoration: underline;
    font-weight: 500;
}

.privacy-details a:hover {
    color: #333333;
    text-decoration: none;
}

/* Section de confidentialité supplémentaire */
.additional-privacy {
    margin-top: 8px;
    text-align: left;
    background: #ffffff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.additional-privacy p {
    color: #666666;
    font-size: 9px;
    line-height: 1.3;
    margin: 0 0 6px 0;
}

.additional-privacy p:last-child {
    margin-bottom: 0;
}

.additional-privacy strong {
    color: #000000;
    font-weight: 600;
}

.additional-privacy ol {
    margin: 6px 0;
    padding-left: 14px;
}

.additional-privacy li {
    color: #666666;
    font-size: 9px;
    line-height: 1.3;
    margin-bottom: 3px;
}

.additional-privacy a {
    color: #000000;
    text-decoration: underline;
    font-weight: 500;
}

.additional-privacy a:hover {
    color: #333333;
    text-decoration: none;
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Écran de jeu */
.game-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

.player-info {
    color: #000000;
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #666666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #f5f5f5;
    border-color: #cccccc;
}

.game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

#game-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.game-controls {
    padding: 12px 16px;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.score-display {
    text-align: center;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.game-instructions {
    text-align: center;
}

.game-instructions p {
    color: #666666;
    font-size: 11px;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .logo-container {
        margin-bottom: 16px;
    }

    .logo {
        max-width: 120px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    p {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .jotform-container {
        padding: 12px;
        margin-bottom: 12px;
    }

    .jotform-container iframe {
        height: 420px !important;
    }
}

@media (max-width: 360px) {
    .logo {
        max-width: 100px;
    }

    h1 {
        font-size: 16px;
    }

    p {
        font-size: 11px;
    }

    .jotform-container iframe {
        height: 380px !important;
    }
}

/* États de transition */
.form-content.transitioning {
    opacity: 0.7;
    pointer-events: none;
}

/* Tentative de style pour le contenu JotForm (limité par les restrictions iframe) */
.jotform-container {
    overflow: hidden;
}


/* Optimisation pour les écrans très petits */
@media (max-height: 600px) {
    .logo-container {
        margin-bottom: 12px;
    }

    .logo {
        max-width: 100px;
    }

    h1 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    p {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .jotform-container {
        padding: 10px;
        margin-bottom: 10px;
    }

    .jotform-container iframe {
        height: 320px !important;
    }
}

@media (max-height: 500px) {
    .logo-container {
        margin-bottom: 8px;
    }

    .logo {
        max-width: 80px;
    }

    h1 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    p {
        font-size: 10px;
        margin-bottom: 8px;
    }

    .jotform-container {
        padding: 8px;
        margin-bottom: 8px;
    }

    .jotform-container iframe {
        height: 280px !important;
    }
}