:root {
    --ink:        #1f2d3a;
    --ivory:      #faf6ef;
    --gold:       #b68a52;
    --gold-soft:  #d9bd91;
    --pine:       #46574a;
    --card-bg:    rgba(255, 255, 255, 0.82);
    --card-blur:  14px;

    --font-script: "Mea Culpa", cursive;
    --font-serif:  "Lora", Georgia, serif;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-serif);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---------- top navigation ---------- */

.site-nav {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 6px;
    padding: 10px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(20, 28, 38, .18);
}

.site-nav-link {
    padding: 12px 24px;
    border-radius: 999px;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    letter-spacing: .03em;
    color: var(--ink);
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.site-nav-link:hover {
    background: rgba(182, 138, 82, .12);
}

.site-nav-link.active {
    background: var(--pine);
    color: var(--ivory);
}

@media (max-width: 480px) {
    .site-nav { top: 12px; gap: 4px; padding: 8px; }
    .site-nav-link { padding: 8px 14px; font-size: .9rem; }
}

/* ---------- jeu page (full-width layout, no photo background) ---------- */

.prog-page {
    background: var(--ivory);
}

.prog-hero {
    padding: 150px 24px 4px;
    text-align: center;
}

.prog-hero .eyebrow {
    margin-bottom: 8px;
}

.prog-hero h2 {
    font-family: var(--font-script);
    font-weight: 400;
    font-size: 4rem;
    line-height: 1;
    color: var(--ink);
    margin-bottom: 8px;
}

.prog-hero-photo {
    max-width: 1080px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--gold-soft);
    box-shadow: 0 25px 60px rgba(20, 28, 38, .2);
}

.prog-hero-photo img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    object-position: center 30%;
}

.eyebrow {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
}

/* ---------- jeu content ---------- */

.game-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4px 24px 72px;
}

.game-card {
    max-width: 1400px;
    height: min(calc(100vh - 160px), 900px);
    min-height: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding:
        clamp(12px, 2vh, 32px)
        clamp(24px, 3vw, 48px)
        clamp(16px, 2.5vh, 44px);
}

.game-intro {
    text-align: center;
    color: #6b6558;
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 2%;
}

/* Conteneur transparent : occupe automatiquement TOUT l'espace restant
   sous le titre et le texte d'intro (grâce à flex:1), sans qu'on ait à
   deviner leur hauteur. */
.game-frame-wrap {
    flex: 1 1 auto;
    min-height: 0;            /* autorise le rétrécissement dans le flex */
    width: 100%;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    container-type: size;     /* permet d'utiliser cqw / cqh ci-dessous */
}

/* Le jeu conserve le ratio 4/3 et prend la plus grande taille qui rentre
   à la fois en largeur ET en hauteur du conteneur.
   min(100cqw, 100cqh*4/3) = "la plus petite des deux contraintes". */
.game-frame {
    width: 100%;                          /* repli si cqw/cqh non supportés */
    width: min(100cqw, 100cqh * 4 / 3);
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--gold-soft);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(20, 28, 38, .25);
    display: block;
}

/* ---------- responsive ---------- */

@media (max-width: 540px) {
    .prog-hero { padding: 118px 16px 34px; }
    .prog-hero h2 { font-size: 2.6rem; margin-bottom: 24px; }
    .prog-hero-photo img { height: 220px; }
    .game-layout { padding: 24px 16px 48px; }
    .game-card {
        height: 52vh;
        min-height: 380px;
        padding: 32px 16px 24px;
    }
}
