/* =========================================================
   ESPORT CAREER — DA blanc/crème luxueuse, or & encre
   ========================================================= */

[hidden]{ display:none !important; }

:root{
  --cream:#FBF7EF;
  --cream-dark:#F1E9D8;
  --white:#FFFFFF;
  --ink:#241F19;
  --ink-soft:#6b6152;
  --ink-faint:#a89d87;
  --gold:#C9A24B;
  --gold-light:#E9D3A0;
  --gold-dark:#9C7A32;
  --bordeaux:#5B1A1A;
  --danger:#C0392B;
  --positive:#2E7D32;
  --line: rgba(36,31,25,0.12);
  --line-gold: rgba(201,162,75,0.35);
  --shadow-soft: 0 10px 30px -12px rgba(36,31,25,0.18);
  --shadow-lift: 0 24px 60px -20px rgba(36,31,25,0.28);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-serif: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22,.68,0,1.02);
}

:root[data-theme="dark"]{
  --cream:#1B1712;
  --cream-dark:#241E17;
  --white:#262019;
  --ink:#F3ECDD;
  --ink-soft:#C9BEA8;
  --ink-faint:#8C8270;
  --gold:#D9B463;
  --gold-light:#F0D998;
  --gold-dark:#C7A055;
  --danger:#E05B4E;
  --positive:#5BC46D;
  --line: rgba(255,255,255,0.10);
  --line-gold: rgba(217,180,99,0.35);
  --shadow-soft: 0 10px 30px -12px rgba(0,0,0,0.55);
  --shadow-lift: 0 24px 60px -20px rgba(0,0,0,0.65);
}
:root[data-theme="dark"] .bg-noise{ mix-blend-mode:screen; opacity:.05; }
:root[data-theme="dark"] body{ color-scheme:dark; }

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  background:var(--cream);
  color:var(--ink);
  transition:background .3s var(--ease), color .3s var(--ease);
  font-family:var(--font-sans);
  min-height:100vh;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{ font-family:var(--font-serif); margin:0; color:var(--ink); }
p{ margin:0; }
button{ font-family:inherit; cursor:pointer; }
input{ font-family:inherit; }

/* ---------- Ambiance de fond ---------- */
.bg-vignette{
  position:fixed; inset:0; z-index:-2; pointer-events:none;
  background:
    radial-gradient(60% 45% at 15% 0%, rgba(201,162,75,0.14), transparent 70%),
    radial-gradient(50% 40% at 100% 10%, rgba(91,26,26,0.07), transparent 70%),
    radial-gradient(70% 60% at 50% 100%, rgba(201,162,75,0.10), transparent 70%),
    var(--cream);
}
.bg-noise{
  position:fixed; inset:0; z-index:-1; pointer-events:none; opacity:.035; mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Topbar ---------- */
.topbar{
  position:fixed; top:0; left:0; right:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 28px;
  background:rgba(251,247,239,0.82);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line-gold);
}
.progress-rail{
  position:absolute; left:0; right:0; bottom:-1px; height:3px;
  background:var(--line); overflow:hidden;
}
.progress-fill{
  height:100%; width:0%; border-radius:0 3px 3px 0;
  background:linear-gradient(90deg,var(--gold-light),var(--gold),var(--gold-dark));
  box-shadow:0 0 8px rgba(201,162,75,.55);
  transition:width .6s var(--ease);
}
.brand{ display:flex; align-items:center; gap:10px; cursor:pointer; transition:transform .35s var(--ease); }
.brand:hover{ transform:scale(1.035); }
.brand-word{
  font-family:var(--font-serif); font-size:15px; letter-spacing:.14em; color:var(--ink);
  transition:letter-spacing .35s var(--ease);
}
.brand:hover .brand-word{ letter-spacing:.2em; }
.brand-word b{
  font-weight:700;
  background:linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-dark) 38%, var(--gold-light) 50%, var(--gold-dark) 62%, var(--gold-dark) 100%);
  background-size:260% 100%;
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent;
  animation:brandShine 5.5s ease-in-out infinite;
}
.brand:hover .brand-word b{ animation-duration:1.4s; }
@keyframes brandShine{
  0%, 12%{ background-position:220% 50%; }
  45%, 60%{ background-position:0% 50%; }
  100%{ background-position:220% 50%; }
}

.crest{ display:block; object-fit:contain; }
.crest-sm{ height:38px; width:auto; }
.crest-lg{ height:128px; width:auto; }

