/* =========================================================
   NEO·GEO SPIRIT - Relooking Large & Responsive (PC / Mobile)
   ========================================================= */

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

body {
  margin: 0 !important;
  padding: 20px 12px 40px 12px !important;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
  color: #e2e8f0 !important;
  background-color: #090b10 !important;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------
1. ÉCRANS PC : Élargissement du tableau principal (1180px)
   --------------------------------------------------------- */
body > div > table:first-of-type {
  width: 1180px !important;
  max-width: 100% !important;
  background-color: #0d1017 !important;
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.85), 0 0 1px rgba(0, 210, 255, 0.35);
  border-radius: 6px;
}

/* Élargissement de la colonne principale de gauche et des blocs d'édito */
body > div > table:first-of-type td[width="698"] {
  width: auto !important;
}

td[background*="edito_fond"] {
  padding: 12px 24px 18px 24px !important;
  color: #1a202c !important;
}

/* Élargissement des tableaux d'actualités (640px -> 92% de la colonne) */
td[background*="fond_accueil"] > div > table {
  width: 92% !important;
  max-width: 820px !important;
}

/* Répétition propre des bordures horizontales élargies */
td[background*="bord_haut"],
td[background*="bord_bas"],
td[background*="edito_h.png"],
td[background*="edito_b.png"] {
  background-repeat: repeat-x !important;
}

/* ---------------------------------------------------------
2. TYPOGRAPHIE & CONTENU
   --------------------------------------------------------- */
font {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

font[size="-1"] {
  font-size: 15.5px !important;
  line-height: 1.65 !important;
}

td[background*="edito_fond"] p {
  margin: 14px 0 !important;
  font-size: 15.5px !important;
  line-height: 1.65 !important;
  color: #1a202c !important;
}

td[background*="edito_h.png"] font,
td[background*="edito_h.png"] strong {
  font-size: 16px !important;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Images fluides partout */
img {
  max-width: 100%;
  height: auto;
}

td[background*="edito_fond"] img {
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

td[background*="edito_fond"] a:hover img {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.5);
}

/* Liens */
a {
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:link, a:visited {
  color: #38bdf8;
  text-decoration: none;
}
a:hover {
  color: #fbbf24 !important;
  text-decoration: underline;
}

td[background*="edito_fond"] a:link,
td[background*="edito_fond"] a:visited {
  color: #065f46 !important;
  text-decoration: none;
}
td[background*="edito_fond"] a:hover {
  color: #b45309 !important;
  text-decoration: underline;
}

/* ---------------------------------------------------------
3. COLONNE LATÉRALE (Menu & Encarts)
   --------------------------------------------------------- */
td[background*="ovale_random"] img {
  border-radius: 4px;
  transition: transform 0.2s ease;
}
td[background*="ovale_random"] a:hover img {
  transform: scale(1.06);
}

td[background*="fond_boutons"] a img {
  margin: 0 3px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
td[background*="fond_boutons"] a:hover img {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

a[href$=".htm"] img[src*="bouton"] {
  display: block;
  transition: transform 0.15s ease, filter 0.15s ease;
}
a[href$=".htm"]:hover img[src*="bouton"] {
  transform: translateX(3px);
  filter: brightness(1.08);
}

td[background*="fond_sitesfils2"] img,
td[background*="fond_partenaire"] img {
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}
td[background*="fond_sitesfils2"] a:hover img,
td[background*="fond_partenaire"] a:hover img {
  transform: scale(1.03);
}

/* =========================================================
   TITRES "MISE À JOUR DU..." : GRAND ÉCRAN (> 960px)
   ========================================================= */
@media screen and (min-width: 961px) {
  td[background*="edito_h"] font,
  td[background*="edito_h"] strong,
  td[background*="edito_h"] b {
    font-size: 20px !important;
    line-height: 1.25 !important;
    letter-spacing: 0.4px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
  }
}

/* =========================================================
   MOBILE & TABLETTE (< 960px)
   Ordre : 1. Bannière -> 2. Boutons de navigation -> 3. Éditos
   ========================================================= */
@media screen and (max-width: 960px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip !important;
    margin: 0 !important;
    padding: 6px !important;
    background-image: none !important;
    background-color: #090b10 !important;
  }

  /* Empilement vertical propre */
  body > div,
  body > div table,
  body > div tbody,
  body > div tr,
  body > div td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
    background-image: none !important;
  }

  body > div > table:first-of-type,
  body > div > table:first-of-type > tbody {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: #0d1017 !important;
  }

  /* Masquer bordures, test au hasard, réseaux sociaux, sites fils et partenaires */
  td[width="18"],
  td[width="22"],
  td[background*="bord_"],
  td[background*="coin_"],
  td[background*="ovale_random"],
  td[background*="fond_boutons"],
  td[background*="fond_sitesfils"],
  td[background*="fond_partenaire"],
  td[background*="edito_hg"],
  td[background*="edito_hd"],
  td[background*="edito_bg"],
  td[background*="edito_bd"],
  td[background*="edito_g"],
  td[background*="edito_d"],
  td[background*="edito_h.png"],
  td[background*="edito_b.png"],
  img[src*="hasard"],
  img[src*="random"],
  img[src*="fatal_fury"],
  img[src*="windjammers"],
  img[src*="gravitor"],
  a[href*="youtube.com"],
  a[href*="facebook.com"],
  a[href*="twitter.com"],
  a[href*="tumblr.com"] {
    display: none !important;
  }

  /* 1. Bannière tout en haut */
  img[src*="banniere_neogeospirit"] {
    order: 1 !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 4px auto 12px auto !important;
  }

  /* 2. Boutons de navigation juste sous la bannière */
  td[rowspan="5"] {
    order: 2 !important;
    margin: 0 auto 14px auto !important;
    padding: 0 8px !important;
  }

  img[src*="bouton"],
  a[href$=".htm"] > img {
    display: block !important;
    width: auto !important;
    max-width: 240px !important;
    height: auto !important;
    margin: 6px auto !important;
  }

  /* 3. Éditos datés en bas */
  td[background*="fond_accueil"] {
    order: 3 !important;
    padding: 0 4px !important;
  }

  td[background*="edito_h"] {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 14px 0 0 0 !important;
    padding: 8px 10px !important;
    background-color: #1e293b !important;
    border-radius: 6px 6px 0 0 !important;
    text-align: center !important;
  }

  td[background*="edito_h"],
  td[background*="edito_h"] * {
    font-size: 18px !important;
    line-height: 1.3 !important;
    color: #ffffff !important;
  }

  td[background*="edito_fond"] {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    background-color: #e2e8f0 !important;
    color: #1a202c !important;
    border-radius: 0 0 6px 6px !important;
  }

  td[background*="edito_fond"] p,
  td[background*="edito_fond"] span,
  td[background*="edito_fond"] font {
    color: #1a202c !important;
  }

  td[background*="edito_fond"] img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 10px auto !important;
  }
}