/* =========================================================
   UI KIT — Top fixe + Bottom fixe + centre scrollable
   Smartphone + PC + safe-area iPhone
   + Bouton central OR "JOUER" (carré arrondi)
   + Aura UNIQUEMENT au survol / focus (pas tout le temps)
   + Popover langue centré (pas de téléport PC)
   + Modal premium (échec)
   + Icônes PNG
   + Anti double-tap zoom
   ========================================================= */

/* =========================
   Variables
   ========================= */
:root{
  --bg-top: #eaf3ff;
  --bg-main: #dce9ff;

  --panel: rgba(255,255,255,.86);
  --text: #0b1a33;
  --muted: #4b6a99;

  --line: rgba(20,60,120,.15);
  --accent-soft: #e1efff;

  --radius: 20px;
  --shadow: 0 12px 40px rgba(20,60,120,.18);

  /* Barres */
  --topH: 90px;
  --botH: 82px;

  /* Layout */
  --wrap: 1200px;

  /* Typo */
  --fs-base: 17px;
  --fs-base-desktop: 18px;
  --fs-nav: 13px;
  --fs-nav-desktop: 16px;

  --tap: 48px;

  /* Or bouton central */
  --gold-1: #ffe08a;
  --gold-2: #ffbf2f;
  --gold-3: #ff9f1a;
  --gold-stroke: rgba(120,80,0,.25);

  /* Modal */
  --alert-red-1: #ff6a6a;
  --alert-red-2: #e5332e;
}

/* =========================
   Base
   ========================= */
*{ box-sizing: border-box; }

html, body{ overflow-x: clip; }

html{
  min-height:100%;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-main) 280px);
  background-color: var(--bg-main);
  background-repeat:no-repeat;
}

body{
  margin:0;
  min-height:100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: transparent;
  font-size: var(--fs-base);
  line-height: 1.55;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; display:block; }

/* Supprime le carré/flash au tap + empêche zoom double tap */
a, button{
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* =========================
   Layout page
   ========================= */
.page-app{
  padding-top: calc(var(--topH) + env(safe-area-inset-top));
  padding-bottom: calc(var(--botH) + env(safe-area-inset-bottom));
}

/* iOS Safari : stabilise les barres fixes */
@supports (-webkit-touch-callout: none){
  .page-app{
    padding-top: calc(var(--topH) + env(safe-area-inset-top) + 2px);
    padding-bottom: calc(var(--botH) + env(safe-area-inset-bottom) + 6px);
  }
}

/* =========================
   Conteneurs
   ========================= */
.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 16px;
}

