/* ==========================================================================
   Jeu 180 ans Bridel — styles (mobile first)
   Maquettes : 1080 px (mobile) / 1920 px (desktop)
   ========================================================================== */

/* Polices de la charte : déposer les WOFF2 fournis par le client dans assets/fonts/
   (IntroHead-R/B/H, MyriadPro-Cond...). En attendant, Barlow Condensed (OFL) sert de repli. */
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-400-yGbn1-s.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-600-iRpfLYp.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-700-fn5da0S.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-800-3GPtPAX.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
    --blue: #0081d5;
    --blue-dark: #00609e;
    --red: #e30613;
    --red-bright: #ef0302;
    --yellow: #ffed00;
    --cream: #fef8e6;
    --sand: #f5ecd4;
    --ink: #1d1d1b;
    --white: #fff;
    --font-title: "Intro Head", "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-text: "Myriad Pro Condensed", "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Myriad Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --radius: 999px;
    --content: min(92vw, 1180px);
    --focus: 0 0 0 3px var(--white), 0 0 0 6px var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--cream) url("../images/rayures-Avyb_4s.webp") top center / 100% auto repeat-y;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--white); padding: .5rem 1rem; }
.skip-link:focus { top: 1rem; }

/* ---------- En-tête ---------- */
.site-header {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    padding-top: clamp(.5rem, 2vw, 2.5rem);
    z-index: 2;
    max-width: 48rem;
    margin-inline: auto;
}
.site-header__hermine { width: clamp(150px, 46vw, 383px); margin-left: -4%; margin-top: clamp(1.5rem, 5vw, 3.5rem); }
.site-header__logo { width: clamp(130px, 35vw, 276px); margin-top: 0; }
.site-header__anniv { justify-self: end; width: clamp(85px, 26vw, 199px); margin-right: 1%; }
.site-header__hermine, .site-header__anniv { pointer-events: none; }
.site-header > :first-child { grid-column: 1; }
.site-header__logo-link { grid-column: 2; display: block; }

