/* PokéBattle V13.28 — exact user-designed battle room + persistent final arena. */

/* Room configuration stays visible above live/final battle without altering engine state. */
#battleGrid.session-active .battlearena > #lobby.pbStable46.hidden{
  display:block!important;width:100%!important;max-width:none!important;
  margin:0 0 12px!important;padding:0!important;border:0!important;
  background:transparent!important;box-shadow:none!important;
}

/* EXACT desktop composition from the approved mockup:
   SET | FORMAT | PRODUCT | QUANTITY | PRICE | CODE
                 RULE    | room action buttons                */
#page-battle #pbLobbyStable46{
  display:grid!important;
  grid-template-columns:minmax(270px,290px) minmax(0,1fr)!important;
  gap:10px!important;width:100%!important;max-width:none!important;
  box-sizing:border-box!important;padding:10px!important;margin:0!important;
  border-radius:14px!important;
}
#page-battle #pbLobbyStable46 .pb46Set{
  min-height:144px!important;height:144px!important;
  grid-template-columns:82px minmax(0,1fr)!important;gap:10px!important;
  padding:10px!important;border-radius:12px!important;align-content:center!important;
  box-sizing:border-box!important;
}
#page-battle #pbLobbyStable46 .pb46SetLogo{height:76px!important;border-radius:9px!important}
#page-battle #pbLobbyStable46 .pb46SetText b{font-size:17px!important}
#page-battle #pbLobbyStable46 .pb46SetText span{margin-top:8px!important;padding:7px 9px!important;font-size:9px!important}
#page-battle #pbLobbyStable46 .pb46SetText small{margin-top:7px!important;font-size:10px!important}

#page-battle #pbLobbyStable46 .pb46Right{
  display:grid!important;grid-template-rows:80px 56px!important;gap:8px!important;min-width:0!important;
}
#page-battle #pbLobbyStable46 .pb46Facts,
#page-battle #pbLobbyStable46 .pb46Lower{
  display:grid!important;
  grid-template-columns:1.05fr 1.10fr 1.06fr 1fr 1.10fr!important;
  gap:8px!important;min-width:0!important;
}
#page-battle #pbLobbyStable46 .pb46Fact{
  min-height:80px!important;height:80px!important;padding:9px 10px!important;
  border-radius:10px!important;box-sizing:border-box!important;overflow:hidden!important;
}
#page-battle #pbLobbyStable46 .pb46Fact small,
#page-battle #pbLobbyStable46 .pb46ModeInline>small{
  display:block!important;margin:0 0 5px!important;color:#8793a8!important;
  font-size:8px!important;font-weight:900!important;letter-spacing:.06em!important;
  text-transform:uppercase!important;
}
#page-battle #pbLobbyStable46 .pb46Fact b{font-size:12px!important;line-height:1.15!important}
#page-battle #pbLobbyStable46 .pb46Fact span{font-size:9px!important;margin-top:4px!important}
#page-battle #pbLobbyStable46 .pb46QtyFact input{min-height:38px!important;font-size:14px!important}

/* Rule is its OWN card, directly under Formato — not nested inside another card. */
#page-battle #pbLobbyStable46 .pb46ModeInline{
  grid-column:1/2!important;display:block!important;height:56px!important;min-height:56px!important;
  margin:0!important;padding:6px 8px!important;box-sizing:border-box!important;
  border:1px solid #2b3549!important;background:#111827!important;border-radius:10px!important;
}
#page-battle #pbLobbyStable46 .pb46ModeInline>small{margin-bottom:4px!important}
#page-battle #pbLobbyStable46 .pb46ModeBtns{
  display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;margin:0!important;
}
#page-battle #pbLobbyStable46 .pb46ModeBtns button{
  width:100%!important;min-width:0!important;min-height:30px!important;height:30px!important;
  padding:0 8px!important;border-radius:8px!important;font-size:9px!important;
  line-height:1!important;font-weight:1000!important;white-space:nowrap!important;
}
#page-battle #pbLobbyStable46 .pb46ModeBtns button:disabled{opacity:1!important;cursor:default!important}

/* Actions begin under Producto and use the original large sizing. */
#page-battle #pbLobbyStable46 .pb46Actions{
  grid-column:2/6!important;display:flex!important;align-items:center!important;
  justify-content:flex-end!important;gap:8px!important;flex-wrap:nowrap!important;min-width:0!important;
}
#page-battle #pbLobbyStable46 .pb46Actions button{
  min-height:40px!important;height:40px!important;padding:0 14px!important;
  border-radius:10px!important;font-size:12px!important;font-weight:1000!important;white-space:nowrap!important;
}
#page-battle #pbLobbyStable46 .pb46CodeRow button{min-height:27px!important;height:27px!important;padding:0 8px!important;font-size:10px!important}

/* Live/final data stays visible but cannot mutate a running result. */
#battleGrid.session-active .battlearena > #lobby.pbStable46.hidden #pbLobbyStable46 select,
#battleGrid.session-active .battlearena > #lobby.pbStable46.hidden #pbLobbyStable46 input,
#battleGrid.session-active .battlearena > #lobby.pbStable46.hidden #pbLobbyStable46 .pb46Set.canEdit{
  pointer-events:none!important;
}
body:not(.pbBattleFinalHoldV1327) #battleGrid.session-active .battlearena > #lobby.pbStable46.hidden #pbLobbyStable46 button:not(#pb46Leave){pointer-events:none!important}
body.pbBattleFinalHoldV1327 #battleGrid.session-active .battlearena > #lobby.pbStable46.hidden #pbLobbyStable46 button:not(#pb46Start):not(#pb46Leave){pointer-events:none!important}