.steps{ display:flex; gap:22px; }
.step{
  display:flex; align-items:center; gap:7px;
  font-size:11.5px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--ink-faint); font-weight:600;
}
.step i{
  font-style:normal; width:18px; height:18px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line); font-size:10px; color:var(--ink-faint);
  transition:all .3s var(--ease);
}
.step.done i{ background:var(--gold); border-color:var(--gold); color:#fff; }
.step.active{ color:var(--ink); }
.step.active i{ background:var(--ink); border-color:var(--ink); color:var(--cream); }

.live-score{ display:flex; align-items:center; gap:10px; }
.gauge{ width:44px; height:44px; transform:rotate(-90deg); }
.gauge-track{ fill:none; stroke:var(--cream-dark); stroke-width:5; }
.gauge-fill{
  fill:none; stroke:var(--gold); stroke-width:5; stroke-linecap:round;
  stroke-dasharray:157; stroke-dashoffset:78.5;
  transition:stroke-dashoffset .7s var(--ease);
}
.live-score-num{ font-family:var(--font-serif); font-size:17px; color:var(--ink); line-height:1; }
.live-score-num small{ font-size:10px; color:var(--ink-faint); font-family:var(--font-sans); }

/* ---------- Layout écrans ---------- */
main{ padding-top:96px; min-height:100vh; display:flex; }
.screen{ display:none; width:100%; }
.screen.active{ display:flex; justify-content:center; }
.screen-inner{ width:100%; max-width:920px; padding:20px 24px 80px; position:relative; }
.hero-inner{ width:100%; max-width:680px; padding:60px 24px 80px; text-align:center; margin:auto; position:relative; z-index:1; }

/* ---------- Fond de rêve : filigrane du blason + particules dorées (accueil uniquement) ---------- */
#screen-hero{ position:relative; overflow:hidden; }
.hero-bg{ position:absolute; inset:0; z-index:0; pointer-events:none; overflow:hidden; }

.hero-crest-watermark{
  position:absolute; left:50%; top:46%; width:min(120vw,1100px); aspect-ratio:1;
  transform:translate(-50%,-50%);
  background-image:url("../assets/logo-esport-career.svg");
  background-repeat:no-repeat; background-position:center; background-size:contain;
  opacity:.05; filter:blur(.5px);
  animation:crestWatermarkLive 40s ease-in-out infinite;
  transform-origin:center center;
}
@keyframes crestWatermarkLive{
  0%,100%{ transform:translate(-50%,-50%) rotate(0deg) scale(1); opacity:.045; }
  50%{ transform:translate(-50%,-50%) rotate(6deg) scale(1.05); opacity:.08; }
}

.dream-sparkles span{
  position:absolute; bottom:-6%; width:5px; height:5px; border-radius:50%;
  background:radial-gradient(circle, var(--gold-light), var(--gold) 55%, transparent 75%);
  box-shadow:0 0 10px 2px rgba(201,162,75,.55);
  opacity:0;
  animation:sparkleFloat linear infinite;
}
.dream-sparkles span:nth-child(1){ left:6%;  animation-duration:14s; animation-delay:0s;  }
.dream-sparkles span:nth-child(2){ left:18%; animation-duration:17s; animation-delay:2s;  width:3px; height:3px; }
.dream-sparkles span:nth-child(3){ left:32%; animation-duration:12s; animation-delay:5s;  }
.dream-sparkles span:nth-child(4){ left:48%; animation-duration:19s; animation-delay:1s;  width:4px; height:4px; }
.dream-sparkles span:nth-child(5){ left:63%; animation-duration:15s; animation-delay:7s;  }
.dream-sparkles span:nth-child(6){ left:76%; animation-duration:13s; animation-delay:3s;  width:3px; height:3px; }
.dream-sparkles span:nth-child(7){ left:88%; animation-duration:18s; animation-delay:6s;  }
.dream-sparkles span:nth-child(8){ left:96%; animation-duration:16s; animation-delay:4.5s; width:4px; height:4px; }
@keyframes sparkleFloat{
  0%{ transform:translateY(0) translateX(0); opacity:0; }
  10%{ opacity:.8; }
  50%{ transform:translateY(-50vh) translateX(12px); opacity:.5; }
  90%{ opacity:0; }
  100%{ transform:translateY(-95vh) translateX(-8px); opacity:0; }
}

.eyebrow{
  text-transform:uppercase; letter-spacing:.22em; font-size:12px;
  color:var(--gold-dark); font-weight:700; margin-bottom:10px;
}
.screen-title{ font-size:clamp(28px,4vw,38px); margin-bottom:8px; }
.screen-sub{ color:var(--ink-soft); margin-bottom:28px; font-size:15px; }

/* Padding élargit la zone tactile (~44px) ; marge négative égale et opposée pour que
   le texte garde la même position visuelle qu'avant (pas de décalage de mise en page). */
.back-link{
  background:none; border:none; color:var(--ink-faint); font-size:12.5px;
  letter-spacing:.05em; padding:14px 8px; margin:-14px -8px 4px; display:inline-flex;
  align-items:center; text-transform:uppercase; font-weight:600; transition:color .2s;
}
.back-link:hover{ color:var(--gold-dark); }

/* ---------- Hero : titre qui s'écrit lettre par lettre, en boucle toutes les 25s ---------- */
.hero-title-fill{
  position:relative; font-size:clamp(34px,7vw,64px); line-height:1.05; margin:8px 0 18px;
  letter-spacing:.01em;
  -webkit-text-stroke:1.5px var(--line-gold);
}
.hero-title-fill .lg{
  color:transparent;
  animation:letterFill 25s ease-in-out infinite;
  animation-delay:var(--_d, 0ms);
}
@keyframes letterFill{
  0%{ color:transparent; }
  4%{ color:var(--_c, var(--gold)); }
  94%{ color:var(--_c, var(--gold)); }
  100%{ color:transparent; }
}

.hero-divider{ display:flex; align-items:center; justify-content:center; gap:10px; margin:0 auto 22px; max-width:220px; }
.hero-divider span{ flex:1; height:1px; background:linear-gradient(90deg, transparent, var(--line-gold)); }
.hero-divider span:last-child{ background:linear-gradient(90deg, var(--line-gold), transparent); }
.hero-divider i{ width:6px; height:6px; background:var(--gold); transform:rotate(45deg); flex:none; }

.hero-sub{ color:var(--ink-soft); font-size:16.5px; line-height:1.6; max-width:520px; margin:0 auto 26px; }

.hero-features{
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  gap:10px 14px; margin-bottom:32px;
  font-size:11px; text-transform:uppercase; letter-spacing:.1em; font-weight:700; color:var(--gold-dark);
}
.hero-features i{ width:3px; height:3px; border-radius:50%; background:var(--line-gold); }

.hero-tabs{ margin-bottom:30px; }
.hero-tabs-nav{
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:10px;
  margin-bottom:14px;
}
.hero-tab{
  display:inline-flex; align-items:center; gap:7px;
  font-family:inherit; font-size:12.5px; font-weight:700; color:var(--ink-soft);
  background:var(--white); border:1px solid var(--line);
  border-radius:999px; padding:7px 16px 7px 12px; box-shadow:none;
  transition:transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s, color .2s;
}
.hero-tab:hover{ transform:translateY(-2px); box-shadow:var(--shadow-soft); border-color:var(--line-gold); }
.hero-tab.active{ color:var(--ink); border-color:var(--gold); box-shadow:var(--shadow-soft); }
.hero-tab.active .hi-icon{ color:var(--gold-dark); }

.hero-tab-panel{
  max-width:480px; margin:0 auto; text-align:center;
  font-size:13.5px; color:var(--ink-soft); line-height:1.55; min-height:38px;
  opacity:0; transform:translateY(4px); transition:opacity .35s var(--ease), transform .35s var(--ease);
}
.hero-tab-panel.visible{ opacity:1; transform:translateY(0); }

.leaderboard-list{
  list-style:none; margin:0; padding:0; text-align:left; counter-reset:lb;
  max-width:280px; margin-inline:auto;
}
.leaderboard-list li{
  counter-increment:lb; display:flex; align-items:center; justify-content:space-between;
  padding:6px 4px; font-size:13px; border-bottom:1px solid var(--line);
}
.leaderboard-list li:last-child{ border-bottom:none; }
.leaderboard-list li::before{
  content:counter(lb); font-weight:800; color:var(--gold-dark); width:18px; display:inline-block;
}
.leaderboard-list li b{ flex:1; text-align:left; margin-left:4px; }
.leaderboard-list li span{ font-variant-numeric:tabular-nums; color:var(--ink-faint); }

.hi-icon{ display:inline-flex; width:16px; height:16px; flex:none; color:var(--ink-faint); transition:color .2s; }
.hi-icon svg{ display:block; width:100%; height:100%; }

.icon-target circle:first-child{ animation:targetPulse 2.2s ease-in-out infinite; }
@keyframes targetPulse{ 0%,100%{ opacity:.45; } 50%{ opacity:1; } }

.icon-globe{ animation:globeSpin 14s linear infinite; }
@keyframes globeSpin{ to{ transform:rotate(360deg); } }

.hero-tab:hover .icon-trophy{ animation:trophyBounce .5s var(--ease); }
@keyframes trophyBounce{ 0%,100%{ transform:translateY(0) rotate(0); } 35%{ transform:translateY(-3px) rotate(-6deg); } 65%{ transform:translateY(0) rotate(4deg); } }

.pseudo-field{ margin-bottom:30px; text-align:center; max-width:340px; margin-inline:auto; }
.pseudo-field label{
  display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:.12em;
  color:var(--ink-faint); margin-bottom:8px; font-weight:700;
}
.pseudo-field input{
  width:100%; border:none; border-bottom:2px solid var(--line-gold);
  background:transparent; padding:8px 4px; font-size:20px; font-family:var(--font-serif);
  color:var(--ink); text-align:center; outline:none; transition:border-color .25s;
}
.pseudo-field input:focus{ border-color:var(--gold); }

.reveal-up{ opacity:0; transform:translateY(16px); animation:revealUp .7s var(--ease) forwards; }
.d1{ animation-delay:.05s; } .d2{ animation-delay:.15s; } .d3{ animation-delay:.28s; }
.d4{ animation-delay:.4s; } .d5{ animation-delay:.52s; }
@keyframes revealUp{ to{ opacity:1; transform:translateY(0); } }

/* ---------- Boutons ---------- */
.btn{
  border-radius:999px; padding:14px 34px; font-size:13.5px; font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; border:1px solid transparent;
  transition:transform .25s var(--ease), box-shadow .25s var(--ease), opacity .25s;
}
.btn-gold{
  background:linear-gradient(135deg,var(--gold-light),var(--gold) 55%,var(--gold-dark));
  color:#2a1d06; box-shadow:var(--shadow-soft);
  position:relative; overflow:hidden;
}
.btn-gold::before{
  content:""; position:absolute; top:0; left:-60%; width:30%; height:100%;
  background:linear-gradient(120deg, transparent, rgba(255,255,255,.6), transparent);
  transform:skewX(-20deg); pointer-events:none;
}
.btn-gold:hover:not(:disabled)::before{ animation:btnShimmer 1.1s ease; }
@keyframes btnShimmer{ from{ left:-60%; } to{ left:130%; } }
.btn-gold:hover:not(:disabled){ transform:translateY(-2px); box-shadow:var(--shadow-lift); }
.btn-gold:disabled{ opacity:.35; cursor:not-allowed; box-shadow:none; }
.btn-ghost{
  background:transparent; color:var(--ink); border-color:var(--line-gold);
}
.btn-ghost:hover{ border-color:var(--gold); color:var(--gold-dark); }
.btn-next{ display:block; margin:34px auto 0; }

/* ---------- Recherche ---------- */
.search-input{
  width:100%; max-width:340px; display:block; margin:0 auto 26px;
  padding:12px 18px; border-radius:999px; border:1px solid var(--line);
  background:var(--white); font-size:16px; outline:none; transition:border-color .2s, box-shadow .2s;
}
.search-input:focus{ border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.15); }

