/* =====================================================================================================================================
   ACCUEIL « AFFICHE » (choisi par le user sur maquettes) : une seule colonne centree, rien sur les cotes.
   titre -> personnage -> pseudo -> TUTO (nouveau joueur) / JOUER -> barre de 3 raccourcis -> pied de page.
   Recompense du jour, missions, nouveautes et « jouer entre amis » s'ouvrent dans une fenetre centree (.hm-panel), comme celles de la boutique.
   Charge apres menu.css / perks.css / compact.css.
   ===================================================================================================================================== */

/* ---- la scene : le pied de page descend tout en bas, le reste est centre dans l'espace qui reste ---- */
.hero-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: none; margin: 0 auto; padding: 4px 4px 14px; text-align: center; }
.hero-brand, .home-foot { margin-top: auto; }

/* ---- le titre : le M, MEEZ ROYALE, une phrase pour comprendre le jeu ---- */
.hero-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.brand-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
#menuHero .hero-m { width: 46px; height: 46px; margin: 0; }
#menuHero .logo { font-size: clamp(32px, 8.5vw, 54px); margin: 0; text-shadow: none; filter: drop-shadow(0 2px 9px rgba(0, 0, 0, .7)); }        /* (lisible aussi sur les cartes claires : Desert, Neige ; un filter plutot qu'un text-shadow, qui se verrait a travers le degrade transparent de « ROYALE ») */
#menuHero .tagline { margin: 0; font: 600 clamp(13px, 3.6vw, 16px) var(--ui); opacity: .88; text-shadow: 0 2px 14px rgba(0, 0, 0, .75); }
#menuHero .prime-ribbon { margin: 4px 0 0; }

/* ---- l'operateur : le dessin prend la hauteur qui reste (--cv-h), un petit badge dessous (nom, « Personnaliser », niveau) ---- */
.char-showcase { --cv-h: clamp(130px, 28vh, 240px); position: relative; width: 100%; max-width: 440px; cursor: pointer; text-align: center; border-radius: 22px; }
.char-showcase:focus-visible { outline: 2px solid var(--brand2); outline-offset: 4px; }
.char-showcase .char-stage { height: var(--cv-h); margin: 0; }
.char-showcase #heroChar { width: 100%; height: var(--cv-h); }
.char-showcase .char-info { display: inline-flex; align-items: center; justify-content: center; gap: 10px; max-width: 100%; margin: 2px auto 0; padding: 6px 16px 7px; text-align: left;
  border-radius: 999px; background: rgba(8, 6, 4, .55); border: 1px solid rgba(255, 255, 255, .15); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .15s; }
.char-showcase:hover .char-info { border-color: rgba(240, 200, 105, .5); }
.char-showcase .char-ring { width: 38px; height: 38px; }
.char-showcase .char-ring::before { inset: 4px; }
.char-showcase .char-ring b { font-size: 15px; }
.char-meta { flex: 0 1 auto; min-width: 0; }
.char-namerow { display: flex; align-items: baseline; gap: 10px; }
.char-name { font: 800 15px var(--ui); }
.char-link { opacity: .85; white-space: nowrap; font-size: 13px; }
.char-showcase:hover .char-link { opacity: 1; text-decoration: underline; }
.lvl-mini { margin-top: 2px; }
.lvl-mini .lvl-top, .lvl-mini .lvl-next { display: none; }                          /* (le detail de l'XP est sur le profil : ici juste la barre) */
.lvl-mini .lvl-bar { height: 5px; width: 150px; max-width: 100%; margin: 3px 0 0; }
.char-showcase .char-row, .char-showcase #charHint { display: none; }               /* (l'avis a sa propre icone dans le pied de page) */
.char-stage::before, .char-stage::after, .char-showcase .char-stage::before, .char-showcase .char-stage::after { display: none; }   /* plus de halo rond ni de cercle en pointilles derriere le personnage */