.panel{
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel.pad{ padding: 18px; }

.footer{
  margin: 18px 0 6px;
  text-align:center;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
   TOP BAR
   ========================================================= */
.appTop{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;

  width: 100%;
  height: calc(var(--topH) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);

  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  /* IMPORTANT (PC): pas de transform ici */
}

.topInner{
  max-width: var(--wrap);
  margin: 0 auto;
  height: var(--topH);

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;

  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  min-width: 0;
}

/* Brand = juste mascotte (plus de titre) */
.brand{
  display:flex;
  align-items:center;
  flex: 1 1 auto;
  min-width: 0;
}

.brandMark{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.brandMarkImg{
  height: 64px;
  width: auto;
  object-fit: contain;
}

/* Wallet (droite) */
.topRight{
  display:flex;
  align-items:center;
  flex: 0 0 auto;
}

.wallet{
  display:flex;
  gap: 14px;
  align-items:center;
}

/* Bulle individuelle */
.coin{
  display:flex;
  align-items:center;
  gap: 10px;

  padding: 10px 16px;
  border-radius: 999px;

  font-weight: 950;
  font-size: 18px;
  min-height: 54px;

  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);

  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.coinVal{ font-variant-numeric: tabular-nums; }

.coinBlue{
  background: linear-gradient(180deg,#eef6ff,#dcecff);
  border-color: rgba(79,163,255,.35);
}

.coinGold{
  background: linear-gradient(180deg,#fff4d6,#ffe7a3);
  border-color: rgba(255,191,47,.45);
}

/* icônes (star / ticket) */
.coinIcoImg{
  width: 34px;
  height: 34px;
  object-fit: contain;
  user-select:none;
  pointer-events:none;
}

/* =========================================================
   BOTTOM BAR
   ========================================================= */
.appBottom{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;

  width: 100%;
  height: calc(var(--botH) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);

  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  display:flex;
  align-items: stretch;
  justify-content: center;

  /* IMPORTANT (PC): pas de transform ici */
}

/* iOS Safari : GPU pour stabiliser */
@supports (-webkit-touch-callout: none){
  .appTop,
  .appBottom{
    transform: translateZ(0);
    will-change: transform;
  }
}

.navItem{
  flex: 1 1 20%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  gap: 6px;
  padding: 10px 6px;
  min-height: var(--botH);

  color: rgba(11,26,51,.78);
  font-weight: 900;
  user-select: none;

  transition: transform .12s ease, filter .12s ease;
}

/* Press sur tous les items */
.navItem:active{
  transform: translateY(2px);
  filter: brightness(.98);
}

/* MAIS pas sur la case Langue (sinon micro-saut du popover sur PC) */
.langNav:active,
.langNav.open{
  transform: none !important;
  filter: none !important;
}

/* Focus clavier propre */
.navItem:focus{ outline: none; }
.navItem:focus-visible{
  outline: 3px solid rgba(79,163,255,.45);
  outline-offset: -6px;
  border-radius: 16px;
}

/* Libellés : évite les décalages (dont “Langue”) */
.navTxt{
  font-size: var(--fs-nav);
  line-height: 1.1;
  margin: 0;
}

/* Icônes PNG du bas */
.navIcoImg{
  width: 56px;
  height: 56px;
  object-fit: contain;
  user-select:none;
  pointer-events:none;
}

/* =========================================================
   BOUTON CENTRAL OR "JOUER" — CARRE ARRONDI
   (englobe logo + texte)
   ========================================================= */
.navFab{
  position: relative;
  flex: 1 1 20%;
  display:flex;
  align-items:center;
  justify-content:center;

  transform: none !important;
  filter: none !important;
}

/* IMPORTANT: on évite que le :active du .navItem aplatisse le container */
.navFab:active{
  transform: none;
  filter: none;
}

.navFab .fabBubble{
  position: relative;

  width: 86px;
  height: 86px;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  gap: 2px;
  padding-top: 6px;
  padding-bottom: 6px;

  border-radius: 20px;

  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.92), rgba(255,255,255,0) 42%),
    linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));

  border: 1px solid var(--gold-stroke);

  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.55),
    0 10px 22px rgba(255,191,47,.30),
    0 6px 14px rgba(0,0,0,.10);

  transition: transform .12s ease, filter .12s ease;
}

/* AURA (glow) — OFF par défaut */
.navFab .fabBubble::before{
  content:"";
  position:absolute;
  inset: -14px;
  border-radius: 26px;
  background: radial-gradient(circle, rgba(255,191,47,.35), rgba(255,191,47,0) 70%);
  filter: blur(1px);
  z-index: -1;

  opacity: 0;
  transform: scale(.98);
  transition: opacity .14s ease, transform .14s ease;
}

/* Reflet */
.navFab .fabBubble::after{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events:none;
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,.55), rgba(255,255,255,0) 45%),
    radial-gradient(circle at 80% 78%, rgba(255,255,255,.22), rgba(255,255,255,0) 55%);
  opacity: .9;
}

/* Aura UNIQUEMENT sur PC (hover + souris) */
@media (hover: hover) and (pointer: fine){
  .navFab:hover .fabBubble::before{
    opacity: 1;
    transform: scale(1);
  }
}

