/* ============================================================
   STARGAMES — base, header, footer, badges, modals
   BEM. Mobile-first. Palette : #1A1A1A / #FFD700 / #C0C0C0
   ============================================================ */

:root {
  --c-bg: #1A1A1A;
  --c-bg-deep: #141414;
  --c-panel: #212121;
  --c-panel-2: #262626;
  --c-line: #2f2f2f;
  --c-line-gold: rgba(255, 215, 0, .28);
  --c-gold: #FFD700;
  --c-gold-deep: #B8860B;
  --c-silver: #C0C0C0;
  --c-text: #FFFFFF;
  --c-muted: #9C9C9C; /* ≥ 4.5:1 sur les fonds #1A1A1A/#212121/#262626 (WCAG AA) */
  --c-red: #C8102E;
  --c-green: #3DA35D;
  --f-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --f-ui: "Segoe UI", Tahoma, Verdana, sans-serif;
  --shadow-panel: 0 14px 40px rgba(0, 0, 0, .45);
  --radius: 4px;
  --header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background:
    radial-gradient(1100px 380px at 50% -120px, rgba(255, 215, 0, .07), transparent 70%),
    var(--c-bg);
}

img, svg { max-width: 100%; vertical-align: middle; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 .6em;
}

p { margin: 0 0 1em; }

a { color: var(--c-gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.skiplink {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 10px 18px;
  background: var(--c-gold);
  color: var(--c-bg);
  font-weight: 700;
}
.skiplink:focus { left: 12px; top: 12px; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--f-ui);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: filter .15s, background .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }

.btn--gold {
  background: linear-gradient(180deg, #FFE566, #FFD700 46%, #E3BE00);
  color: #1A1A1A;
  box-shadow: 0 2px 14px rgba(255, 215, 0, .18);
}
.btn--gold:hover { filter: brightness(1.08); }

.btn--ghost {
  background: transparent;
  border-color: var(--c-gold);
  color: var(--c-gold);
}
.btn--ghost:hover { background: rgba(255, 215, 0, .1); }

.btn--sm { padding: 8px 14px; font-size: .74rem; }
.btn--wide { width: 100%; }

/* ---------- Logo ---------- */

.sg-logo { display: inline-block; flex: none; }
.sg-logo__sheen { transform: skewX(-18deg); }

.sg-logo--anim .sg-logo__facet {
  opacity: 0;
  transform: scale(.55);
  transform-origin: 50% 50%;
  animation: sg-facet-in .5s cubic-bezier(.2, .7, .3, 1.25) forwards;
}
.sg-logo--anim .sg-logo__facet:nth-child(1)  { animation-delay: .05s; }
.sg-logo--anim .sg-logo__facet:nth-child(2)  { animation-delay: .13s; }
.sg-logo--anim .sg-logo__facet:nth-child(3)  { animation-delay: .21s; }
.sg-logo--anim .sg-logo__facet:nth-child(4)  { animation-delay: .29s; }
.sg-logo--anim .sg-logo__facet:nth-child(5)  { animation-delay: .37s; }
.sg-logo--anim .sg-logo__facet:nth-child(6)  { animation-delay: .45s; }
.sg-logo--anim .sg-logo__facet:nth-child(7)  { animation-delay: .53s; }
.sg-logo--anim .sg-logo__facet:nth-child(8)  { animation-delay: .61s; }
.sg-logo--anim .sg-logo__facet:nth-child(9)  { animation-delay: .69s; }
.sg-logo--anim .sg-logo__facet:nth-child(10) { animation-delay: .77s; }
.sg-logo--anim .sg-logo__sheen { animation: sg-sheen 6s ease-in-out 1.6s infinite; }

@keyframes sg-facet-in {
  to { opacity: 1; transform: scale(1); }
}
@keyframes sg-sheen {
  0%   { transform: skewX(-18deg) translateX(0); }
  14%  { transform: skewX(-18deg) translateX(165px); }
  100% { transform: skewX(-18deg) translateX(165px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sg-logo--anim .sg-logo__facet { animation: none; opacity: 1; transform: none; }
  .sg-logo--anim .sg-logo__sheen { animation: none; opacity: 0; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 20, 20, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-line-gold);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 16px;
  min-height: var(--header-h);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.header__brand:hover { text-decoration: none; }

.header__wordmark {
  font-family: var(--f-display);
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--c-text);
}

.nav {
  display: none;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
}

.nav__link {
  padding: 8px 8px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-silver);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav__link:hover { color: var(--c-gold); text-decoration: none; }
.nav__link--active { color: var(--c-gold); border-bottom-color: var(--c-gold); }

.header__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header__age { display: inline-flex; }

.langswitch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 700;
}
.langswitch__item { color: var(--c-muted); letter-spacing: .06em; }
.langswitch__item:hover { color: var(--c-gold); text-decoration: none; }
.langswitch__item--active { color: var(--c-gold); border-bottom: 2px solid var(--c-gold); }
.langswitch__sep { color: var(--c-line); }

.header__auth { display: flex; align-items: center; gap: 8px; }

.header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
}
.header__username { color: var(--c-silver); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header__username:hover { color: var(--c-gold); text-decoration: none; }
.header__balance {
  padding: 6px 10px;
  border: 1px solid var(--c-line-gold);
  border-radius: var(--radius);
  color: var(--c-gold);
  font-weight: 700;
  white-space: nowrap;
}

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px 9px;
  background: none;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  cursor: pointer;
}
.burger__line {
  display: block;
  height: 2px;
  background: var(--c-gold);
  transition: transform .2s, opacity .2s;
}
.burger[aria-expanded="true"] .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile déplié */
.nav--open {
  display: flex;
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 99;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px 0 14px;
  background: var(--c-bg-deep);
  border-bottom: 1px solid var(--c-line-gold);
  box-shadow: var(--shadow-panel);
}
.nav--open .nav__link {
  padding: 13px 22px;
  border-bottom: 1px solid var(--c-line);
  font-size: .88rem;
}

/* ---------- Sections communes ---------- */

.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 44px 16px;
}
.section--narrow { max-width: 880px; }
.section--tight { padding-top: 0; }
.section--chips { padding-top: 8px; padding-bottom: 0; }
.section--flush { padding-bottom: 0; }

/* Sous-titres de groupe (entre h2 de section et h3 de carte) */
.subhead { font-size: 1.2rem; }
.subhead--lg { font-size: 1.35rem; margin-top: 2em; }

/* Espacements utilitaires (remplacent les styles inline) */
.u-mb { margin-bottom: 34px; }
.u-mt { margin-top: 34px; }

.kicker {
  display: block;
  margin-bottom: 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--c-gold);
}