/* ---- jouer : pseudo (invite), TUTO au-dessus (nouveau joueur), JOUER ; le TUTO / le JOUER discret sont habilles dans menu.css (.btn-play-tuto) ---- */
.play-zone { width: 100%; max-width: 420px; margin: 4px 0 0; }
#playGuest .field { height: 46px; margin: 0; padding: 0 16px; border-radius: 14px; font-size: 16px; text-align: center; background: rgba(8, 7, 6, .66); border-color: rgba(255, 255, 255, .16); }
#playGuest .hint, #playAccount { display: none; }                                    /* (le badge du perso dit deja qui tu es ; le bouton Connexion est en haut) */
#menuHero .play-wrap { margin-top: 10px; align-items: center; }
#menuHero .btn-play { height: 66px; }
#menuHero .btn-play-tuto { height: 72px; }
.play-wrap:has(.btn-play-tuto:not(.hidden)) #play { width: 72%; }

/* ---- la barre de 3 raccourcis (recompense du jour, missions, Pass) ---- */
.glass { background: linear-gradient(155deg, rgba(46, 39, 32, .8), rgba(20, 17, 14, .9)); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 14px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06); }
.home-bar { display: flex; align-items: stretch; width: 100%; max-width: 480px; border-radius: 16px; overflow: hidden; }
.hb-seg { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 8px; cursor: pointer; white-space: nowrap;
  color: var(--text); background: none; border: 0; font: 700 14px var(--ui); transition: background .15s; }
.hb-seg + .hb-seg { border-left: 1px solid rgba(255, 255, 255, .1); }
.hb-seg:hover { background: rgba(240, 200, 105, .1); }
.hb-seg:focus-visible { outline: 2px solid var(--brand2); outline-offset: -2px; }
.hb-ic { flex: none; color: var(--brand); }
.hb-label { overflow: hidden; text-overflow: ellipsis; }
.hb-val { color: var(--brand); font: 800 13px var(--mono); }
.hb-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ff5d9a; box-shadow: 0 0 8px #ff5d9a; }
.hb-seg.locked .hb-ic { color: rgba(255, 255, 255, .45); }
.hb-seg.locked .hb-label::after { content: "\1F512"; margin-left: 5px; font-size: 11px; opacity: .7; }

@media (max-width: 520px) {                                                           /* telephone : l'icone au-dessus de son libelle, rien n'est tronque */
  .hb-seg { flex-direction: column; gap: 3px; padding: 9px 4px 8px; font-size: 12px; }
  .hb-dot { position: absolute; top: 8px; left: calc(50% + 9px); }
}

/* ---- le pied de page : amis a gauche, « en ligne » + carte du moment au centre, nouveautes / avis / reseaux a droite ---- */
.home-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 880px; padding: 10px 2px 0; }
.hf-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--text); white-space: nowrap;
  background: rgba(8, 6, 4, .5); border: 1px solid rgba(255, 255, 255, .16); font: 700 13px var(--ui); transition: border-color .15s, background .15s, color .15s; }
.hf-btn:hover { border-color: var(--brand); background: rgba(240, 200, 105, .12); }
.hf-btn.on { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 14px rgba(240, 200, 105, .22); }
.hf-btn:focus-visible, .hf-ic:focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; }
.hf-live { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; text-align: center; }
.hf-live .pill { margin: 0; padding: 0; background: none; border: 0; font: 600 12.5px var(--ui); opacity: .9; }
.hf-icons { flex: none; display: flex; align-items: center; gap: 8px; }
.hf-ic { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--text); text-decoration: none;
  background: rgba(8, 6, 4, .5); border: 1px solid rgba(255, 255, 255, .14); transition: border-color .15s, color .15s, transform .15s; }
.hf-ic:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.hf-ic .badge-dot { top: -3px; right: -3px; }
@media (max-width: 720px) {
  .home-foot { flex-wrap: wrap; justify-content: center; }
  .hf-live { order: 3; flex-basis: 100%; }
}

