/* Accueil uniquement. Surcharges isolées du style commun.
   Le CSS existant reste intact. Toutes les ressources restent locales. */
.home {
  --cream-dim: #bfb89e;
  --gold-bright: #ffd94d;
  --out-expo: cubic-bezier(.16, 1, .3, 1);
  --out-cubic: cubic-bezier(.22, .61, .36, 1);
  font-size: 22px;
  line-height: 1.6;
  background: #0a0a0a;
}
.home p { color: var(--cream); }
.home :is(p, a, button, h4, .hq-label, .rank-rep, .footer-bottom) { font-size: max(22px, 1em); }
.home :is(a, button) { transition: transform 180ms var(--out-cubic); }
.home a:hover { color: var(--gold-bright); }
.home :is(a, button):focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 5px; }
.home .container { max-width: 1320px; padding-inline: 32px; }
.home section { padding: 88px 0; scroll-margin-top: 102px; }
.home .skip-link { position: fixed; top: 12px; left: 20px; z-index: 120; padding: 12px 24px; background: var(--bg-coal); transform: translateY(-160%); }
.home .skip-link:focus { transform: none; }
.home header { padding: 12px 0; background: #111; backdrop-filter: none; border-bottom: 3px double #76612b; }
.home header .container { gap: 24px; }
.home .brand { font-size: 28px; min-height: 48px; white-space: nowrap; }
.home .header-right { gap: 24px; }
.home nav ul { gap: 26px; }
.home nav a { display: flex; align-items: center; min-height: 48px; font: 24px 'Bebas Neue', sans-serif; letter-spacing: .07em; color: var(--cream); }
.home .lang-toggle { flex-shrink: 0; border-radius: 2px; width: 48px; height: 48px; border-color: #76612b; }
.home .lang-toggle img { width: 30px; height: 30px; border-radius: 0; object-fit: contain; }
.home .lang-toggle:hover { transform: translateY(-3px); box-shadow: 3px 5px 0 #000; border-color: var(--gold-bright); }
.home .burger { min-height: 48px; min-width: 48px; padding: 0 10px; }

/* A double rule, clipped corners and a light upper edge form the game panel. */
.home :is(.feature-card, .mode-card, .hq-card, .rank-card, .rank-dialog-panel) {
  position: relative;
  background: #1a1a1a url('images/home-grain.svg') repeat;
  border: 3px double #8b7137;
  box-shadow: inset 0 2px 0 #f0e6d21a, 6px 8px 0 #000;
}
.home :is(.feature-card, .mode-card, .hq-card, .rank-card)::before {
  content: ''; position: absolute; inset: 7px; pointer-events: none;
  background: linear-gradient(var(--gold),var(--gold)) left top / 16px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) left top / 2px 16px no-repeat,
    linear-gradient(var(--gold),var(--gold)) right bottom / 16px 2px no-repeat,
    linear-gradient(var(--gold),var(--gold)) right bottom / 2px 16px no-repeat;
  opacity: .7;
}

/* Original centered composition: tower, wordmark, tagline, actions. */
.home .hero { min-height: max(760px, 100svh); padding: 96px 0 88px; text-align: center; display: block; background: #0a0a0a; }
.home .hero::before { background: radial-gradient(ellipse at 50% 35%, transparent 25%, #0a0a0ab3 100%); z-index: 1; }
.home .hero-layout { position: relative; z-index: 3; }
.home .hero-content { max-width: 900px; margin: 0 auto; animation: home-arrive 400ms var(--out-expo) backwards; }
.home .hotel-float { position: relative; width: 100%; height: 280px; margin: 0 auto 20px; animation: home-float 3.8s ease-in-out -1.4s infinite; --float-y: -6px; }
.home .hero-hotel { display: block; width: auto; height: 100%; max-height: none; max-width: 100%; margin: 0 auto; object-fit: contain; filter: drop-shadow(5px 8px 1px #000b); }
.home .hero-subtitle { margin: 0 auto 24px; color: var(--gold); font: 24px 'Bebas Neue', sans-serif; letter-spacing: .22em; }
.home .hero h1 { display: flex; flex-wrap: nowrap; justify-content: center; align-items: baseline; gap: .15em; font: clamp(72px, 9vw, 120px)/1.1 'Bebas Neue', sans-serif; letter-spacing: .06em; }
.home .hero h1 .don { display: inline-block; font: inherit; color: transparent; -webkit-text-stroke: 2px var(--gold); text-shadow: none; letter-spacing: inherit; }
.home .hero h1 .mafio { display: inline-block; font: 400 1.15em/.9 'Mr De Haviland', cursive; color: var(--cream); -webkit-text-stroke: 0; text-shadow: 3px 4px 0 #000; transform: rotate(-2deg); letter-spacing: .01em; }
.home .hero-tagline { color: var(--cream); font-size: 24px; max-width: 650px; margin: 28px auto 32px; }
.home .hero-buttons { justify-content: center; position: relative; gap: 16px; margin: 0; }
.home .btn { min-height: 56px; padding: 12px 24px; font: 24px/1.3 'Bebas Neue', sans-serif; letter-spacing: .1em; border: 3px double #e8b923; box-shadow: 4px 6px 0 #000; }
.home .btn-primary { background: #8b0000; color: var(--cream); }
.home .btn-secondary { background: #171717; color: var(--gold); }
.home .btn:hover { transform: translateY(-4px); color: var(--gold-bright); border-color: var(--gold-bright); box-shadow: 6px 10px 0 #000; }
.home .btn-primary:hover { background: #8b0000; }
.home .btn-secondary:hover { background: #171717; }
.home .character-float { position: absolute; z-index: 2; pointer-events: none; right: -60px; bottom: 0; width: min(40%, 440px); height: 68%; animation: home-float 2.9s ease-in-out -.7s infinite; --float-y: -8px; }
.home .hero-character { display: block; position: static; width: 100%; height: 100%; max-height: 600px; opacity: .2; object-fit: contain; object-position: bottom; filter: drop-shadow(7px 10px 1px #000c); }
.home .parallax-sky { opacity: .55; }
.home .parallax-buildings { height: 48%; opacity: .75; filter: none; }
.home .parallax-shadows { opacity: .45; }
.home .cloud { z-index: 1; opacity: .35; filter: none; }
.home .cloud-front, .home .cloud-3, .home .cloud-5 { display: none; }
.home .fade-up { animation: none; }

/* Short centered cartouches, with decorative rules confined to their frame. */
.home :is(.features, .empire, .modes, .ranks, .studio) { background: #0a0a0a; border: 0; }
.home :is(.features, .modes, .studio) { background: #101010 url('images/home-grain.svg') repeat; }
.home .section-title, .home .ranks .section-title {
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto 28px;
  padding: 18px 28px; border: 3px double #8b7137; background: #1a1a1a;
  font-size: clamp(32px, 3.5vw, 48px); line-height: 1.15;
  box-shadow: inset 0 2px 0 #f0e6d21a, 4px 5px 0 #000;
}
.home .section-title::after { width: 34px; height: 3px; margin: 0; position: absolute; left: calc(50% - 17px); bottom: -3px; background: var(--gold); }
.home :is(.section-subtitle, .ranks-intro, .empire-text, .studio-text) { font-size: 22px; color: var(--cream); max-width: 780px; margin: 0 auto 56px; text-align: center; }
.home :is(.features-grid, .modes-grid, .ranks-grid) { gap: 38px 28px; }
.home .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 24px; }
.home .home-list-item { min-width: 0; }
.home .feature-card { height: 100%; padding: 24px; text-align: left; }
.home .feature-card img { width: 108px; height: 96px; margin: -50px 0 22px; filter: drop-shadow(4px 7px 0 #0009); }
.home .feature-card h3 { font-size: 30px; }
.home .feature-card p { margin: 0; }
.home :is(.feature-card, .mode-card, .hq-card, .rank-card) { transition: transform 200ms var(--out-cubic); }
.home :is(.feature-card, .mode-card, .hq-card, .rank-card):hover { transform: translateY(-4px); border-color: var(--gold-bright); box-shadow: inset 0 2px 0 #f0e6d21a, 8px 12px 0 #000; }
.home .empire { overflow: visible; }
.home .empire-stage { min-height: 0; display: block; margin: 36px auto; }
.home .empire-bg { position: relative; display: block; top: auto; left: auto; transform: none; width: min(620px, 90%); margin: 0 auto -80px; opacity: 1; filter: drop-shadow(6px 10px 0 #000); }
.home .empire-progression { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 0; margin: 0; border: 0; background: none; backdrop-filter: none; }
.home .hq-card { padding: 24px 18px; height: 100%; gap: 12px; }
.home .hq-card img { width: 140px; max-width: 100%; height: 130px; margin-top: -46px; filter: drop-shadow(4px 7px 0 #0009); }
.home .hq-label { font: 26px 'Bebas Neue', sans-serif; color: var(--cream); }
.home .hq-arrow { display: none; }
.home .empire-text { margin-bottom: 0; font-style: normal; }
.home .modes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 24px; }
.home .mode-card { overflow: visible; height: 100%; padding: 24px; }
.home .mode-card-image { height: 180px; margin-top: -46px; background: none; overflow: visible; }
.home .mode-card-image img { max-width: 100%; max-height: 100%; filter: drop-shadow(5px 8px 0 #0009); transition: transform 200ms var(--out-cubic); }
.home .mode-card:hover .mode-card-image img { transform: translateY(-4px); }
.home .mode-card-content { padding: 24px 0 0; }
.home .mode-card-content h3 { font-size: 30px; }
.home .mode-card-content p { font-size: 22px; margin: 0; }
.home .ranks-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 28px; margin-bottom: 0; }
.home .rank-card { padding: 24px 18px; height: 100%; }
.home .rank-card img { width: 96px; height: 96px; margin: -48px auto 20px; filter: drop-shadow(4px 6px 0 #0009); image-rendering: auto; }
.home .rank-card h4 { color: var(--gold); font-size: 26px; }
.home .rank-card .rank-rep { color: var(--cream-dim); font-size: 22px; }
.home .rank-king { border-color: var(--gold); background-color: #281515; }
.home .rank-card-open { z-index: 1; }
.home .rank-card:focus-within { outline: 3px solid var(--gold-bright); outline-offset: 5px; }
.home .studio-logo { filter: drop-shadow(4px 8px 0 #000); max-width: 220px; margin-bottom: 32px; }
.home .studio-text { margin-bottom: 0; }
.home footer { border-top: 3px double #76612b; }
.home .footer-grid { grid-template-columns: 1.4fr .8fr 1.25fr .8fr; gap: 28px; }
.home footer :is(p, a, h4, .footer-bottom) { font-size: 22px; }
.home footer ul a { min-height: 44px; display: inline-flex; align-items: center; overflow-wrap: anywhere; max-width: 100%; }
.home .footer-bottom { color: var(--cream-dim); }

/* Native dialog: backdrop closes, Escape closes, no cross; text button for keyboard. */
.home .rank-dialog { padding: 24px; }
.home .rank-dialog::backdrop { background: #000b; backdrop-filter: none; }
.home .rank-dialog-panel { padding: 24px; display: flex; flex-direction: column; width: min(680px, 100%); }
.home .rank-dialog[open] .rank-dialog-panel { animation: home-arrive 400ms var(--out-expo) both; }
.home .rank-dialog-close { order: 2; position: static; float: none; align-self: center; margin: 24px 0 0; padding: 8px 24px; border: 3px double #8b7137; box-shadow: 3px 4px 0 #000; font: 24px 'Bebas Neue', sans-serif; }
.home .rank-unlock-content { padding: 0; }
.home .rank-unlock-heading { padding: 0; }
.home .rank-unlock-heading h2 { font-size: 36px; }
.home .rank-unlock-heading img { width: 96px; height: 96px; filter: drop-shadow(4px 6px 0 #0009); }
.home .rank-reward-group h3 { font-size: 28px; color: var(--gold); }
.home .rank-reward h4, .home .rank-recipe :is(h4, p) { font-size: 22px; }
.home .rank-recipe { padding: 20px; }
.home .rank-reward { border: 3px double #76612b; }
.home .rank-dialog[open] :is(.rank-reward, .rank-recipe) { animation: home-cascade 500ms var(--out-cubic) 300ms backwards; }
.home .rank-dialog[open] .rank-reward:nth-child(2) { animation-delay: 380ms; }

/* Reveals own wrappers; hover and responsive placement keep their own transforms. */
.home .reveal-ready:not(.is-revealed) > .container { opacity: 0; }
.home .reveal-ready.is-revealed > .container { animation: home-arrive 400ms var(--out-expo) backwards; }
.home .reveal-ready.is-revealed .home-list-item { animation: home-cascade 500ms var(--out-cubic) backwards; animation-delay: calc(300ms + var(--item-order, 0) * 80ms); }
.home .hero.is-offscreen :is(.hotel-float, .character-float, .cloud) { animation-play-state: paused; }
@keyframes home-arrive { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes home-cascade { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes home-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(var(--float-y, -4px)); } }

@media (max-width: 1100px) {
  .home .burger { display: block; }
  .home nav ul { display: none; position: absolute; top: 76px; right: 24px; background: #1a1a1a; border: 3px double #8b7137; padding: 20px 24px; flex-direction: column; gap: 8px; min-width: 230px; box-shadow: 6px 8px 0 #000; }
  .home nav ul.open { display: flex; }
  .home .modes-grid { grid-template-columns: 1fr; gap: 52px; }
  .home .mode-card { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: center; }
  .home .mode-card-content { padding: 0; }
  .home .mode-card-image { margin: 0; }
  .home .ranks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .home .container { padding-inline: 24px; }
  .home section { padding-block: 64px; }
  .home .hero { min-height: max(700px, 100svh); padding: 96px 0 72px; }
  .home .hotel-float { height: 210px; margin-bottom: 22px; }
  .home .hero-subtitle { font-size: 22px; letter-spacing: .1em; }
  .home .hero h1 { font-size: clamp(64px, 12vw, 92px); }
  .home .hero-tagline { margin: 24px auto 28px; font-size: 22px; }
  .home .character-float { display: none; }
  .home .features-grid { grid-template-columns: 1fr; gap: 54px; }
  .home .empire-progression { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 50px 22px; }
  .home .empire-bg { margin-bottom: -24px; }
  .home .ranks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 20px; }
  .home .section-title, .home .ranks .section-title { padding: 18px 22px; font-size: 34px; }
  .home .mode-card { display: block; }
  .home .mode-card-image { margin-top: -46px; margin-bottom: 24px; }
  .home .rank-dialog { padding: 16px; }
  .home .rank-dialog-panel { padding: 22px; max-height: calc(100dvh - 32px); }
  .home .rank-reward-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .home .container { padding-inline: 18px; }
  .home header .container, .home .header-right { gap: 12px; }
  .home .brand { font-size: 24px; gap: 8px; }
  .home .brand img { height: 32px; }
  .home .hero-buttons { flex-direction: row; gap: 10px; }
  .home .btn { width: auto; flex: 1; padding-inline: 12px; }
  .home .hero h1 { font-size: clamp(58px, 16vw, 72px); }
  .home .footer-grid { grid-template-columns: 1fr; }
  .home .rank-card, .home .hq-card { padding-inline: 18px; }
  .home .rank-card h4 { font-size: 24px; overflow-wrap: anywhere; }
  .home .rank-recipe { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.home) { scroll-behavior: auto; }
  .home *, .home *::before, .home *::after, .home ::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .home .reveal-ready:not(.is-revealed) > .container { opacity: 1; }
}
