/* InazumArcade V794 — fit minigame labels in the PC battle viewport and shorten TAG TEAM card entrance only. */

/* PC only: reorganise the existing minigame contents; preserve artwork, typography, controls and game logic. */
@media (min-width: 701px) {
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-battle-overlay {
    padding: 8px 12px;
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-battle-panel.ia-v660-battle-minigame {
    width: min(1120px, 100%);
    max-width: 1120px;
    max-height: calc(100% - 8px);
    min-height: 0;
    overflow: hidden;
    padding: 9px 12px;
    gap: 5px;
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-battle-minigame > header {
    margin: 0;
    padding: 0 0 5px;
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-battle-minigame > header p {
    max-width: 100%;
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "gamehead gamehead"
      "instruction instruction"
      "scene body"
      "live live"
      "foot foot";
    align-items: start;
    column-gap: 14px;
    row-gap: 6px;
    margin: 4px 0 0 !important;
    padding: 9px 11px !important;
    overflow: visible;
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-game-head { grid-area: gamehead; padding-bottom: 7px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-instruction {
    grid-area: instruction;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 12px !important;
    margin: 0 !important;
    padding: 7px 10px !important;
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-instruction p { margin: 0 !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-game-foot { grid-area: foot; margin-top: 2px !important; padding-top: 5px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-live-message { grid-area: live; margin: 0 !important; min-height: 0 !important; }

  /* Three-colour choice minigame: keep its scene and all three live choices side by side. */
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .scene-chaos { grid-area: scene; align-self: stretch; margin: 0 !important; padding: 9px 10px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v663-chaos { grid-area: body; align-self: stretch; margin: 0 !important; padding: 0 !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v663-chaos-radar { margin: 0 0 7px !important; padding: 7px 9px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v660-chaos-grid { gap: 7px !important; margin-top: 0 !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v660-chaos-cell { min-height: 96px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v660-score-row { margin-top: 7px !important; padding: 7px 9px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v663-game-tip { margin: 6px 0 0 !important; padding: 6px 8px !important; }

  /* Combo: put the full sequence and all five buttons opposite the decorative orbit. */
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] {
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, .75fr);
    grid-template-areas:
      "gamehead gamehead"
      "instruction instruction"
      "body scene"
      "live live"
      "foot foot";
  }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v663-combo { grid-area: body; margin: 0 !important; padding: 8px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .scene-combo { grid-area: scene; align-self: stretch; margin: 0 !important; padding: 9px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .combo-orbit { min-height: 130px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v663-combo-options { gap: 5px !important; margin-top: 7px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v660-combo-choice { min-height: 70px !important; padding: 7px 4px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v663-sequence { display: flex; align-items: stretch; gap: 4px; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v663-sequence > span { flex: 1 1 0; min-width: 0; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v663-sequence > em { flex: 0 0 auto; align-self: center; }

  /* Zone game already has a two-column composition; keep both columns in the PC battle panel. */
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="king-zones"] .ia-v663-zone-layout { grid-area: body; grid-column: 1 / -1; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: 10px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="king-zones"] .ia-v663-zone-grid { gap: 7px !important; margin-top: 7px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="king-zones"] .ia-v660-zone-card { min-height: 98px !important; }
}

/* Shorter desktop viewports: recover vertical room from spacing, never from text size. */
@media (min-width: 701px) and (max-height: 760px) {
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v513-battle-panel.ia-v660-battle-minigame { padding: 6px 9px; gap: 3px; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game { row-gap: 4px; padding: 7px 9px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-game-head { padding-bottom: 5px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-instruction { padding: 5px 8px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="field-chaos"] .ia-v660-chaos-cell { min-height: 82px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .combo-orbit { min-height: 108px !important; }
  html:not(.ia-real-phone-mode):not(.ia-phone-preview) #iaScoutingOverlay #iaScoutingMain[data-view="game"] .ia-v660-opponent-game[data-opponent-minigame="combo-chain"] .ia-v660-combo-choice { min-height: 62px !important; }
}

/* TAG TEAM reveal only: keep the original animation style, but remove the long entrance delay. */
#iaScoutingOverlay .ia-v516-reveal-card:has(.ia-v623-real-tag-card) {
  animation-duration: .24s !important;
  animation-delay: calc(var(--reveal-i, 0) * 35ms) !important;
}
#iaScoutingOverlay .ia-v623-real-tag-card .ia-v589-tag-debug-item {
  animation-duration: .28s !important;
}