.section__title { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }

.rule {
  width: 72px;
  height: 2px;
  margin: 18px 0 26px;
  background: linear-gradient(90deg, var(--c-gold), transparent);
  border: 0;
}

.notice {
  padding: 14px 18px;
  border-left: 3px solid var(--c-gold);
  background: var(--c-panel);
  color: var(--c-silver);
  font-size: .92rem;
}
.notice--icon {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ---------- Badges ---------- */

.badge--18 { flex: none; }

.licbadge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.licbadge__shield { flex: none; }
.licbadge__txt {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--c-silver);
}
.licbadge__txt strong { display: block; color: var(--c-gold); }

.sslbadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--c-silver);
  margin-bottom: 6px;
}

.paybadges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paybadge--img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 32px;
  padding: 0 10px;
  background: #FFFFFF;
  border: 1px solid #d8d8d8;
  border-radius: 5px;
}
.paybadge--img img {
  max-height: 20px;
  max-width: 68px;
  width: auto;
}

/* ---------- Bandeau de confiance ---------- */

.footer__trustrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px 34px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 16px;
  border-top: 1px solid var(--c-line);
}

.trustitem {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.trustitem:hover { text-decoration: none; opacity: .85; }

.trustitem__note {
  font-size: .74rem;
  color: var(--c-muted);
  line-height: 1.35;
  max-width: 190px;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 56px;
  background: var(--c-bg-deep);
  border-top: 1px solid var(--c-line-gold);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 44px 16px 26px;
}

.footer__brand { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }

.footer__title {
  font-family: var(--f-ui);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin: 0 0 14px;
}
.footer__title--pay { margin-top: 22px; }

.footer__addr {
  font-style: normal;
  color: var(--c-silver);
  font-size: .88rem;
  margin-bottom: 12px;
}

.footer__contactlines { font-size: .88rem; }
.footer__muted { color: var(--c-muted); }

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__links li { margin-bottom: 8px; }
.footer__links a { color: var(--c-silver); font-size: .88rem; }
.footer__links a:hover { color: var(--c-gold); }

.footer__lictext { font-size: .82rem; color: var(--c-silver); }
.footer__trust { margin-top: 10px; }

.footer__rglink { display: block; }
.footer__rglink:hover { text-decoration: none; }
.footer__rgage { margin: 6px 0 0; }

.footer__bottom {
  border-top: 1px solid var(--c-line);
  /* réserve en bas pour le bouton de chat fixe (52px + marge) */
  padding: 18px 16px 96px;
  text-align: center;
}
.footer__licline {
  max-width: 860px;
  margin: 0 auto 8px;
  font-size: .78rem;
  color: var(--c-muted);
}
.footer__copy { font-size: .78rem; color: var(--c-muted); margin: 0; }

/* ---------- Age-gate ---------- */

.agegate {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 10, .92);
  backdrop-filter: blur(10px);
}

