/* Freekick uses its own shell. Reserve the shared header before fitting play. */
body.gc-arcade-freekick .stadiumWrap { min-width:0; }
body.gc-arcade-freekick canvas#pitch {
  display:block;width:100%;height:auto;aspect-ratio:820/600;
  max-width:100%;object-fit:contain;
}

/* navigation-v2 updates --gc-content-height from visualViewport, including
   Safari's expanding toolbar. The header already includes the top safe area. */
html:has(body.gc-arcade-freekick.gc-in-game) {
  height:100%!important;overflow:hidden!important;
}
body.gc-arcade-freekick.gc-in-game {
  height:calc(var(--gc-content-height,calc(100dvh - 52px)) + var(--gc-header-height,52px))!important;
  min-height:0!important;max-height:none!important;overflow:hidden!important;
}
body.gc-arcade-freekick.gc-in-game .shell.gc-play-layout {
  display:flex!important;flex-direction:column!important;
  width:100%!important;max-width:1180px!important;
  height:var(--gc-content-height,calc(100dvh - var(--gc-header-height,52px)))!important;
  max-height:var(--gc-content-height,calc(100dvh - var(--gc-header-height,52px)))!important;
  min-height:0!important;margin:0 auto!important;gap:5px!important;
  padding:5px max(6px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px))!important;
  overflow:hidden!important;
}
body.gc-arcade-freekick.gc-in-game .hero {
  display:block!important;flex:0 0 auto!important;margin:0!important;
}
body.gc-arcade-freekick.gc-in-game .scoreGrid {
  margin:0!important;gap:4px!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
body.gc-arcade-freekick.gc-in-game .scoreCard {
  min-width:0!important;padding:3px!important;border-radius:10px!important;
}
body.gc-arcade-freekick.gc-in-game .scoreCard b {
  font-size:18px!important;line-height:1.1!important;
}
body.gc-arcade-freekick.gc-in-game .scoreCard.livesCard b {
  font-size:18px!important;letter-spacing:1px!important;
}
body.gc-arcade-freekick.gc-in-game .heartWrap { min-height:0!important; }
body.gc-arcade-freekick.gc-in-game .scoreCard small {
  display:block!important;font-size:11px!important;line-height:1.1!important;
}
body.gc-arcade-freekick.gc-in-game .layout {
  display:flex!important;flex-direction:column!important;
  flex:1 1 0!important;min-height:0!important;min-width:0!important;
  gap:5px!important;
}
body.gc-arcade-freekick.gc-in-game .layout > div:first-child {
  display:flex!important;flex-direction:column!important;
  flex:1 1 0!important;min-width:0!important;min-height:70px!important;
}
body.gc-arcade-freekick.gc-in-game .stadiumWrap {
  display:flex!important;align-items:center!important;justify-content:center!important;
  position:relative!important;flex:1 1 0!important;
  height:auto!important;min-height:0!important;max-height:100%!important;
  padding:3px!important;aspect-ratio:auto!important;overflow:hidden!important;
}
body.gc-arcade-freekick.gc-in-game canvas#pitch {
  width:100%!important;height:100%!important;min-height:0!important;
  max-width:100%!important;max-height:100%!important;
  aspect-ratio:auto!important;object-fit:contain!important;
}
body.gc-arcade-freekick.gc-in-game .hudPill {
  top:6px!important;padding:4px 7px!important;font-size:11px!important;
}
body.gc-arcade-freekick.gc-in-game #placeInfo {left:6px!important;}
body.gc-arcade-freekick.gc-in-game #windInfo {right:6px!important;}
body.gc-arcade-freekick.gc-in-game .log {
  flex:0 0 auto!important;max-height:22px!important;margin:0 0 3px!important;
}
body.gc-arcade-freekick.gc-in-game .layout > .panel {
  flex:0 1 auto!important;min-width:0!important;min-height:0!important;
  max-height:100%!important;padding:5px 7px!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior:contain;touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
}
body.gc-arcade-freekick.gc-in-game #game:not(.hide) {
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  grid-template-areas:"mode mode" "aim aim" "power impact" "action impact";
  gap:4px 8px!important;align-items:center!important;
}
body.gc-arcade-freekick.gc-in-game .topRow {
  grid-area:mode;min-height:36px!important;gap:6px!important;
}
body.gc-arcade-freekick.gc-in-game .smallPill {
  min-width:0!important;padding:4px 7px!important;font-size:12px!important;
}
body.gc-arcade-freekick.gc-in-game .backBtn {
  min-height:44px!important;padding:5px 8px!important;font-size:12px!important;
}
body.gc-arcade-freekick.gc-in-game .fk-aim-control {grid-area:aim;}
body.gc-arcade-freekick.gc-in-game .fk-impact-control {grid-area:impact;}
body.gc-arcade-freekick.gc-in-game .powerWrap {grid-area:power;}
body.gc-arcade-freekick.gc-in-game .actionRow {grid-area:action;}
body.gc-arcade-freekick.gc-in-game .controlBlock {gap:3px!important;min-width:0!important;}
body.gc-arcade-freekick.gc-in-game .label,
body.gc-arcade-freekick.gc-in-game .powerText {
  font-size:12px!important;line-height:1.2!important;letter-spacing:0!important;
}
body.gc-arcade-freekick.gc-in-game .aimSlider {
  display:block;width:100%;height:20px!important;margin:5px 0!important;
}
body.gc-arcade-freekick.gc-in-game .aimSlider::-webkit-slider-thumb {
  width:30px!important;height:30px!important;
}
body.gc-arcade-freekick.gc-in-game .aimSlider::-moz-range-thumb {
  width:30px!important;height:30px!important;
}
body.gc-arcade-freekick.gc-in-game .aimTicks {
  margin:0!important;font-size:10px!important;line-height:1!important;
}
body.gc-arcade-freekick.gc-in-game .impactCanvas {
  width:84px!important;height:84px!important;min-width:84px!important;min-height:84px!important;
  max-width:none!important;max-height:none!important;touch-action:none;
}
body.gc-arcade-freekick.gc-in-game .powerWrap {padding:5px 7px!important;}
body.gc-arcade-freekick.gc-in-game .powerText {margin:0 0 3px!important;}
body.gc-arcade-freekick.gc-in-game .powerBar {height:13px!important;}
body.gc-arcade-freekick.gc-in-game .actionRow {gap:4px!important;}
/* The shot remains reachable if unusually short windows need panel scrolling. */
body.gc-arcade-freekick.gc-in-game .actionRow {
  position:sticky;bottom:0;z-index:2;background:#163529;border-radius:10px;
}
body.gc-arcade-freekick.gc-in-game .bigBtn {
  min-height:44px!important;padding:8px 5px!important;
  font-size:14px!important;line-height:1.2!important;border-radius:10px!important;
}
body.gc-arcade-freekick.gc-in-game .controlBlock .fine,
body.gc-arcade-freekick.gc-in-game #powerHint {display:none!important;}