/* ---------- Grilles de cartes ---------- */
.card-grid{ display:grid; gap:14px; }
.country-grid{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); max-height:400px; overflow-y:auto; padding:4px 4px 10px; }
.game-grid{ grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); }
.club-grid{ grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); }
.origin-grid{ grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }
.origin-card{ padding:24px 20px; display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; }
.origin-card .origin-title{ font-family:var(--font-serif); font-size:17px; color:var(--ink); }
.origin-card .origin-desc{ font-size:13px; color:var(--ink-soft); line-height:1.5; }

.card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius-md);
  cursor:pointer; transition:transform .25s var(--ease), border-color .25s, box-shadow .25s;
  position:relative; text-align:center;
}
.card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-soft); border-color:var(--line-gold); }
.card.selected{ border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,75,.18), var(--shadow-soft); }
.card.selected::after{
  content:"✓"; position:absolute; top:8px; right:10px; color:var(--gold-dark); font-weight:800; font-size:13px;
}

.country-card{ padding:14px 10px; display:flex; flex-direction:column; align-items:center; gap:6px; }
.country-card .name{ font-size:12.5px; font-weight:600; }

.flag-img{
  width:26px; height:19px; object-fit:cover; border-radius:3px;
  box-shadow:0 0 0 1px rgba(36,31,25,0.12); background:var(--cream-dark);
}
.flag-img-lg{ width:32px; height:23px; border-radius:4px; }
.club-badge .flag-img{ width:30px; height:22px; }

