[data-rush-mobile] [data-rush-surface] {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

[data-rush-mobile] [data-rush-settings] {
  margin: 0;
  padding: 0;
  border: 0;
}

[data-rush-mobile] [data-rush-settings] > summary {
  display: none;
}

[data-rush-mobile] [data-rush-attack] {
  display: none;
}

[data-rush-mobile] [data-rush-stage][data-rush-screen] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 8px 12px 12px;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  overflow: auto;
  overscroll-behavior: contain;
  background: #161815;
}

[data-rush-mobile]:has([data-rush-screen="expanded"]) {
  overflow: hidden;
}

[data-rush-mobile] main:has(> [data-rush-screen="expanded"]) > :not([data-rush-stage]) {
  visibility: hidden;
}

[data-rush-mobile] [data-rush-stage][data-rush-screen="expanded"] {
  position: fixed;
  z-index: 10;
  inset: 0;
  height: 100vh;
  height: 100dvh;
}

[data-rush-mobile] [data-rush-stage][data-rush-screen] [data-rush-arena] {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
}

@media (hover: none) and (pointer: coarse) {
  [data-rush-mobile] {
    padding: 8px 12px 12px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
  }

  [data-rush-mobile] header {
    margin-bottom: 4px;
  }

  [data-rush-mobile] h1 {
    font-size: 1.45rem;
  }

  [data-rush-mobile] [data-rush-settings] > summary {
    display: list-item;
    align-content: center;
    min-height: 44px;
    touch-action: manipulation;
  }

  [data-rush-mobile] [data-rush-mouse-settings] {
    display: none;
  }

  [data-rush-mobile] [data-rush-arena] {
    aspect-ratio: auto;
    height: clamp(200px, 53vh, 440px);
    height: clamp(200px, 53svh, 440px);
  }

  [data-rush-mobile] #radar {
    top: 6px;
    right: 6px;
    width: clamp(64px, 22vw, 100px);
    pointer-events: none;
  }

  [data-rush-mobile] [data-rush-attack] {
    position: absolute;
    z-index: 2;
    inset: auto 10px 10px auto;
    display: grid;
    place-items: center;
    width: clamp(60px, 16vw, 74px);
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid #f4d8aa;
    border-radius: 50%;
    color: #252019;
    background: #e2c497;
    box-shadow: 0 2px 12px #141b1880;
    font-weight: 700;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  [data-rush-mobile] [data-rush-attack]:enabled:active {
    background: #f4d8aa;
  }

  [data-rush-mobile] #crosshair {
    z-index: 2;
    width: 21px;
    height: 21px;
  }

  [data-rush-mobile] #crosshair::before {
    top: 10px;
  }

  [data-rush-mobile] #crosshair::after {
    left: 10px;
  }

  [data-rush-mobile] [data-rush-stats] {
    padding: 6px 0;
    gap: 4px 10px;
    font-size: .82rem;
  }

  [data-rush-mobile] [data-rush-actions] {
    gap: 4px 8px;
  }

  [data-rush-mobile] [data-rush-actions] > button {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  [data-rush-mobile] [data-rush-actions] > [role="status"] {
    flex-basis: 100%;
  }

  [data-rush-mobile] [data-rush-guide] {
    margin-top: 4px;
  }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  [data-rush-mobile] [data-rush-stage] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(112px, 26vw, 184px);
    align-items: start;
    gap: 8px;
  }

  [data-rush-mobile] [data-rush-arena] {
    height: clamp(136px, calc(100vh - 112px), 380px);
    height: clamp(136px, calc(100svh - 112px), 380px);
  }

  [data-rush-mobile] #radar {
    width: clamp(60px, 26vh, 96px);
  }

  [data-rush-mobile] [data-rush-stats] {
    padding-top: 0;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  [data-rush-mobile] [data-rush-stage][data-rush-screen] {
    grid-template-columns: minmax(0, 1fr) clamp(132px, 26vw, 196px);
    grid-template-rows: minmax(0, 1fr);
  }
}