/* ---- les fenetres de l'accueil : recompense du jour, missions, nouveautes, jouer entre amis ---- */
.hm-panel { max-width: 440px; padding: 18px 18px 20px; text-align: left; align-items: stretch; max-height: calc(var(--h100) - 32px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4a4238 transparent; }
.hm-wide { max-width: 520px; }
.hm-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.hm-ico { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #2a1710; }
.hm-title { flex: 1; min-width: 0; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.hm-x { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--text); background: rgba(255, 255, 255, .08); border: 0; font-size: 13px; transition: background .15s; }
.hm-x:hover { background: rgba(255, 255, 255, .17); }
.hm-x:focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; }
.hm-sub { margin: -4px 0 14px; font: 600 13px/1.45 var(--ui); opacity: .72; }
.hm-panel .dl-login-head { justify-content: center; margin-bottom: 8px; }
.hm-panel .dl-login-head b { display: none; }                                         /* (la fenetre porte deja le titre) */
.hm-panel .dl-streak { font-size: 13px; }
.hm-panel .dl-claim { margin-top: 9px; padding: 11px; font-size: 14.5px; }
.hm-panel .dl-note { margin-top: 10px; font-size: 13px; }
.hm-panel #dailyBody { display: flex; flex-direction: column; gap: 16px; }
.hm-panel .dl-missions { display: flex; flex-direction: column; gap: 8px; max-height: min(54vh, 430px); overflow-y: auto; padding: 0 2px 0 0; scrollbar-width: thin; scrollbar-color: #4a4238 transparent; }
.hm-panel .dl-m { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 13px; border-radius: 16px; }
.hm-panel .dl-m-top { margin: 0; gap: 9px; }
.hm-panel .dl-m-text { font: 650 14.5px/1.25 var(--ui); }
.hm-panel .dl-m-row { min-height: 0; gap: 10px; }
.hm-panel .dl-rew { font-size: 12.5px; }
.hm-panel .dl-m-top .small-btn { flex: none; padding: 6px 14px; font-size: 12.5px; }
.hm-panel .dl-check { flex: none; font-size: 13px; }
.hm-panel .dl-guest { padding: 18px 6px 6px; }
.hm-panel #newsBody { max-height: 60vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4a4238 transparent; }
.hm-group { display: flex; flex-direction: column; gap: 10px; }
.hm-group .host-btn { width: 100%; margin: 0; justify-content: center; padding: 12px 16px; font-size: 14px; }
.hm-group #partyArea { max-width: none; margin: 0; }
.hm-group #partyRow { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.hm-group .party-label { font-size: 13px; opacity: .85; }
.hm-group .party-controls { gap: 8px; }
.hm-group #partyRow .field { width: 104px; }
.hm-group #roomCard, .hm-group #partyCard { margin: 0; }

/* ---- grands ecrans : tout grossit avec la hauteur de la fenetre (paliers ci-dessous), le pied de page colle en bas ---- */
@media (min-width: 1181px) {
  #menuStage:has(#menuHero:not(.hidden)) { max-width: none; padding: 0; }
  body:not(.is-prime) #menu:has(#menuHero:not(.hidden)) { background:
    radial-gradient(ellipse 100% 75% at 50% 42%, rgba(8, 7, 6, .04), rgba(6, 5, 4, .5) 100%),
    linear-gradient(180deg, rgba(24, 19, 15, .38) 0%, rgba(9, 8, 7, .58) 100%); }
  .hero-stage { padding: 22px 24px 16px; min-height: calc((var(--h100) - var(--nav-h, 72px)) / var(--hz)); }               /* (marges en px, pas en vh : dans une zone zoomee, le vh grossit aussi et fausse le calcul de hauteur ci-dessous) */
}
/* ---- L'ECHELLE DE L'ACCUEIL SUIT LA HAUTEUR DE LA FENETRE. Ce qui doit tenir sans defiler : tout, pied de page compris. Contenu fixe mesure a
   l'echelle 1 : --fixed px (titre, badge, pseudo, boutons, barre, pied) + la hauteur du dessin du personnage (110 a 300 px, c'est lui qui
   s'ajuste) ; --fixed est plus grand quand la ligne TUTO est la (nouveau joueur). Le menu du haut (73 px) et ~12 px de marge sont retires.
   Les paliers visent un personnage d'environ 230 px quand tout est affiche (echelle = (hauteur - 85) / (--fixed + 230), arrondie vers le bas
   a 0,05). Les amis / la salle privee sont dans une fenetre : plus rien sous le pli. ---- */
@media (min-width: 1181px) {
  #menuHero { --hz: .6; --fixed: 404px; zoom: var(--hz); }
  #menuHero:has(#playTuto:not(.hidden)) { --fixed: 462px; }
  .char-showcase { --cv-h: clamp(110px, calc((var(--h100) - 85px) / var(--hz) - var(--fixed)), 300px); }          /* le personnage prend ce qui reste de hauteur */
}
@media (min-width: 1181px) and (min-height: 540px) { #menuHero { --hz: .65; } }
@media (min-width: 1181px) and (min-height: 575px) { #menuHero { --hz: .7; } }
@media (min-width: 1181px) and (min-height: 610px) { #menuHero { --hz: .75; } }
@media (min-width: 1181px) and (min-height: 645px) { #menuHero { --hz: .8; } }
@media (min-width: 1181px) and (min-height: 680px) { #menuHero { --hz: .85; } }
@media (min-width: 1181px) and (min-height: 715px) { #menuHero { --hz: .9; } }
@media (min-width: 1181px) and (min-height: 750px) { #menuHero { --hz: .95; } }
@media (min-width: 1181px) and (min-height: 785px) { #menuHero { --hz: 1; } }
@media (min-width: 1181px) and (min-height: 820px) { #menuHero { --hz: 1.05; } }
@media (min-width: 1181px) and (min-height: 855px) { #menuHero { --hz: 1.1; } }
@media (min-width: 1181px) and (min-height: 890px) { #menuHero { --hz: 1.15; } }
@media (min-width: 1181px) and (min-height: 925px) { #menuHero { --hz: 1.2; } }
@media (min-width: 1210px) and (min-height: 960px) { #menuHero { --hz: 1.25; } }
@media (min-width: 1250px) and (min-height: 995px) { #menuHero { --hz: 1.3; } }
@media (min-width: 1330px) and (min-height: 1065px) { #menuHero { --hz: 1.4; } }
@media (min-width: 1420px) and (min-height: 1135px) { #menuHero { --hz: 1.5; } }
@media (min-width: 1500px) and (min-height: 1205px) { #menuHero { --hz: 1.6; } }
@media (min-width: 1700px) and (min-height: 1345px) { #menuHero { --hz: 1.8; } }
@media (min-width: 1900px) and (min-height: 1485px) { #menuHero { --hz: 2; } }


/* =====================================================================================================================================
   UN ACCUEIL QUI VIT (2026-10-05) : de quoi donner envie de cliquer JOUER, surtout aux nouveaux. Tout est decoratif et se coupe avec Reglages > Effets visuels
   (body.no-fx) et prefers-reduced-motion. Etincelles + suivi de souris : fx.js (homeLife).
   ===================================================================================================================================== */
/* le M du titre flotte et brille */
#menuHero .hero-m { filter: drop-shadow(0 0 10px rgba(240, 200, 105, .6)); animation: mFloat 5s ease-in-out infinite; }
@keyframes mFloat { 50% { transform: translateY(-4px) rotate(-3deg); filter: drop-shadow(0 0 18px rgba(240, 190, 120, .9)); } }

/* le personnage : projecteur chaud + rayons qui tournent doucement derriere lui, flotte, ombre au sol, etincelles */
.char-showcase::before { content: ""; position: absolute; z-index: 0; left: 50%; top: calc(var(--cv-h) * .5); width: min(560px, 130vw); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  translate: calc(-50% + var(--cpx, 0) * -14px) calc(-50% + var(--cpy, 0) * -8px);
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, .2) 0 6deg, transparent 6deg 20deg), radial-gradient(circle, rgba(255, 210, 120, .28), transparent 62%);
  -webkit-mask: radial-gradient(circle, #000 6%, transparent 66%); mask: radial-gradient(circle, #000 6%, transparent 66%); animation: raysSpin 70s linear infinite; }
@keyframes raysSpin { to { rotate: 360deg; } }
.char-showcase .char-stage { transform: translate(calc(var(--cpx, 0) * 7px), calc(var(--cpy, 0) * 4px)); transition: transform .25s ease-out; }
.char-showcase #heroChar { animation: charFloat 4.2s ease-in-out infinite; }
@keyframes charFloat { 50% { transform: translateY(-7px); } }
.char-showcase .char-stage::after { display: block; content: ""; position: absolute; left: 50%; bottom: 1%; width: 44%; height: 14px; margin-left: -22%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .5), transparent 70%); animation: charShadow 4.2s ease-in-out infinite; }
@keyframes charShadow { 50% { transform: scale(.82); opacity: .6; } }
.char-stage .sp { position: absolute; z-index: 2; width: var(--s, 10px); height: var(--s, 10px); margin: calc(var(--s, 10px) / -2) 0 0 calc(var(--s, 10px) / -2); pointer-events: none;
  background: #fff7d6; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 5px #ffd45a);
  opacity: 0; animation: twinkle var(--t, 3s) ease-in-out var(--d, 0s) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }

/* le gros bouton respire (battement) : JOUER, ou TUTO pour un nouveau joueur ; le « Recommande » rebondit et les atouts rassurent */
@keyframes btnBeat { 0%, 62%, 100% { transform: scale(1); } 70% { transform: scale(1.035); } 78% { transform: scale(1); } 86% { transform: scale(1.025); } }
.btn-play-tuto:not(.hidden):not(:hover):not(:disabled), .play-wrap:not(:has(.btn-play-tuto:not(.hidden))) #play:not(:hover):not(:disabled) { animation: playGlow 3.4s ease-in-out infinite, btnBeat 3.4s ease-in-out infinite; }
.tuto-flag { animation: flagBob 1.6s ease-in-out infinite; }
@keyframes flagBob { 50% { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0, 0, 0, .35); } }
.play-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.play-perks.hidden { display: none; }
.hero-stage:has(#playPerks:not(.hidden)) .char-showcase { --cv-h: clamp(104px, calc(28vh - 56px), 210px); }              /* (les atouts prennent ~56 px avec leur marge : le personnage rend la place, l'accueil tient toujours dans l'ecran) */
.play-perks li { position: relative; padding: 4px 12px 4px 26px; border-radius: 999px; font: 700 12px var(--ui); color: var(--text); background: rgba(8, 6, 4, .5); border: 1px solid rgba(240, 200, 105, .3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: rise .6s var(--ease) backwards; }
.play-perks li::before { content: "✓"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #5fd47e; font-weight: 900; }
.play-perks li:nth-child(2) { animation-delay: .1s; }
.play-perks li:nth-child(3) { animation-delay: .2s; }

body.no-fx #menuHero .hero-m, body.no-fx .char-showcase::before, body.no-fx .char-showcase #heroChar, body.no-fx .char-showcase .char-stage::after, body.no-fx .tuto-flag,
body.no-fx .btn-play-tuto, body.no-fx .play-wrap #play, body.no-fx .play-perks li { animation: none; }
body.no-fx .char-stage .sp { display: none; }
body.no-fx .char-showcase .char-stage { transform: none; }
@media (prefers-reduced-motion: reduce) {
  #menuHero .hero-m, .char-showcase::before, .char-showcase #heroChar, .char-showcase .char-stage::after, .tuto-flag, .btn-play-tuto, .play-wrap #play, .play-perks li { animation: none !important; }
  .char-stage .sp { display: none; }
}