.game-card{ padding:24px 16px 20px; display:flex; flex-direction:column; align-items:center; gap:10px; overflow:hidden; }
.game-card .game-icon{ width:40px; height:40px; }
.game-card .game-icon svg{ width:100%; height:100%; stroke:var(--gold-dark); fill:none; stroke-width:1.6; }
.game-card .game-name{ font-family:var(--font-serif); font-size:16px; }
.game-card .game-tag{ font-size:12px; color:var(--ink-soft); }
.game-card .game-bar{ position:absolute; bottom:0; left:0; right:0; height:4px; opacity:.55; }

.club-card{ padding:22px 14px 18px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.club-badge{
  width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--cream),var(--white));
  border:1.5px solid var(--line-gold); font-size:24px;
  color:var(--ink); position:relative;
}
.club-badge::after{
  content:""; position:absolute; inset:-4px; border-radius:50%; border:1px solid var(--club-color,var(--gold));
  opacity:.35;
}
.club-card .club-name{ font-size:13.5px; font-weight:700; text-align:center; }
.club-card .club-country{ font-size:10.5px; letter-spacing:.1em; color:var(--ink-faint); font-weight:700; margin-top:-4px; }

/* ---------- Scénario ---------- */
.scenario-inner{ display:grid; grid-template-columns:240px 1fr; gap:28px; align-items:start; max-width:960px; }
.stats-panel{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:22px 20px; box-shadow:var(--shadow-soft); position:sticky; top:112px;
}
.stats-title{ font-size:11.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--gold-dark); font-weight:800; margin-bottom:16px; }
.stats-title-life{ margin-top:22px; padding-top:16px; border-top:1px solid var(--line); }
.stat-row{ margin-bottom:14px; }
.stat-row:last-child{ margin-bottom:0; }
.stat-row .stat-head{ display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:6px; }
.stat-row .stat-head b{ font-weight:700; }
.stat-row .stat-head span{ color:var(--ink-faint); font-variant-numeric:tabular-nums; }
.stat-track{ height:7px; border-radius:999px; background:var(--cream-dark); overflow:hidden; }
.stat-fill{ height:100%; border-radius:999px; background:linear-gradient(90deg,var(--gold-light),var(--gold-dark)); transition:width .6s var(--ease); }

