/* InazumArcade V790 — mobile-only continuation of V789.
   Fixes the active expedition viewport, all event/minigame panels and the
   brand-mark overlap in the phone navbar. No gameplay logic is modified. */

/* -------------------------------------------------------------------------
   PHONE NAVBAR — reserve the far-left slot for the brand mark.
   The achievement and leaderboard controls remain grouped on the right.
   ------------------------------------------------------------------------- */
html.ia-real-phone-mode .topbar .brand-bar{
  position:absolute!important;
  left:7px!important;
  right:auto!important;
  top:7px!important;
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:38px!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  z-index:11004!important;
  pointer-events:none!important;
}
html.ia-real-phone-mode .topbar .brand{
  display:grid!important;
  place-items:center!important;
  width:36px!important;
  min-width:36px!important;
  height:38px!important;
  margin:0!important;
  padding:2px!important;
}
html.ia-real-phone-mode .topbar .brand-mark{
  display:grid!important;
  place-items:center!important;
  width:31px!important;
  min-width:31px!important;
  max-width:31px!important;
  height:31px!important;
  margin:0!important;
}
html.ia-real-phone-mode .topbar .brand-mark img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
}
html.ia-real-phone-mode .topbar .brand-name{display:none!important}

/* -------------------------------------------------------------------------
   BATTAGLIA INAZUMA — let the complete active expedition scroll vertically.
   The old game view forced a fixed-height flex column with overflow:hidden;
   that clipped the alert, reward, squad, tool and extraction panels.
   ------------------------------------------------------------------------- */