.agegate__panel {
  max-width: 480px;
  padding: 38px 30px 26px;
  text-align: center;
  background: var(--c-panel);
  border: 1px solid var(--c-line-gold);
  border-top: 3px solid var(--c-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.agegate__title { font-size: 1.5rem; margin-top: 16px; }
.agegate__text { color: var(--c-silver); font-size: .92rem; }

.agegate__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0 18px;
}

.agegate__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  font-size: .78rem;
  color: var(--c-muted);
}

/* ---------- Bandeau cookies ---------- */

.cookiebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 240;
  background: var(--c-bg-deep);
  border-top: 2px solid var(--c-gold);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .5);
}

.cookiebar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

.cookiebar__text { font-size: .86rem; color: var(--c-silver); margin-bottom: 12px; }

.cookiebar__prefs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--c-panel);
  border-radius: var(--radius);
}
.cookiebar__opt { font-size: .85rem; color: var(--c-silver); }
.cookiebar__opt input { accent-color: var(--c-gold); margin-right: 8px; }

.cookiebar__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Modales ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 10, 10, .78);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: auto;
  padding: 28px 24px 22px;
  background: var(--c-panel);
  border: 1px solid var(--c-line-gold);
  border-top: 3px solid var(--c-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.modal__title { font-size: 1.3rem; padding-right: 30px; }
.modal__text { color: var(--c-silver); font-size: .92rem; }
.modal__cta { margin: 0; }

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  color: var(--c-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { color: var(--c-gold); }

/* ---------- Formulaire de dépôt ---------- */

.depform__methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}
.depform__methods legend {
  padding: 0 6px;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-gold);
}
.depform__method { font-size: .9rem; color: var(--c-silver); }
.depform__method input { accent-color: var(--c-gold); margin-right: 8px; }

.depform__amount {
  display: block;
  margin-bottom: 8px;
  font-size: .85rem;
  color: var(--c-silver);
}
.depform__amount input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-text);
  font-size: 1rem;
}
.depform__amount input:focus { outline: none; border-color: var(--c-gold); }

.form__hint { font-size: .78rem; color: var(--c-muted); }
.form__note { font-size: .74rem; color: var(--c-muted); margin: 10px 0 0; }

.form__msg { min-height: 1.2em; font-size: .85rem; margin: 0 0 10px; }
.form__msg--err { color: #ff7b7b; }
.form__msg--ok { color: var(--c-green); }

/* Utilitaires */
.u-hidden { display: none !important; }
body.u-lock { overflow: hidden; }

/* L'attribut hidden doit toujours l'emporter sur les display des blocs */
[hidden] { display: none !important; }

/* Focus clavier visible partout */
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

/* Chiffres tabulaires pour cotes, scores et montants */
.odd__val, .event__score, .betslip__odds, .betslip__pot strong,
.boostcard__old, .boostcard__new, .chip__count, .matchcard__markets,
.statcard__value, .header__balance, .gamecard__jackpot {
  font-variant-numeric: tabular-nums;
}

/* ---------- Statut VIP dans le header ---------- */

.header__viptier {
  padding: 5px 9px;
  border: 1px solid var(--c-gold-deep);
  border-radius: 3px;
  color: var(--c-gold);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.header__viptier:hover { text-decoration: none; border-color: var(--c-gold); }
@media (max-width: 900px) { .header__viptier { display: none; } }

/* ---------- Chat (préversion) ---------- */

.chatfab {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--c-panel);
  border: 1px solid var(--c-gold);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  transition: box-shadow .15s, transform .15s;
}
.chatfab:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255, 215, 0, .25); }

.chatbox {
  position: fixed;
  left: 14px;
  bottom: 78px;
  z-index: 116;
  width: min(320px, calc(100vw - 28px));
  padding: 16px 18px 18px;
  background: var(--c-panel);
  border: 1px solid var(--c-line-gold);
  border-top: 3px solid var(--c-gold);
  border-radius: 6px;
  box-shadow: var(--shadow-panel);
}

.chatbox__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 8px;
}
.chatbox__close { position: static; width: 28px; height: 28px; }
.chatbox__text { font-size: .84rem; color: var(--c-silver); }

/* ---------- Breakpoints ---------- */

@media (min-width: 768px) {
  .agegate__actions { flex-direction: row; justify-content: center; }
  .cookiebar__actions { justify-content: flex-end; }
  .cookiebar__inner { display: grid; grid-template-columns: 1fr auto; gap: 6px 22px; align-items: center; }
  .cookiebar__text { margin: 0; }
  .cookiebar__prefs { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 18px; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .nav { display: flex; }
  .burger { display: none; }
  .footer__grid { grid-template-columns: 1.2fr .8fr 1fr 1fr; }
}

/* Lien connexion/compte visible uniquement dans le menu mobile déplié */
.nav__link--mobile { display: none; }
.nav--open .nav__link--mobile { display: block; color: var(--c-gold); }

@media (max-width: 479px) {
  /* Le badge 18+ reste visible à toutes les tailles d'écran (exigence BKC) */
  .header__auth .btn--ghost { display: none; }
  .header__wordmark { display: none; }
}