/* Aura aussi au focus clavier */
.navFab:focus-visible .fabBubble::before{
  opacity: 1;
  transform: scale(1);
}

/* Icône JOUER (PNG) */
.navFabImg{
  width: 70px;
  height: 70px;
  object-fit: contain;
  user-select:none;
  pointer-events:none;
}

/* Texte JOUER */
.navFab .navTxt{
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .5px;
  color: #2b1a00;
  margin-top: -4px;
}

/* clic */
.navFab:active .fabBubble{
  transform: translateY(2px) scale(.985);
  filter: brightness(.97);
}

/* =========================================================
   LANG MENU (popover centré)
   ========================================================= */
.langNav{ position: relative; }

.langFab{
  all: unset;
  cursor: pointer;
  width: 100%;
  height: 100%;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  gap: 6px;
  padding: 10px 6px;
  min-height: var(--botH);

  color: rgba(11,26,51,.78);
  font-weight: 900;
}

.langFab:focus{ outline:none; }
.langFab:focus-visible{
  outline: 3px solid rgba(79,163,255,.45);
  outline-offset: -6px;
  border-radius: 16px;
}

.langMenu{
  position: fixed;
  left: 50%;
  bottom: calc(var(--botH) + 10px + env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 24px));

  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);

  display: grid;
  gap: 10px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate3d(-50%, 6px, 0);
  transform-origin: 50% 100%;

  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
  z-index: 9999;
}

.langNav.open .langMenu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0);
}

.langChoice{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;

  min-height: 50px;
  padding: 0 12px;
  border-radius: 14px;

  font-weight: 950;
  font-size: 16px;

  border: 1px solid rgba(79,163,255,.25);
  background: rgba(79,163,255,.12);
  text-align:center;
}
.langChoice:hover{ background: rgba(79,163,255,.20); }

.langMenu::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-10px;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,.92);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.flagIco{
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}

/* =========================================================
   ALERT MODAL
   ========================================================= */
body.modal-open{ overflow: hidden; }

.alertOverlay{
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(11,26,51,.35);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.alertOverlay.open{ display:flex; }

.alertModal{
  width: min(420px, 100%);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  transform: scale(.95);
  opacity: 0;
  transition: .18s ease;
}
.alertOverlay.open .alertModal{
  transform: scale(1);
  opacity: 1;
}

.alertTop{
  position: relative;
  padding: 40px 20px 30px;
  background: linear-gradient(180deg,var(--alert-red-1),var(--alert-red-2));
  text-align: center;
  color: white;
}

.alertTitle{
  margin: 0 0 25px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
}

.alertIconWrap{
  width: 90px;
  height: 90px;
  margin: 0 auto;
  background: rgba(255,255,255,.95);
  border-radius: 28px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

.alertIcon{
  font-size: 34px;
  color: var(--alert-red-2);
  font-weight: 900;
}

.alertClose{
  position:absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.25);
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}
.alertClose:active{ transform: scale(.95); }

.alertBottom{
  background: white;
  padding: 28px 20px 32px;
  text-align: center;
}

.alertText{
  font-size: 16px;
  font-weight: 700;
  color: #444;
  margin-bottom: 24px;
}

.alertBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 130px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 900;
  font-size: 16px;
  color: white;
  background: linear-gradient(180deg,var(--alert-red-1),var(--alert-red-2));
  box-shadow: 0 10px 20px rgba(229,51,46,.35);
}
.alertBtn:active{ transform: translateY(2px); }

/* =========================================================
   CONTENT
   ========================================================= */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  padding: 18px;
}

.kicker{
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .2px;
  margin-bottom: 8px;
}