.story-card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:34px 36px; box-shadow:var(--shadow-soft);
}
.story-anim{ animation:cardIn .5s var(--ease); }
@keyframes cardIn{ from{ opacity:0; transform:translateY(10px) scale(.99); } to{ opacity:1; transform:none; } }
.story-progress{ font-size:11.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--ink-faint); font-weight:700; margin-bottom:10px; }
.daily-challenge{
  display:inline-flex; align-items:center; gap:7px; font-size:11.5px; font-weight:700; letter-spacing:.03em;
  color:var(--gold-dark); background:var(--cream); border:1px solid var(--line-gold);
  border-radius:999px; padding:5px 14px 5px 10px; margin-bottom:14px;
}
.daily-challenge .hi-icon svg{ stroke:var(--gold-dark); }
.daily-challenge:empty{ display:none; margin:0; padding:0; border:none; }
.story-title{ font-size:26px; margin-bottom:12px; }
.story-text{ font-size:15.5px; line-height:1.65; color:var(--ink-soft); margin-bottom:26px; }

.story-choices{ display:flex; flex-direction:column; gap:12px; }
.choice-btn{
  text-align:left; background:var(--cream); border:1px solid var(--line);
  border-left:3px solid var(--gold); border-radius:var(--radius-sm);
  padding:15px 18px; font-size:14.5px; font-weight:600; color:var(--ink);
  transition:transform .2s var(--ease), background .2s, border-color .2s;
  display:flex; align-items:center; gap:10px;
}
.choice-btn::before{ content:"→"; color:var(--gold-dark); font-weight:700; }
.choice-btn:hover{ background:var(--white); transform:translateX(4px); border-left-color:var(--gold-dark); box-shadow:var(--shadow-soft); }
.choice-btn:disabled{ opacity:.5; cursor:default; }

.brief-banner{
  margin-top:22px; padding:14px 18px; border-radius:var(--radius-sm);
  background:var(--cream-dark); border-left:3px solid var(--gold-dark);
  font-size:14px; color:var(--ink-soft); line-height:1.5;
  opacity:0; transform:translateY(6px); transition:opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events:none;
}
.brief-banner.visible{ opacity:1; transform:translateY(0); }
.brief-banner:empty{ margin:0; padding:0; border:none; background:none; }

.brief-quote{ font-style:italic; margin:0 0 10px; }
.brief-score{ display:flex; flex-wrap:wrap; gap:6px 8px; margin-bottom:8px; }
.brief-score:last-child{ margin-bottom:0; }
.delta-chip{
  font-style:normal; font-size:11px; font-weight:800; letter-spacing:.02em;
  padding:3px 9px; border-radius:999px; background:var(--white);
  border:1px solid var(--line); font-variant-numeric:tabular-nums; white-space:nowrap;
  display:inline-block; opacity:0; transform:scale(.4);
  animation:chipPop .4s cubic-bezier(.34,1.56,.64,1) forwards;
  animation-delay:calc(var(--i, 0) * 80ms);
}
.delta-chip.pos{ color:var(--positive); border-color:rgba(46,125,50,.35); }
.delta-chip.neg{ color:var(--danger); border-color:rgba(140,34,34,.3); }
@keyframes chipPop{
  0%{ opacity:0; transform:scale(.4); }
  70%{ opacity:1; transform:scale(1.12); }
  100%{ opacity:1; transform:scale(1); }
}

.brief-daily{
  font-style:normal; font-size:12px; font-weight:700; margin:0; padding-top:8px;
  border-top:1px dashed var(--line);
}
.brief-daily.done{ color:var(--gold-dark); }
.brief-daily.missed{ color:var(--ink-faint); }

/* ---------- Résultat ---------- */
.result-inner{ position:relative; text-align:center; max-width:520px; }

/* Cadre à bande défilante : le contour de la carte devient une bordure animée
   dont l'épaisseur, la vitesse et les couleurs montent avec le palier de score. */
