﻿
body{

margin:0;

font-family:system-ui;

background:#f6f8fb;

}

.container{

max-width:700px;

margin:auto;

padding:30px;

}

.card{

background:white;

padding:30px;

border-radius:24px;

box-shadow:
0 10px 25px rgba(0,0,0,.08);

}

h1{
font-size:32px;
text-align:center;

}

.progress{

height:18px;

background:#eceff3;

border-radius:999px;

overflow:hidden;

margin-bottom:30px;

}

.bar{

height:100%;

border-radius:30px;

background:
linear-gradient(
90deg,
#7c3aed,
#ec4899
);

transition:.4s;

}

.question{

font-size:60px;

text-align:center;

margin:30px 0;

}

input{

width:140px;

font-size:32px;

text-align:center;

padding:10px;

border-radius:18px;

border:2px solid #ddd;

display:block;

margin:auto;

}

button{

display:block;

margin:
24px auto;

padding:
16px 28px;

border:none;

border-radius:999px;

font-size:20px;

cursor:pointer;

background:
linear-gradient(
135deg,
#7c3aed,
#ec4899
);

color:white;

}

.ok{

color:#16a34a;

text-align:center;

}

.bad{

color:#dc2626;

text-align:center;

}


.textfin{

font-size:22px;
}
.links{

display:flex;

    gap:12px;

    margin-top:25px;

}

.links a{

 flex:1;

    text-align:center;

    padding:15px 10px;

    border-radius:12px;

    background:#4CAF50;

    color:#fff;

    text-decoration:none;

    font-weight:bold;

    transition:.2s;

}
.links a:hover{

    transform:translateY(-2px);

    filter:brightness(1.08);

}




/* téléphone */
@media (max-width:600px){

.grid{
gap:4px;
}

.fact{

font-size:11px;

border-radius:8px;

}

}
/* isolation de la page Commencer */

.welcome h1{

font-size:clamp(
32px,
5vw,
42px
);

margin-bottom:24px;

}

.welcome h2{

font-size:clamp(
20px,
2.5vw,
28px
);

line-height:1.2;

margin:
0 0 12px;

}

.welcome h3{

font-size:clamp(
18px,
2vw,
22px
);

margin:
12px 0;

}

.welcome p{

font-size:16px;

line-height:1.7;

}

.welcome ul{

font-size:16px;

}

.welcome button{

font-size:20px;

}
.mission-header{

    max-width:700px;
    margin:15px auto 10px;
    padding:15px 18px;

    background:white;

    border-radius:18px;

    box-shadow:0 4px 12px rgba(0,0,0,.08);

}

.mission-header h1{

    margin:0 0 12px;

    text-align:center;

    font-size:24px;

    color:#444;

}

.progress{

    margin-bottom:15px;

}

.progress-bar{

    height:14px;

    background:#ececec;

    border-radius:30px;

    overflow:hidden;

}

