/* iJob مباريات — couche « application » (mobile). Le bureau garde la mise en page du thème. */

html { -webkit-tap-highlight-color: transparent; }

/* Garde-fou : aucun élément (publicité, tableau, image…) ne doit élargir la page sur mobile.
   « clip » ne crée pas de conteneur de défilement : l'en-tête collant (sticky) continue de fonctionner. */
html, body { max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
@supports not (overflow: clip) { html { overflow-x: hidden; } }
.adsbygoogle, iframe, embed, video { max-width: 100%; }
a, button, .btn, .ijc-opt { touch-action: manipulation; }

/* Transitions douces entre les pages (navigateurs compatibles, sans JavaScript). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
.site-header { view-transition-name: app-header; }
.tabbar { view-transition-name: app-tabbar; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* Bouton retour (mobile et application installée) */
.app-back { display: none; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--ink); flex: 0 0 auto; margin-inline-start: -6px; }
.app-back:hover { background: var(--soft); text-decoration: none; }
.app-back svg { width: 24px; height: 24px; }

/* Barre d'onglets */
.tabbar { display: none; position: fixed; inset-inline: 0; bottom: 0; z-index: 70; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: flex-end; box-shadow: 0 -6px 20px rgba(15, 40, 80, .06); }
@supports (backdrop-filter: blur(10px)) { .tabbar { background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.6) blur(14px); } }
.tabbar .tab, .tabbar .tab-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 52px; padding: 6px 2px 4px; border: 0; background: none; border-radius: 14px; color: var(--muted); font: inherit; font-size: .72rem; font-weight: 700; line-height: 1.3; cursor: pointer; text-decoration: none; }
.tabbar .tab:hover, .tabbar .tab-main:hover { text-decoration: none; }
.tabbar .ico { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 99px; transition: background .15s; }
.tabbar svg { width: 23px; height: 23px; }
.tabbar [aria-current="page"] { color: var(--blue); }
.tabbar [aria-current="page"] .ico { background: #e6efff; }
.tabbar .tab:active .ico { background: var(--soft); }
.tabbar .tab-main { color: var(--blue); }
.tabbar .tab-main .ico { width: 52px; height: 52px; margin-top: -24px; margin-bottom: 1px; border-radius: 18px; background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(11, 95, 214, .35); border: 4px solid var(--bg); }
.tabbar .tab-main:active .ico { transform: scale(.95); }
.tabbar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Feuille « المزيد » */
.app-sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 20, 30, .45); opacity: 0; transition: opacity .2s; }
.app-sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 90; max-height: 86vh; display: flex; flex-direction: column; background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(15, 40, 80, .18); transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
.app-sheet[hidden], .app-sheet-backdrop[hidden] { display: none; }
.sheet-open .app-sheet { transform: none; }
.sheet-open .app-sheet-backdrop { opacity: 1; }
.sheet-open { overflow: hidden; }
.app-sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.app-sheet-head h2 { margin: 0; font-size: 1.15rem; }
.app-sheet-head .grab { position: absolute; top: 7px; inset-inline-start: 50%; width: 40px; height: 4px; margin-inline-start: -20px; border-radius: 99px; background: var(--line); }
.app-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 20px; }
.app-sheet-body h3 { font-size: .85rem; color: var(--muted); margin: 16px 4px 6px; font-weight: 700; }
.app-list { list-style: none; margin: 0; padding: 0; background: var(--soft); border-radius: 16px; overflow: hidden; }
.app-list li + li { border-top: 1px solid var(--line); }
.app-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; color: var(--ink); font-weight: 600; }
.app-list a:hover, .app-list a:active { background: #e9eef7; text-decoration: none; }
.app-list .em { font-size: 1.25rem; width: 28px; text-align: center; }
.app-list small { margin-inline-start: auto; color: var(--muted); font-weight: 500; }
.app-list-small a { min-height: 46px; font-weight: 500; }
.app-install { margin-top: 4px; }
.app-install .btn { width: 100%; }
.app-install .btn svg { width: 20px; height: 20px; }
.app-ios-tip { margin: 8px 4px 0; font-size: .92rem; color: var(--ink2); }
.app-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--soft); color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.app-icon-btn svg { width: 20px; height: 20px; }

/* Invitation à installer */
.app-toast { position: fixed; inset-inline: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 75; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 10px 12px; box-shadow: 0 12px 30px rgba(15, 40, 80, .18); animation: app-up .3s ease-out; }
.app-toast[hidden] { display: none; }
.app-toast img { display: block; border-radius: 10px; }
.app-toast-txt { flex: 1; min-width: 0; line-height: 1.35; }
.app-toast-txt strong { display: block; font-size: .95rem; }
.app-toast-txt small { color: var(--muted); font-size: .8rem; }
.app-toast .btn { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
@keyframes app-up { from { transform: translateY(20px); opacity: 0; } }

/* ------------------------------------------------------------ */
/* Mobile : présentation « application »                         */
/* ------------------------------------------------------------ */
@media (max-width: 760px) {
  body.has-tabbar { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .app-back { display: grid; }
  .nav-toggle, .main-nav { display: none !important; }

  .site-header { padding-top: env(safe-area-inset-top); }
  .site-header .container { min-height: 56px; gap: 8px; }
  .logo { font-size: 1.32rem; }
  .logo .pill { font-size: .74rem; padding: 2px 9px 3px; }

  .container { padding-inline: 14px; }
  .hero { padding: 26px 0 30px; border-radius: 0 0 26px 26px; }
  .hero h1 { font-size: 1.62rem; }
  .hero p.lead { font-size: 1rem; margin-bottom: 18px; }
  .hero-stats { gap: 8px; margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-stats div { background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 8px 10px; font-size: .8rem; text-align: center; }
  .hero-stats strong { font-size: 1.2rem; }
  .section { padding: 22px 0 4px; }
  .section-head h2 { font-size: 1.2rem; }

  /* Fil d'Ariane sur une ligne, défilable (reste visible et lisible par Google) */
  .crumbs { white-space: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px 0 4px; font-size: .82rem; }
  .crumbs::-webkit-scrollbar { display: none; }

  /* Cartes plus « natives » */
  .concours-card, .ijc-card, .article, .post-card, .q-list, .steps li { border-radius: 18px; }
  .concours-card { padding: 16px; }
  .ijc-card { padding: 18px 16px; }
  .concours-card:active, .post-card:active, .axe-card:active, .spec-item:active { transform: scale(.985); }
  .concours-card, .post-card, .axe-card, .spec-item { transition: transform .12s; }
  .q-list a { padding: 13px 14px; min-height: 52px; }
  .btn { min-height: 48px; border-radius: 14px; }

  /* Quiz : plein écran, boutons de navigation collés en bas */
  body.is-quiz .site-footer, body.is-quiz .ijc-ad { display: none; }
  body.is-quiz { padding-bottom: env(safe-area-inset-bottom); }
  body.is-quiz .ijc-quiz-page { padding-top: 12px; }

  .site-footer { margin-top: 28px; padding-top: 28px; }
}

/* Application installée : pas de pied de page « site web » superflu sur mobile */
@media (display-mode: standalone) and (max-width: 760px) {
  .site-footer .footer-grid > div:not(:first-child) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sheet, .app-sheet-backdrop, .tabbar .ico { transition: none; }
  .app-toast { animation: none; }
}