/* Netlify injects this 64px-high frame on the live site. Leave its area free
   so it cannot cover either the shot button or the spin target. */
body.gc-arcade-freekick.gc-in-game:has(#nl-badge-frame) .shell.gc-play-layout {
  height:max(0px,calc(var(--gc-content-height,calc(100dvh - var(--gc-header-height,52px))) - 64px))!important;
  max-height:max(0px,calc(var(--gc-content-height,calc(100dvh - var(--gc-header-height,52px))) - 64px))!important;
}

/* A short landscape viewport puts the pitch and controls beside each other.
   Do not restore the old auto-height shell between 700px and 900px. */
@media (orientation:landscape) and (min-width:560px), (min-width:1000px) {
  body.gc-arcade-freekick.gc-in-game .layout {
    display:grid!important;grid-template-columns:minmax(0,1fr) clamp(260px,36vw,340px)!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  body.gc-arcade-freekick.gc-in-game .layout > div:first-child {min-height:0!important;}
  body.gc-arcade-freekick.gc-in-game .layout > .panel {height:100%!important;}
  body.gc-arcade-freekick.gc-in-game #game:not(.hide) {
    grid-template-areas:"mode mode" "aim impact" "power impact" "action impact";
  }
  body.gc-arcade-freekick.gc-in-game .fk-impact-control {align-self:center;}
}
