@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 10px 24px 36px;
}

/* ===================== HEADER ===================== */
header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 6px 4px;
    background: transparent;
    margin-bottom: 10px;
    flex-wrap: wrap;
    margin-left: 0;
    flex-shrink: 0;
}

.header-entrainement {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header-label-tag {
    background: #1D9DA0;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    width: 260px;
}

header > h1 {
    flex: 1;
    border-left: 2px solid #0dadb0;
    padding-left: 18px;
    margin-left: 0;
}

#grosTitre {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    color: #9b2335;
    overflow-wrap: break-word;
}

hr { border: none; border-top: 1px solid #ddd; }

/* ===================== CHRONO + INTRO BAR ===================== */
.chrono-intro-bar {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.chrono-col { width: 260px; }

.intro-col {
    display: flex;
    align-items: center;
}

.chrono-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #9b2335;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 3px 10px rgba(155,35,53,0.35);
}

.chrono-face { flex-shrink: 0; }

.chrono-svg { width: 52px; height: 52px; display: block; }

.chrono-texte {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chrono-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.chrono-sub {
    color: rgba(255,255,255,0.82);
    font-size: 0.72rem;
    font-weight: 500;
}

.chrono-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.chrono-btn:hover { background: rgba(255,255,255,0.45); transform: scale(1.08); }

.sidebar-intro {
    font-size: 1rem;
    color: #333;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-intro strong { color: #b8860b; }

.intro-ligne {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 1rem;
    line-height: 1.25;
}

.intro-ligne i {
    color: #b8860b;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.intro-ligne span { flex: 1; }

/* ===================== LAYOUT ===================== */
.main-content {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 0;
}

/* ===================== TIMELINE ===================== */
.timeline-wrapper {
    position: relative;
    padding: 16px 0 24px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #ccc;
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 70px repeat(5, 1fr) 100px;
    grid-template-rows: 1fr 40px 1fr;
    gap: 0 8px;
    position: relative;
    z-index: 1;
}

.timeline-grid4 {
    display: grid;
    grid-template-columns: 70px repeat(4, 1fr) 100px;
    grid-template-rows: 1fr 40px 1fr;
    gap: 0 8px;
    position: relative;
    z-index: 1;
}

.timeline-grid6 {
    display: grid;
    grid-template-columns: 70px repeat(6, 1fr) 100px;
    grid-template-rows: 1fr 40px 1fr;
    gap: 0 8px;
    position: relative;
    z-index: 1;
}

.timeline-grid7 {
    display: grid;
    grid-template-columns: 70px repeat(7, 1fr) 100px;
    grid-template-rows: 1fr 40px 1fr;
    gap: 0 8px;
    position: relative;
    z-index: 1;
}

/* DÉPART / ARRIVÉE */
.label-depart, .label-arrivee {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 5px;
}

.label-arrivee { color: #cc0000; font-weight: 700; }
.label-depart  { color: #9b2335; font-weight: 700; }
.label-depart .dot { background: #9b2335; box-shadow: 0 0 0 2px #9b2335; }

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #aaa;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #aaa;
}

.dot.colored { background: #1D9DA0; box-shadow: 0 0 0 2px #1D9DA0; }

.dot-slot {
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

/* CARD SLOTS */
.card-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-slot.bottom { grid-row: 3; align-items: center; padding-top: 24px; }
.card-slot.top    { grid-row: 1; align-items: center; justify-content: flex-end; padding-bottom: 24px; }

/* TRIANGLE — grand, fondu dans la card, pointe vers le dot */
.card-slot.bottom .level-card {
    border-radius: 10px;
}
.card-slot.bottom .level-card::before {
    content: '';
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 32px solid transparent;
    border-right: 32px solid transparent;
    border-bottom: 26px solid var(--card-color);
}

.card-slot.top .level-card {
    border-radius: 10px;
}
.card-slot.top .level-card::after {
    content: '';
    position: absolute;
    bottom: -26px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 32px solid transparent;
    border-right: 32px solid transparent;
    border-top: 26px solid var(--card-color);
}

/* CARDS */
.level-card {
    --card-color: #ccc;
    background: var(--card-color);
    border-radius: 10px;
    color: white;
    width: 100%;
    max-width: 230px;
    min-width: 150px;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-label {
    padding: 16px 12px 14px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 68px;
    line-height: 1.3;
    gap: 5px;
}

.card-num {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-align: center;
    opacity: 0.9;
}

.card-buttons {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.25);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.card-btn {
    flex: 1;
    padding: 16px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
    font-size: 1.55rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.card-btn:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.25); }
.card-btn:hover { background: rgba(255,255,255,0.35); color: white; }

/* COULEURS */
.n1 { --card-color: #00cccc; }
.n2 { --card-color: #d4a017; }
.n3 { --card-color: #8b00cc; }
.n4 { --card-color: #1D9DA0; }
.n5 { --card-color: #7a6500; }
.n6 { --card-color: #d4a0c0; }
.n7 { --card-color: #6d135b; }

/* QUIZ */
.quiz-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1D3461;
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 8px;
    white-space: nowrap;
}

.quiz-btn:hover { background: #152a4e; color: white; }

.video-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1D9DA0;
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 8px;
    white-space: nowrap;
}

.video-btn:hover { background: #167275; color: white; }

/* TOOLTIP */
.tooltip-container { position: relative; display: inline-block; }
.tooltip-container .tooltip-text {
    visibility: hidden;
    width: 160px;
    background-color: #1D3461;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }
.info-icon { color: #1D9DA0; cursor: pointer; }

/* FOOTER */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: #9AABBF;
    font-size: 0.8rem;
    padding: 6px 0;
    background: #f5f5f5;
    z-index: 100;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
    .main-content { grid-template-columns: 1fr; }
    .timeline-grid4 { grid-template-columns: 60px repeat(4, 1fr) 90px; }
    .timeline-grid { grid-template-columns: 60px repeat(5, 1fr) 90px; }
    .timeline-grid6 { grid-template-columns: 60px repeat(6, 1fr) 90px; }
    .timeline-grid7 { grid-template-columns: 60px repeat(7, 1fr) 90px; }
}

@media (max-width: 768px) {
    body { padding: 15px; }
    #grosTitre { font-size: 1.8rem; }
    .timeline-grid4 { grid-template-columns: repeat(4, 1fr); }
    .timeline-grid { grid-template-columns: repeat(5, 1fr); }
    .timeline-grid6 { grid-template-columns: repeat(6, 1fr); }
    .timeline-grid7 { grid-template-columns: repeat(7, 1fr); }
}

.timeline-wrapper i { font-size: 20px; }

/* ===================== BANDEAU ===================== */
.bandeau-lateral {
    width: 260px;
    flex-shrink: 0;
    margin-top: 0;
    overflow: visible;
}

.bandeau-haut {
    background: #1D9DA0;
    border-radius: 6px 6px 0 0;
    padding: 16px 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.bandeau-perso {
    background: white;
    border-radius: 50%;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.bandeau-perso img {
    width: 90px;
    height: auto;
}

.perso-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: auto;
}

.perso-img { width: 100px; height: auto; display: block; }

.ampoule-img { display: none; }

/* Bloc titre : deux rectangles décalés */
.bandeau-titre {
    position: relative;
    margin: 20px 0 0 8px;
    padding: 20px;
    background: transparent;
    height: 110px;
    width: 210px;
}

/* Rectangle rouge — plus large */
.bandeau-titre::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: calc(100% - 16px);
    height: 74px;
    background: #9b2335;
    z-index: 1;
}

/* Cadre blanc — plus large, décalé 20px */
.bandeau-titre::after {
    content: '';
    position: absolute;
    top: 20px; left: 16px;
    right: 0; bottom: 0;
    background: transparent;
    border: 3px solid white;
    z-index: 2;
}

/* Texte centré sur la zone de chevauchement */
.bandeau-titre p {
    position: relative;
    z-index: 3;
    margin: 0;
    padding: 10px 10px 10px 10px;
    color: white;
    font-size: 1.05rem;
    line-height: 1.45;
    text-align: center;
}

.bandeau-titre strong { font-weight: 400; }

.bandeau-info {
    background: #1D9DA0;
    color: white;
    text-align: center;
    padding: 25px 16px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.bandeau-info hr {
    border-color: rgba(255,255,255,0.4);
    margin: 8px 0;
}

.bandeau-theme {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
}

.colonne-droite {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.colonne-droite .sidebar-intro {
    padding: 0 0 8px 0;
    background: transparent;
    box-shadow: none;
}
