/* Styles dédiés au jeu game-forecast */

/* Styles pour le message de limitation quotidienne */
.daily-limit-message {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, #f5f0d7 0%, #fff8e1 100%);
    border: 2px solid #dcc8aa;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    margin: 2rem auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.daily-limit-message .limit-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.daily-limit-message .title-pikto {
    width: 50px;
    height: 50px;
    opacity: 0.8;
    animation: float 3s ease-in-out infinite;
}

.daily-limit-message .title-pikto:nth-child(1) {
    animation-delay: 0s;
}

.daily-limit-message .title-pikto:nth-child(2) {
    animation-delay: 0.3s;
}

.daily-limit-message .title-pikto:nth-child(3) {
    animation-delay: 0.6s;
}

.daily-limit-message h3 {
    color: #7c3aed;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #7c3aed, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    max-width: 100%;
}

.daily-limit-message .limit-text {
    font-size: 1.2rem;
    color: #555;
    margin: 1rem 0;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.daily-limit-message .limit-decoration {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.daily-limit-message .decoration-icon {
    width: 40px;
    height: 40px;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

.daily-limit-message .decoration-icon:nth-child(1) {
    animation-delay: 0s;
}

.daily-limit-message .decoration-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.daily-limit-message .decoration-icon:nth-child(3) {
    animation-delay: 1s;
}

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

/* Styles pour l'explication de l'algorithme */
.algorithme-explication {
    max-width: 800px;
    margin: 2rem auto 0 auto;
    padding: 1.5rem 0;
}

.algorithme-explication summary {
    font-weight: 600;
    color: #4a4a4a;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.algorithme-explication summary:hover {
    color: #7c3aed;
}

.algorithme-explication p {
    color: #666;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    margin: 1rem 0;
    padding-left: 1rem;
}

.algorithme-explication p:last-child {
    margin-bottom: 0;
}

.algorithme-explication .author-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
}

.algorithme-explication .author-link:hover {
    text-decoration: underline;
    color: #5b21b6;
}

/* Styles pour les liens externes */
.external-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: normal !important;
    font-family: 'Arial', sans-serif !important;
    font-style: normal !important;
}

.external-link:hover {
    text-decoration: underline;
    color: #5b21b6;
}

.forecast-section {
    background: rgba(245, 240, 215, 0.9);
    border: 2px solid rgba(220, 200, 170, 0.8);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.forecast-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #7c3aed;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #7c3aed, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nergo-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin: 0 auto 2rem auto;
    max-width: 600px;
    line-height: 1.5;
    font-style: italic;
    padding: 0 1rem;
}

.game-forecast-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-forecast {
    background: rgba(252, 250, 240, 0.9);
    border: 2px solid rgba(200, 180, 150, 0.8);
    border-radius: 15px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

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

.game-intro p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.btn-start {
    background: linear-gradient(45deg, #7c3aed, #fbbf24);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3);
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* Styles pour les étapes du jeu */
.game-step {
    display: none;
    text-align: center;
}

.game-step.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.game-step h3 {
    color: #7c3aed;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin: 2rem auto;
    justify-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.choice-item {
    background: rgba(252, 250, 240, 0.95);
    border: 3px solid rgba(200, 180, 150, 0.8);
    border-radius: 15px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    box-sizing: border-box;
    width: 100px;
    height: 100px;
    position: relative;
    overflow: hidden;
}

.choice-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Disposition circulaire pour les étapes 1 et 2 */
.choices-grid.circular {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 400px;
    height: 400px;
    margin: 2rem auto;
}

.choices-grid.circular .choice-item {
    position: absolute;
    min-width: 80px;
    max-width: 80px;
    height: 80px;
}

/* Disposition matricielle pour l'étape 3 */
.choices-grid.matrix-step3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

.matrix-row-top,
.matrix-row-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    justify-items: center;
}

.matrix-main {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0.8rem;
    justify-items: center;
}

.matrix-step3 .choice-item {
    min-width: 70px;
    max-width: 70px;
    height: 70px;
}

/* Grilles adaptatives selon le nombre d'éléments */
.choices-grid.items-7 { 
    grid-template-columns: repeat(3, 1fr);
    max-width: 360px;
}

.choices-grid.items-6 { 
    grid-template-columns: repeat(3, 1fr);
    max-width: 360px;
}

.choices-grid.items-5 { 
    grid-template-columns: repeat(3, 1fr);
    max-width: 360px;
}

.choices-grid.items-4 { 
    grid-template-columns: repeat(2, 1fr);
    max-width: 240px;
}

.choices-grid.items-3 { 
    grid-template-columns: repeat(3, 1fr);
    max-width: 360px;
}

.choices-grid.items-2 { 
    grid-template-columns: repeat(2, 1fr);
    max-width: 240px;
}

.choices-grid.items-1 { 
    grid-template-columns: 1fr;
    max-width: 120px;
}

/* Pour l'étape 3 avec 26 pictogrammes */
.choices-grid.items-26 {
    grid-template-columns: repeat(6, 1fr);
    max-width: 660px;
    gap: 0.8rem;
}

.choices-grid.items-25 {
    grid-template-columns: repeat(5, 1fr);
    max-width: 560px;
}

.choice-item:hover {
    border-color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.2);
}

.choice-item.flipped {
    opacity: 0.3;
    transform: rotateY(180deg);
}

.choice-item.flipped img {
    visibility: hidden;
}

.choice-item.blocked {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
}

.choice-item.blocked:hover {
    transform: none;
    box-shadow: none;
    border-color: #ccc;
}

.choice-item.selected {
    background: linear-gradient(45deg, #7c3aed, #fbbf24);
    color: white;
    border-color: #7c3aed;
}

.game-controls {
    margin-top: 2rem;
    text-align: center;
}

.btn-next {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
    /* Amélioration pour mobile */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Styles pour l'affichage du résultat optimisé pour les captures d'écran */
.screenshot-container {
    background: rgba(245, 240, 215, 0.9);
    border: 2px solid rgba(220, 200, 170, 0.8);
    border-radius: 20px;
    padding: 2rem;
    margin: 1rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    box-sizing: border-box;
}

.result-header h3 {
    color: #7c3aed;
    font-size: 1.4rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
    background: linear-gradient(45deg, #7c3aed, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    line-height: 1.3;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.pictogram-section {
    text-align: center;
    flex-shrink: 0;
}

.pictogram-section img {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 0.8rem;
}

.pictogram-name {
    color: #7c3aed;
    font-size: 1.3rem;
    margin: 0;
    font-weight: bold;
}

.analysis-section {
    width: 100%;
    background: rgba(235, 220, 180, 0.8);
    border: 2px solid rgba(210, 185, 140, 0.8);
    border-left: 5px solid #7c3aed;
    border-radius: 15px;
    padding: 1.2rem;
    box-sizing: border-box;
}

.analysis-text {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
    text-align: justify;
    hyphens: auto;
    word-wrap: break-word;
}

.key-phrase {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
}

.tips-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tip-item {
    font-size: 0.9rem;
    line-height: 1.3;
    padding-left: 0.5rem;
}

.screenshot-tip {
    margin-top: 1.5rem;
    background: rgba(250, 248, 235, 0.8);
    border: 2px solid rgba(230, 215, 185, 0.7);
    border-left: 4px solid #7c3aed;
    border-radius: 10px;
    padding: 0.8rem;
}

.screenshot-tip p {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
    text-align: center;
}

/* Animation pour l'apparition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive pour forecast */
@media (max-width: 768px) {
    .forecast-section {
        padding: 2rem 1rem;
        margin: 1rem 0;
    }

    .forecast-section h2 {
        font-size: 2rem;
    }

    .choices-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.8rem;
        margin: 2rem auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Amélioration des boutons sur mobile */
    .btn-next {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        min-height: 48px; /* Taille minimum recommandée pour touch */
        width: auto;
        min-width: 150px;
    }

    .choice-item {
        width: 80px;
        height: 80px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }

    /* Grilles adaptatives pour mobile */
    .choices-grid.items-7,
    .choices-grid.items-6,
    .choices-grid.items-5 { 
        grid-template-columns: repeat(3, 1fr);
        max-width: 270px;
    }

    .choices-grid.items-4,
    .choices-grid.items-3,
    .choices-grid.items-2 { 
        grid-template-columns: repeat(2, 1fr);
        max-width: 180px;
    }

    .choices-grid.items-1 { 
        grid-template-columns: 1fr;
        max-width: 90px;
    }

    .choices-grid.items-26 {
        grid-template-columns: repeat(4, 1fr);
        max-width: 340px;
        gap: 0.6rem;
    }

    .choices-grid.items-25 {
        grid-template-columns: repeat(4, 1fr);
        max-width: 340px;
    }

    /* Styles responsive pour l'affichage du résultat - tablettes */
    .screenshot-container {
        padding: 1.8rem 1.2rem;
    }

    .result-header h3 {
        font-size: 1.3rem;
    }

    .pictogram-section img {
        width: 75px !important;
        height: 75px !important;
    }

    .pictogram-name {
        font-size: 1.2rem;
    }

    .analysis-text {
        font-size: 0.9rem;
    }

    /* Style mobile pour le message de limite quotidienne */
    .daily-limit-message {
        padding: 2rem 1rem;
        margin: 1.5rem auto;
        max-width: 90%;
        width: calc(100% - 2rem);
    }

    .daily-limit-message h3 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 1.2rem;
    }

    .daily-limit-message .limit-text {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .forecast-section {
        padding: 1.5rem 0.5rem;
    }

    .btn-start {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    /* Style mobile très petit écran pour le message de limite quotidienne */
    .daily-limit-message {
        padding: 1.5rem 0.8rem;
        margin: 1rem auto;
        max-width: 95%;
        width: calc(100% - 1rem);
        min-height: auto;
    }

    .daily-limit-message h3 {
        font-size: 1.3rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        padding: 0 0.2rem;
    }

    .daily-limit-message .limit-text {
        font-size: 1rem;
        line-height: 1.5;
        padding: 0 0.2rem;
        word-break: break-word;
    }

    .choices-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.6rem;
        margin: 1.5rem auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .choice-item {
        width: 70px;
        height: 70px;
        padding: 0.3rem;
        font-size: 0.7rem;
    }

    /* Grilles adaptatives pour très petit mobile */
    .choices-grid.items-7,
    .choices-grid.items-6,
    .choices-grid.items-5 { 
        grid-template-columns: repeat(3, 1fr);
        max-width: 230px;
    }

    .choices-grid.items-4,
    .choices-grid.items-3,
    .choices-grid.items-2 { 
        grid-template-columns: repeat(2, 1fr);
        max-width: 154px;
    }

    .choices-grid.items-1 { 
        grid-template-columns: 1fr;
        max-width: 77px;
    }

    .choices-grid.items-26 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 245px;
        gap: 0.5rem;
    }

    .choices-grid.items-25 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 245px;
    }

    /* Styles responsive pour l'affichage du résultat */
    .screenshot-container {
        padding: 1.2rem 0.8rem;
        margin: 0.5rem 0;
    }

    .result-header h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        line-height: 1.2;
    }

    .result-content {
        gap: 1rem;
    }

    .pictogram-section img {
        width: 60px !important;
        height: 60px !important;
    }

    .pictogram-name {
        font-size: 1rem;
    }

    .analysis-section {
        padding: 0.8rem;
    }

    .analysis-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .screenshot-tip {
        margin-top: 1rem;
        padding: 0.6rem;
    }

    .screenshot-tip p {
        font-size: 0.75rem;
    }
}