/* Le Big Plugg — bandeau commun des pages de jeu */
.lbp-game-banner,
.lbp-game-banner * {
  box-sizing: border-box;
}

body.lbp-game-page {
  overflow-x: hidden;
}

.lbp-game-banner {
  position: sticky;
  top: 0;
  z-index: 2147483000;
  width: 100vw;
  min-height: 82px;
  margin: 0 0 20px calc(50% - 50vw);
  padding: 10px clamp(12px, 3vw, 36px);
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(150px, 260px) minmax(70px, 1fr);
  align-items: center;
  gap: 14px;
  isolation: isolate;
  background: #fffaf0;
  color: #151009;
  border-bottom: 2px solid #151009;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
}

.lbp-game-banner__logo {
  grid-column: 1;
  justify-self: start;
  width: min(100%, 146px);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
}

.lbp-game-banner__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.lbp-game-banner__back {
  grid-column: 2;
  justify-self: center;
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 2px solid #151009;
  border-radius: 11px;
  background: #ffd400;
  color: #151009;
  box-shadow: 5px 5px 0 #151009;
  text-decoration: none;
  text-align: center;
  text-transform: uppercase;
  font: 900 11px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.lbp-game-banner__back:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 #151009;
  filter: saturate(1.08);
}

.lbp-game-banner__back:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 #151009;
}

.lbp-game-banner__logo:focus-visible,
.lbp-game-banner__back:focus-visible {
  outline: 3px solid #f32b87;
  outline-offset: 3px;
}

.lbp-game-banner__spacer {
  grid-column: 3;
  min-width: 0;
}

/* FLB Fighterz utilise un écran 16:9 plein cadre : conserver le bandeau
   sans couper le canvas dans la hauteur restante. */
body.lbp-game-page--fullscreen {
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: 100vh !important;
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
}

body.lbp-game-page--fullscreen .lbp-game-banner {
  position: relative;
  flex: 0 0 82px;
  margin-bottom: 0;
}

body.lbp-game-page--fullscreen #frame {
  flex: 0 0 auto;
  width: min(100vw, calc((100vh - 82px) * 16 / 9)) !important;
  width: min(100vw, calc((100dvh - 82px) * 16 / 9)) !important;
  height: min(calc(100vh - 82px), calc(100vw * 9 / 16)) !important;
  height: min(calc(100dvh - 82px), calc(100vw * 9 / 16)) !important;
  max-width: 100vw;
  max-height: calc(100vh - 82px);
  max-height: calc(100dvh - 82px);
  margin: auto;
}

body.lbp-game-page--fullscreen #frame:fullscreen,
body.lbp-game-page--fullscreen #frame:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
}

@media (max-width: 600px) {
  .lbp-game-banner {
    min-height: 70px;
    margin-bottom: 14px;
    padding: 8px 10px;
    grid-template-columns: minmax(58px, 1fr) minmax(132px, 210px) minmax(58px, 1fr);
    gap: 8px;
  }

  .lbp-game-banner__logo {
    width: min(100%, 100px);
    height: 50px;
  }

  .lbp-game-banner__back {
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #151009;
    font-size: 10px;
  }

  .lbp-game-banner__back:hover {
    transform: none;
    box-shadow: 4px 4px 0 #151009;
  }

  .lbp-game-banner__back:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 #151009;
  }

  body.lbp-game-page--fullscreen .lbp-game-banner {
    flex-basis: 70px;
  }

  body.lbp-game-page--fullscreen #frame {
    width: min(100vw, calc((100vh - 70px) * 16 / 9)) !important;
    width: min(100vw, calc((100dvh - 70px) * 16 / 9)) !important;
    height: min(calc(100vh - 70px), calc(100vw * 9 / 16)) !important;
    height: min(calc(100dvh - 70px), calc(100vw * 9 / 16)) !important;
    max-height: calc(100vh - 70px);
    max-height: calc(100dvh - 70px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lbp-game-banner__back { transition: none; }
}