.progress-fill{

    height:100%;

    width:0;

    border-radius:30px;

    background:linear-gradient(90deg,#4CAF50,#8BC34A);

    transition:.4s;

}

.progress-text{

    margin-top:10px;

    text-align:center;

    font-weight:bold;

    color:#666;

}

.mission-stats{

    display:flex;

    gap:10px;

}

.stat{

    flex:1;

    border-radius:14px;

    padding:10px 6px;

    text-align:center;

    transition:.25s;
	

}

.stat:hover{

    transform:translateY(-3px);

}

.good{

    background:#E8F8EC;

}

.bad{

    background:#FDECEC;

}

.zestar{

    background:#FFF8D8;

}

.value{

    font-size:26px;

    font-weight:bold;

    margin-bottom:2px;

}

.label{

    font-size:13px;

    color:#666;

}

@media(max-width:650px){

    .mission-stats{

        gap:8px;

    }

    .stat{

        padding:12px 6px;

    }

    .value{

        font-size:20px;

    }

    .label{

        font-size:13px;

    }

}

.trophy-popup{

    position:fixed;

    left:50%;
    top:40%;

    transform:translate(-50%,-50%) scale(.7);

    width:360px;
    max-width:90%;

    background:white;

    border-radius:25px;

    padding:30px;

    text-align:center;

    box-shadow:0 15px 40px rgba(0,0,0,.30);

    opacity:0;

    pointer-events:none;

    transition:.35s;

    z-index:10000;

	overflow:visible;
}

.trophy-popup.show{

    opacity:1;

    transform:translate(-50%,-50%) scale(1);

}

.trophy-icon{

    font-size:70px;

    margin-top:-10px;
    margin-bottom:10px;

    animation:bounce .8s;

}

.trophy-title{

    font-size:32px;

    font-weight:bold;

    color:#444;

    margin-bottom:10px;

}

.trophy-text{

    font-size:18px;

    color:#666;

}

@keyframes bounce{

    0%{

        transform:scale(.3);

    }

    60%{

        transform:scale(1.2);

    }

    100%{

        transform:scale(1);

    }

}
#overlay{

    position:fixed;

    inset:0;

    
    backdrop-filter:blur(3px);

    opacity:0;

    pointer-events:none;

    transition:.3s;

    z-index:9998;

}

#overlay.show{

    opacity:1;

}
.trophy-popup{

    z-index:9999;

}
.overlay-green{

    background:rgba(76,175,80,.25);

}

.overlay-gold{

    background:rgba(255,193,7,.30);

}

.overlay-rainbow{

    background:linear-gradient(
        45deg,
        rgba(255,0,0,.20),
        rgba(255,255,0,.20),
        rgba(0,255,0,.20),
        rgba(0,150,255,.20),
        rgba(150,0,255,.20)
    );

}

#stars-rain{

    position:fixed;

    inset:0;

    pointer-events:none;

    overflow:hidden;

    z-index:9999;

}


.falling-star{

    position:absolute;

    top:-40px;

    font-size:30px;

    animation:fall 2.5s linear forwards;

}

@keyframes fall{

    from{

        transform:
            translate(0,0)
            rotate(0deg);

    }

    to{

        transform:
            translate(
                calc(-80px + 160px * var(--drift)),
                110vh
            )
            rotate(720deg);

        opacity:0;

    }

}
.valid-star{

    position:absolute;

    right:-12px;
	
	top:-12px;
	
	transform:rotate(15deg);

    font-size:58px;

    animation:starAppear .9s;

    filter:drop-shadow(0 0 10px gold);

	z-index:10005;


}

@keyframes starAppear{

    0%{

        transform:scale(.2) rotate(-30deg);

        opacity:0;

    }

    60%{

        transform:scale(1.3) rotate(15deg);

        opacity:1;

    }

    100%{

        transform:scale(1) rotate(0deg);

        opacity:1;

    }

}
.progress-stars{

    margin:5px 0 5px;

}

.star{

    display:inline-block;

    font-size:40px;

    margin:0 3px;
	background:transparent;

}

.full{

    color:#FFD700;

    text-shadow:0 0 8px gold;

}

.empty{

    color:#DDD;

}

.new{

    animation:newStar .7s ease;

}

@keyframes newStar{

    0%{

        transform:scale(.2) rotate(-30deg);

        opacity:0;

    }

    50%{

        transform:scale(1.6) rotate(15deg);

    }

    75%{

        transform:scale(.9);

    }

    100%{

        transform:scale(1);

        opacity:1;

    }

}
.correction-card{

    text-align:center;

    padding:35px;

    animation:fadeIn .3s;

}

.error-icon{

    font-size:60px;

    margin-bottom:15px;

}

.result{

    font-size:42px;

    font-weight:bold;

    color:#4CAF50;

    margin:20px 0;

}

.tip{

    margin-top:15px;

    color:#666;

    font-style:italic;
    transition:.4s;

}
.answer{

    color:#2E7D32;

    font-weight:bold;

    animation:pop .4s;

}