.result-card-frame{
  position:relative; border-radius:calc(var(--radius-lg) + 4px);
  padding:0; box-shadow:var(--shadow-lift);
  transition:padding .3s var(--ease), box-shadow .3s var(--ease);
  animation:cardIn .6s var(--ease);
}
.result-card-frame.tier-superstar{
  padding:3px;
  background:linear-gradient(100deg, #14100c 0%, #9c7a32 22%, #e9d3a0 42%, #c9a24b 62%, #14100c 82%, #9c7a32 100%);
  background-size:280% 100%; animation:cardIn .6s var(--ease), frameScroll 11s linear infinite;
  box-shadow:0 30px 50px -22px rgba(36,31,25,.45), 0 10px 24px -12px rgba(201,162,75,.35);
}
.result-card-frame.tier-legend{
  padding:4px;
  background:linear-gradient(100deg, #14100c 0%, #9c7a32 22%, #f2e2b8 42%, #c9a24b 62%, #14100c 82%, #9c7a32 100%);
  background-size:280% 100%; animation:cardIn .6s var(--ease), frameScroll 9s linear infinite;
  box-shadow:0 34px 56px -22px rgba(36,31,25,.5), 0 12px 30px -10px rgba(201,162,75,.4);
}
.result-card-frame.tier-champion{
  padding:5px;
  background:linear-gradient(100deg, #14100c 0%, #9c7a32 20%, #ffe9b0 38%, #f2e2b8 50%, #c9a24b 62%, #14100c 82%, #9c7a32 100%);
  background-size:280% 100%; animation:cardIn .6s var(--ease), frameScroll 7s linear infinite;
  box-shadow:0 38px 64px -20px rgba(36,31,25,.55), 0 14px 36px -8px rgba(201,162,75,.5);
}
@keyframes frameScroll{ from{ background-position:0% 50%; } to{ background-position:280% 50%; } }

.result-card{
  position:relative; z-index:1; background:linear-gradient(160deg,var(--white),var(--cream));
  border:1.5px solid var(--line-gold); border-radius:var(--radius-lg);
  padding:38px 32px 30px; overflow:hidden;
}
.result-card::before, .result-card::after{
  content:""; position:absolute; width:26px; height:26px; border:2px solid var(--gold);
  opacity:.5;
}
.result-card::before{ top:12px; left:12px; border-right:none; border-bottom:none; }
.result-card::after{ bottom:12px; right:12px; border-left:none; border-top:none; }

.result-card{
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--game-color, var(--gold)) 10%, transparent), transparent 55%),
    linear-gradient(160deg,var(--white),var(--cream));
}
.result-watermark{
  position:absolute; top:-8%; right:-12%; width:62%; aspect-ratio:1; z-index:0; pointer-events:none;
  opacity:.07;
}
.result-watermark svg{ width:100%; height:100%; stroke:var(--game-color, var(--gold)); fill:none; stroke-width:1; }
.result-content{ position:relative; z-index:1; }

.result-top{ display:flex; align-items:center; justify-content:center; gap:18px; margin-bottom:18px; }
.flag-img-result{ width:40px; height:29px; border-radius:5px; }
.result-game-icon{ width:26px; height:26px; }
.result-game-icon svg{ width:100%; height:100%; stroke:var(--gold-dark); fill:none; stroke-width:1.6; }
.result-badge{ width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--white); border:1.5px solid var(--line-gold); }
.result-badge .flag-img{ width:26px; height:19px; box-shadow:none; }

.result-pseudo{ font-size:30px; margin-bottom:4px; }
.result-meta{ color:var(--ink-soft); font-size:13.5px; margin-bottom:20px; }
.result-rank{ text-transform:uppercase; letter-spacing:.12em; font-size:13px; font-weight:800; color:var(--gold-dark); margin-bottom:2px; }
.result-rank-desc{ color:var(--ink-soft); font-size:13px; margin-bottom:18px; }

.result-score{ position:relative; display:inline-block; font-family:var(--font-serif); font-size:64px; line-height:1; color:var(--ink); }
.result-score.tier-elite{
  font-family:'Cinzel', var(--font-serif); font-weight:700; letter-spacing:.02em;
}
.result-score.tier-elite small{ font-family:'Cinzel', var(--font-serif); letter-spacing:.04em; }
.result-score small{ font-size:18px; color:var(--ink-faint); font-family:var(--font-sans); }
.result-stars{ margin:10px 0 22px; font-size:20px; letter-spacing:4px; color:var(--gold); }
.result-stars .dim{ color:var(--line-gold); }