h1{
  margin: 0 0 10px;
  font-size: clamp(30px, 3.8vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.6px;
}

.h2{
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 950;
}

.sub{
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 70ch;
}

.ctaRow{ display:flex; gap: 10px; flex-wrap: wrap; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 950;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  min-height: var(--tap);
  font-size: 1rem;
}
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: linear-gradient(180deg, #6fb8ff, #3f92ff);
  color: #fff;
}
.btn.primary:hover{ filter: brightness(1.05); }

.btn.ghost{
  background: rgba(79,163,255,.15);
  border-color: rgba(79,163,255,.35);
  color: var(--text);
}
.btn.ghost:hover{ background: rgba(79,163,255,.22); }

.btn.full{ width: 100%; }

.chips{ display:flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.chip{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  font-weight: 950;
  font-size: 0.95rem;
}

.heroRight{ display:flex; flex-direction: column; gap: 12px; }

.miniCard{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  border-radius: 18px;
  padding: 14px;
}

.miniCard.soft{
  background: linear-gradient(180deg, var(--accent-soft), rgba(255,255,255,.78));
  border-color: rgba(79,163,255,.35);
}

.miniTitle{ font-weight: 950; margin: 0 0 10px; }
.miniTxt{ margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.gameBox{
  border: 1px dashed rgba(20,60,120,.25);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.65);
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.gameLine{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}
.gameLabel{ color: var(--muted); font-weight: 900; font-size: 13px; }
.gameValue{ font-weight: 950; font-size: 13px; }

.grid2{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.row{ display:flex; gap: 10px; flex-wrap: wrap; }

.list{ display:flex; flex-direction:column; gap: 10px; margin-top: 10px; }

.listItem{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items:center;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
}

.liTitle{ font-weight: 950; }
.liSub{ color: var(--muted); font-size: 13px; margin-top: 2px; font-weight: 800; }

.badge{
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 0.95rem;
  border: 1px solid rgba(79,163,255,.35);
  background: rgba(79,163,255,.14);
}

.badge.gold{
  border-color: rgba(255,191,47,.35);
  background: rgba(255,191,47,.18);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .grid2{ grid-template-columns: 1fr; }
}

@media (max-width: 700px){
  :root{
    --topH: 96px;
    --botH: 86px;
  }

  .brandMarkImg{ height: 72px; }

  .navIcoImg{ width: 50px; height: 50px; }

  .navFab .fabBubble{ width: 86px; height: 86px; border-radius: 20px; }
  .navFabImg{ width: 68px; height: 68px; }
}

@media (max-width: 380px){
  .navIcoImg{ width: 44px; height: 44px; }
  .navFab .fabBubble{ width: 82px; height: 82px; }
  .navFabImg{ width: 60px; height: 60px; }
}

@media (min-width: 900px){
  body{ font-size: var(--fs-base-desktop); }
  :root{ --botH: 90px; }

  .navTxt{
    font-size: var(--fs-nav-desktop);
    font-weight: 950;
    letter-spacing: .2px;
  }

  .navIcoImg{ width: 62px; height: 62px; }

  .navFab .fabBubble{ width: 92px; height: 92px; border-radius: 22px; }
  .navFabImg{ width: 74px; height: 74px; }

  .coin{
    padding: 12px 20px;
    font-size: 20px;
    min-height: 58px;
  }
  .coinIcoImg{ width: 40px; height: 40px; }
}

/* =========================================================
   OVERRIDE MOBILE — Wallet (stars/tickets) plus lisible
   ========================================================= */
@media (max-width: 700px){
  .wallet{ gap: 12px; }

  .coin{
    min-height: 56px;
    padding: 10px 16px;
    gap: 12px;
    font-size: 20px;
  }

  .coinIcoImg{
    width: 42px;
    height: 42px;
  }

  .coinVal{
    font-weight: 950;
    letter-spacing: .2px;
  }
}

/* Petit mobile: on réduit un peu pour éviter de casser */
@media (max-width: 380px){
  .coin{
    min-height: 52px;
    padding: 8px 12px;
    font-size: 18px;
    gap: 10px;
  }
  .coinIcoImg{
    width: 38px;
    height: 38px;
  }
}