@keyframes pop{

    0%{

        transform:scale(.3);

        opacity:0;

    }

    70%{

        transform:scale(1.2);

    }

    100%{

        transform:scale(1);

        opacity:1;

    }

}

/* =========================================
   NAVIGATION
========================================= */

.bottom-navigation {
    display: flex;

    justify-content: center;

    margin: 35px 0 20px;
}

.back-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 180px;
    min-height: 48px;

    padding: 0 25px;

    border-radius: 10px;

    background: #0c1d33;

    border: 1px solid #367da9;

    color: #bfe8ff;

    text-decoration: none;

    font-weight: 700;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.back-button:hover {
    background: #12365a;
    transform: translateY(-2px);
}


/* =========================================
   FOOTER
========================================= */

footer {
    text-align: center;

    color: #607b96;

    font-size: 12px;

    padding-top: 10px;
}


.tables-result {
    max-width: 900px;
    margin: 30px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.tables-result h2 {
    margin: 0;
    color: #174b8f;
    font-size: 28px;
}

.tables-subtitle {
    margin: 8px 0 25px;
    color: #666;
    font-size: 17px;
}

/* =========================
   GRILLE 10 × 10
========================= */

.tables-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 7px;
}

/* Case normale */

.table-cell {
    aspect-ratio: 1 / 1;
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #d8e8f7;
    border-radius: 10px;

    background: #f7fbff;
    color: #174b8f;

    font-size: clamp(11px, 1.6vw, 17px);
    font-weight: 700;

    transition: all 0.25s ease;
}

/* Bonne réponse */

.table-cell.success {
    border-color: #f5c542;
    background: #fff9d9;
    color: #f0b400;
}

.table-cell.success::before {
    content: "★";
    font-size: clamp(24px, 3vw, 38px);
}

/* On cache l'opération quand elle devient une étoile */

.table-cell.success .operation {
    display: none;
}
/* Table en erreur */
.table-cell.error {
    border-color: #e74c3c;
    background: #fff;
    color: #e74c3c;

    flex-direction: column;
    gap: 0px;
}

/* Cercle rouge avec la croix */
.table-cell.error .error-circle {
    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #e74c3c;

    color: white;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

/* On utilise directement le symbole dans le HTML */
.table-cell.error .error-circle {
    font-family: Arial, sans-serif;
}

/* Opération sous le cercle */
.table-cell.error .operation {
    margin-top: -2px;
    display: block;
    font-size: clamp(11px, 1.4vw, 16px);
    font-weight: 700;
    color: #e74c3c;
}
/* Légende */

.tables-legend {
    display: flex;
    justify-content: center;
    gap: 35px;
    margin-top: 25px;
    color: #555;
    font-size: 15px;
}

.tables-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-star {
    color: #f5bd18;
    font-size: 27px;
}

.legend-error {
    width: 27px;
    height: 27px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #e74c3c;
    color: white;

    font-weight: bold;
    font-size: 20px;
}

/* Message */

.diagnostic-message {
    max-width: 650px;
    margin: 25px auto 15px;
    padding: 18px 22px;

    border-radius: 14px;
    background: #eef7ff;

    color: #174b8f;
    font-size: 17px;
    line-height: 1.5;
}

/* Bouton */

.continue-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 13px 28px;

    border-radius: 12px;
    background: #2878d8;
    color: white;

    text-decoration: none;
    font-weight: 700;
    font-size: 17px;

    transition: transform 0.2s, background 0.2s;
}

.continue-btn:hover {
    background: #1765c0;
    transform: translateY(-2px);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .tables-result {
        margin: 15px;
        padding: 15px;
    }

    .tables-grid {
        gap: 4px;
    }

    .table-cell {
        border-radius: 6px;
        border-width: 1px;
    }

    .tables-legend {
        gap: 15px;
        font-size: 13px;
    }

    .diagnostic-message {
        font-size: 15px;
        padding: 15px;
    }
}