/* =====================================================================
   Circus Casino Allevard — thème commun (jeu, pages légales, staff, admin)
   Calqué sur les créas Meta du casino : rouge franc, blanc, photos sombres, Poppins très gras,
   cartouches blancs inclinés, bloc logo rouge en parallélogramme, bandeau légal jaune.
   Toutes les couleurs sont des variables : modifier ici pour changer le thème.
   ===================================================================== */
:root {
  /* Marque Circus */
  --c-red: #EB0303;
  --c-red-logo: #FA0000;
  --c-red-dark: #900508;
  --c-white: #FFFFFF;
  --c-black: #000000;
  --c-ink: #111111;
  /* Bandeau légal */
  --c-yellow: #FEDE00;
  --c-legal-text: #000000;
  /* Pages claires (back-office, pages légales) */
  --c-paper: #FFFFFF;
  --c-paper-2: #F2F2F2;
  --c-text-dark: #111111;
  --c-muted-dark: #5C5C5C;
  --c-line-dark: #DADADA;
  --c-error: #EB0303;
  --c-success: #12873B;
  --c-focus: #000000;

  /* Le seul dégradé de la charte : rouge plein à gauche → photo visible à droite (cf. créa ads1) */
  --veil: linear-gradient(90deg, #EB0303 0%, #EB0303 26%, rgba(144, 5, 8, .9) 58%, rgba(144, 5, 8, .5) 100%);

  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-legal: 'Roboto Condensed', 'Arial Narrow', 'Roboto', Arial, sans-serif;
  --radius: 4px;
  --radius-sm: 2px;
  --tilt: -4deg;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Pied de page collé en bas sur les pages courtes : body en colonne, main prend la hauteur restante */
body {
  display: flex; flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text-dark);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
}
body > main { flex: 1 0 auto; }
/* Enfants centrés par margin auto : en flex column ils se rétréciraient à leur contenu sans width: 100% */
body > header, body > main, body > .site-footer, body > .demo-banner { width: 100%; }
.site-footer { margin-top: auto; flex: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: var(--c-red); }
a:hover { color: var(--c-red-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Cartouche blanc incliné (élément signature des pubs) ---------- */
.tag {
  display: inline-block; padding: .04em .3em .08em;
  background: var(--c-white); color: var(--c-red-dark);
  font-weight: 900; line-height: 1.1;
  transform: rotate(var(--tilt));
}

/* ---------- Bloc logo : parallélogramme rouge « Circus CASINO ALLEVARD » ---------- */
.brand {
  display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center;
  column-gap: .22em; padding: .55em 1.35em .5em 1.25em;
  background: var(--c-red-logo); color: var(--c-white); text-decoration: none; line-height: 1;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
  font-size: 14px;
}
.brand:hover { color: var(--c-white); }
.brand:focus-visible { outline: none; filter: brightness(.85); }
.brand-circus {
  grid-row: 1 / span 2; writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: .92em; font-weight: 800; letter-spacing: -.01em;
}
.brand-casino { font-size: 2.55em; font-weight: 600; letter-spacing: .01em; line-height: .9; }
.brand-city { font-size: 1.08em; font-weight: 800; letter-spacing: .02em; padding-left: .08em; }

/* ---------- Boutons : aplats, angles nets ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.4em;
  border: 2px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 800; font-size: 1rem; line-height: 1.2; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, color .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary, .btn-red { color: var(--c-white); background: var(--c-red); }
.btn-primary:hover:not(:disabled), .btn-red:hover:not(:disabled) { color: var(--c-white); background: var(--c-red-dark); }
.btn-white { color: var(--c-red-dark); background: var(--c-white); }
.btn-white:hover:not(:disabled) { color: var(--c-red); }
.btn-ghost { color: inherit; background: transparent; border-color: currentColor; }
.btn-ghost:hover:not(:disabled) { background: rgba(127, 127, 127, .12); }
.btn-small { min-height: 44px; padding: .4em 1em; font-size: .9rem; } /* 44 px : cible tactile minimale */
.btn-block { width: 100%; }

/* ---------- Bandeau démo ---------- */
.demo-banner {
  position: relative; z-index: 30;
  padding: .45rem 1rem; text-align: center;
  font-size: .8rem; font-weight: 700; color: var(--c-black); background: var(--c-white);
  border-bottom: 3px solid var(--c-black);
}
.demo-banner button { margin-left: .5rem; padding: .1rem .6rem; border: 2px solid currentColor; border-radius: 2px; background: transparent; cursor: pointer; font-weight: 700; font-size: .75rem; }

/* ---------- Pied de page : logo posé sur le bandeau légal (comme les cadres officiels) ---------- */
.site-footer { background: var(--c-black); color: var(--c-white); }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.2rem;
  padding: .6rem 1rem 0; margin: 0; list-style: none; font-size: .85rem;
}
.footer-links a, .footer-links button {
  display: inline-flex; align-items: center; min-height: 44px; /* cible tactile */
  color: rgba(255, 255, 255, .8); font-weight: 600; text-decoration: none;
  background: none; border: 0; padding: 0 4px; cursor: pointer; font-size: inherit;
}
.footer-links a:hover, .footer-links button:hover { color: var(--c-white); text-decoration: underline; }
.footer-note { margin: 0; padding: 0 1rem 1rem; text-align: center; font-size: .75rem; color: rgba(255, 255, 255, .7); }
.footer-brand { display: flex; justify-content: flex-end; padding: 0 max(6%, calc((100vw - 1120px) / 2)); }
.footer-brand .brand { font-size: clamp(13px, 3.8vw, 17px); }
.site-footer :focus-visible { outline-color: var(--c-yellow); }

/* ---------- Bandeau légal obligatoire (jeux d'argent) ---------- */
.legal-banner {
  display: flex; align-items: center; gap: 12px 18px;
  padding: 12px max(14px, calc((100vw - 1120px) / 2)) calc(12px + var(--safe-bottom));
  background: var(--c-yellow); color: var(--c-legal-text);
}
.legal-banner p {
  flex: 1; min-width: 0; margin: 0;
  font-family: var(--font-legal);
  font-weight: 700; font-size: clamp(12.5px, 3.5vw, 1.08rem); line-height: 1.18; text-transform: uppercase;
}
.legal-banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-banner a:hover { color: inherit; text-decoration-thickness: 2px; }
.legal-banner a:focus-visible { outline-color: var(--c-legal-text); }
/* Bloc gouvernement au-dessus du -18, à droite du texte (disposition des créas) */
.legal-pictos { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.legal-pictos .gouv { width: auto; height: 46px; }
.legal-pictos .moins18 { width: auto; height: 42px; }
@media (min-width: 720px) {
  .legal-pictos { flex-direction: row; gap: 12px; }
  .legal-pictos .gouv { height: 54px; }
  .legal-pictos .moins18 { height: 50px; }
}

/* ---------- Bandeau cookies ---------- */
/* Barre compacte pleine largeur collée en bas (mobile : empilée ; desktop : sur une ligne).
   Tant qu'il est affiché, le body réserve sa hauteur (--consent-h) : on peut toujours faire défiler le contenu au-dessus. */
body.has-consent { padding-bottom: calc(var(--consent-h, 150px) + 8px); }
/* Défilement vers un champ / bouton (focus clavier, scrollIntoView) : il s'arrête au-dessus du bandeau */
html:has(> body.has-consent) { scroll-padding-bottom: calc(var(--consent-h, 150px) + 8px); }
.consent {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
  isolation: isolate; /* les boutons restent au-dessus de tout décor du bandeau */
  max-height: 80vh; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  background: var(--c-white); color: var(--c-text-dark); border-top: 4px solid var(--c-red);
  animation: consent-in .25s ease-out;
}
.consent :focus-visible { outline-color: var(--c-black); }
/* Fondu seul : les boutons ne bougent pas pendant l'apparition (cible immobile dès le premier toucher) */
@keyframes consent-in { from { opacity: 0; } }
.consent h2 { margin: 0 0 2px; font-size: .95rem; font-weight: 800; color: var(--c-black); }
.consent p { margin: 0 0 10px; font-size: .8rem; line-height: 1.4; color: var(--c-muted-dark); }
.consent p a { display: inline-block; padding: 2px 0; }
.consent-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.consent-actions .btn { min-height: 44px; padding: .5em .6em; font-size: .88rem; white-space: nowrap; }
@media (min-width: 720px) {
  .consent {
    display: grid; align-items: center; gap: 2px 24px;
    grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "title text actions";
    padding: 10px max(20px, calc((100vw - 1120px) / 2)) calc(10px + var(--safe-bottom));
  }
  .consent h2 { grid-area: title; margin: 0; }
  .consent p { grid-area: text; margin: 0; }
  .consent-options { grid-area: opts; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 6px 0 0; }
  .consent-actions { grid-area: actions; grid-template-columns: repeat(3, auto); }
  .consent-actions .btn { padding: .5em 1.1em; }
  .consent.is-custom { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "text text" "opts actions"; align-items: end; }
}
.consent-options { margin: 0 0 12px; display: grid; gap: 8px; }
.consent-option {
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center;
  padding: .7rem .85rem; border: 1px solid var(--c-line-dark); border-radius: var(--radius-sm); background: var(--c-paper-2);
}
.consent-option strong { font-size: .9rem; color: var(--c-black); }
.consent-option small { grid-column: 1; font-size: .78rem; color: var(--c-muted-dark); }
.consent-option input { grid-row: 1 / span 2; grid-column: 2; width: 22px; height: 22px; accent-color: var(--c-red); }

/* ---------- Pages de contenu (règlement, confidentialité) : fond blanc, lisible ---------- */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 0 max(16px, calc((100vw - 900px) / 2)); background: var(--c-black);
}
.page-header .brand { font-size: 12px; }
.page-header .btn { margin: 12px 0; color: var(--c-white); }
.page-header :focus-visible { outline-color: var(--c-yellow); }
.prose { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; color: var(--c-text-dark); }
.prose h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); font-weight: 900; line-height: 1.1; margin: .6rem 0 1.2rem; color: var(--c-black); }
.prose h2 { font-size: 1.15rem; font-weight: 800; color: var(--c-red); margin: 2rem 0 .5rem; }
.prose p, .prose li { color: var(--c-text-dark); font-size: .95rem; }
.prose table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--c-line-dark); }
.prose th { color: var(--c-black); font-weight: 800; }
/* Petit écran : chaque ligne devient une carte, chaque cellule précédée de son intitulé (data-label) */
@media (max-width: 599px) {
  .table-stack thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    margin: 0 0 12px; padding: 10px 14px;
    border: 1px solid var(--c-line-dark); border-radius: var(--radius-sm); background: var(--c-paper-2);
  }
  .prose .table-stack td { padding: 4px 0; border: 0; overflow-wrap: anywhere; }
  .table-stack td::before {
    content: attr(data-label); display: block;
    font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c-red);
  }
}
.todo { background: var(--c-yellow); color: var(--c-black); padding: 0 .3em; font-weight: 700; }
.page-404 { text-align: center; padding-top: 12vh; }
.page-404 .brand { font-size: 18px; margin-bottom: 1.5rem; }