/* Feux d'artifice décoratifs */
.fireworks { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fireworks img { position: absolute; }
.fireworks__left { left: -2%; top: clamp(260px, 26vw, 720px); width: clamp(70px, 14vw, 376px); }
.fireworks__right { right: -1%; top: clamp(240px, 24vw, 700px); width: clamp(45px, 9vw, 230px); }

/* ---------- Structure ---------- */
main { position: relative; flex: 1 0 auto; z-index: 1; }

.container { width: var(--content); margin-inline: auto; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 3rem; padding: .7rem 2.25rem;
    font-family: var(--font-title); font-weight: 800; font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    text-transform: uppercase; letter-spacing: .02em; text-decoration: none;
    color: var(--white); background: var(--red); border: 0; border-radius: var(--radius);
    cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
    transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { background: #c10510; transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn--light { background: var(--white); color: var(--blue); }
.btn--light:hover { background: var(--cream); }

/* ---------- Bandeaux titre (PERDU !, OUPS !) ---------- */
.ribbon {
    position: relative; display: grid; place-items: center;
    width: min(88vw, 991px); aspect-ratio: 991 / 373; margin: 0 auto;
    background: url("../images/bandeau-rouge--1lAjIr.webp") center / contain no-repeat;
}
.ribbon__text {
    margin: 0; transform: rotate(-4deg);
    font-family: var(--font-title); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2.6rem, 11vw, 9.5rem); line-height: 1; color: var(--white);
}

.message {
    position: relative; padding: clamp(2rem, 8vw, 2.5rem) 0 clamp(2rem, 6vw, 5rem); text-align: center;
}
.message__text {
    max-width: 22ch; margin: clamp(1rem, 3vw, 2.5rem) auto 0;
    font-family: var(--font-title); font-weight: 700; font-size: clamp(1.6rem, 5vw, 4.3rem); line-height: 1.08;
    color: var(--red-bright);
}
.message__text--wide { max-width: 32ch; }
.message__arrow {
    position: absolute; width: clamp(48px, 12vw, 200px);
    left: max(2vw, calc(50% - min(44vw, 520px))); top: 55%;
    transform: rotate(-90deg);
}
.message__actions { margin-top: 2rem; }

/* Décor normand (vaches, phare) au-dessus du pied de page */
.decor {
    display: block; width: 100%;
    min-height: 70px;
    margin-top: auto;
    aspect-ratio: 1920 / 593;
    object-fit: cover;
    object-position: center bottom;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
    /* comble les bords irréguliers du visuel avec le bleu du pied de page */
    background: linear-gradient(to bottom, transparent 80%, var(--blue) 80%);
}
.decor--mirror { transform: scaleX(-1); }

/* ---------- Pied de page ---------- */
.site-footer {
    position: relative; z-index: 1;
    background: var(--blue); color: var(--white); text-align: center;
    padding: clamp(1.75rem, 4vw, 3.5rem) 1rem clamp(2.5rem, 5vw, 4.5rem);
    font-family: var(--font-text); font-size: clamp(1rem, 1.6vw, 1.2rem);
}
.site-footer address { font-style: normal; line-height: 1.35; }
.site-footer__title { display: block; font-weight: 700; text-transform: uppercase; }
.site-footer__links { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 0; font-weight: 600; }
.site-footer__links li + li::before { content: "-"; margin: 0 .6rem; }
.site-footer__links a, .site-footer__links button {
    color: inherit; text-decoration: none; font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
}
.site-footer__links a:hover, .site-footer__links button:hover { text-decoration: underline; }

/* ---------- Formulaires (sur fond bleu) ---------- */
.form-panel { background: var(--blue); color: var(--white); padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(2rem, 4vw, 3rem); position: relative; z-index: 1; }
.form { width: min(88vw, 820px); margin-inline: auto; }
.form__row { margin-bottom: clamp(1.1rem, 2.4vw, 1.8rem); text-align: center; }
.form label.field-label, .form__row > label {
    display: block; margin-bottom: .5rem;
    font-family: var(--font-title); font-weight: 400; text-transform: uppercase;
    font-size: clamp(1.45rem, 3.6vw, 2.6rem); line-height: 1.1;
}
.form input[type="email"], .form input[type="text"], .form input[type="tel"] {
    width: 100%; height: clamp(3rem, 6vw, 3.75rem); padding: 0 1.25rem;
    font: 500 1.15rem/1 var(--font-body); color: var(--ink);
    background: var(--white); border: 2px solid transparent; border-radius: var(--radius);
}
.form input:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
.form input[aria-invalid="true"] { border-color: var(--yellow); }
.form .help { margin: .6rem 0 0; font-size: .95rem; opacity: .95; }

.form__checks { width: fit-content; max-width: 100%; margin: 0 auto 1.5rem; text-align: left; }
.check { display: flex; align-items: flex-start; gap: .65rem; margin-bottom: .7rem; font-size: 1.05rem; cursor: pointer; }
.check input {
    appearance: none; flex: none; width: 1.4rem; height: 1.4rem; margin: .05rem 0 0;
    background: var(--white); border-radius: 4px; cursor: pointer; display: grid; place-content: center;
}
.check input::after {
    content: ""; width: .95rem; height: .55rem; margin-top: -.2rem;
    border-left: 3px solid var(--red); border-bottom: 3px solid var(--red);
    transform: rotate(-45deg) scale(0); transition: transform .12s ease;
}
.check input:checked::after { transform: rotate(-45deg) scale(1); }

.form__errors, .form-error {
    list-style: none; margin: .5rem auto 0; padding: .55rem 1rem; width: fit-content; max-width: 100%;
    background: var(--yellow); color: var(--ink); border-radius: 10px; font-weight: 600; font-size: .98rem;
}
.form__errors li + li { margin-top: .25rem; }
.form__global-error { margin: 0 auto 1.5rem; padding: 1rem 1.25rem; background: var(--white); color: var(--red); border-radius: 14px; text-align: center; font-weight: 700; }
.form__global-error strong { display: block; font-family: var(--font-title); font-size: 1.5rem; text-transform: uppercase; }
.form__submit { text-align: center; margin-top: 1.25rem; }
.form__captcha { display: flex; justify-content: center; margin: 0 0 1.25rem; }
.form__mandatory { text-align: center; font-size: .9rem; margin: 1rem 0 0; }

.legal-notice {
    width: min(88vw, 900px); margin: 1.75rem auto 0; font-size: .82rem; line-height: 1.45; opacity: .95;
}
.legal-notice a { color: inherit; }

/* Champ piège anti-robot : hors écran mais présent dans le DOM */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ALTCHA aux couleurs du site */
altcha-widget {
    --altcha-border-radius: 12px;
    --altcha-color-base: var(--white);
    --altcha-color-text: var(--ink);
    --altcha-color-border: transparent;
    --altcha-max-width: 320px;
}

/* ---------- Page d'accueil ---------- */
.landing-hero { position: relative; padding: clamp(1rem, 4vw, 3rem) 0 0; max-width: 48rem; margin-inline: auto; }
.landing-hero__visual { width: min(96vw, 1037px); margin: 0 auto; }
.landing-hero__cta { display: block; text-decoration: none; }
.landing-hero__cta:hover img { transform: scale(1.01); }
.landing-hero__cta img { transition: transform .25s ease; }

/* ---------- Page de jeu ---------- */
.game { position: relative; text-align: center; }
.bubble {
    position: relative; z-index: 2;
    width: min(94vw, 48rem); max-width: 48rem; margin: clamp(1.5rem, 5vw, 2.375rem) auto 0;
    padding: clamp(1rem, 2.5vw, 2.5rem) clamp(1rem, 4vw, 4rem);
    background: var(--blue); color: var(--white); border-radius: clamp(14px, 2vw, 28px);
    font-family: var(--font-title); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.375rem); line-height: 1.15;
}
.bubble p { margin: 0; }
.landscape {
    position: relative; margin-top: clamp(-4rem, -4vw, -1rem);
    background: url("../images/paysage-bretagne-lPB_R0W.webp") center top / cover no-repeat;
    min-height: clamp(520px, 85vw, 1900px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: clamp(10rem, 21vw, 37rem);
    margin-bottom: -2px;
}
.bottles { display: flex; justify-content: center; align-items: flex-end; gap: clamp(.25rem, 3vw, 4rem); width: min(98vw, 64rem); padding: 0; margin: 0; list-style: none; }
.bottles__item { display: contents; }
.bottle {
    position: relative; flex: 0 1 340px; padding: 0; border: 0; background: none; cursor: pointer;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.bottle img { position: relative; z-index: 1; width: 100%; }
.bottle::after {
    content: ""; position: absolute; z-index: 0; left: -40%; right: -40%; bottom: -14%; height: 32%;
    background: url("../images/ombre-bouteille-r0GgYfw.webp") center / contain no-repeat;
}
.bottle:hover, .bottle:focus-visible { transform: translateY(-4%) rotate(-3deg); }
.bottle:focus-visible { box-shadow: none; outline: 4px solid var(--yellow); outline-offset: 6px; border-radius: 30px; }
.bottle.is-chosen { animation: bottle-pick 1s ease-in-out both; }
.bottles.is-locked .bottle:not(.is-chosen) { opacity: .45; transform: none; }
@keyframes bottle-pick {
    0% { transform: translateY(0); }
    20% { transform: translateY(-10%) rotate(-8deg); }
    40% { transform: translateY(-10%) rotate(8deg); }
    60% { transform: translateY(-10%) rotate(-6deg); }
    80% { transform: translateY(-12%) rotate(4deg) scale(1.05); }
    100% { transform: translateY(-12%) scale(1.08); }
}
.game__footer-spacer { height: clamp(2rem, 6vw, 6rem); background: linear-gradient(transparent, var(--blue)); }

/* ---------- Page gagnant ---------- */
.win { position: relative; text-align: center; }
.win__header { position: relative; z-index: 2; width: min(94vw, 1420px); margin: clamp(1rem, 5vw, 4rem) auto 0; }
.win__firework { width: clamp(150px, 30vw, 568px); margin: 0 auto -3%; }
.win__ellipse {
    position: relative; margin: 0 auto; width: min(92vw, 1356px);
    padding: clamp(3.5rem, 9vw, 10rem) 6% clamp(2rem, 5vw, 5rem);
    background: var(--blue); color: var(--white); border-radius: 50%;
}
.win__title {
    position: absolute; left: 50%; top: 0; translate: -50% -35%; rotate: -3deg;
    margin: 0; padding: .1em .5em; white-space: nowrap;
    background: var(--yellow); color: var(--red); box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
    font-family: var(--font-title); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2.3rem, 10vw, 9rem); line-height: 1.05;
}
.win__prize { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: clamp(1.25rem, 3.6vw, 3.4rem); line-height: 1.12; }
.win__prize span { display: block; text-transform: uppercase; }
.win__visual {
    position: relative; margin-top: clamp(-4rem, -6vw, -1rem);
    background: url("../images/paysage-bretagne-lPB_R0W.webp") center top / cover no-repeat;
    padding: clamp(1rem, 3vw, 3rem) 0 clamp(4rem, 12vw, 12rem);
}
.win__box { position: relative; z-index: 1; width: min(78vw, 980px); margin: 0 auto; transform: rotate(4deg); }
.win__stars { position: absolute; right: max(2vw, calc(50% - min(48vw, 640px))); bottom: 10%; width: clamp(80px, 16vw, 320px); }
.win__star { position: absolute; right: max(10vw, calc(50% - min(38vw, 520px))); bottom: 0; width: clamp(70px, 15vw, 310px); }
.win .form-panel { padding-top: clamp(2rem, 4vw, 4rem); }
.win__intro { margin: 0 auto 2rem; max-width: 46ch; font-size: 1.1rem; }

/* ---------- Pages de contenu (règlement, mentions...) ---------- */
.content-page { padding: clamp(1.5rem, 5vw, 5rem) 0 clamp(2rem, 6vw, 5rem); }
.page-title {
    display: flex; align-items: center; justify-content: center; gap: clamp(.5rem, 2vw, 1.5rem);
    margin: 0 0 clamp(1.25rem, 4vw, 3rem); text-align: center;
    font-family: var(--font-title); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2rem, 6vw, 5rem); line-height: 1; color: var(--red-bright);
}
.page-title img { width: clamp(48px, 8vw, 110px); }
.content-box {
    width: min(92vw, 1100px); margin-inline: auto; padding: clamp(1.25rem, 4vw, 4rem);
    background: var(--sand); border-radius: 6px;
}
.prose { font-size: 1.02rem; line-height: 1.6; overflow-wrap: anywhere; }
.prose h2, .prose h3 { font-family: var(--font-title); color: var(--blue); line-height: 1.15; margin: 2rem 0 .75rem; }
.prose h2 { font-size: clamp(1.4rem, 3vw, 2rem); text-transform: uppercase; }
.prose h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
.prose > :first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; }
.prose .table-wrap { overflow-x: auto; margin: 1.25rem 0; }
.prose table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; background: var(--white); }
.prose th, .prose td { border: 1px solid #d9cfb4; padding: .6rem .75rem; text-align: left; vertical-align: top; }
.prose th { background: var(--blue); color: var(--white); }
.contact-slot { min-height: clamp(420px, 60vw, 820px); }
.contact-slot__placeholder { margin: 0; text-align: center; font-family: var(--font-title); font-weight: 800; font-size: clamp(1.6rem, 4vw, 3rem); color: var(--red-bright); text-transform: uppercase; }


/* ---------- Desktop ---------- */
@media (min-width: 900px) {
    .site-header__hermine { margin-top: clamp(2rem, 5.5vw, 6.5rem); }
    .check { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.prose a { color: var(--blue-dark); }
.toc { list-style: none; padding: 0 !important; margin: 1.25rem 0 2rem; display: grid; gap: .35rem; }
.toc a { font-weight: 600; }
.prose h2[id] { scroll-margin-top: 1rem; }