/* ---------- Paliers de rang (score) : couleurs héritées par toute la carte depuis le cadre ---------- */
.result-card-frame.tier-amateur{ --tier-1:#9c8f7a; --tier-2:#c9a24b; --tier-3:#9c8f7a; }
.result-card-frame.tier-prospect{ --tier-1:#b98b4a; --tier-2:#e9c37a; --tier-3:#b98b4a; }
.result-card-frame.tier-pro{ --tier-1:#8a97a8; --tier-2:#d8e2ea; --tier-3:#8a97a8; }
.result-card-frame.tier-superstar{ --tier-1:#c9a24b; --tier-2:#f5dfa0; --tier-3:#c9a24b; }
.result-card-frame.tier-legend{ --tier-1:#2f7cb0; --tier-2:#7ec8ea; --tier-3:#2f7cb0; }
.result-card-frame.tier-champion{ --tier-1:#e04fd1; --tier-2:#ffd76a; --tier-3:#4fc3ff; }

.result-score.tier-shine{
  background:linear-gradient(90deg, var(--tier-1), var(--tier-2), var(--tier-3), var(--tier-2), var(--tier-1));
  background-size:280% 100%;
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent;
  filter:drop-shadow(0 0 16px color-mix(in srgb, var(--tier-2) 55%, transparent));
  animation:scoreShine 3.4s linear infinite;
}
.result-card.tier-champion .result-score.tier-shine{ animation-duration:2.1s; }

@keyframes scoreShine{
  0%{ background-position:0% 50%; }
  100%{ background-position:280% 50%; }
}

.result-card.tier-champion{ animation:cardIn .6s var(--ease), championPulse 2.4s ease-in-out infinite .6s; }
@keyframes championPulse{
  0%, 100%{ box-shadow:var(--shadow-lift), 0 0 0 0 rgba(224,79,209,0); }
  50%{ box-shadow:var(--shadow-lift), 0 0 34px 2px rgba(224,79,209,.35); }
}

.result-stats{ display:grid; grid-template-columns:1fr 1fr; gap:14px 20px; text-align:left; margin-top:6px; }

.result-life{ margin-top:22px; padding-top:18px; border-top:1px solid var(--line-gold); text-align:left; }
.result-life-title{ font-size:11px; text-transform:uppercase; letter-spacing:.14em; color:var(--gold-dark); font-weight:800; margin-bottom:10px; }
.result-life-line{ font-size:13.5px; color:var(--ink-soft); line-height:1.55; margin-bottom:6px; }

.result-trophies{ margin-top:22px; padding-top:18px; border-top:1px solid var(--line-gold); text-align:left; }
.trophy-grid{ display:flex; flex-wrap:wrap; gap:8px; }
.trophy-badge{
  display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700;
  color:var(--ink); background:var(--cream); border:1px solid var(--line-gold);
  border-radius:999px; padding:6px 12px 6px 8px;
}
.trophy-badge i{ font-style:normal; font-size:14px; }
.trophy-empty{ font-size:12.5px; color:var(--ink-faint); font-style:italic; }

.result-joke{
  margin-top:20px; padding-top:16px; border-top:1px dashed var(--line);
  font-size:12.5px; font-style:italic; color:var(--ink-faint); text-align:center;
}

.result-actions{ display:flex; gap:14px; justify-content:center; margin-top:28px; flex-wrap:wrap; }

.result-end-restart{ display:block; margin:30px auto 0; }

/* ---------- Partage ---------- */
.share-panel{ margin-top:34px; padding-top:24px; border-top:1px solid var(--line); }
.share-title{ font-size:11.5px; text-transform:uppercase; letter-spacing:.14em; color:var(--ink-faint); font-weight:700; margin-bottom:14px; }
.share-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.btn-share-wide{ grid-column:1 / -1; }
#btnShareInstagram{ grid-column:1 / -1; max-width:calc(50% - 5px); margin:0 auto; }
.btn-share{
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:var(--white); border:1px solid var(--line); border-radius:999px;
  padding:11px 14px; font-size:12.5px; font-weight:700; color:var(--ink);
  transition:transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.btn-share:hover{ transform:translateY(-2px); border-color:var(--gold); box-shadow:var(--shadow-soft); }
.share-icon{ font-size:15px; color:var(--gold-dark); font-weight:800; display:inline-flex; align-items:center; }
.share-icon svg{ width:15px; height:15px; }

/* ---------- Photo personnalisée ---------- */
.photo-upload{ margin-top:22px; padding-top:22px; border-top:1px solid var(--line); text-align:center; }
.photo-upload-btn{ display:inline-flex; cursor:pointer; }

.photo-hero{ display:flex; justify-content:center; margin-bottom:16px; }
.card-photo-lg{
  width:92px; height:92px; border-radius:50%; object-fit:cover;
  border:3px solid var(--game-color, var(--gold));
  box-shadow:0 0 0 4px var(--white), var(--shadow-lift);
}

/* ---------- Toast ---------- */
#toast{
  position:fixed; left:50%; bottom:28px; transform:translate(-50%,20px);
  background:var(--ink); color:var(--cream); padding:13px 22px; border-radius:999px;
  font-size:13px; font-weight:600; box-shadow:var(--shadow-lift);
  opacity:0; pointer-events:none; transition:opacity .35s var(--ease), transform .35s var(--ease);
  z-index:200; max-width:min(90vw,420px); text-align:center;
}
#toast.visible{ opacity:1; transform:translate(-50%,0); }

/* ---------- Confetti ---------- */
#confetti-layer{ position:fixed; inset:0; pointer-events:none; z-index:80; overflow:hidden; }
.confetti-piece{
  position:absolute; top:-20px; width:8px; height:14px; opacity:.9;
  animation:confettiFall linear forwards;
}
@keyframes confettiFall{
  to{ transform:translateY(110vh) rotate(540deg); opacity:0; }
}

/* ---------- Footer ---------- */
.site-footer{
  text-align:center; font-size:11.5px; color:var(--ink-faint); padding:22px 24px 34px;
  max-width:720px; margin:0 auto; line-height:1.6;
}
.site-footer p{ margin:0 0 16px; }
.site-credit{ margin:18px 0 0 !important; font-size:10px; letter-spacing:.03em; color:var(--ink-faint); opacity:.75; }
.btn-donate{
  position:relative; overflow:hidden; display:inline-flex; align-items:center; gap:8px;
  font-family:inherit; font-size:12px; font-weight:700; letter-spacing:.03em;
  color:var(--gold-dark); background:linear-gradient(135deg,var(--cream-dark),var(--white));
  border:1px solid var(--line-gold);
  border-radius:999px; padding:10px 22px; box-shadow:var(--shadow-soft);
  transition:transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.btn-donate::before{
  content:""; position:absolute; top:0; left:-60%; width:35%; height:100%;
  background:linear-gradient(120deg, transparent, rgba(255,255,255,.8), transparent);
  transform:skewX(-20deg); pointer-events:none;
  animation:donateShimmer 3.6s ease-in-out infinite;
}
@keyframes donateShimmer{ 0%{ left:-60%; } 55%,100%{ left:130%; } }
.btn-donate svg{ transform-origin:center; animation:heartBeat 1.9s ease-in-out infinite; }
@keyframes heartBeat{
  0%,100%{ transform:scale(1); }
  15%{ transform:scale(1.3); }
  30%{ transform:scale(1); }
  45%{ transform:scale(1.22); }
  60%{ transform:scale(1); }
}
.btn-donate:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lift); border-color:var(--gold); color:var(--gold); }

/* ---------- Bascule thème clair / sombre ---------- */
.theme-toggle{
  position:fixed; right:22px; bottom:22px; z-index:90;
  display:flex; align-items:center; justify-content:center;
  width:42px; height:42px; border-radius:50%;
  background:var(--white); border:1px solid var(--line-gold); color:var(--gold-dark);
  box-shadow:var(--shadow-soft);
  transition:transform .25s var(--ease), box-shadow .25s var(--ease);
}
.theme-toggle:hover{ transform:translateY(-2px) rotate(-10deg); box-shadow:var(--shadow-lift); }
.theme-toggle .icon-sun{ display:none; }
:root[data-theme="dark"] .theme-toggle .icon-moon{ display:none; }
:root[data-theme="dark"] .theme-toggle .icon-sun{ display:block; }

.lang-toggle{
  position:fixed; right:74px; bottom:22px; z-index:90;
  display:flex; align-items:center; justify-content:center;
  width:42px; height:42px; border-radius:50%;
  background:var(--white); border:1px solid var(--line-gold); color:var(--gold-dark);
  font-family:inherit; font-size:11px; font-weight:800; letter-spacing:.03em;
  box-shadow:var(--shadow-soft);
  transition:transform .25s var(--ease), box-shadow .25s var(--ease);
}
.lang-toggle:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lift); }

/* ---------- Défi entre amis ---------- */
.challenge-banner{
  max-width:480px; margin:0 auto 20px; padding:12px 18px; text-align:center;
  font-size:13px; font-weight:700; color:var(--gold-dark);
  background:var(--white); border:1px solid var(--line-gold); border-radius:999px;
  box-shadow:var(--shadow-soft);
}

/* ---------- Quêtes du jour ---------- */
.global-challenge{
  max-width:480px; margin:0 auto 22px; padding:16px 22px; text-align:center;
  background:linear-gradient(135deg,var(--cream-dark),var(--white));
  border:1px solid var(--line-gold); border-radius:var(--radius-md); box-shadow:var(--shadow-soft);
}
.global-challenge-title{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.12em; font-weight:800;
  color:var(--gold-dark); margin-bottom:6px;
}
.global-challenge-text{ font-size:13.5px; font-weight:600; color:var(--ink); line-height:1.5; }

.daily-quests{ margin-bottom:30px; }
.quests-title{
  font-size:11px; text-transform:uppercase; letter-spacing:.14em; font-weight:800;
  color:var(--ink-faint); margin-bottom:10px;
}
.quests-row{ display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px; }
.quest-chip{
  display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700;
  color:var(--ink-faint); background:var(--cream-dark); border:1px solid var(--line);
  border-radius:999px; padding:6px 14px; transition:color .2s, background .2s, border-color .2s;
}
.quest-chip i{
  font-style:normal; width:14px; height:14px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center; font-size:9px;
  border:1px solid var(--line-gold); color:var(--gold);
}
.quest-chip.done{ color:var(--ink); background:var(--white); border-color:var(--line-gold); }
.quest-chip.done i{ background:var(--gold); border-color:var(--gold); color:#fff; }

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .steps span:not(.active) i{ }
  .steps{ display:none; }
  .scenario-inner{ grid-template-columns:1fr; }
  .stats-panel{ position:static; }
}
@media (max-width: 520px){
  .topbar{ padding:12px 16px; }
  .brand-word{ font-size:12px; letter-spacing:.1em; }
  .story-card{ padding:26px 20px; }
  .result-card{ padding:30px 20px 24px; }
  /* Les boutons langue/thème sont fixes en bas à droite : on garde le bas de page
     dégagé pour que rien (footer, bouton don, dernière rangée de trophées) ne finisse
     coincé derrière eux une fois le scroll arrivé en butée. */
  .site-footer{ padding-bottom:96px; }
  .result-trophies{ margin-bottom:8px; }
  .trophy-grid{ padding-right:56px; }
}

@media (prefers-reduced-motion: reduce){
  .reveal-up, .hero-title-fill .lg, .delta-chip, .btn-donate::before, .btn-donate svg,
  .btn-gold:hover:not(:disabled)::before, .hero-crest-watermark, .dream-sparkles span,
  .result-score.tier-shine, .result-card-frame, .brand-word b{ animation:none; opacity:1; transform:none; }
  .brand-word b{ background:none; -webkit-text-fill-color:var(--gold-dark); color:var(--gold-dark); }
  .hero-title-fill .lg{ color:var(--_c, var(--gold)); }
  .hero-crest-watermark{ opacity:.05; }
  .dream-sparkles{ display:none; }
  .result-score.tier-shine{
    background:none; -webkit-text-fill-color:var(--tier-2); color:var(--tier-2); filter:none;
  }
}