/* Finished battle: revealed lanes, card totals and result stay exactly where they ended. */
body.pbBattleFinalHoldV1327 #playerSlots{display:grid!important;visibility:visible!important}
body.pbBattleFinalHoldV1327 #battleResult{display:block!important}
body.pbBattleFinalHoldV1327 #battleResult .battleResultActions{display:none!important}

/* VS: fighters first, OPEN last. */
.pb1319Open{
  position:absolute;left:50%;top:50%;z-index:6;transform:translate(-50%,-50%) scale(.55);opacity:0;
  color:#fff;font-size:68px;font-weight:1000;letter-spacing:.16em;
  text-shadow:0 0 24px rgba(255,210,55,.48),0 7px 28px rgba(0,0,0,.6);pointer-events:none;
}
.pb1319Open.go{animation:pb1328Open .38s cubic-bezier(.2,.9,.2,1) forwards}
@keyframes pb1328Open{to{opacity:1;transform:translate(-50%,-50%) scale(1)}}

/* Sets preview: sticky app header never covers close button. */
#setPreviewV6{z-index:1000010!important;place-items:start center!important;align-items:start!important;overflow:auto!important;padding:88px 17px 18px!important}
#setPreviewV6 .modalcard{position:relative!important;margin:0 auto!important;max-height:calc(100dvh - 106px)!important}
#setPreviewV6 .zoomClose{top:10px!important;right:12px!important;z-index:30!important}
#setPreviewV6 .previewCardsV6{max-height:calc(100dvh - 245px)!important}

/* Pokédex detail identity + progress remain sticky while the cards scroll. */
#pokedexDetailV138 .pokedexStickyV1327{
  position:sticky;top:84px;z-index:70;background:linear-gradient(180deg,#080b13 0%,rgba(8,11,19,.97) 88%,rgba(8,11,19,0) 100%);
  padding:0 0 8px;margin:0 0 8px;backdrop-filter:blur(12px);
}
#pokedexDetailV138 .pokedexStickyV1327 .pokedexDetailTopV138{margin-bottom:10px!important;box-shadow:0 10px 24px rgba(0,0,0,.18)}
#pokedexDetailV138 .pokedexStickyV1327 .pokedexDetailProgressV138{margin-bottom:0!important;box-shadow:0 10px 24px rgba(0,0,0,.14)}

@media(max-width:900px){
  #page-battle #pbLobbyStable46{grid-template-columns:1fr!important}
  #page-battle #pbLobbyStable46 .pb46Set{min-height:96px!important;grid-template-columns:72px 1fr!important}
  #page-battle #pbLobbyStable46 .pb46SetLogo{height:66px!important}
  #page-battle #pbLobbyStable46 .pb46Facts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #page-battle #pbLobbyStable46 .pb46Fact:nth-child(2){min-height:122px!important}
  #pokedexDetailV138 .pokedexStickyV1327{top:74px}
}
@media(max-width:760px){
  #page-battle #pbLobbyStable46{padding:7px!important;gap:7px!important}
  #page-battle #pbLobbyStable46 .pb46Facts{grid-template-columns:1fr 1fr!important;gap:6px!important}
  #page-battle #pbLobbyStable46 .pb46Actions button{min-height:38px!important;font-size:10px!important;padding:0 10px!important}
  #page-battle #pbLobbyStable46 .pb46ModeBtns button{min-height:32px!important;font-size:9px!important}
  .pb1319Open{font-size:36px}
  #setPreviewV6{padding:76px 8px 10px!important}
  #setPreviewV6 .modalcard{max-height:calc(100dvh - 88px)!important}
  #setPreviewV6 .previewCardsV6{max-height:calc(100dvh - 220px)!important}
  #pokedexDetailV138 .pokedexStickyV1327{top:68px;padding-bottom:6px}
}


/* V13.28 responsive battle room. */
@media(max-width:1000px){
  #page-battle #pbLobbyStable46{grid-template-columns:1fr!important}
  #page-battle #pbLobbyStable46 .pb46Set{height:auto!important;min-height:96px!important;grid-template-columns:72px 1fr!important}
  #page-battle #pbLobbyStable46 .pb46Right{grid-template-rows:auto auto!important}
  #page-battle #pbLobbyStable46 .pb46Facts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #page-battle #pbLobbyStable46 .pb46Fact{height:auto!important;min-height:76px!important}
  #page-battle #pbLobbyStable46 .pb46Fact:nth-child(2){height:auto!important;min-height:76px!important}
  #page-battle #pbLobbyStable46 .pb46Lower{grid-template-columns:1fr!important}
  #page-battle #pbLobbyStable46 .pb46ModeInline{grid-column:1!important;width:100%!important;height:auto!important;min-height:56px!important}
  #page-battle #pbLobbyStable46 .pb46Actions{grid-column:1!important;justify-content:flex-start!important;flex-wrap:wrap!important}
}
@media(max-width:760px){
  #page-battle #pbLobbyStable46{padding:7px!important;gap:7px!important}
  #page-battle #pbLobbyStable46 .pb46Facts{grid-template-columns:1fr 1fr!important;gap:6px!important}
  #page-battle #pbLobbyStable46 .pb46Actions button{min-height:38px!important;height:38px!important;font-size:10px!important;padding:0 10px!important}
  #page-battle #pbLobbyStable46 .pb46ModeBtns button{min-height:32px!important;height:32px!important;font-size:9px!important}
}