html.ia-real-phone-mode #iaScoutingOverlay{
  display:grid!important;
  place-items:stretch!important;
  padding:0!important;
  overflow:hidden!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-shell{
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  width:100vw!important;
  min-width:0!important;
  max-width:100vw!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  margin:0!important;
  border-radius:0!important;
  overflow:hidden!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-header{
  flex:0 0 auto!important;
  min-width:0!important;
  gap:7px!important;
  padding:7px 9px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-brand{min-width:0!important;gap:7px!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-brand-icon{
  width:31px!important;height:31px!important;flex:0 0 31px!important;font-size:18px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-eyebrow{font-size:7px!important;letter-spacing:.08em!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-header h2{font-size:clamp(14px,4vw,19px)!important;line-height:1.05!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-head-actions{flex:0 0 auto!important;gap:5px!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-os-guide-shortcut,
html.ia-real-phone-mode #iaScoutingOverlay .ia-sc-close{min-height:34px!important;height:34px!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-sc-close{width:34px!important;flex:0 0 34px!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-topline{
  flex:0 0 auto!important;
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:space-between!important;
  gap:3px 8px!important;
  padding:5px 9px!important;
  font-size:7px!important;
  line-height:1.3!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v516-global-nav{
  flex:0 0 auto!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:3px!important;
  padding:4px 6px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v516-global-nav button{
  min-width:0!important;
  min-height:35px!important;
  padding:5px 3px!important;
  font-size:clamp(8px,2.2vw,10px)!important;
  line-height:1.15!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-scouting-main{
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
  padding:8px 8px calc(18px + env(safe-area-inset-bottom))!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"]{
  display:block!important;
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
  padding:7px 7px calc(22px + env(safe-area-inset-bottom))!important;
}

/* V513 live mission: stats stay in a visible three-cell row below the title. */
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-mission{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:max-content max-content max-content!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  align-items:stretch!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  margin:0!important;
  gap:8px!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-top{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  gap:6px!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  padding:0 0 7px!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-title{min-width:0!important}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-title small{
  display:block!important;font-size:9px!important;line-height:1.25!important;white-space:normal!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-title h3{
  margin:2px 0!important;font-size:clamp(15px,4.2vw,19px)!important;line-height:1.1!important;white-space:normal!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-metrics{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  width:100%!important;
  min-width:0!important;
  gap:4px!important;
  align-items:stretch!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-metrics>span{
  display:grid!important;
  grid-template-rows:auto auto auto!important;
  justify-items:center!important;
  align-content:center!important;
  min-width:0!important;
  min-height:49px!important;
  padding:5px 3px!important;
  gap:2px!important;
  white-space:normal!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  text-align:center!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-metrics>span small{
  display:block!important;
  min-width:0!important;
  font-size:clamp(7px,2vw,9px)!important;
  line-height:1.15!important;
  letter-spacing:.025em!important;
  white-space:normal!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  text-align:center!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-metrics>span b{
  display:block!important;
  min-width:0!important;
  font-size:clamp(11px,3.2vw,15px)!important;
  line-height:1.1!important;
  white-space:normal!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  text-align:center!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-metrics>span b i{font-size:9px!important}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-metrics>span em{display:flex!important;gap:2px!important;justify-content:center!important;max-width:100%!important}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v525-mode-banner{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  min-width:0!important;
  height:auto!important;
  max-height:none!important;
  gap:4px!important;
  padding:8px!important;
  white-space:normal!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  line-height:1.35!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v525-mode-banner>*{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}

/* Radar and side panels flow in document order instead of a viewport-height grid. */
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-layout{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:none!important;
  grid-template-areas:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  align-items:stretch!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  gap:8px!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-layout>*{
  grid-area:auto!important;
  position:relative!important;
  inset:auto!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-radar-zone{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:max-content max-content max-content max-content!important;
  grid-template-areas:none!important;
  align-items:start!important;
  justify-items:stretch!important;
  gap:7px!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  padding:8px!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-zone-head,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-radar-shell,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-cell-legend,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-feed{
  grid-area:auto!important;
  min-width:0!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-zone-head{
  display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:space-between!important;gap:5px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-zone-head>span{white-space:normal!important;overflow-wrap:anywhere!important}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-radar-shell{
  display:grid!important;
  place-items:center!important;
  width:min(88vw,420px)!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  aspect-ratio:1/1!important;
  margin:0 auto!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-radar-shell .ia-os-board{
  width:86%!important;height:86%!important;max-width:100%!important;max-height:100%!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-cell-legend{
  display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:5px 9px!important;
  font-size:9px!important;line-height:1.25!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-feed{
  display:block!important;min-height:0!important;padding:8px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-feed p{
  display:block!important;-webkit-line-clamp:unset!important;overflow:visible!important;
  white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.4!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-side{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  align-items:stretch!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  gap:7px!important;
  padding:7px!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-side>section{
  grid-column:1/-1!important;
  grid-row:auto!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  padding:8px!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-squad-panel,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-tools-panel{overflow:visible!important}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-team-list{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-team-member{
  min-width:0!important;max-width:100%!important;white-space:normal!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-team-member b,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-team-member small{
  min-width:0!important;white-space:normal!important;text-overflow:clip!important;overflow:visible!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-tools-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-tools-grid button{
  min-width:0!important;min-height:40px!important;height:auto!important;padding:6px!important;
  white-space:normal!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-extract,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-safe-note{
  grid-column:1/-1!important;min-width:0!important;width:100%!important;height:auto!important;
  max-height:none!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important;
}

/* Card-discovery/recruitment panels become extra rows, never side-clipped. */
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-game-layout{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:none!important;
  grid-template-areas:none!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-game-layout>*{
  grid-area:auto!important;position:relative!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-radar-zone{
  grid-template-columns:minmax(0,1fr)!important;grid-template-rows:max-content max-content max-content max-content!important;
  grid-template-areas:none!important;min-height:0!important;height:auto!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-radar-zone>*{grid-area:auto!important}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-overlay{
  position:relative!important;inset:auto!important;display:flex!important;flex-direction:column!important;
  align-items:stretch!important;justify-content:flex-start!important;align-self:stretch!important;
  grid-area:auto!important;min-width:0!important;min-height:0!important;width:100%!important;height:auto!important;
  max-height:none!important;padding:9px!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v517-found-layout{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;
  gap:9px!important;align-items:start!important;min-width:0!important;height:auto!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-identity,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-copy{
  min-width:0!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-identity>.ia-os-card{
  width:min(190px,100%)!important;max-width:190px!important;height:auto!important;min-height:0!important;aspect-ratio:2/3!important;margin:0 auto!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-copy>p{
  white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important;line-height:1.4!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-actions{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:max-content!important;
  min-width:0!important;min-height:0!important;width:100%!important;height:auto!important;max-height:none!important;
  gap:6px!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-found-actions button{
  grid-column:1!important;min-width:0!important;width:100%!important;min-height:42px!important;height:auto!important;
  padding:8px!important;font-size:10px!important;line-height:1.25!important;white-space:normal!important;
  overflow:visible!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v623-fey-replace{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;min-width:0!important;
}

/* Legacy expedition view retained for older active saves. */
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-mission-top{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto auto!important;
  gap:6px!important;min-width:0!important;height:auto!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-mission-layout{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;
  grid-auto-rows:max-content!important;gap:8px!important;min-height:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-board-frame{
  width:min(88vw,420px)!important;max-width:100%!important;height:auto!important;max-height:none!important;
  aspect-ratio:1/1!important;flex:0 0 auto!important;margin:0 auto!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-mission-side{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;
  grid-auto-rows:max-content!important;min-width:0!important;min-height:0!important;width:100%!important;
  height:auto!important;max-height:none!important;gap:7px!important;overflow:visible!important;align-content:start!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-mission-side>section,
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-found-panel{
  grid-column:1/-1!important;grid-row:auto!important;min-width:0!important;min-height:0!important;
  height:auto!important;max-height:none!important;padding:8px!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-found-layout{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;
  min-height:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-os-found-actions button{
  min-height:42px!important;height:auto!important;padding:8px!important;white-space:normal!important;overflow-wrap:anywhere!important;
}

/* Opponent duels and their choice/result minigames: scroll the whole dialog. */
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-overlay{
  position:fixed!important;inset:0!important;z-index:100060!important;
  display:grid!important;place-items:start center!important;
  width:100vw!important;height:100dvh!important;max-height:100dvh!important;
  padding:8px!important;overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel{
  position:relative!important;width:min(620px,100%)!important;min-width:0!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  margin:0 auto!important;padding:12px!important;overflow:visible!important;
  overflow-wrap:anywhere!important;box-sizing:border-box!important;
}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel>header{min-width:0!important;overflow:visible!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel>header h3{font-size:clamp(17px,5vw,22px)!important;line-height:1.15!important;overflow-wrap:anywhere!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel :is(button,.ia-v513-lanes,.ia-v513-battle-player-grid,.ia-v525-tactic-grid){min-width:0!important;max-width:100%!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel .ia-v513-battle-player-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel .ia-v513-lanes{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-battle-panel :is(button,.ia-v513-lanes button){height:auto!important;min-height:42px!important;white-space:normal!important;overflow-wrap:anywhere!important}

/* -------------------------------------------------------------------------
   BATTAGLIA EVENTI / MINIGIOCHI / SFIDE — the layer itself becomes the
   scroller and the shell grows with content. No hidden or cropped tiles.
   ------------------------------------------------------------------------- */
html.ia-real-phone-mode #iaV552EventLayer{
  display:block!important;
  position:fixed!important;inset:0!important;
  width:100vw!important;height:100dvh!important;max-height:100dvh!important;
  padding:calc(7px + env(safe-area-inset-top)) 7px calc(12px + env(safe-area-inset-bottom))!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
  box-sizing:border-box!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-shell{
  position:relative!important;
  display:block!important;
  width:100%!important;max-width:940px!important;min-width:0!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  margin:0 auto 10px!important;padding:0!important;
  overflow:visible!important;overscroll-behavior:auto!important;
  border-radius:13px!important;box-sizing:border-box!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-head{
  display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;
  min-width:0!important;gap:8px!important;padding:11px 11px 10px!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-title-mark{
  flex:0 0 38px!important;width:38px!important;height:38px!important;font-size:20px!important;border-radius:9px!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-head>div:nth-child(2){flex:1 1 190px!important;min-width:0!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-head small{font-size:8px!important;line-height:1.3!important;letter-spacing:.09em!important;overflow-wrap:anywhere!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-head h2{font-size:clamp(17px,5vw,23px)!important;line-height:1.1!important;overflow-wrap:anywhere!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-head p{font-size:11px!important;line-height:1.4!important;overflow-wrap:anywhere!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-close{flex:0 0 34px!important;width:34px!important;height:34px!important;min-height:34px!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-content{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;
  min-width:0!important;min-height:0!important;height:auto!important;max-height:none!important;
  gap:9px!important;padding:10px!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-content.has-sim-panel{
  grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;align-items:stretch!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-stage{
  display:block!important;align-self:stretch!important;
  min-width:0!important;min-height:0!important;width:100%!important;
  height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-stage>*{
  display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
  height:auto!important;max-height:none!important;overflow:visible!important;box-sizing:border-box!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-sim-panel{
  position:relative!important;top:auto!important;display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;
  min-width:0!important;width:100%!important;height:auto!important;max-height:none!important;
  padding:9px!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-sim-panel>small,
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-sim-panel>em{grid-column:1/-1!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-event-foot,
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-foot{
  display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;
  gap:5px 10px!important;padding:9px 11px!important;font-size:8px!important;line-height:1.35!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-section{
  display:block!important;min-width:0!important;height:auto!important;max-height:none!important;
  padding:12px 10px 3px!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-section>div:first-child{min-width:0!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-section h3{font-size:clamp(13px,3.8vw,18px)!important;line-height:1.2!important;overflow-wrap:anywhere!important}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:minmax(125px,auto)!important;align-items:stretch!important;gap:7px!important;
  min-width:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-tile{
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  min-width:0!important;min-height:128px!important;height:auto!important;max-height:none!important;
  padding:9px!important;gap:5px!important;white-space:normal!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-tile>b,
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-tile>small,
html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-tile>i{
  display:block!important;min-width:0!important;white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaV552EventLayer :is(.ia-v552-copy,.ia-v552-game-intro,.ia-v555-event-intro,.ia-v555-archive-game,.ia-v555-archive-layout,.ia-v555-archive-board-wrap){
  min-width:0!important;max-width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaV552EventLayer :is(.ia-v552-actions,.ia-v555-actions,.ia-v553-actions){
  display:flex!important;flex-wrap:wrap!important;gap:7px!important;min-width:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
}
html.ia-real-phone-mode #iaV552EventLayer :is(.ia-v552-actions,.ia-v555-actions,.ia-v553-actions) button{
  min-width:0!important;max-width:100%!important;min-height:42px!important;height:auto!important;
  white-space:normal!important;overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #iaV552EventLayer :is(.ia-v552-chest-choices,.ia-v552-odds,.ia-v552-intro-grid){
  grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;min-width:0!important;
}
html.ia-real-phone-mode #iaV552EventLayer :is(.ia-v552-chest-choice,.ia-v552-odds>span){min-width:0!important;height:auto!important;min-height:100px!important;white-space:normal!important;overflow-wrap:anywhere!important}

/* Narrow portrait devices: one readable column and no side-by-side clipping. */
@media(max-width:540px){
  html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-side{grid-template-columns:minmax(0,1fr)!important}
  html.ia-real-phone-mode #iaScoutingOverlay .ia-v513-team-list{grid-template-columns:minmax(0,1fr)!important}
  html.ia-real-phone-mode #iaV552EventLayer .ia-v552-debug-grid{grid-template-columns:minmax(0,1fr)!important}
  html.ia-real-phone-mode #iaV552EventLayer :is(.ia-v552-chest-choices,.ia-v552-odds,.ia-v552-intro-grid){grid-template-columns:minmax(0,1fr)!important}
  html.ia-real-phone-mode #iaV552EventLayer .ia-v552-chest-choice{min-height:125px!important}
  html.ia-real-phone-mode #iaV552EventLayer .ia-v552-sim-panel{grid-template-columns:minmax(0,1fr)!important}
}

/* Landscape phones use the available width without sacrificing vertical scroll. */
@media(orientation:landscape) and (min-width:600px){
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game-layout{
    grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr)!important;
    grid-template-rows:max-content!important;
    grid-template-areas:none!important;
    align-items:start!important;
  }
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-radar-zone{
    grid-column:1!important;grid-row:1!important;
  }
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-side{
    grid-column:2!important;grid-row:1!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-risk-panel,
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-loot-panel,
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-extract,
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-safe-note{
    grid-column:1/-1!important;
  }
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-radar-shell{width:min(48vw,360px)!important}
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-game-layout{grid-template-columns:minmax(0,1fr)!important}
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-radar-zone,
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-found-overlay,
  html.ia-real-phone-mode #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-game.has-found .ia-v513-side{grid-column:1!important;grid-row:auto!important}
}
